Commit a440d351 by Torkel Ödegaard

renaming things in admin

parent 4391209f
import { NavModel, NavModelItem, NavIndex } from 'app/types';
function getNotFoundModel(): NavModel {
var node: NavModelItem = {
const node: NavModelItem = {
id: 'not-found',
text: 'Page not found',
icon: 'fa fa-fw fa-warning',
......
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);
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);
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);
......@@ -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);
};
......
......@@ -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 {
......
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;
/** @ngInject */
constructor(backendSrv: any, navModelSrv) {
this.navModel = navModelSrv.getNav('cfg', 'admin', 'server-stats', 1);
coreModule.controller('AdminListUsersCtrl', AdminListUsersCtrl);
coreModule.controller('AdminEditUserCtrl', AdminEditUserCtrl);
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);
......@@ -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';
import './dashboard_loaders';
import './ReactContainer';
import ServerStats from 'app/features/admin/containers/ServerStats';
import ServerStats from 'app/features/admin/ServerStats';
import AlertRuleList from 'app/features/alerting/AlertRuleList';
import FolderSettings from 'app/containers/ManageDashboards/FolderSettings';
import FolderPermissions from 'app/containers/ManageDashboards/FolderPermissions';
......
......@@ -21,19 +21,19 @@ configure({ adapter: new Adapter() });
const global = window as any;
global.$ = global.jQuery = $;
const localStorageMock = (function() {
var store = {};
const localStorageMock = (() => {
let store = {};
return {
getItem: function(key) {
getItem: key => {
return store[key];
},
setItem: function(key, value) {
setItem: (key, value) => {
store[key] = value.toString();
},
clear: function() {
clear: () => {
store = {};
},
removeItem: function(key) {
removeItem: key => {
delete store[key];
},
};
......
......@@ -31,7 +31,7 @@ export function createNavModel(title: string, ...tabs: string[]): NavModel {
breadcrumbs: [],
};
for (let tab of tabs) {
for (const tab of tabs) {
node.children.push({
id: tab,
icon: 'icon',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment