From 4bac304fef0bbb8efcb8ca463e330ae780e1af43 Mon Sep 17 00:00:00 2001 From: Alison Date: Sun, 26 Aug 2018 14:45:47 -0500 Subject: [PATCH 1/7] show error if trying unpublished query in alert or dashboard --- client/app/components/dashboards/add-widget-dialog.html | 2 +- client/app/components/dashboards/add-widget-dialog.js | 5 ++++- client/app/pages/alert/index.js | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/app/components/dashboards/add-widget-dialog.html b/client/app/components/dashboards/add-widget-dialog.html index 90676dfbf1..9b178d7036 100644 --- a/client/app/components/dashboards/add-widget-dialog.html +++ b/client/app/components/dashboards/add-widget-dialog.html @@ -66,5 +66,5 @@ diff --git a/client/app/components/dashboards/add-widget-dialog.js b/client/app/components/dashboards/add-widget-dialog.js index aca1c9be34..1861adab32 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); }); @@ -47,6 +47,9 @@ const AddWidgetDialog = { if (queryId) { Query.get({ id: queryId }, (query) => { + if (query.is_draft === true) { + toastr.error('Unpublished queries cant not be used in dashboards.'); + } if (query) { this.selectedQuery = query; if (query.visualizations.length) { diff --git a/client/app/pages/alert/index.js b/client/app/pages/alert/index.js index f33f791574..e79db5cb93 100644 --- a/client/app/pages/alert/index.js +++ b/client/app/pages/alert/index.js @@ -13,6 +13,9 @@ function AlertCtrl($routeParams, $location, $sce, toastr, currentUser, Query, Ev this.trustAsHtml = html => $sce.trustAsHtml(html); this.onQuerySelected = (item) => { + if (item.is_draft === true) { + toastr.error('Unpublished queries can not be used in alerts.'); + } this.selectedQuery = new Query(item); this.selectedQuery.getQueryResultPromise().then((result) => { this.queryResult = result; From ac50f657aacaef293e05350800d0c213efeed1b2 Mon Sep 17 00:00:00 2001 From: Alison Date: Sun, 2 Sep 2018 13:50:39 -0500 Subject: [PATCH 2/7] disable unpublished in alerts instead of toastr error --- client/app/pages/alert/alert.html | 3 ++- client/app/pages/alert/index.js | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) 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 e79db5cb93..738e9df1b8 100644 --- a/client/app/pages/alert/index.js +++ b/client/app/pages/alert/index.js @@ -13,9 +13,6 @@ function AlertCtrl($routeParams, $location, $sce, toastr, currentUser, Query, Ev this.trustAsHtml = html => $sce.trustAsHtml(html); this.onQuerySelected = (item) => { - if (item.is_draft === true) { - toastr.error('Unpublished queries can not be used in alerts.'); - } this.selectedQuery = new Query(item); this.selectedQuery.getQueryResultPromise().then((result) => { this.queryResult = result; @@ -52,6 +49,11 @@ 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)'; + } + }); }); }; From 8ca270343a3815fd2e9c9984eea3ad4386f63610 Mon Sep 17 00:00:00 2001 From: Alison Date: Sun, 2 Sep 2018 14:32:56 -0500 Subject: [PATCH 3/7] disable unpublished in add to dashboard instead of toastr error --- client/app/components/dashboards/add-widget-dialog.html | 1 + client/app/components/dashboards/add-widget-dialog.js | 8 +++++--- client/app/components/dashboards/add-widget-dialog.less | 6 ++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client/app/components/dashboards/add-widget-dialog.html b/client/app/components/dashboards/add-widget-dialog.html index 9b178d7036..3f8e302571 100644 --- a/client/app/components/dashboards/add-widget-dialog.html +++ b/client/app/components/dashboards/add-widget-dialog.html @@ -49,6 +49,7 @@ diff --git a/client/app/components/dashboards/add-widget-dialog.js b/client/app/components/dashboards/add-widget-dialog.js index 1861adab32..30748d6efb 100644 --- a/client/app/components/dashboards/add-widget-dialog.js +++ b/client/app/components/dashboards/add-widget-dialog.js @@ -47,9 +47,6 @@ const AddWidgetDialog = { if (queryId) { Query.get({ id: queryId }, (query) => { - if (query.is_draft === true) { - toastr.error('Unpublished queries cant not be used in dashboards.'); - } if (query) { this.selectedQuery = query; if (query.visualizations.length) { @@ -74,6 +71,11 @@ const AddWidgetDialog = { // outdated results. if (this.searchTerm === term) { this.searchedQueries = results.results; + this.searchedQueries.forEach((q) => { + if (q.is_draft === true) { + q.name += ' (Unpublished)'; + } + }); } }); }, 200); diff --git a/client/app/components/dashboards/add-widget-dialog.less b/client/app/components/dashboards/add-widget-dialog.less index d156595123..cbba552dd2 100644 --- a/client/app/components/dashboards/add-widget-dialog.less +++ b/client/app/components/dashboards/add-widget-dialog.less @@ -1,3 +1,9 @@ .word-wrap-break { word-wrap: break-word; +} + +.inactive { + text-decoration: line-through; + pointer-events: none; + cursor: not-allowed; } \ No newline at end of file From 105580910dcec8a505ee4156e295ce7cef8c5deb Mon Sep 17 00:00:00 2001 From: Alison Date: Sun, 14 Oct 2018 16:23:27 -0500 Subject: [PATCH 4/7] ui changes for disabled state of add query to dashboard --- client/app/components/dashboards/add-widget-dialog.less | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/app/components/dashboards/add-widget-dialog.less b/client/app/components/dashboards/add-widget-dialog.less index cbba552dd2..cdf6f2ebd3 100644 --- a/client/app/components/dashboards/add-widget-dialog.less +++ b/client/app/components/dashboards/add-widget-dialog.less @@ -3,7 +3,11 @@ } .inactive { - text-decoration: line-through; + background-color: #eee !important; + border-color: transparent; + opacity: 0.65; + box-shadow: none; + color: #333; pointer-events: none; cursor: not-allowed; } \ No newline at end of file From 0b6a188f003ce5648eb951b408a6d225e5cd6bd0 Mon Sep 17 00:00:00 2001 From: Alison Date: Sun, 21 Oct 2018 17:46:44 -0500 Subject: [PATCH 5/7] change for feedback PR 2765 --- client/app/components/dashboards/add-widget-dialog.less | 2 +- client/app/pages/alert/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/app/components/dashboards/add-widget-dialog.less b/client/app/components/dashboards/add-widget-dialog.less index cdf6f2ebd3..9a52f128ec 100644 --- a/client/app/components/dashboards/add-widget-dialog.less +++ b/client/app/components/dashboards/add-widget-dialog.less @@ -5,7 +5,7 @@ .inactive { background-color: #eee !important; border-color: transparent; - opacity: 0.65; + opacity: 0.5; box-shadow: none; color: #333; pointer-events: none; diff --git a/client/app/pages/alert/index.js b/client/app/pages/alert/index.js index 738e9df1b8..c7433f94d8 100644 --- a/client/app/pages/alert/index.js +++ b/client/app/pages/alert/index.js @@ -51,7 +51,7 @@ function AlertCtrl($routeParams, $location, $sce, toastr, currentUser, Query, Ev this.queries = results.results; this.queries.forEach((q) => { if (q.is_draft === true) { - q.name += ' (Unpublished)'; + q.name += ' (Unpublished)'; } }); }); From 71e5c0240cb1060e2bf3e555124ac6d48a828586 Mon Sep 17 00:00:00 2001 From: Alison Date: Sun, 25 Nov 2018 21:35:18 -0600 Subject: [PATCH 6/7] add tags to query list in alerts and add to dashboard --- client/app/components/dashboards/add-widget-dialog.html | 2 +- client/app/components/dashboards/add-widget-dialog.js | 3 +++ client/app/pages/alert/index.js | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client/app/components/dashboards/add-widget-dialog.html b/client/app/components/dashboards/add-widget-dialog.html index 3f8e302571..81735a2ff3 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}}
diff --git a/client/app/components/dashboards/add-widget-dialog.js b/client/app/components/dashboards/add-widget-dialog.js index 39246f7f7f..27ae32b519 100644 --- a/client/app/components/dashboards/add-widget-dialog.js +++ b/client/app/components/dashboards/add-widget-dialog.js @@ -75,6 +75,9 @@ const AddWidgetDialog = { if (q.is_draft === true) { q.name += ' (Unpublished)'; } + q.tags.forEach((t) => { + q.name += ' ' + t + ''; + }); }); } }); diff --git a/client/app/pages/alert/index.js b/client/app/pages/alert/index.js index ea52151ddc..20f3fd68cd 100644 --- a/client/app/pages/alert/index.js +++ b/client/app/pages/alert/index.js @@ -51,6 +51,9 @@ function AlertCtrl($routeParams, $location, $sce, toastr, currentUser, Query, Ev if (q.is_draft === true) { q.name += ' (Unpublished)'; } + q.tags.forEach((t) => { + q.name += ' ' + t + ''; + }); }); }); }; From 61270d412c93c900a8666a34bc7b4ef30a681175 Mon Sep 17 00:00:00 2001 From: Alison Date: Fri, 30 Nov 2018 05:41:51 -0600 Subject: [PATCH 7/7] address () and tag styles --- client/app/components/dashboards/add-widget-dialog.html | 2 +- client/app/components/dashboards/add-widget-dialog.js | 4 ++-- client/app/pages/alert/index.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/app/components/dashboards/add-widget-dialog.html b/client/app/components/dashboards/add-widget-dialog.html index 81735a2ff3..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}} {{tag}} + ng-click="$ctrl.selectQuery(query.id)">{{query.name}} {{tag}}
diff --git a/client/app/components/dashboards/add-widget-dialog.js b/client/app/components/dashboards/add-widget-dialog.js index 27ae32b519..c8888d073b 100644 --- a/client/app/components/dashboards/add-widget-dialog.js +++ b/client/app/components/dashboards/add-widget-dialog.js @@ -73,10 +73,10 @@ const AddWidgetDialog = { this.searchedQueries = results.results; this.searchedQueries.forEach((q) => { if (q.is_draft === true) { - q.name += ' (Unpublished)'; + q.name += ' Unpublished'; } q.tags.forEach((t) => { - q.name += ' ' + t + ''; + q.name += ' ' + t + ''; }); }); } diff --git a/client/app/pages/alert/index.js b/client/app/pages/alert/index.js index 20f3fd68cd..ee9d7b3da6 100644 --- a/client/app/pages/alert/index.js +++ b/client/app/pages/alert/index.js @@ -49,10 +49,10 @@ function AlertCtrl($routeParams, $location, $sce, toastr, currentUser, Query, Ev this.queries = results.results; this.queries.forEach((q) => { if (q.is_draft === true) { - q.name += ' (Unpublished)'; + q.name += ' Unpublished'; } q.tags.forEach((t) => { - q.name += ' ' + t + ''; + q.name += ' ' + t + ''; }); }); });