From 0fab210ad2a6688bc58c23b3cc5c97266f2929ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 5 Feb 2016 12:13:59 +0100 Subject: [PATCH] feat(apps): changed edit apps view to use plugin-component for apps config view --- .../app/core/directives/plugin_component.ts | 11 +++++++++ public/app/features/apps/all.ts | 1 - public/app/features/apps/config_view.ts | 23 ------------------- public/app/features/apps/partials/edit.html | 2 +- .../app/features/panel/metrics_panel_ctrl.ts | 4 ++-- 5 files changed, 14 insertions(+), 27 deletions(-) delete mode 100644 public/app/features/apps/config_view.ts diff --git a/public/app/core/directives/plugin_component.ts b/public/app/core/directives/plugin_component.ts index 94e50bf5c86..21900ce94ed 100644 --- a/public/app/core/directives/plugin_component.ts +++ b/public/app/core/directives/plugin_component.ts @@ -141,6 +141,17 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $ }; }); } + // AppConfigCtrl + case 'app-config-ctrl': { + return System.import(scope.ctrl.appModel.module).then(function(appModule) { + return { + name: 'app-config-' + scope.ctrl.appModel.appId, + bindings: {appModel: "=", appEditCtrl: "="}, + attrs: {"app-model": "ctrl.appModel", "app-edit-ctrl": "ctrl"}, + Component: appModule.ConfigCtrl, + }; + }); + } // Panel case 'panel': { return loadPanelComponentInfo(scope, attrs); diff --git a/public/app/features/apps/all.ts b/public/app/features/apps/all.ts index 6f15e8b1bf6..fcdd27dff4d 100644 --- a/public/app/features/apps/all.ts +++ b/public/app/features/apps/all.ts @@ -1,3 +1,2 @@ import './edit_ctrl'; import './list_ctrl'; -import './config_view'; diff --git a/public/app/features/apps/config_view.ts b/public/app/features/apps/config_view.ts deleted file mode 100644 index 31e85967cb2..00000000000 --- a/public/app/features/apps/config_view.ts +++ /dev/null @@ -1,23 +0,0 @@ -/// - -import angular from 'angular'; - -/** @ngInject */ -function appConfigView(dynamicDirectiveSrv) { - return dynamicDirectiveSrv.create({ - scope: { - appModel: "=" - }, - directive: scope => { - return System.import(scope.appModel.module).then(function(appModule) { - return { - name: 'app-config-' + scope.appModel.appId, - fn: appModule.configView, - }; - }); - }, - }); -} - - -angular.module('grafana.directives').directive('appConfigView', appConfigView); diff --git a/public/app/features/apps/partials/edit.html b/public/app/features/apps/partials/edit.html index 20df40bd247..efc5f93c738 100644 --- a/public/app/features/apps/partials/edit.html +++ b/public/app/features/apps/partials/edit.html @@ -97,7 +97,7 @@

Configuration:

- +
diff --git a/public/app/features/panel/metrics_panel_ctrl.ts b/public/app/features/panel/metrics_panel_ctrl.ts index 1e6f34775f5..2c25aa6eca5 100644 --- a/public/app/features/panel/metrics_panel_ctrl.ts +++ b/public/app/features/panel/metrics_panel_ctrl.ts @@ -6,8 +6,8 @@ import _ from 'lodash'; import kbn from 'app/core/utils/kbn'; import {PanelCtrl} from './panel_ctrl'; -import * as rangeUtil from '../../core/utils/rangeutil'; -import * as dateMath from '../../core/utils/datemath'; +import * as rangeUtil from 'app/core/utils/rangeutil'; +import * as dateMath from 'app/core/utils/datemath'; class MetricsPanelCtrl extends PanelCtrl { error: boolean;