From 78598df96e803c9ee58dc17e1c09bab7bb2ebc75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 1 Feb 2016 19:00:40 +0100 Subject: [PATCH] fixes(): fixes for changed app -> public/app paths and fixes for optimized build --- public/app/core/services/alert_srv.js | 2 +- public/app/features/annotations/editor_ctrl.js | 2 +- public/app/features/annotations/partials/editor.html | 2 +- public/app/features/annotations/query_editor.ts | 2 +- public/app/features/dashboard/keybindings.js | 2 +- public/app/features/panel/panel.ts | 1 + public/app/features/panel/panel_loader.ts | 2 +- public/app/plugins/datasource/elasticsearch/edit_view.ts | 1 + public/less/timepicker.less | 2 +- tasks/build_task.js | 6 +++--- tasks/options/ngtemplates.js | 1 + 11 files changed, 13 insertions(+), 10 deletions(-) diff --git a/public/app/core/services/alert_srv.js b/public/app/core/services/alert_srv.js index 463be459659..d833a0667ac 100644 --- a/public/app/core/services/alert_srv.js +++ b/public/app/core/services/alert_srv.js @@ -72,7 +72,7 @@ function (angular, _, coreModule) { scope.noText = payload.noText || "Cancel"; var confirmModal = $modal({ - template: './app/partials/confirm_modal.html', + template: 'public/app/partials/confirm_modal.html', persist: false, modalClass: 'modal-no-header confirm-modal', show: false, diff --git a/public/app/features/annotations/editor_ctrl.js b/public/app/features/annotations/editor_ctrl.js index 69bc07ae26d..d9731686a4f 100644 --- a/public/app/features/annotations/editor_ctrl.js +++ b/public/app/features/annotations/editor_ctrl.js @@ -31,7 +31,7 @@ function (angular, _, $) { }; $scope.datasourceChanged = function() { - datasourceSrv.get($scope.currentAnnotation.datasource).then(function(ds) { + return datasourceSrv.get($scope.currentAnnotation.datasource).then(function(ds) { $scope.currentDatasource = ds; $scope.currentAnnotation.datasource = ds.name; }); diff --git a/public/app/features/annotations/partials/editor.html b/public/app/features/annotations/partials/editor.html index 35adae93137..8894cb4b47f 100644 --- a/public/app/features/annotations/partials/editor.html +++ b/public/app/features/annotations/partials/editor.html @@ -33,9 +33,9 @@ -
+
diff --git a/public/app/features/annotations/query_editor.ts b/public/app/features/annotations/query_editor.ts index 4cc6416093a..42d3e9047b5 100644 --- a/public/app/features/annotations/query_editor.ts +++ b/public/app/features/annotations/query_editor.ts @@ -9,7 +9,7 @@ function annotationsQueryEditor(dynamicDirectiveSrv) { annotation: "=", datasource: "=" }, - watchPath: "datasource.type", + watchPath: "annotation.datasource", directive: scope => { return System.import(scope.datasource.meta.module).then(function(dsModule) { return { diff --git a/public/app/features/dashboard/keybindings.js b/public/app/features/dashboard/keybindings.js index 32980f46d7b..c85226d1266 100644 --- a/public/app/features/dashboard/keybindings.js +++ b/public/app/features/dashboard/keybindings.js @@ -21,7 +21,7 @@ function(angular, $) { helpModalScope = $rootScope.$new(); var helpModal = $modal({ - template: './app/partials/help_modal.html', + template: 'public/app/partials/help_modal.html', persist: false, show: false, scope: helpModalScope, diff --git a/public/app/features/panel/panel.ts b/public/app/features/panel/panel.ts index 7312e18ccc7..56749f90253 100644 --- a/public/app/features/panel/panel.ts +++ b/public/app/features/panel/panel.ts @@ -6,6 +6,7 @@ import {PanelCtrl} from './panel_ctrl'; import {MetricsPanelCtrl} from './metrics_panel_ctrl'; export class DefaultPanelCtrl extends PanelCtrl { + /** @ngInject */ constructor($scope, $injector) { super($scope, $injector); } diff --git a/public/app/features/panel/panel_loader.ts b/public/app/features/panel/panel_loader.ts index f0b4dbca327..58d0fe47c73 100644 --- a/public/app/features/panel/panel_loader.ts +++ b/public/app/features/panel/panel_loader.ts @@ -24,7 +24,7 @@ function panelLoader($compile, dynamicDirectiveSrv, $http, $q, $injector, $templ } var cached = $templateCache.get(directive.templateUrl); if (cached) { - return cached; + return $q.when(cached); } return $http.get(directive.templateUrl).then(res => { return res.data; diff --git a/public/app/plugins/datasource/elasticsearch/edit_view.ts b/public/app/plugins/datasource/elasticsearch/edit_view.ts index 2de77f43bdd..c7e17d4fbea 100644 --- a/public/app/plugins/datasource/elasticsearch/edit_view.ts +++ b/public/app/plugins/datasource/elasticsearch/edit_view.ts @@ -5,6 +5,7 @@ import _ from 'lodash'; export class EditViewCtrl { + /** @ngInject */ constructor($scope) { $scope.indexPatternTypes = [ {name: 'No pattern', value: undefined}, diff --git a/public/less/timepicker.less b/public/less/timepicker.less index fe7936f5d75..7910d18c23c 100644 --- a/public/less/timepicker.less +++ b/public/less/timepicker.less @@ -7,7 +7,7 @@ } .gf-timepicker-dropdown { - margin: -5px -10px; + margin: -5px -10px 10px 5px; padding: 10px 20px; float: right; background-color: @grafanaPanelBackground; diff --git a/tasks/build_task.js b/tasks/build_task.js index 39bb547be00..d844b661722 100644 --- a/tasks/build_task.js +++ b/tasks/build_task.js @@ -19,9 +19,9 @@ module.exports = function(grunt) { 'ngAnnotate:build', 'systemjs:build', 'concat:js', - // 'filerev', - // 'remapFilerev', - // 'usemin', + 'filerev', + 'remapFilerev', + 'usemin', 'uglify:genDir' ]); diff --git a/tasks/options/ngtemplates.js b/tasks/options/ngtemplates.js index 66ca44896c7..ad0581416bb 100644 --- a/tasks/options/ngtemplates.js +++ b/tasks/options/ngtemplates.js @@ -5,6 +5,7 @@ module.exports = function(config) { src: ['app/**/*.html'], dest: '<%= genDir %>/app/core/partials.js', options: { + prefix: 'public/', bootstrap: function(module, script) { return "define('app/core/partials', ['app/core/core_module'], function(coreModule) { \n" + "coreModule.default.run(['$templateCache', function($templateCache) { \n" +