diff --git a/client/app/assets/less/redash/query.less b/client/app/assets/less/redash/query.less index 81ae31aa9d..1a03ebc4f6 100644 --- a/client/app/assets/less/redash/query.less +++ b/client/app/assets/less/redash/query.less @@ -221,14 +221,20 @@ edit-in-place p.editable:hover { } .page-header--new { - .label-default { - margin-right: 3px; + .query-tags, + .query-tags__mobile { + .label-default, + .label-warning { + margin-right: 3px; + } } } .page-header--query { .page-title { display: block; + margin-left: 15px; + margin-right: 15px; } } @@ -520,9 +526,41 @@ nav .rg-bottom { } } +.query-tags { + display: inline-block; + vertical-align: middle; + margin-top: -3px; // padding-top of tags +} + +.query-tags__mobile { + display: none; + margin: -5px 0 0 0; + padding: 0 0 0 23px; +} + // Smaller screens @media (max-width: 880px) { + .page-header--query { + .page-title { + margin-left: 0; + margin-right: 0; + } + } + + .query-tags:not(.query-tags__empty) { + display: none; + } + + .query-tags__mobile:not(.query-tags__empty) { + display: block; + } + + .btn--showhide, + .query-actions-menu .dropdown-toggle { + margin-bottom: 5px; + } + .btn-publish { display: none; } @@ -562,6 +600,11 @@ nav .rg-bottom { } } + .query-visualizations-wrapper { + margin-left: -15px; + margin-right: -15px; + } + main { flex-direction: column-reverse; @@ -610,17 +653,6 @@ nav .rg-bottom { } } - -@media (max-width: 438px) { - .btn--showhide { - margin-bottom: 5px; - } - - .btn-publish { - margin-bottom: 5px; - } -} - @media (max-width: 768px) { .editor__left__schema, .editor__left__data-source { display: none; diff --git a/client/app/assets/less/redash/redash-newstyle.less b/client/app/assets/less/redash/redash-newstyle.less index 3e87aae392..2f18c05ad4 100644 --- a/client/app/assets/less/redash/redash-newstyle.less +++ b/client/app/assets/less/redash/redash-newstyle.less @@ -1,3 +1,5 @@ +@import (reference, less) '~bootstrap/less/labels.less'; + // Variables @redash-gray: rgba(102, 136, 153, 1); @redash-orange: rgba(255, 120, 100, 1); @@ -449,15 +451,22 @@ page-header, .page-header--new { background: fade(@redash-gray, 85%); } -.label-default-unpublished { +.label-tag-unpublished { background: fade(@redash-gray, 85%); - display: inline-block; - overflow: hidden; +} + +.label-tag-archived { + .label-warning(); } .label-tag { background: fade(@redash-gray, 10%); color: fade(@redash-gray, 75%); +} + +.label-tag-unpublished, +.label-tag-archived, +.label-tag { margin-right: 3px; display: inline-block; margin-top: 2px; diff --git a/client/app/components/tags-control/control-template.html b/client/app/components/tags-control/control-template.html index 65a1a09a1e..e8e56056fd 100644 --- a/client/app/components/tags-control/control-template.html +++ b/client/app/components/tags-control/control-template.html @@ -1,3 +1,4 @@ + {{ tag }} Add tag + UnpublishedArchived + + `, + bindings: { + query: '=', + canEdit: '<', + getAvailableTags: '<', + onEdit: '&', + }, + }); + + ngModule.component('dashboardTagsControl', { + template: ` + + UnpublishedArchived + + `, + bindings: { + dashboard: '=', + canEdit: '<', + getAvailableTags: '<', + onEdit: '&', + }, + }); } diff --git a/client/app/components/tags-control/tags-control.less b/client/app/components/tags-control/tags-control.less new file mode 100644 index 0000000000..13bbfaf082 --- /dev/null +++ b/client/app/components/tags-control/tags-control.less @@ -0,0 +1,7 @@ +tags-control { + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: stretch; + justify-content: flex-start; +} diff --git a/client/app/components/transclude-replace.js b/client/app/components/transclude-replace.js new file mode 100644 index 0000000000..ecda2161aa --- /dev/null +++ b/client/app/components/transclude-replace.js @@ -0,0 +1,23 @@ +export default function init(ngModule) { + ngModule.directive('ngTranscludeReplace', $log => ({ + terminal: true, + restrict: 'EA', + link: ($scope, $element, $attr, ctrl, transclude) => { + if (!transclude) { + $log.error( + 'orphan', + 'Illegal use of ngTranscludeReplace directive in the template! ' + + 'No parent directive that requires a transclusion found.', + ); + return; + } + transclude((clone) => { + if (clone.length) { + $element.replaceWith(clone); + } else { + $element.remove(); + } + }); + }, + })); +} diff --git a/client/app/pages/dashboards/dashboard-list.html b/client/app/pages/dashboards/dashboard-list.html index 65b35d2aa2..bee3b69e1b 100644 --- a/client/app/pages/dashboards/dashboard-list.html +++ b/client/app/pages/dashboards/dashboard-list.html @@ -77,9 +77,7 @@ {{ dashboard.name }} -
- Unpublished - + - Unpublished - Archived - +
diff --git a/client/app/pages/queries-list/queries-list.html b/client/app/pages/queries-list/queries-list.html index 60b517a794..43c38b9e89 100644 --- a/client/app/pages/queries-list/queries-list.html +++ b/client/app/pages/queries-list/queries-list.html @@ -95,11 +95,7 @@ {{query.name}} -
- - - Unpublished - + diff --git a/client/app/pages/queries/query.html b/client/app/pages/queries/query.html index a9377ab737..3398a32814 100644 --- a/client/app/pages/queries/query.html +++ b/client/app/pages/queries/query.html @@ -23,7 +23,12 @@

- + +

  @@ -42,7 +47,7 @@

-
+
@@ -68,12 +73,10 @@

-
- Unpublished - Archived - -
+
@@ -185,7 +188,7 @@

-
+