diff --git a/client/app/components/dashboards/add-widget-dialog.html b/client/app/components/dashboards/add-widget-dialog.html index 90676dfbf1..02dc5639ab 100644 --- a/client/app/components/dashboards/add-widget-dialog.html +++ b/client/app/components/dashboards/add-widget-dialog.html @@ -37,7 +37,7 @@
{{query.name}} + ng-click="$ctrl.selectQuery(query.id)">{{query.name}} {{tag}}
@@ -49,6 +49,7 @@ @@ -66,5 +67,5 @@ diff --git a/client/app/components/dashboards/add-widget-dialog.js b/client/app/components/dashboards/add-widget-dialog.js index a0ae6fcafb..c8888d073b 100644 --- a/client/app/components/dashboards/add-widget-dialog.js +++ b/client/app/components/dashboards/add-widget-dialog.js @@ -23,7 +23,7 @@ const AddWidgetDialog = { this.searchTerm = ''; this.recentQueries = []; - // Don't show draft (unpublished) queries + // Don't show draft (unpublished) queries in Add Widget modal list Query.recent().$promise.then((items) => { this.recentQueries = items.filter(item => !item.is_draft); }); @@ -71,6 +71,14 @@ const AddWidgetDialog = { // outdated results. if (this.searchTerm === term) { this.searchedQueries = results.results; + this.searchedQueries.forEach((q) => { + if (q.is_draft === true) { + q.name += ' Unpublished'; + } + q.tags.forEach((t) => { + q.name += ' ' + t + ''; + }); + }); } }); }, 200); diff --git a/client/app/components/dashboards/add-widget-dialog.less b/client/app/components/dashboards/add-widget-dialog.less index d156595123..9a52f128ec 100644 --- a/client/app/components/dashboards/add-widget-dialog.less +++ b/client/app/components/dashboards/add-widget-dialog.less @@ -1,3 +1,13 @@ .word-wrap-break { word-wrap: break-word; +} + +.inactive { + background-color: #eee !important; + border-color: transparent; + opacity: 0.5; + box-shadow: none; + color: #333; + pointer-events: none; + cursor: not-allowed; } \ No newline at end of file diff --git a/client/app/pages/alert/alert.html b/client/app/pages/alert/alert.html index 737f384624..4052bfd0bb 100644 --- a/client/app/pages/alert/alert.html +++ b/client/app/pages/alert/alert.html @@ -15,7 +15,8 @@ {{$select.selected.name}} + refresh-delay="0" + ui-disable-choice="q.is_draft === true">
diff --git a/client/app/pages/alert/index.js b/client/app/pages/alert/index.js index e5548f77ef..ee9d7b3da6 100644 --- a/client/app/pages/alert/index.js +++ b/client/app/pages/alert/index.js @@ -47,6 +47,14 @@ function AlertCtrl($routeParams, $location, $sce, toastr, currentUser, Query, Ev Query.query({ q: term }, (results) => { this.queries = results.results; + this.queries.forEach((q) => { + if (q.is_draft === true) { + q.name += ' Unpublished'; + } + q.tags.forEach((t) => { + q.name += ' ' + t + ''; + }); + }); }); };