From f1a44ad0903be93fd86061a72bd2f37b2c410db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 28 Oct 2016 13:36:27 +0200 Subject: [PATCH] ux(): progress on row ux --- .../app/features/dashboard/row/add_panel.html | 45 +------------ .../app/features/dashboard/row/options.html | 67 +++++++++---------- public/app/features/dashboard/row/row.ts | 19 ++++++ public/app/partials/dashboard.html | 6 +- public/sass/pages/_dashboard.scss | 35 ++++++---- 5 files changed, 80 insertions(+), 92 deletions(-) diff --git a/public/app/features/dashboard/row/add_panel.html b/public/app/features/dashboard/row/add_panel.html index 32c198258c3..d4876b0070d 100644 --- a/public/app/features/dashboard/row/add_panel.html +++ b/public/app/features/dashboard/row/add_panel.html @@ -1,9 +1,9 @@ -
+
- Panel search - + +
@@ -17,42 +17,3 @@
- -
-
-
Options
-
-
- Title - -
-
- -
- -
-
- - -
-
-
- Height - -
-
-
- -
Row Templating
- -
-
- Repeat Row -
- +
+
+ +
+ +
+
+ + +
+
+
+ Height + +
+
+
-
-
Options
-
-
- Title - -
-
- -
- -
-
- - -
-
-
- Height - -
-
-
+
+
Row Templating
-
Row Templating
- -
-
- Repeat Row -
- + +
+
+
diff --git a/public/app/features/dashboard/row/row.ts b/public/app/features/dashboard/row/row.ts index 2c234512c33..2a873f7a274 100644 --- a/public/app/features/dashboard/row/row.ts +++ b/public/app/features/dashboard/row/row.ts @@ -183,3 +183,22 @@ coreModule.directive('panelDropZone', function($timeout) { }); }; }); + +coreModule.directive('rowHeight', function() { + return function(scope, element) { + scope.$watchGroup(['row.collapse', 'row.height'], function() { + element.css({ minHeight: scope.row.collapse ? '5px' : scope.row.height }); + }); + + scope.onAppEvent('panel-fullscreen-enter', function(evt, info) { + var hasPanel = _.find(scope.row.panels, {id: info.panelId}); + if (!hasPanel) { + element.hide(); + } + }); + + scope.onAppEvent('panel-fullscreen-exit', function() { + element.show(); + }); + }; +}); diff --git a/public/app/partials/dashboard.html b/public/app/partials/dashboard.html index 8721e411b68..b605c736467 100644 --- a/public/app/partials/dashboard.html +++ b/public/app/partials/dashboard.html @@ -1,8 +1,7 @@ -
+
-
@@ -11,9 +10,8 @@
- + -
diff --git a/public/sass/pages/_dashboard.scss b/public/sass/pages/_dashboard.scss index 75ea1939935..bc3a66f10f0 100644 --- a/public/sass/pages/_dashboard.scss +++ b/public/sass/pages/_dashboard.scss @@ -206,7 +206,8 @@ div.flot-text { // .dash-row { - border-left: 1px solid $dark-2; + border-left: 1px solid $dark-4; + display: block; } .dash-row-header { @@ -214,7 +215,7 @@ div.flot-text { display: flex; flex-direction: row; margin-right: $panel-margin; - margin-left: $gf-form-margin; + margin-left: 0; border-bottom: 1px solid $dark-4; &:hover { @@ -225,13 +226,16 @@ div.flot-text { } .dash-row-header-title { + border-top: 1px solid $dark-4; padding: 0.6rem; .dash-row-collapse-toggle { - font-size: $font-size-sm; + padding: 0 2px; + font-size: $font-size-xs; color: $text-muted; position: relative; - left: -5px; + left: -3px; + top: -1px; } &:hover { @@ -272,7 +276,6 @@ div.flot-text { flex: 50; } - .dash-edit-mode { .dash-row { } @@ -281,12 +284,6 @@ div.flot-text { } } -.dash-row-options { - background: $panel-bg; - margin: 0 $panel-margin*2 0 $panel-margin; - padding: $spacer*1.5; -} - .dash-row-options-close-btn { float: right; padding: 0; @@ -303,6 +300,19 @@ div.flot-text { } } +.dash-row-options { + background: $panel-bg; + margin: 0 0 $panel-margin 0; + padding: $spacer*1.5; +} + +.dash-row-add-panel { + margin: 0; + padding: $panel-margin; + display: flex; + align-items: flex-start; +} + .add-panel-panels-scroll { width: 100%; overflow: hidden; @@ -314,7 +324,8 @@ div.flot-text { } .add-panel-item { - background: $input-label-bg; + background: $panel-bg; + border: $panel-border; padding: $spacer; min-width: 9rem; max-width: 9rem;