renaming things in admin

This commit is contained in:
Torkel Ödegaard
2018-09-07 17:55:38 +02:00
parent 4391209f7b
commit a440d3510a
14 changed files with 24 additions and 41 deletions

View File

@@ -1,6 +1,5 @@
import angular from 'angular';
export class AdminEditOrgCtrl {
export default class AdminEditOrgCtrl {
/** @ngInject */
constructor($scope, $routeParams, backendSrv, $location, navModelSrv) {
$scope.init = () => {
@@ -48,4 +47,3 @@ export class AdminEditOrgCtrl {
}
}
angular.module('grafana.controllers').controller('AdminEditOrgCtrl', AdminEditOrgCtrl);

View File

@@ -1,7 +1,6 @@
import angular from 'angular';
import _ from 'lodash';
export class AdminEditUserCtrl {
export default class AdminEditUserCtrl {
/** @ngInject */
constructor($scope, $routeParams, backendSrv, $location, navModelSrv) {
$scope.user = {};
@@ -117,5 +116,3 @@ export class AdminEditUserCtrl {
$scope.init();
}
}
angular.module('grafana.controllers').controller('AdminEditUserCtrl', AdminEditUserCtrl);

View File

@@ -1,6 +1,5 @@
import angular from 'angular';
export class AdminListOrgsCtrl {
export default class AdminListOrgsCtrl {
/** @ngInject */
constructor($scope, backendSrv, navModelSrv) {
$scope.init = () => {
@@ -33,4 +32,3 @@ export class AdminListOrgsCtrl {
}
}
angular.module('grafana.controllers').controller('AdminListOrgsCtrl', AdminListOrgsCtrl);

View File

@@ -2,14 +2,14 @@ import React from 'react';
import renderer from 'react-test-renderer';
import { ServerStats } from './ServerStats';
import { createNavModel } from 'test/mocks/common';
import { ServerStat } from '../apis';
import { ServerStat } from './state/apis';
describe('ServerStats', () => {
it('Should render table with stats', done => {
const navModel = createNavModel('Admin', 'stats');
const stats: ServerStat[] = [{ name: 'Total dashboards', value: 10 }, { name: 'Total Users', value: 1 }];
let getServerStats = () => {
const getServerStats = () => {
return Promise.resolve(stats);
};

View File

@@ -3,7 +3,7 @@ import { hot } from 'react-hot-loader';
import { connect } from 'react-redux';
import { NavModel, StoreState } from 'app/types';
import { getNavModel } from 'app/core/selectors/navModel';
import { getServerStats, ServerStat } from '../apis';
import { getServerStats, ServerStat } from './state/apis';
import PageHeader from 'app/core/components/PageHeader/PageHeader';
interface Props {

View File

@@ -1,7 +1,7 @@
import AdminListUsersCtrl from './admin_list_users_ctrl';
import './admin_list_orgs_ctrl';
import './admin_edit_org_ctrl';
import './admin_edit_user_ctrl';
import AdminListUsersCtrl from './AdminListUsersCtrl';
import AdminEditUserCtrl from './AdminEditUserCtrl';
import AdminListOrgsCtrl from './AdminListOrgsCtrl';
import AdminEditOrgCtrl from './AdminEditOrgCtrl';
import coreModule from 'app/core/core_module';
@@ -27,21 +27,11 @@ class AdminHomeCtrl {
}
}
export class AdminStatsCtrl {
stats: any;
navModel: any;
coreModule.controller('AdminListUsersCtrl', AdminListUsersCtrl);
coreModule.controller('AdminEditUserCtrl', AdminEditUserCtrl);
/** @ngInject */
constructor(backendSrv: any, navModelSrv) {
this.navModel = navModelSrv.getNav('cfg', 'admin', 'server-stats', 1);
backendSrv.get('/api/admin/stats').then(stats => {
this.stats = stats;
});
}
}
coreModule.controller('AdminListOrgsCtrl', AdminListOrgsCtrl);
coreModule.controller('AdminEditOrgCtrl', AdminEditOrgCtrl);
coreModule.controller('AdminSettingsCtrl', AdminSettingsCtrl);
coreModule.controller('AdminHomeCtrl', AdminHomeCtrl);
coreModule.controller('AdminStatsCtrl', AdminStatsCtrl);
coreModule.controller('AdminListUsersCtrl', AdminListUsersCtrl);

View File

@@ -8,7 +8,7 @@ import './playlist/all';
import './snapshot/all';
import './panel/all';
import './org/all';
import './admin/admin';
import './admin';
import './alerting/NotificationsEditCtrl';
import './alerting/NotificationsListCtrl';
import './styleguide/styleguide';