mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Began work on improving structure and organization of components under features/dashboard, #14062
This commit is contained in:
parent
2264c27504
commit
26385dea8f
@ -2,7 +2,6 @@ import './dashboard_ctrl';
|
||||
import './alerting_srv';
|
||||
import './history/history';
|
||||
import './dashboard_loader_srv';
|
||||
import './dashnav/dashnav';
|
||||
import './submenu/submenu';
|
||||
import './save_as_modal';
|
||||
import './save_modal';
|
||||
@ -17,17 +16,17 @@ import './unsaved_changes_srv';
|
||||
import './unsaved_changes_modal';
|
||||
import './timepicker/timepicker';
|
||||
import './upload';
|
||||
import './export/export_modal';
|
||||
import './export_data/export_data_modal';
|
||||
import './ad_hoc_filters';
|
||||
import './repeat_option/repeat_option';
|
||||
import './dashgrid/DashboardGridDirective';
|
||||
import './dashgrid/RowOptions';
|
||||
import './folder_picker/folder_picker';
|
||||
import './move_to_folder_modal/move_to_folder';
|
||||
import './settings/settings';
|
||||
import './panellinks/module';
|
||||
import './dashlinks/module';
|
||||
import './components/DashLinks';
|
||||
import './components/DashExportModal';
|
||||
import './components/DashNav';
|
||||
import './components/ExportDataModal';
|
||||
import './components/FolderPicker';
|
||||
|
||||
// angular wrappers
|
||||
import { react2AngularDirective } from 'app/core/utils/react2angular';
|
||||
@ -35,11 +34,3 @@ import DashboardPermissions from './permissions/DashboardPermissions';
|
||||
|
||||
react2AngularDirective('dashboardPermissions', DashboardPermissions, ['dashboardId', 'folder']);
|
||||
|
||||
import coreModule from 'app/core/core_module';
|
||||
import { FolderDashboardsCtrl } from './folder_dashboards_ctrl';
|
||||
import { DashboardImportCtrl } from './dashboard_import_ctrl';
|
||||
import { CreateFolderCtrl } from './create_folder_ctrl';
|
||||
|
||||
coreModule.controller('FolderDashboardsCtrl', FolderDashboardsCtrl);
|
||||
coreModule.controller('DashboardImportCtrl', DashboardImportCtrl);
|
||||
coreModule.controller('CreateFolderCtrl', CreateFolderCtrl);
|
||||
|
@ -2,7 +2,7 @@ import angular from 'angular';
|
||||
import { saveAs } from 'file-saver';
|
||||
|
||||
import coreModule from 'app/core/core_module';
|
||||
import { DashboardExporter } from './exporter';
|
||||
import { DashboardExporter } from './DashboardExporter';
|
||||
|
||||
export class DashExportCtrl {
|
||||
dash: any;
|
||||
@ -66,7 +66,7 @@ export class DashExportCtrl {
|
||||
export function dashExportDirective() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'public/app/features/dashboard/export/export_modal.html',
|
||||
templateUrl: 'public/app/features/dashboard/components/DashExportModal/template.html',
|
||||
controller: DashExportCtrl,
|
||||
bindToController: true,
|
||||
controllerAs: 'ctrl',
|
@ -6,8 +6,8 @@ jest.mock('app/core/store', () => {
|
||||
|
||||
import _ from 'lodash';
|
||||
import config from 'app/core/config';
|
||||
import { DashboardExporter } from '../export/exporter';
|
||||
import { DashboardModel } from '../dashboard_model';
|
||||
import { DashboardExporter } from './DashboardExporter';
|
||||
import { DashboardModel } from '../../dashboard_model';
|
||||
|
||||
describe('given dashboard with repeated panels', () => {
|
||||
let dash, exported;
|
@ -1,6 +1,6 @@
|
||||
import config from 'app/core/config';
|
||||
import _ from 'lodash';
|
||||
import { DashboardModel } from '../dashboard_model';
|
||||
import { DashboardModel } from '../../dashboard_model';
|
||||
|
||||
export class DashboardExporter {
|
||||
constructor(private datasourceSrv) {}
|
@ -0,0 +1,2 @@
|
||||
export { DashboardExporter } from './DashboardExporter';
|
||||
export { DashExportCtrl } from './DashExportCtrl';
|
@ -1,6 +1,6 @@
|
||||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
import { iconMap } from './editor';
|
||||
import { iconMap } from './DashLinksEditorCtrl';
|
||||
|
||||
function dashLinksContainer() {
|
||||
return {
|
@ -11,7 +11,7 @@ export let iconMap = {
|
||||
cloud: 'fa-cloud',
|
||||
};
|
||||
|
||||
export class DashLinkEditorCtrl {
|
||||
export class DashLinksEditorCtrl {
|
||||
dashboard: any;
|
||||
iconMap: any;
|
||||
mode: any;
|
||||
@ -65,8 +65,8 @@ export class DashLinkEditorCtrl {
|
||||
function dashLinksEditor() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
controller: DashLinkEditorCtrl,
|
||||
templateUrl: 'public/app/features/dashboard/dashlinks/editor.html',
|
||||
controller: DashLinksEditorCtrl,
|
||||
templateUrl: 'public/app/features/dashboard/components/DashLinks/editor.html',
|
||||
bindToController: true,
|
||||
controllerAs: 'ctrl',
|
||||
scope: {
|
@ -0,0 +1,2 @@
|
||||
export { DashLinksContainerCtrl } from './DashLinksContainerCtrl';
|
||||
export { DashLinksEditorCtrl } from './DashLinksEditorCtrl';
|
@ -1,7 +1,7 @@
|
||||
import moment from 'moment';
|
||||
import angular from 'angular';
|
||||
import { appEvents, NavModel } from 'app/core/core';
|
||||
import { DashboardModel } from '../dashboard_model';
|
||||
import { DashboardModel } from '../../dashboard_model';
|
||||
|
||||
export class DashNavCtrl {
|
||||
dashboard: DashboardModel;
|
||||
@ -107,7 +107,7 @@ export class DashNavCtrl {
|
||||
export function dashNavDirective() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'public/app/features/dashboard/dashnav/dashnav.html',
|
||||
templateUrl: 'public/app/features/dashboard/components/DashNav/template.html',
|
||||
controller: DashNavCtrl,
|
||||
bindToController: true,
|
||||
controllerAs: 'ctrl',
|
@ -0,0 +1 @@
|
||||
export { DashNavCtrl } from './DashNavCtrl';
|
@ -31,7 +31,7 @@ export class ExportDataModalCtrl {
|
||||
export function exportDataModal() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'public/app/features/dashboard/export_data/export_data_modal.html',
|
||||
templateUrl: 'public/app/features/dashboard/components/ExportDataModal/template.html',
|
||||
controller: ExportDataModalCtrl,
|
||||
controllerAs: 'ctrl',
|
||||
scope: {
|
@ -0,0 +1 @@
|
||||
export { ExportDataModalCtrl } from './ExportDataModalCtrl';
|
@ -168,7 +168,7 @@ export class FolderPickerCtrl {
|
||||
export function folderPicker() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'public/app/features/dashboard/folder_picker/folder_picker.html',
|
||||
templateUrl: 'public/app/features/dashboard/components/FolderPicker/template.html',
|
||||
controller: FolderPickerCtrl,
|
||||
bindToController: true,
|
||||
controllerAs: 'ctrl',
|
@ -0,0 +1 @@
|
||||
export { FolderPickerCtrl } from './FolderPickerCtrl';
|
@ -1,25 +0,0 @@
|
||||
import { FolderPageLoader } from './folder_page_loader';
|
||||
|
||||
export class FolderPermissionsCtrl {
|
||||
navModel: any;
|
||||
folderId: number;
|
||||
uid: string;
|
||||
dashboard: any;
|
||||
meta: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv, navModelSrv, private $routeParams, $location) {
|
||||
if (this.$routeParams.uid) {
|
||||
this.uid = $routeParams.uid;
|
||||
|
||||
new FolderPageLoader(this.backendSrv).load(this, this.uid, 'manage-folder-permissions').then(folder => {
|
||||
if ($location.path() !== folder.meta.url) {
|
||||
$location.path(`${folder.meta.url}/permissions`).replace();
|
||||
}
|
||||
|
||||
this.dashboard = folder.dashboard;
|
||||
this.meta = folder.meta;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { DashboardImportCtrl } from '../dashboard_import_ctrl';
|
||||
import config from '../../../core/config';
|
||||
import { DashboardImportCtrl } from './DashboardImportCtrl';
|
||||
import config from 'app/core/config';
|
||||
|
||||
describe('DashboardImportCtrl', () => {
|
||||
const ctx: any = {};
|
@ -1,4 +1,4 @@
|
||||
import { FolderPageLoader } from './folder_page_loader';
|
||||
import { FolderPageLoader } from './services/FolderPageLoader';
|
||||
import locationUtil from 'app/core/utils/location_util';
|
||||
|
||||
export class FolderDashboardsCtrl {
|
@ -46,7 +46,7 @@ export class MoveToFolderCtrl {
|
||||
export function moveToFolderModal() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'public/app/features/dashboard/move_to_folder_modal/move_to_folder.html',
|
||||
templateUrl: 'public/app/features/manage-dashboards/components/MoveToFolderModal/template.html',
|
||||
controller: MoveToFolderCtrl,
|
||||
bindToController: true,
|
||||
controllerAs: 'ctrl',
|
@ -0,0 +1 @@
|
||||
export { MoveToFolderCtrl } from './MoveToFolderCtrl';
|
@ -1,7 +1,15 @@
|
||||
import coreModule from 'app/core/core_module';
|
||||
export * from './components/MoveToFolderModal';
|
||||
|
||||
import { DashboardListCtrl } from './DashboardListCtrl';
|
||||
import { SnapshotListCtrl } from './SnapshotListCtrl';
|
||||
import { FolderDashboardsCtrl } from './FolderDashboardsCtrl';
|
||||
import { DashboardImportCtrl } from './DashboardImportCtrl';
|
||||
import { CreateFolderCtrl } from './CreateFolderCtrl';
|
||||
|
||||
import coreModule from 'app/core/core_module';
|
||||
|
||||
coreModule.controller('DashboardListCtrl', DashboardListCtrl);
|
||||
coreModule.controller('SnapshotListCtrl', SnapshotListCtrl);
|
||||
coreModule.controller('FolderDashboardsCtrl', FolderDashboardsCtrl);
|
||||
coreModule.controller('DashboardImportCtrl', DashboardImportCtrl);
|
||||
coreModule.controller('CreateFolderCtrl', CreateFolderCtrl);
|
||||
|
Loading…
Reference in New Issue
Block a user