From 09dbd6b1a6dd8b2866b289ca592c76e2da3c0078 Mon Sep 17 00:00:00 2001 From: ijin08 Date: Wed, 13 Feb 2019 11:04:22 +0100 Subject: [PATCH 01/20] removed _plugins.scss and _settings_permissions.scc, removed unused classes in _login.scss, reduced dark variabels in light theme and alignied light theme a bit with dark theme, turned blue-gray, dark-3 and panel-bg variables into one variable and removed gray-7 in dark theme --- public/sass/_grafana.scss | 2 - public/sass/_variables.dark.scss | 43 +++++------- public/sass/_variables.light.scss | 69 +++++++++---------- public/sass/base/_reboot.scss | 2 +- public/sass/base/_type.scss | 2 +- .../components/_settings_permissions.scss | 32 --------- public/sass/pages/_login.scss | 35 ---------- public/sass/pages/_plugins.scss | 31 --------- 8 files changed, 53 insertions(+), 163 deletions(-) delete mode 100644 public/sass/components/_settings_permissions.scss delete mode 100644 public/sass/pages/_plugins.scss diff --git a/public/sass/_grafana.scss b/public/sass/_grafana.scss index 739ccb6c412..3170de5ba1a 100644 --- a/public/sass/_grafana.scss +++ b/public/sass/_grafana.scss @@ -60,7 +60,6 @@ @import 'components/panel_text'; @import 'components/panel_heatmap'; @import 'components/panel_logs'; -@import 'components/settings_permissions'; @import 'components/tagsinput'; @import 'components/tables_lists'; @import 'components/search'; @@ -110,7 +109,6 @@ @import 'pages/admin'; @import 'pages/alerting'; @import 'pages/history'; -@import 'pages/plugins'; @import 'pages/signup'; @import 'pages/styleguide'; @import 'pages/errorpage'; diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index 6181590985f..8c729f0d1e8 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -6,24 +6,23 @@ $theme-name: dark; // New Colors // ------------------------- $sapphire-faint: #041126; -$sapphire-light: #5794F2; -$sapphire-base: #3274D9; -$sapphire-shade: #1F60C4; -$lobster-base: #E02F44; -$lobster-shade: #C4162A; -$forest-light: #96D98D; -$forest-base: #37872D; -$forest-shade: #19730E; -$green-base: #299C46; -$green-shade: #23843B; - +$sapphire-light: #5794f2; +$sapphire-base: #3274d9; +$sapphire-shade: #1f60c4; +$lobster-base: #e02f44; +$lobster-shade: #c4162a; +$forest-light: #96d98d; +$forest-base: #37872d; +$forest-shade: #19730e; +$green-base: #299c46; +$green-shade: #23843b; // Grays // ------------------------- $black: #000; $dark-1: #141414; $dark-2: #1f1f20; -$dark-3: #262628; +$dark-3: #222426; $dark-4: #333333; $dark-5: #444444; $gray-1: #555555; @@ -31,9 +30,7 @@ $gray-2: #8e8e8e; $gray-3: #b3b3b3; $gray-4: #d8d9da; $gray-5: #ececec; -$gray-7: #fbfbfb; -$gray-blue: #212327; $input-black: #09090b; $white: #fff; @@ -101,14 +98,14 @@ $external-link-color: $sapphire-light; // Typography // ------------------------- $headings-color: darken($white, 11%); -$abbr-border-color: $gray-3 !default; +$abbr-border-color: $gray-2 !default; $text-muted: $text-color-weak; $hr-border-color: $dark-4; // Panel // ------------------------- -$panel-bg: #212124; +$panel-bg: $dark-3; $panel-border: solid 1px $dark-1; $panel-header-hover-bg: $dark-4; $panel-corner: $panel-bg; @@ -121,7 +118,6 @@ $page-header-border-color: $dark-4; $divider-border-color: $gray-1; // Graphite Target Editor -$tight-form-bg: $dark-3; $tight-form-func-bg: $dark-4; $tight-form-func-highlight-bg: $dark-5; @@ -136,11 +132,11 @@ $card-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, 0.1), 1px 1px 0 0 rgba(0, 0, 0, 0. // Lists $list-item-bg: $card-background; -$list-item-hover-bg: lighten($gray-blue, 2%); +$list-item-hover-bg: lighten($dark-3, 2%); $list-item-link-color: $text-color; $list-item-shadow: $card-shadow; -$empty-list-cta-bg: $gray-blue; +$empty-list-cta-bg: $dark-3; // Scrollbars $scrollbarBackground: #404357; @@ -149,7 +145,6 @@ $scrollbarBorder: black; // Tables // ------------------------- -$table-bg: transparent; // overall background-color $table-bg-accent: $dark-3; // for striping $table-border: $dark-3; // table and cell border @@ -196,7 +191,7 @@ $input-box-shadow: inset 1px 0px 0.3rem 0px rgba(150, 150, 150, 0.1); $input-border-focus: $input-border-color; $input-box-shadow-focus: rgba(102, 175, 233, 0.6); $input-color-placeholder: $gray-1 !default; -$input-label-bg: $gray-blue; +$input-label-bg: $dark-3; $input-label-border-color: $dark-3; $input-color-select-arrow: $white; @@ -205,7 +200,7 @@ $placeholderText: darken($text-color, 25%); // Search $search-shadow: 0 0 30px 0 $black; -$search-filter-box-bg: $gray-blue; +$search-filter-box-bg: $dark-3; // Typeahead $typeahead-shadow: 0 5px 10px 0 $black; @@ -343,7 +338,7 @@ $diff-json-new: #457740; $diff-json-changed-fg: $gray-5; $diff-json-changed-num: $text-color; -$diff-json-icon: $gray-7; +$diff-json-icon: $gray-5; //Submenu $variable-option-bg: $dropdownLinkBackgroundHover; @@ -377,7 +372,7 @@ $panel-editor-tabs-line-color: #e3e3e3; $panel-editor-viz-item-bg-hover: darken($sapphire-base, 46%); $panel-options-group-border: none; -$panel-options-group-header-bg: $gray-blue; +$panel-options-group-header-bg: $dark-3; $panel-grid-placeholder-bg: $sapphire-faint; $panel-grid-placeholder-shadow: 0 0 4px $sapphire-shade; diff --git a/public/sass/_variables.light.scss b/public/sass/_variables.light.scss index f0e0a535653..e5d67f092ee 100644 --- a/public/sass/_variables.light.scss +++ b/public/sass/_variables.light.scss @@ -5,25 +5,23 @@ $theme-name: light; // New Colors // ------------------------- -$sapphire-faint: #F5F9FF; -$sapphire-light: #A8CAFF; -$sapphire-base: #3274D9; -$sapphire-shade: #1F60C4; -$lobster-base: #E02F44; -$lobster-shade: #C4162A; -$green-base: #37872D; -$green-shade: #19730E; -$green-base: #3EB15B; -$green-shade: #369B4F; -$purple-shade: #8F3BB8; -$yellow-base: #F2CC0C; +$sapphire-faint: #f5f9ff; +$sapphire-light: #a8caff; +$sapphire-base: #3274d9; +$sapphire-shade: #1f60c4; +$lobster-base: #e02f44; +$lobster-shade: #c4162a; +$green-base: #37872d; +$green-shade: #19730e; +$green-base: #3eb15b; +$green-shade: #369b4f; +$purple-shade: #8f3bb8; +$yellow-base: #f2cc0c; // Grays // ------------------------- $black: #000; $dark-2: #1e2028; -$dark-3: #303133; -$dark-4: #35373f; $dark-5: #41444b; $gray-1: #52545c; $gray-2: #767980; @@ -78,12 +76,7 @@ $text-color-emphasis: $dark-5; $text-shadow-faint: none; // gradients -$brand-gradient: linear-gradient( - to right, - rgba(255, 213, 0, 1) 0%, - rgba(255, 68, 0, 1) 99%, - rgba(255, 68, 0, 1) 100% -); +$brand-gradient: linear-gradient(to right, rgba(255, 213, 0, 1) 0%, rgba(255, 68, 0, 1) 99%, rgba(255, 68, 0, 1) 100%); $page-gradient: linear-gradient(180deg, $white 10px, $gray-7 100px); $edit-gradient: linear-gradient(-60deg, $gray-7, #f5f6f9 70%, $gray-7 98%); @@ -101,7 +94,7 @@ $headings-color: $text-color; $abbr-border-color: $gray-2 !default; $text-muted: $text-color-weak; -$hr-border-color: $dark-3 !default; +$hr-border-color: $gray-4 !default; // Panel // ------------------------- @@ -118,13 +111,12 @@ $page-header-border-color: $gray-4; $divider-border-color: $gray-2; // Graphite Target Editor -$tight-form-bg: #eaebee; $tight-form-func-bg: $gray-5; $tight-form-func-highlight-bg: $gray-6; $modal-backdrop-bg: $body-bg; $code-tag-bg: $gray-6; -$code-tag-border: darken($code-tag-bg, 3%); +$code-tag-border: $gray-4; // cards $card-background: linear-gradient(135deg, $gray-6, $gray-5); @@ -146,7 +138,6 @@ $scrollbarBorder: $gray-4; // Tables // ------------------------- -$table-bg: transparent; // overall background-color $table-bg-accent: $gray-5; // for striping $table-border: $gray-3; // table and cell border @@ -167,8 +158,9 @@ $btn-success-bg-hl: $green-shade; $btn-danger-bg: $lobster-base; $btn-danger-bg-hl: $lobster-shade; -$btn-inverse-bg: $gray-6; -$btn-inverse-bg-hl: darken($gray-6, 5%); +$btn-inverse-bg: $gray-5; +$btn-inverse-bg-hl: darken($gray-5, 5%); +$btn-inverse-bg-hl: $gray-4; $btn-inverse-text-color: $gray-1; $btn-inverse-text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); @@ -186,7 +178,7 @@ $btn-drag-image: '../img/grab_light.svg'; $input-bg: $white; $input-bg-disabled: $gray-5; -$input-color: $dark-3; +$input-color: $dark-5; $input-border-color: $gray-5; $input-box-shadow: none; $input-border-focus: $sapphire-light !default; @@ -215,7 +207,7 @@ $dropdownBorder: $gray-4; $dropdownDividerTop: $gray-6; $dropdownDividerBottom: $white; -$dropdownLinkColor: $dark-3; +$dropdownLinkColor: $dark-5; $dropdownLinkColorHover: $link-color; $dropdownLinkColorActive: $link-color; @@ -230,7 +222,7 @@ $horizontalComponentOffset: 180px; $navbarHeight: 52px; $navbarBackground: $white; -$navbarBorder: 1px solid $gray-4; +$navbarBorder: 1px solid $gray-5; $navbarShadow: 0 0 3px #c1c1c1; $navbarLinkColor: #444; @@ -270,7 +262,7 @@ $success-text-color: lighten($green, 10%); $alert-error-bg: linear-gradient(90deg, $lobster-base, $lobster-shade); $alert-success-bg: linear-gradient(90deg, $green-base, $green-shade); $alert-warning-bg: linear-gradient(90deg, $lobster-base, $lobster-shade); -$alert-info-bg: $sapphire-base; +$alert-info-bg: linear-gradient(100deg, $sapphire-base, $sapphire-shade); // popover $popover-bg: $page-bg; @@ -278,7 +270,7 @@ $popover-color: $text-color; $popover-border-color: $gray-5; $popover-shadow: 0 0 20px $white; -$popover-help-bg: $sapphire-base; +$popover-help-bg: $btn-secondary-bg; $popover-help-color: $gray-6; $popover-error-bg: $btn-danger-bg; @@ -324,10 +316,10 @@ $json-explorer-url-color: $sapphire-base; $diff-label-bg: $gray-5; $diff-label-fg: $gray-2; -$diff-arrow-color: $dark-3; -$diff-group-bg: $gray-7; +$diff-arrow-color: $dark-5; +$diff-group-bg: $gray-6; -$diff-json-bg: $gray-5; +$diff-json-bg: $gray-6; $diff-json-fg: $gray-1; $diff-json-added: $sapphire-shade; @@ -349,14 +341,14 @@ $variable-option-bg: $dropdownLinkBackgroundHover; $switch-bg: $white; $switch-slider-color: $gray-7; $switch-slider-off-bg: $gray-5; -$switch-slider-on-bg: linear-gradient(90deg, #FF9830, #E55400); +$switch-slider-on-bg: linear-gradient(90deg, #ff9830, #e55400); $switch-slider-shadow: 0 0 3px $dark-5; //Checkbox // ------------------------- $checkbox-bg: $gray-6; $checkbox-border: 1px solid $gray-3; -$checkbox-checked-bg: linear-gradient(0deg, #FF9830, #E55400); +$checkbox-checked-bg: linear-gradient(0deg, #ff9830, #e55400); $checkbox-color: $gray-7; //Panel Edit @@ -369,7 +361,10 @@ $panel-editor-viz-item-shadow-hover: 0 0 4px $blue-light; $panel-editor-viz-item-border-hover: 1px solid $blue-light; $panel-editor-viz-item-bg: $white; $panel-editor-tabs-line-color: $dark-5; -$panel-editor-viz-item-bg-hover: lighten($blue, 62%);$panel-options-group-border: none; + +$panel-editor-viz-item-bg-hover: lighten($blue, 62%); + +$panel-options-group-border: none; $panel-options-group-header-bg: $gray-5; $panel-grid-placeholder-bg: $sapphire-faint; diff --git a/public/sass/base/_reboot.scss b/public/sass/base/_reboot.scss index 8aac8bc815e..65cfafc107d 100644 --- a/public/sass/base/_reboot.scss +++ b/public/sass/base/_reboot.scss @@ -246,7 +246,7 @@ textarea { table { // Reset for nesting within parents with `background-color`. - background-color: $table-bg; + background-color: transparent; } caption { diff --git a/public/sass/base/_type.scss b/public/sass/base/_type.scss index 9919a370a87..82aae6351af 100644 --- a/public/sass/base/_type.scss +++ b/public/sass/base/_type.scss @@ -266,7 +266,7 @@ dd { // Abbreviations and acronyms abbr[title] { cursor: help; - border-bottom: 1px dotted $gray-2; + border-bottom: 1px dotted $abbr-border-color; } abbr.initialism { diff --git a/public/sass/components/_settings_permissions.scss b/public/sass/components/_settings_permissions.scss deleted file mode 100644 index 5864c58679e..00000000000 --- a/public/sass/components/_settings_permissions.scss +++ /dev/null @@ -1,32 +0,0 @@ -.permissionlist { - .permissionlist__section { - margin-bottom: $spacer*2; - } - - .permissionlist__section-header { - margin-bottom: $spacer; - display: flex; - } - - .permissionlist__section-header h6 { - margin: auto 5px; - color: $text-color-weak; - } - - .permissionlist__section-header__add-button { - margin-left: auto; - width: 105px; - } - - .permissionlist__item { - background-color: $tight-form-bg; - - &:hover { - background-color: $tight-form-func-bg; - } - } - - .permissionlist__item-buttons { - margin-left: auto; - } -} diff --git a/public/sass/pages/_login.scss b/public/sass/pages/_login.scss index 091391da7ff..c42fd47ba1c 100644 --- a/public/sass/pages/_login.scss +++ b/public/sass/pages/_login.scss @@ -176,12 +176,6 @@ select:-webkit-autofill:focus { } } -.login-tab-header { - background: $tight-form-bg; - text-align: center; - margin-bottom: 3rem; -} - .login-change-password-info { padding-bottom: 1.5rem; @@ -195,26 +189,6 @@ select:-webkit-autofill:focus { background-color: $btn-semi-transparent; } -.btn-login-tab { - background: transparent; - border: none; - font-size: 15px; - padding: 10px 10px; - font-weight: bold; - display: inline-block; - width: 170px; - color: $text-color; - - &.active { - background: darken($tight-form-bg, 5%); - color: $white; - } - - &:focus { - outline: 0; - } -} - .password-strength { display: block; width: 15%; @@ -252,15 +226,6 @@ select:-webkit-autofill:focus { width: 100%; } -.password-recovery { - background: $tight-form-bg; - padding: 10px; - - a { - color: $gray-2; - } -} - .login-divider { float: left; width: 100%; diff --git a/public/sass/pages/_plugins.scss b/public/sass/pages/_plugins.scss deleted file mode 100644 index 2570eb6c791..00000000000 --- a/public/sass/pages/_plugins.scss +++ /dev/null @@ -1,31 +0,0 @@ -.get-more-plugins-link { - color: $gray-3; - font-size: $font-size-sm; - position: relative; - top: 1.2rem; - - &:hover { - color: $link-hover-color; - } - - img { - vertical-align: top; - } -} - -@include media-breakpoint-down(sm) { - .get-more-plugins-link { - display: none; - } -} - -.plugin-info-list-item { - white-space: nowrap; - max-width: $page-sidebar-width; - text-overflow: ellipsis; - overflow: hidden; - - img { - width: 16px; - } -} From 7a4508d11eb2e6192fdeb7db04fe5909fd11bb6d Mon Sep 17 00:00:00 2001 From: ijin08 Date: Wed, 13 Feb 2019 14:56:28 +0100 Subject: [PATCH 02/20] added new dark variable to dark theme(the color used for page-bg), changed some backgroud colors that doesn't use variables to use variables, made some slight tweaks to dark variables, fixed so item hover is the same as card hover --- public/sass/_variables.dark.scss | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index 8c729f0d1e8..48e6c8ab690 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -21,10 +21,11 @@ $green-shade: #23843b; // ------------------------- $black: #000; $dark-1: #141414; +$dark-1-5: #161719; $dark-2: #1f1f20; $dark-3: #222426; -$dark-4: #333333; -$dark-5: #444444; +$dark-4: #343436; +$dark-5: #424345; $gray-1: #555555; $gray-2: #8e8e8e; $gray-3: #b3b3b3; @@ -64,8 +65,8 @@ $critical: $lobster-base; // Scaffolding // ------------------------- -$body-bg: rgb(23, 24, 25); -$page-bg: rgb(22, 23, 25); +$body-bg: $dark-1-5; +$page-bg: $dark-1-5; $body-color: $gray-4; $text-color: $gray-4; @@ -85,8 +86,8 @@ $brand-gradient: linear-gradient( rgba(255, 68, 0, 0.7) 100% ); -$page-gradient: linear-gradient(180deg, #222426 10px, rgb(22, 23, 25) 100px); -$edit-gradient: linear-gradient(180deg, rgb(22, 23, 25) 50%, #090909); +$page-gradient: linear-gradient(180deg, $dark-3 10px, $dark-1-5 100px); +$edit-gradient: linear-gradient(180deg, $dark-1-5 50%, $input-black); // Links // ------------------------- @@ -111,7 +112,7 @@ $panel-header-hover-bg: $dark-4; $panel-corner: $panel-bg; // page header -$page-header-bg: linear-gradient(90deg, #292a2d, black); +$page-header-bg: linear-gradient(90deg, $dark-3, $input-black); $page-header-shadow: inset 0px -4px 14px $dark-2; $page-header-border-color: $dark-4; @@ -126,21 +127,21 @@ $code-tag-bg: $dark-1; $code-tag-border: $dark-4; // cards -$card-background: linear-gradient(135deg, #2f2f32, #262628); -$card-background-hover: linear-gradient(135deg, #343436, #262628); +$card-background: linear-gradient(135deg, $dark-4, $dark-3); +$card-background-hover: linear-gradient(135deg, $dark-5, $dark-4); $card-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, 0.1), 1px 1px 0 0 rgba(0, 0, 0, 0.3); // Lists $list-item-bg: $card-background; -$list-item-hover-bg: lighten($dark-3, 2%); +$list-item-hover-bg: $card-background-hover; $list-item-link-color: $text-color; $list-item-shadow: $card-shadow; $empty-list-cta-bg: $dark-3; // Scrollbars -$scrollbarBackground: #404357; -$scrollbarBackground2: #3a3a3a; +$scrollbarBackground: $dark-5; +$scrollbarBackground2: $dark-4; $scrollbarBorder: black; // Tables From 6160f361215462e90f0b98c1f40c49dc1f9e6870 Mon Sep 17 00:00:00 2001 From: ijin08 Date: Wed, 13 Feb 2019 18:04:53 +0100 Subject: [PATCH 03/20] removed more unused variables, restyled scrollbar --- public/sass/_variables.dark.scss | 13 ++++--------- public/sass/_variables.light.scss | 20 +++++++------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index 48e6c8ab690..502aab64dee 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -12,8 +12,6 @@ $sapphire-shade: #1f60c4; $lobster-base: #e02f44; $lobster-shade: #c4162a; $forest-light: #96d98d; -$forest-base: #37872d; -$forest-shade: #19730e; $green-base: #299c46; $green-shade: #23843b; @@ -140,9 +138,9 @@ $list-item-shadow: $card-shadow; $empty-list-cta-bg: $dark-3; // Scrollbars -$scrollbarBackground: $dark-5; +$scrollbarBackground: $dark-4; $scrollbarBackground2: $dark-4; -$scrollbarBorder: black; +$scrollbarBorder: $dark-5; // Tables // ------------------------- @@ -189,8 +187,8 @@ $input-bg-disabled: $dark-3; $input-color: $gray-4; $input-border-color: $dark-3; $input-box-shadow: inset 1px 0px 0.3rem 0px rgba(150, 150, 150, 0.1); -$input-border-focus: $input-border-color; -$input-box-shadow-focus: rgba(102, 175, 233, 0.6); +$input-border-focus: $dark-3 !default; +$input-box-shadow-focus: rgba(102, 175, 233, 0.6) !default; $input-color-placeholder: $gray-1 !default; $input-label-bg: $dark-3; $input-label-border-color: $dark-3; @@ -231,9 +229,6 @@ $navbarHeight: 55px; $navbarBackground: $panel-bg; $navbarBorder: 1px solid $dark-3; -$navbarShadow: 0 0 20px black; - -$navbarLinkColor: $gray-4; $navbarButtonBackground: $navbarBackground; $navbarButtonBackgroundHighlight: $body-bg; diff --git a/public/sass/_variables.light.scss b/public/sass/_variables.light.scss index e5d67f092ee..16c1555f31e 100644 --- a/public/sass/_variables.light.scss +++ b/public/sass/_variables.light.scss @@ -11,8 +11,6 @@ $sapphire-base: #3274d9; $sapphire-shade: #1f60c4; $lobster-base: #e02f44; $lobster-shade: #c4162a; -$green-base: #37872d; -$green-shade: #19730e; $green-base: #3eb15b; $green-shade: #369b4f; $purple-shade: #8f3bb8; @@ -36,7 +34,6 @@ $white: #fff; // Accent colors // ------------------------- $blue: #0083b3; -$blue-light: #00a8e6; $green: #3aa655; $red: $lobster-base; $yellow: #ff851b; @@ -132,9 +129,9 @@ $list-item-shadow: $card-shadow; $empty-list-cta-bg: $gray-6; // Scrollbars -$scrollbarBackground: $gray-5; -$scrollbarBackground2: $gray-5; -$scrollbarBorder: $gray-4; +$scrollbarBackground: $gray-4; +$scrollbarBackground2: $gray-4; +$scrollbarBorder: $gray-3; // Tables // ------------------------- @@ -181,7 +178,7 @@ $input-bg-disabled: $gray-5; $input-color: $dark-5; $input-border-color: $gray-5; $input-box-shadow: none; -$input-border-focus: $sapphire-light !default; +$input-border-focus: $gray-5 !default; $input-box-shadow-focus: $sapphire-light !default; $input-color-placeholder: $gray-4 !default; $input-label-bg: $gray-5; @@ -223,9 +220,6 @@ $navbarHeight: 52px; $navbarBackground: $white; $navbarBorder: 1px solid $gray-5; -$navbarShadow: 0 0 3px #c1c1c1; - -$navbarLinkColor: #444; $navbarButtonBackground: lighten($navbarBackground, 3%); $navbarButtonBackgroundHighlight: lighten($navbarBackground, 5%); @@ -357,12 +351,12 @@ $panel-editor-shadow: 0px 0px 8px $gray-3; $panel-editor-side-menu-shadow: drop-shadow(0 0 2px $gray-3); $panel-editor-viz-item-shadow: 0 0 4px $gray-3; $panel-editor-viz-item-border: 1px solid $gray-3; -$panel-editor-viz-item-shadow-hover: 0 0 4px $blue-light; -$panel-editor-viz-item-border-hover: 1px solid $blue-light; +$panel-editor-viz-item-shadow-hover: 0 0 4px $sapphire-light; +$panel-editor-viz-item-border-hover: 1px solid $sapphire-light; $panel-editor-viz-item-bg: $white; $panel-editor-tabs-line-color: $dark-5; -$panel-editor-viz-item-bg-hover: lighten($blue, 62%); +$panel-editor-viz-item-bg-hover: lighten($sapphire-base, 45%); $panel-options-group-border: none; $panel-options-group-header-bg: $gray-5; From cbb91adb43bb65b94deda47e0a09f294244a180c Mon Sep 17 00:00:00 2001 From: ijin08 Date: Thu, 14 Feb 2019 11:47:17 +0100 Subject: [PATCH 04/20] changed color for blue light in light theme + small changes in naming etc --- public/sass/_variables.dark.scss | 8 ++++---- public/sass/_variables.light.scss | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index 502aab64dee..d624d912bab 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -175,7 +175,7 @@ $btn-link-color: $gray-3; $iconContainerBackground: $black; $btn-divider-left: $dark-4; -$btn-divider-right: $dark-2; +$btn-divider-right: $dark-1-5; $btn-drag-image: '../img/grab_dark.svg'; @@ -188,7 +188,7 @@ $input-color: $gray-4; $input-border-color: $dark-3; $input-box-shadow: inset 1px 0px 0.3rem 0px rgba(150, 150, 150, 0.1); $input-border-focus: $dark-3 !default; -$input-box-shadow-focus: rgba(102, 175, 233, 0.6) !default; +$input-box-shadow-focus: $sapphire-light !default; $input-color-placeholder: $gray-1 !default; $input-label-bg: $dark-3; $input-label-border-color: $dark-3; @@ -268,7 +268,7 @@ $alert-warning-bg: linear-gradient(90deg, $lobster-base, $lobster-shade); $alert-info-bg: linear-gradient(100deg, $sapphire-base, $sapphire-shade); // popover -$popover-bg: $page-bg; +$popover-bg: $dark-1-5; $popover-color: $text-color; $popover-border-color: $dark-4; $popover-shadow: 0 0 20px black; @@ -379,7 +379,7 @@ $logs-color-unkown: $gray-2; // toggle-group $button-toggle-group-btn-active-bg: linear-gradient(90deg, #eb7b18, #d44a3a); $button-toggle-group-btn-active-shadow: inset 0 0 4px $black; -$button-toggle-group-btn-seperator-border: 1px solid $page-bg; +$button-toggle-group-btn-seperator-border: 1px solid $dark-1-5; $vertical-resize-handle-bg: $dark-5; $vertical-resize-handle-dots: $gray-1; diff --git a/public/sass/_variables.light.scss b/public/sass/_variables.light.scss index 16c1555f31e..94c2134313f 100644 --- a/public/sass/_variables.light.scss +++ b/public/sass/_variables.light.scss @@ -6,7 +6,7 @@ $theme-name: light; // New Colors // ------------------------- $sapphire-faint: #f5f9ff; -$sapphire-light: #a8caff; +$sapphire-light: #5794f2; $sapphire-base: #3274d9; $sapphire-shade: #1f60c4; $lobster-base: #e02f44; @@ -307,7 +307,7 @@ $json-explorer-url-color: $sapphire-base; // Changelog and diff // ------------------------- -$diff-label-bg: $gray-5; +$diff-label-bg: $gray-7; $diff-label-fg: $gray-2; $diff-arrow-color: $dark-5; From 3b3a5b67972caa819e53ca57381b33dbf4e448cc Mon Sep 17 00:00:00 2001 From: ijin08 Date: Thu, 14 Feb 2019 13:32:45 +0100 Subject: [PATCH 05/20] increased blue in dark-1-5, dark-3 and dark-4 --- public/sass/_variables.dark.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index d624d912bab..470b9609252 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -19,10 +19,10 @@ $green-shade: #23843b; // ------------------------- $black: #000; $dark-1: #141414; -$dark-1-5: #161719; +$dark-1-5: #16171a; $dark-2: #1f1f20; -$dark-3: #222426; -$dark-4: #343436; +$dark-3: #1f2124; +$dark-4: #323436; $dark-5: #424345; $gray-1: #555555; $gray-2: #8e8e8e; From 794fb3e039ead4507f9ea50fa5f4aab26eabe9ff Mon Sep 17 00:00:00 2001 From: ijin08 Date: Fri, 15 Feb 2019 14:02:46 +0100 Subject: [PATCH 06/20] new dark-3 became new dark-2, created new lighter dark-3, changed panel-bg, empty-cta etc to dark-2 --- public/sass/_variables.dark.scss | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index 470b9609252..eced6d9fbf2 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -20,8 +20,8 @@ $green-shade: #23843b; $black: #000; $dark-1: #141414; $dark-1-5: #16171a; -$dark-2: #1f1f20; -$dark-3: #1f2124; +$dark-2: #1f2124; +$dark-3: #252629; $dark-4: #323436; $dark-5: #424345; $gray-1: #555555; @@ -104,7 +104,7 @@ $hr-border-color: $dark-4; // Panel // ------------------------- -$panel-bg: $dark-3; +$panel-bg: $dark-2; $panel-border: solid 1px $dark-1; $panel-header-hover-bg: $dark-4; $panel-corner: $panel-bg; @@ -135,7 +135,7 @@ $list-item-hover-bg: $card-background-hover; $list-item-link-color: $text-color; $list-item-shadow: $card-shadow; -$empty-list-cta-bg: $dark-3; +$empty-list-cta-bg: $dark-2; // Scrollbars $scrollbarBackground: $dark-4; @@ -175,7 +175,7 @@ $btn-link-color: $gray-3; $iconContainerBackground: $black; $btn-divider-left: $dark-4; -$btn-divider-right: $dark-1-5; +$btn-divider-right: $dark-2; $btn-drag-image: '../img/grab_dark.svg'; @@ -190,7 +190,7 @@ $input-box-shadow: inset 1px 0px 0.3rem 0px rgba(150, 150, 150, 0.1); $input-border-focus: $dark-3 !default; $input-box-shadow-focus: $sapphire-light !default; $input-color-placeholder: $gray-1 !default; -$input-label-bg: $dark-3; +$input-label-bg: $dark-2; $input-label-border-color: $dark-3; $input-color-select-arrow: $white; @@ -199,7 +199,7 @@ $placeholderText: darken($text-color, 25%); // Search $search-shadow: 0 0 30px 0 $black; -$search-filter-box-bg: $dark-3; +$search-filter-box-bg: $dark-2; // Typeahead $typeahead-shadow: 0 5px 10px 0 $black; @@ -368,7 +368,7 @@ $panel-editor-tabs-line-color: #e3e3e3; $panel-editor-viz-item-bg-hover: darken($sapphire-base, 46%); $panel-options-group-border: none; -$panel-options-group-header-bg: $dark-3; +$panel-options-group-header-bg: $dark-2; $panel-grid-placeholder-bg: $sapphire-faint; $panel-grid-placeholder-shadow: 0 0 4px $sapphire-shade; From c62f06b42727a6b358b069261c4d63a68a36f559 Mon Sep 17 00:00:00 2001 From: ijin08 Date: Mon, 18 Feb 2019 14:35:13 +0100 Subject: [PATCH 07/20] reversed most of grays in dark theme --- public/sass/_variables.dark.scss | 120 ++++++++++++++++--------------- 1 file changed, 63 insertions(+), 57 deletions(-) diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index eced6d9fbf2..cecf7f214fd 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -17,13 +17,18 @@ $green-shade: #23843b; // Grays // ------------------------- + $black: #000; $dark-1: #141414; -$dark-1-5: #16171a; -$dark-2: #1f2124; -$dark-3: #252629; -$dark-4: #323436; -$dark-5: #424345; +$dark-2: #161719; +$dark-3: #1f1f20; +$dark-4: #212124; +$dark-5: #222426; +$dark-6: #262628; +$dark-7: #292a2d; +$dark-8: #2f2f32; +$dark-9: #343436; +$dark-10: #424345; $gray-1: #555555; $gray-2: #8e8e8e; $gray-3: #b3b3b3; @@ -31,6 +36,7 @@ $gray-4: #d8d9da; $gray-5: #ececec; $input-black: #09090b; +$gray-blue: #212327; $white: #fff; @@ -63,14 +69,14 @@ $critical: $lobster-base; // Scaffolding // ------------------------- -$body-bg: $dark-1-5; -$page-bg: $dark-1-5; +$body-bg: $dark-2; +$page-bg: $dark-2; $body-color: $gray-4; $text-color: $gray-4; $text-color-strong: $white; $text-color-weak: $gray-2; -$text-color-faint: $dark-5; +$text-color-faint: $dark-10; $text-color-emphasis: $gray-5; $text-shadow-faint: 1px 1px 4px rgb(45, 45, 45); @@ -84,8 +90,8 @@ $brand-gradient: linear-gradient( rgba(255, 68, 0, 0.7) 100% ); -$page-gradient: linear-gradient(180deg, $dark-3 10px, $dark-1-5 100px); -$edit-gradient: linear-gradient(180deg, $dark-1-5 50%, $input-black); +$page-gradient: linear-gradient(180deg, $dark-5 10px, dark-2 100px); +$edit-gradient: linear-gradient(180deg, $dark-2 50%, $input-black); // Links // ------------------------- @@ -100,33 +106,33 @@ $headings-color: darken($white, 11%); $abbr-border-color: $gray-2 !default; $text-muted: $text-color-weak; -$hr-border-color: $dark-4; +$hr-border-color: $dark-9; // Panel // ------------------------- -$panel-bg: $dark-2; +$panel-bg: $dark-4; $panel-border: solid 1px $dark-1; -$panel-header-hover-bg: $dark-4; +$panel-header-hover-bg: $dark-9; $panel-corner: $panel-bg; // page header -$page-header-bg: linear-gradient(90deg, $dark-3, $input-black); -$page-header-shadow: inset 0px -4px 14px $dark-2; -$page-header-border-color: $dark-4; +$page-header-bg: linear-gradient(90deg, $dark-7, $input-black); +$page-header-shadow: inset 0px -4px 14px $dark-3; +$page-header-border-color: $dark-9; $divider-border-color: $gray-1; // Graphite Target Editor -$tight-form-func-bg: $dark-4; -$tight-form-func-highlight-bg: $dark-5; +$tight-form-func-bg: $dark-9; +$tight-form-func-highlight-bg: $dark-10; $modal-backdrop-bg: #353c42; $code-tag-bg: $dark-1; -$code-tag-border: $dark-4; +$code-tag-border: $dark-9; // cards -$card-background: linear-gradient(135deg, $dark-4, $dark-3); -$card-background-hover: linear-gradient(135deg, $dark-5, $dark-4); +$card-background: linear-gradient(135deg, $dark-8, $dark-6); +$card-background-hover: linear-gradient(135deg, $dark-9, $dark-6); $card-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, 0.1), 1px 1px 0 0 rgba(0, 0, 0, 0.3); // Lists @@ -135,20 +141,20 @@ $list-item-hover-bg: $card-background-hover; $list-item-link-color: $text-color; $list-item-shadow: $card-shadow; -$empty-list-cta-bg: $dark-2; +$empty-list-cta-bg: $gray-blue; // Scrollbars -$scrollbarBackground: $dark-4; -$scrollbarBackground2: $dark-4; -$scrollbarBorder: $dark-5; +$scrollbarBackground: $dark-9; +$scrollbarBackground2: $dark-9; +$scrollbarBorder: $dark-10; // Tables // ------------------------- -$table-bg-accent: $dark-3; // for striping -$table-border: $dark-3; // table and cell border +$table-bg-accent: $dark-6; // for striping +$table-border: $dark-6; // table and cell border -$table-bg-odd: $dark-2; -$table-bg-hover: $dark-3; +$table-bg-odd: $dark-3; +$table-bg-hover: $dark-6; // Buttons // ------------------------- @@ -165,8 +171,8 @@ $btn-success-bg-hl: $green-shade; $btn-danger-bg: $lobster-base; $btn-danger-bg-hl: $lobster-shade; -$btn-inverse-bg: $dark-3; -$btn-inverse-bg-hl: lighten($dark-3, 4%); +$btn-inverse-bg: $dark-6; +$btn-inverse-bg-hl: lighten($dark-6, 4%); $btn-inverse-text-color: $link-color; $btn-inverse-text-shadow: 0px 1px 0 rgba(0, 0, 0, 0.1); @@ -174,24 +180,24 @@ $btn-link-color: $gray-3; $iconContainerBackground: $black; -$btn-divider-left: $dark-4; -$btn-divider-right: $dark-2; +$btn-divider-left: $dark-9; +$btn-divider-right: $dark-3; $btn-drag-image: '../img/grab_dark.svg'; // Forms // ------------------------- $input-bg: $input-black; -$input-bg-disabled: $dark-3; +$input-bg-disabled: $dark-6; $input-color: $gray-4; -$input-border-color: $dark-3; +$input-border-color: $dark-6; $input-box-shadow: inset 1px 0px 0.3rem 0px rgba(150, 150, 150, 0.1); -$input-border-focus: $dark-3 !default; +$input-border-focus: $dark-6 !default; $input-box-shadow-focus: $sapphire-light !default; $input-color-placeholder: $gray-1 !default; -$input-label-bg: $dark-2; -$input-label-border-color: $dark-3; +$input-label-bg: $gray-blue; +$input-label-border-color: $dark-6; $input-color-select-arrow: $white; // Input placeholder text color @@ -199,16 +205,16 @@ $placeholderText: darken($text-color, 25%); // Search $search-shadow: 0 0 30px 0 $black; -$search-filter-box-bg: $dark-2; +$search-filter-box-bg: $gray-blue; // Typeahead $typeahead-shadow: 0 5px 10px 0 $black; -$typeahead-selected-bg: $dark-4; +$typeahead-selected-bg: $dark-9; $typeahead-selected-color: $yellow; // Dropdowns // ------------------------- -$dropdownBackground: $dark-3; +$dropdownBackground: $dark-6; $dropdownBorder: rgba(0, 0, 0, 0.2); $dropdownDividerTop: transparent; $dropdownDividerBottom: #444; @@ -217,7 +223,7 @@ $dropdownLinkColor: $text-color; $dropdownLinkColorHover: $white; $dropdownLinkColorActive: $white; -$dropdownLinkBackgroundHover: $dark-4; +$dropdownLinkBackgroundHover: $dark-9; // Horizontal forms & lists // ------------------------- @@ -228,7 +234,7 @@ $horizontalComponentOffset: 180px; $navbarHeight: 55px; $navbarBackground: $panel-bg; -$navbarBorder: 1px solid $dark-3; +$navbarBorder: 1px solid $dark-6; $navbarButtonBackground: $navbarBackground; $navbarButtonBackgroundHighlight: $body-bg; @@ -239,19 +245,19 @@ $navbar-button-border: #2f2f32; // ------------------------- $side-menu-bg: $black; $side-menu-bg-mobile: $side-menu-bg; -$side-menu-item-hover-bg: $dark-2; +$side-menu-item-hover-bg: $dark-3; $side-menu-shadow: 0 0 20px black; $side-menu-link-color: $link-color; // Menu dropdowns // ------------------------- $menu-dropdown-bg: $body-bg; -$menu-dropdown-hover-bg: $dark-2; +$menu-dropdown-hover-bg: $dark-3; $menu-dropdown-shadow: 5px 5px 20px -5px $black; // Tabs // ------------------------- -$tab-border-color: $dark-4; +$tab-border-color: $dark-9; // Toolbar $toolbar-bg: $input-black; @@ -268,9 +274,9 @@ $alert-warning-bg: linear-gradient(90deg, $lobster-base, $lobster-shade); $alert-info-bg: linear-gradient(100deg, $sapphire-base, $sapphire-shade); // popover -$popover-bg: $dark-1-5; +$popover-bg: $dark-2; $popover-color: $text-color; -$popover-border-color: $dark-4; +$popover-border-color: $dark-9; $popover-shadow: 0 0 20px black; $popover-help-bg: $btn-secondary-bg; @@ -316,13 +322,13 @@ $json-explorer-url-color: #027bff; // Changelog and diff // ------------------------- -$diff-label-bg: $dark-2; +$diff-label-bg: $dark-3; $diff-label-fg: $white; -$diff-group-bg: $dark-4; +$diff-group-bg: $dark-9; $diff-arrow-color: $white; -$diff-json-bg: $dark-4; +$diff-json-bg: $dark-9; $diff-json-fg: $gray-5; $diff-json-added: $sapphire-shade; @@ -342,7 +348,7 @@ $variable-option-bg: $dropdownLinkBackgroundHover; //Switch Slider // ------------------------- $switch-bg: $input-bg; -$switch-slider-color: $dark-2; +$switch-slider-color: $dark-3; $switch-slider-off-bg: $gray-1; $switch-slider-on-bg: linear-gradient(90deg, #eb7b18, #d44a3a); $switch-slider-shadow: 0 0 3px black; @@ -358,8 +364,8 @@ $checkbox-color: $dark-1; // ------------------------- $panel-editor-shadow: 0 0 20px black; $panel-editor-side-menu-shadow: drop-shadow(0 0 10px $black); -$panel-editor-viz-item-shadow: 0 0 8px $dark-5; -$panel-editor-viz-item-border: 1px solid $dark-5; +$panel-editor-viz-item-shadow: 0 0 8px $dark-10; +$panel-editor-viz-item-border: 1px solid $dark-10; $panel-editor-viz-item-shadow-hover: 0 0 4px $sapphire-light; $panel-editor-viz-item-border-hover: 1px solid $sapphire-light; $panel-editor-viz-item-bg: $input-black; @@ -368,7 +374,7 @@ $panel-editor-tabs-line-color: #e3e3e3; $panel-editor-viz-item-bg-hover: darken($sapphire-base, 46%); $panel-options-group-border: none; -$panel-options-group-header-bg: $dark-2; +$panel-options-group-header-bg: $gray-blue; $panel-grid-placeholder-bg: $sapphire-faint; $panel-grid-placeholder-shadow: 0 0 4px $sapphire-shade; @@ -379,8 +385,8 @@ $logs-color-unkown: $gray-2; // toggle-group $button-toggle-group-btn-active-bg: linear-gradient(90deg, #eb7b18, #d44a3a); $button-toggle-group-btn-active-shadow: inset 0 0 4px $black; -$button-toggle-group-btn-seperator-border: 1px solid $dark-1-5; +$button-toggle-group-btn-seperator-border: 1px solid $dark-2; -$vertical-resize-handle-bg: $dark-5; +$vertical-resize-handle-bg: $dark-10; $vertical-resize-handle-dots: $gray-1; $vertical-resize-handle-dots-hover: $gray-2; From e5562305e36ed52e2ea69b18ff1aafbbd95e3369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 18 Feb 2019 15:35:27 +0100 Subject: [PATCH 08/20] fixed page-header-bg --- public/sass/_variables.dark.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index cecf7f214fd..46b6c923f0a 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -116,7 +116,7 @@ $panel-header-hover-bg: $dark-9; $panel-corner: $panel-bg; // page header -$page-header-bg: linear-gradient(90deg, $dark-7, $input-black); +$page-header-bg: linear-gradient(90deg, $dark-7, $black); $page-header-shadow: inset 0px -4px 14px $dark-3; $page-header-border-color: $dark-9; From 93e8edfdddebc1bdf3ecd2d192afc94b2d113b60 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Mon, 18 Feb 2019 15:31:47 +0100 Subject: [PATCH 09/20] Fixing array direction, adding simple render test, fixes #15478 Fixed unit test and updated gauge Added migration for threshold order --- .../src/components/Gauge/Gauge.test.tsx | 4 +- .../grafana-ui/src/components/Gauge/Gauge.tsx | 7 +- .../ThresholdsEditor.test.tsx | 65 +++++++++++-------- .../ThresholdsEditor/ThresholdsEditor.tsx | 52 ++++++++------- .../ThresholdsEditor.test.tsx.snap | 7 ++ .../dashboard/state/DashboardMigrator.ts | 6 ++ 6 files changed, 84 insertions(+), 57 deletions(-) create mode 100644 packages/grafana-ui/src/components/ThresholdsEditor/__snapshots__/ThresholdsEditor.test.tsx.snap diff --git a/packages/grafana-ui/src/components/Gauge/Gauge.test.tsx b/packages/grafana-ui/src/components/Gauge/Gauge.test.tsx index 5e5f477a733..70e29abc221 100644 --- a/packages/grafana-ui/src/components/Gauge/Gauge.test.tsx +++ b/packages/grafana-ui/src/components/Gauge/Gauge.test.tsx @@ -84,9 +84,9 @@ describe('Get thresholds formatted', () => { it('should get the correct formatted values when thresholds are added', () => { const { instance } = setup({ thresholds: [ - { index: 2, value: 75, color: '#6ED0E0' }, - { index: 1, value: 50, color: '#EAB839' }, { index: 0, value: -Infinity, color: '#7EB26D' }, + { index: 1, value: 50, color: '#EAB839' }, + { index: 2, value: 75, color: '#6ED0E0' }, ], }); diff --git a/packages/grafana-ui/src/components/Gauge/Gauge.tsx b/packages/grafana-ui/src/components/Gauge/Gauge.tsx index b8c257f4138..2ec0517e96a 100644 --- a/packages/grafana-ui/src/components/Gauge/Gauge.tsx +++ b/packages/grafana-ui/src/components/Gauge/Gauge.tsx @@ -98,16 +98,15 @@ export class Gauge extends PureComponent { getFormattedThresholds() { const { maxValue, minValue, thresholds, theme } = this.props; - const thresholdsSortedByIndex = [...thresholds].sort((t1, t2) => t1.index - t2.index); - const lastThreshold = thresholdsSortedByIndex[thresholdsSortedByIndex.length - 1]; + const lastThreshold = thresholds[thresholds.length - 1]; return [ - ...thresholdsSortedByIndex.map(threshold => { + ...thresholds.map(threshold => { if (threshold.index === 0) { return { value: minValue, color: getColorFromHexRgbOrName(threshold.color, theme.type) }; } - const previousThreshold = thresholdsSortedByIndex[threshold.index - 1]; + const previousThreshold = thresholds[threshold.index - 1]; return { value: threshold.value, color: getColorFromHexRgbOrName(previousThreshold.color, theme.type) }; }), { value: maxValue, color: getColorFromHexRgbOrName(lastThreshold.color, theme.type) }, diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.test.tsx b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.test.tsx index 2b6af67df22..ea94537c429 100644 --- a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.test.tsx +++ b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.test.tsx @@ -1,9 +1,8 @@ import React, { ChangeEvent } from 'react'; -import { shallow } from 'enzyme'; - +import { mount } from 'enzyme'; import { ThresholdsEditor, Props } from './ThresholdsEditor'; -const setup = (propOverrides?: object) => { +const setup = (propOverrides?: Partial) => { const props: Props = { onChange: jest.fn(), thresholds: [], @@ -11,12 +10,26 @@ const setup = (propOverrides?: object) => { Object.assign(props, propOverrides); - return shallow().instance() as ThresholdsEditor; + const wrapper = mount(); + const instance = wrapper.instance() as ThresholdsEditor; + + return { + instance, + wrapper, + }; }; +describe('Render', () => { + it('should render with base threshold', () => { + const { wrapper } = setup(); + + expect(wrapper).toMatchSnapshot(); + }); +}); + describe('Initialization', () => { it('should add a base threshold if missing', () => { - const instance = setup(); + const { instance } = setup(); expect(instance.state.thresholds).toEqual([{ index: 0, value: -Infinity, color: '#7EB26D' }]); }); @@ -24,7 +37,7 @@ describe('Initialization', () => { describe('Add threshold', () => { it('should not add threshold at index 0', () => { - const instance = setup(); + const { instance } = setup(); instance.onAddThreshold(0); @@ -32,32 +45,32 @@ describe('Add threshold', () => { }); it('should add threshold', () => { - const instance = setup(); + const { instance } = setup(); instance.onAddThreshold(1); expect(instance.state.thresholds).toEqual([ - { index: 1, value: 50, color: '#EAB839' }, { index: 0, value: -Infinity, color: '#7EB26D' }, + { index: 1, value: 50, color: '#EAB839' }, ]); }); it('should add another threshold above a first', () => { - const instance = setup({ + const { instance } = setup({ thresholds: [{ index: 0, value: -Infinity, color: '#7EB26D' }, { index: 1, value: 50, color: '#EAB839' }], }); instance.onAddThreshold(2); expect(instance.state.thresholds).toEqual([ - { index: 2, value: 75, color: '#6ED0E0' }, - { index: 1, value: 50, color: '#EAB839' }, { index: 0, value: -Infinity, color: '#7EB26D' }, + { index: 1, value: 50, color: '#EAB839' }, + { index: 2, value: 75, color: '#6ED0E0' }, ]); }); it('should add another threshold between first and second index', () => { - const instance = setup({ + const { instance } = setup({ thresholds: [ { index: 0, value: -Infinity, color: '#7EB26D' }, { index: 1, value: 50, color: '#EAB839' }, @@ -68,10 +81,10 @@ describe('Add threshold', () => { instance.onAddThreshold(2); expect(instance.state.thresholds).toEqual([ - { index: 3, value: 75, color: '#6ED0E0' }, - { index: 2, value: 62.5, color: '#EF843C' }, - { index: 1, value: 50, color: '#EAB839' }, { index: 0, value: -Infinity, color: '#7EB26D' }, + { index: 1, value: 50, color: '#EAB839' }, + { index: 2, value: 62.5, color: '#EF843C' }, + { index: 3, value: 75, color: '#6ED0E0' }, ]); }); }); @@ -83,7 +96,7 @@ describe('Remove threshold', () => { { index: 1, value: 50, color: '#EAB839' }, { index: 2, value: 75, color: '#6ED0E0' }, ]; - const instance = setup({ thresholds }); + const { instance } = setup({ thresholds }); instance.onRemoveThreshold(thresholds[0]); @@ -96,9 +109,7 @@ describe('Remove threshold', () => { { index: 1, value: 50, color: '#EAB839' }, { index: 2, value: 75, color: '#6ED0E0' }, ]; - const instance = setup({ - thresholds, - }); + const { instance } = setup({ thresholds }); instance.onRemoveThreshold(thresholds[1]); @@ -116,7 +127,7 @@ describe('change threshold value', () => { { index: 1, value: 50, color: '#EAB839' }, { index: 2, value: 75, color: '#6ED0E0' }, ]; - const instance = setup({ thresholds }); + const { instance } = setup({ thresholds }); const mockEvent = ({ target: { value: '12' } } as any) as ChangeEvent; @@ -126,7 +137,7 @@ describe('change threshold value', () => { }); it('should update value', () => { - const instance = setup(); + const { instance } = setup(); const thresholds = [ { index: 0, value: -Infinity, color: '#7EB26D' }, { index: 1, value: 50, color: '#EAB839' }, @@ -150,24 +161,24 @@ describe('change threshold value', () => { }); describe('on blur threshold value', () => { - it('should resort rows and update indexes', () => { - const instance = setup(); + it.only('should resort rows and update indexes', () => { + const { instance } = setup(); const thresholds = [ { index: 0, value: -Infinity, color: '#7EB26D' }, { index: 1, value: 78, color: '#EAB839' }, { index: 2, value: 75, color: '#6ED0E0' }, ]; - instance.state = { + instance.setState({ thresholds, - }; + }); instance.onBlur(); expect(instance.state.thresholds).toEqual([ - { index: 2, value: 78, color: '#EAB839' }, - { index: 1, value: 75, color: '#6ED0E0' }, { index: 0, value: -Infinity, color: '#7EB26D' }, + { index: 1, value: 75, color: '#6ED0E0' }, + { index: 2, value: 78, color: '#EAB839' }, ]); }); }); diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx index f4db23d6656..475e69b4de8 100644 --- a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx +++ b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx @@ -1,7 +1,7 @@ import React, { PureComponent, ChangeEvent } from 'react'; import { Threshold } from '../../types'; -import { ColorPicker } from '../ColorPicker/ColorPicker'; -import { PanelOptionsGroup } from '../PanelOptionsGroup/PanelOptionsGroup'; +import { ColorPicker } from '..'; +import { PanelOptionsGroup } from '..'; import { colors } from '../../utils'; import { getColorFromHexRgbOrName, ThemeContext } from '@grafana/ui'; @@ -54,16 +54,16 @@ export class ThresholdsEditor extends PureComponent { const value = afterThresholdValue - (afterThresholdValue - beforeThresholdValue) / 2; // Set a color - const color = colors.filter(c => newThresholds.some(t => t.color === c) === false)[0]; + const color = colors.filter(c => !newThresholds.some(t => t.color === c))[0]; this.setState( { thresholds: this.sortThresholds([ ...newThresholds, { + color, index, value: value as number, - color, }, ]), }, @@ -137,10 +137,11 @@ export class ThresholdsEditor extends PureComponent { onBlur = () => { this.setState(prevState => { const sortThresholds = this.sortThresholds([...prevState.thresholds]); - let index = sortThresholds.length - 1; + let index = 0; sortThresholds.forEach(t => { - t.index = index--; + t.index = index++; }); + return { thresholds: sortThresholds }; }); @@ -153,12 +154,13 @@ export class ThresholdsEditor extends PureComponent { sortThresholds = (thresholds: Threshold[]) => { return thresholds.sort((t1, t2) => { - return t2.value - t1.value; + return t1.value - t2.value; }); }; renderInput = (threshold: Threshold) => { const value = threshold.index === 0 ? 'Base' : threshold.value; + return (
@@ -190,30 +192,32 @@ export class ThresholdsEditor extends PureComponent { render() { const { thresholds } = this.state; - return ( {theme => { return (
- {thresholds.map((threshold, index) => { - return ( -
-
this.onAddThreshold(threshold.index + 1)} - > - + {thresholds + .slice(0) + .reverse() + .map((threshold, index) => { + return ( +
+
this.onAddThreshold(threshold.index + 1)} + > + +
+
+
{this.renderInput(threshold)}
-
-
{this.renderInput(threshold)}
-
- ); - })} + ); + })}
); diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/__snapshots__/ThresholdsEditor.test.tsx.snap b/packages/grafana-ui/src/components/ThresholdsEditor/__snapshots__/ThresholdsEditor.test.tsx.snap new file mode 100644 index 00000000000..b0dc025090b --- /dev/null +++ b/packages/grafana-ui/src/components/ThresholdsEditor/__snapshots__/ThresholdsEditor.test.tsx.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Render should render with base threshold 1`] = ` + + + +`; diff --git a/public/app/features/dashboard/state/DashboardMigrator.ts b/public/app/features/dashboard/state/DashboardMigrator.ts index 1aa310308d5..c43f4c491c0 100644 --- a/public/app/features/dashboard/state/DashboardMigrator.ts +++ b/public/app/features/dashboard/state/DashboardMigrator.ts @@ -399,6 +399,12 @@ export class DashboardMigrator { prefix: panel.options.prefix, suffix: panel.options.suffix, }; + + // correct order + if (panel.options.thresholds) { + panel.options.thresholds.reverse(); + } + // this options prop was due to a bug delete panel.options.options; delete panel.options.unit; From df170aee166ee1ef28cfe562bf51fa22a9a188a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 18 Feb 2019 15:04:26 +0100 Subject: [PATCH 10/20] Updated explore icon and style tweaks Lowered icon size and improved paddings, tried to align placement between dashboard and explore --- pkg/api/index.go | 2 +- .../app/features/explore/ExploreToolbar.tsx | 16 ++++++------ public/img/icons_dark_theme/icon_explore.svg | 24 ++++++++++++++++++ public/img/icons_light_theme/icon_explore.svg | 24 ++++++++++++++++++ public/sass/base/_icons.scss | 7 ++++++ public/sass/components/_navbar.scss | 24 ++++++++---------- public/sass/components/_sidemenu.scss | 2 +- public/sass/pages/_explore.scss | 25 +------------------ 8 files changed, 76 insertions(+), 48 deletions(-) create mode 100644 public/img/icons_dark_theme/icon_explore.svg create mode 100644 public/img/icons_light_theme/icon_explore.svg diff --git a/pkg/api/index.go b/pkg/api/index.go index e90db84016d..248ebf63f0f 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -145,7 +145,7 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er Text: "Explore", Id: "explore", SubTitle: "Explore your data", - Icon: "fa fa-rocket", + Icon: "gicon gicon-explore", Url: setting.AppSubUrl + "/explore", }) } diff --git a/public/app/features/explore/ExploreToolbar.tsx b/public/app/features/explore/ExploreToolbar.tsx index 786998c96c1..adcd0c8afa8 100644 --- a/public/app/features/explore/ExploreToolbar.tsx +++ b/public/app/features/explore/ExploreToolbar.tsx @@ -103,18 +103,16 @@ export class UnConnectedExploreToolbar extends PureComponent {
{exploreId === 'left' && ( - + Explore )}
-
- {exploreId === 'right' && ( - - - - )} -
+ {exploreId === 'right' && ( + + + + )}
@@ -156,7 +154,7 @@ export class UnConnectedExploreToolbar extends PureComponent { splitted, title: 'Run Query', onClick: this.onRunQuery, - buttonClassName: 'navbar-button--primary', + buttonClassName: 'navbar-button--secondary', iconClassName: loading ? 'fa fa-spinner fa-fw fa-spin run-icon' : 'fa fa-level-down fa-fw run-icon', iconSide: IconSide.right, })} diff --git a/public/img/icons_dark_theme/icon_explore.svg b/public/img/icons_dark_theme/icon_explore.svg new file mode 100644 index 00000000000..8d7e1b93fce --- /dev/null +++ b/public/img/icons_dark_theme/icon_explore.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + diff --git a/public/img/icons_light_theme/icon_explore.svg b/public/img/icons_light_theme/icon_explore.svg new file mode 100644 index 00000000000..8732b2d9ae8 --- /dev/null +++ b/public/img/icons_light_theme/icon_explore.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + diff --git a/public/sass/base/_icons.scss b/public/sass/base/_icons.scss index 2d0cb394da1..8d171673f6b 100644 --- a/public/sass/base/_icons.scss +++ b/public/sass/base/_icons.scss @@ -192,6 +192,10 @@ background-image: url('../img/icons_#{$theme-name}_theme/icon_zoom_out.svg'); } +.gicon-explore { + background-image: url('../img/icons_#{$theme-name}_theme/icon_explore.svg'); +} + .sidemenu { .gicon-dashboard { background-image: url('../img/icons_dark_theme/icon_dashboard.svg'); @@ -205,6 +209,9 @@ .gicon-question { background-image: url('../img/icons_dark_theme/icon_question.svg'); } + .gicon-explore { + background-image: url('../img/icons_dark_theme/icon_explore.svg'); + } } .fa--permissions-list { diff --git a/public/sass/components/_navbar.scss b/public/sass/components/_navbar.scss index 86494f9e47a..b96f7bb7fc5 100644 --- a/public/sass/components/_navbar.scss +++ b/public/sass/components/_navbar.scss @@ -1,9 +1,8 @@ .navbar { position: relative; - padding-left: 20px; z-index: $zindex-navbar-fixed; height: $navbarHeight; - padding-right: 20px; + padding: 0 20px 0 50px; display: flex; flex-grow: 1; border-bottom: 1px solid transparent; @@ -57,15 +56,14 @@ white-space: nowrap; display: block; margin: 0; - color: darken($link-color, 5%); + color: $headings-color; font-size: $font-size-lg; - padding-left: 1rem; min-height: $navbarHeight; line-height: $navbarHeight; .fa-caret-down { font-size: 60%; - padding-left: 0.2rem; + padding-left: 6px; } &--search { @@ -73,12 +71,12 @@ } .gicon { + top: -2px; position: relative; - top: -1px; - font-size: 19px; + font-size: 17px; line-height: 8px; opacity: 0.75; - margin-right: 13px; + margin-right: 10px; display: none; } @@ -123,7 +121,7 @@ height: 30px; color: $text-muted; border: 1px solid $navbar-button-border; - margin-right: 3px; + margin-left: 3px; white-space: nowrap; .gicon { @@ -152,19 +150,19 @@ } } - &--primary { - @include buttonBackground($btn-primary-bg, $btn-primary-bg-hl); + &--secondary { + @include buttonBackground($btn-secondary-bg, $btn-secondary-bg-hl); } } @include media-breakpoint-up(sm) { .navbar { - padding-left: 50px; + padding-left: 60px; } .sidemenu-open { .navbar { - padding-left: 15px; + padding-left: 20px; margin-left: 0; } } diff --git a/public/sass/components/_sidemenu.scss b/public/sass/components/_sidemenu.scss index 44941540598..f30bdb5c79e 100644 --- a/public/sass/components/_sidemenu.scss +++ b/public/sass/components/_sidemenu.scss @@ -253,7 +253,7 @@ li.sidemenu-org-switcher { } .sidemenu__logo_small_breakpoint { - padding: 16px 10px 26px; + padding: 14px 10px 26px 13px; display: flex; flex-direction: row; justify-content: space-between; diff --git a/public/sass/pages/_explore.scss b/public/sass/pages/_explore.scss index 151130a69e2..50d2c188862 100644 --- a/public/sass/pages/_explore.scss +++ b/public/sass/pages/_explore.scss @@ -30,12 +30,6 @@ padding: 0; margin-left: 0; } - - .explore-toolbar-header-title { - .navbar-page-btn { - padding-left: 0; - } - } } .explore-toolbar { @@ -87,22 +81,9 @@ align-items: center; } -.explore-toolbar-header-title { - color: darken($link-color, 5%); - - .navbar-page-btn { - padding-left: $dashboard-padding; - } - - .fa { - font-size: 100%; - opacity: 0.75; - margin-right: 0.5em; - } -} - .explore-toolbar-header-close { margin-left: auto; + color: $text-color-weak; } .explore-toolbar-content { @@ -156,7 +137,6 @@ .sidemenu-open { .explore-toolbar-header-title { .navbar-page-btn { - padding-left: 0; margin-left: 0; } } @@ -164,7 +144,6 @@ .explore-toolbar-header-title { .navbar-page-btn { - padding-left: 0; margin-left: $dashboard-padding; } } @@ -185,7 +164,6 @@ .sidemenu-open { .explore-toolbar-header-title { .navbar-page-btn { - padding-left: 0; margin-left: $dashboard-padding; } } @@ -193,7 +171,6 @@ .explore-toolbar-header-title { .navbar-page-btn { - padding-left: 0; margin-left: $dashboard-padding; } } From 13e27601df3a13105da437eb3f8b16e9164907ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 18 Feb 2019 21:29:42 +0100 Subject: [PATCH 11/20] Fixed navbar backbutton padding --- public/sass/components/_navbar.scss | 4 ++-- public/sass/pages/_explore.scss | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/sass/components/_navbar.scss b/public/sass/components/_navbar.scss index b96f7bb7fc5..a86b8c450a0 100644 --- a/public/sass/components/_navbar.scss +++ b/public/sass/components/_navbar.scss @@ -162,7 +162,7 @@ .sidemenu-open { .navbar { - padding-left: 20px; + padding-left: 25px; margin-left: 0; } } @@ -178,7 +178,7 @@ display: flex; height: $navbarHeight; align-items: center; - padding-left: 7px; + padding-right: 13px; } .navbar-edit__back-btn { diff --git a/public/sass/pages/_explore.scss b/public/sass/pages/_explore.scss index 50d2c188862..9b8f18e8681 100644 --- a/public/sass/pages/_explore.scss +++ b/public/sass/pages/_explore.scss @@ -38,7 +38,7 @@ flex-flow: row wrap; justify-content: flex-start; height: auto; - padding: 0px $dashboard-padding; + padding: 0px $dashboard-padding 0 25px; border-bottom: 1px solid #0000; transition-duration: 0.35s; transition-timing-function: ease-in-out; From 56136a53960b5fe830a02d2514dae4d645012cdf Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Mon, 18 Feb 2019 22:54:45 +0100 Subject: [PATCH 12/20] fix native annotation filtered by template variable with pipe --- public/app/plugins/datasource/grafana/datasource.ts | 11 +++++++++-- .../datasource/grafana/specs/datasource.test.ts | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/datasource/grafana/datasource.ts b/public/app/plugins/datasource/grafana/datasource.ts index 3bf772d160c..0e779b234eb 100644 --- a/public/app/plugins/datasource/grafana/datasource.ts +++ b/public/app/plugins/datasource/grafana/datasource.ts @@ -57,10 +57,17 @@ class GrafanaDatasource { if (!_.isArray(options.annotation.tags) || options.annotation.tags.length === 0) { return this.$q.when([]); } + const delimiter = '__delimiter__'; const tags = []; for (const t of params.tags) { - const renderedValues = this.templateSrv.replace(t, {}, 'pipe'); - for (const tt of renderedValues.split('|')) { + const renderedValues = this.templateSrv.replace(t, {}, value => { + if (typeof value === 'string') { + return value; + } + + return value.join(delimiter); + }); + for (const tt of renderedValues.split(delimiter)) { tags.push(tt); } } diff --git a/public/app/plugins/datasource/grafana/specs/datasource.test.ts b/public/app/plugins/datasource/grafana/specs/datasource.test.ts index 3a52e278690..3c0205640e2 100644 --- a/public/app/plugins/datasource/grafana/specs/datasource.test.ts +++ b/public/app/plugins/datasource/grafana/specs/datasource.test.ts @@ -14,7 +14,7 @@ describe('grafana data source', () => { const templateSrvStub = { replace: val => { - return val.replace('$var2', 'replaced|replaced2').replace('$var', 'replaced'); + return val.replace('$var2', 'replaced__delimiter__replaced2').replace('$var', 'replaced'); }, }; From 7f04848dea98282a97f6f6a9227dc2d96f05cbf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Tue, 19 Feb 2019 07:48:54 +0100 Subject: [PATCH 13/20] Fixes #15505 --- .../ThresholdsEditor/ThresholdsEditor.tsx | 35 +++++++++++-------- .../ThresholdsEditor/_ThresholdsEditor.scss | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx index 475e69b4de8..d613a911b03 100644 --- a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx +++ b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx @@ -159,8 +159,6 @@ export class ThresholdsEditor extends PureComponent { }; renderInput = (threshold: Threshold) => { - const value = threshold.index === 0 ? 'Base' : threshold.value; - return (
@@ -171,21 +169,28 @@ export class ThresholdsEditor extends PureComponent {
)}
-
- this.onChangeThresholdValue(event, threshold)} - value={value} - onBlur={this.onBlur} - readOnly={threshold.index === 0} - /> -
- {threshold.index > 0 && ( -
this.onRemoveThreshold(threshold)}> - + {threshold.index === 0 && ( +
+
)} + {threshold.index > 0 && ( + <> +
+ this.onChangeThresholdValue(event, threshold)} + value={threshold.value} + onBlur={this.onBlur} + readOnly={threshold.index === 0} + /> +
+
this.onRemoveThreshold(threshold)}> + +
+ + )}
); }; diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/_ThresholdsEditor.scss b/packages/grafana-ui/src/components/ThresholdsEditor/_ThresholdsEditor.scss index 8ef59bf08af..af70fd86f7a 100644 --- a/packages/grafana-ui/src/components/ThresholdsEditor/_ThresholdsEditor.scss +++ b/packages/grafana-ui/src/components/ThresholdsEditor/_ThresholdsEditor.scss @@ -43,7 +43,7 @@ } .thresholds-row-input { - margin-top: 49px; + margin-top: 44px; margin-left: 2px; } From 7754c37a1fcad6451b0becc424b1d6c264b92ad3 Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 19 Feb 2019 08:22:33 +0100 Subject: [PATCH 14/20] reduce loglevel to debug --- pkg/services/auth/token_cleanup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/auth/token_cleanup.go b/pkg/services/auth/token_cleanup.go index aa5bc4856ab..1fe0996aa4c 100644 --- a/pkg/services/auth/token_cleanup.go +++ b/pkg/services/auth/token_cleanup.go @@ -52,6 +52,6 @@ func (srv *UserAuthTokenService) deleteExpiredTokens(maxInactiveLifetime, maxLif return 0, nil } - srv.log.Info("cleanup of expired auth tokens done", "count", affected) + srv.log.Debug("cleanup of expired auth tokens done", "count", affected) return affected, err } From 891b2ca1a2af4af5d702e949f92cc93fb440ba1e Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Tue, 19 Feb 2019 09:43:35 +0100 Subject: [PATCH 15/20] fix: Have the tab param removed from the url when leaving edit mode #15485 --- public/app/features/dashboard/components/DashNav/DashNav.tsx | 2 +- public/app/features/dashboard/services/DashboardSrv.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/components/DashNav/DashNav.tsx b/public/app/features/dashboard/components/DashNav/DashNav.tsx index 8806e35c6b6..99ce3f904cd 100644 --- a/public/app/features/dashboard/components/DashNav/DashNav.tsx +++ b/public/app/features/dashboard/components/DashNav/DashNav.tsx @@ -65,7 +65,7 @@ export class DashNav extends PureComponent { }); } else { this.props.updateLocation({ - query: { panelId: null, edit: null, fullscreen: null }, + query: { panelId: null, edit: null, fullscreen: null, tab: null }, partial: true, }); } diff --git a/public/app/features/dashboard/services/DashboardSrv.ts b/public/app/features/dashboard/services/DashboardSrv.ts index e20c0ed5a31..c82aed13e44 100644 --- a/public/app/features/dashboard/services/DashboardSrv.ts +++ b/public/app/features/dashboard/services/DashboardSrv.ts @@ -43,6 +43,7 @@ export class DashboardSrv { delete urlParams.fullscreen; delete urlParams.edit; delete urlParams.panelId; + delete urlParams.tab; this.$location.search(urlParams); return; } @@ -58,6 +59,7 @@ export class DashboardSrv { urlParams.edit = true; } else { delete urlParams.edit; + delete urlParams.tab; } if (options.panelId || options.panelId === 0) { From 99205d5d9a8177a45220a8f67ad91ca66ce2bd8a Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Tue, 19 Feb 2019 10:40:54 +0100 Subject: [PATCH 16/20] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d3121df80c..a46feac37f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,14 @@ * **Internal Metrics** Edition has been added to the build_info metric. This will break any Graphite queries using this metric. Edition will be a new label for the Prometheus metric. [#15363](https://github.com/grafana/grafana/pull/15363) +### Bug fixes + +* **Gauge**: Fix issue with gauge requests being cancelled [#15366](https://github.com/grafana/grafana/issues/15366) +* **Gauge**: Accept decimal inputs for thresholds [#15372](https://github.com/grafana/grafana/issues/15372) +* **UI**: Fix error caused by named colors that are not part of named colors palette [#15373](https://github.com/grafana/grafana/issues/15373) +* **UI**: Bug pressing special regexp chars in input fields [#12972](https://github.com/grafana/grafana/issues/12972) + + ### 6.0.0-beta1 fixes * **Postgres**: Fix default port not added when port not configured [#15189](https://github.com/grafana/grafana/issues/15189) From a9748f460ed54537c656e1ff765cd05ff160ceeb Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Tue, 19 Feb 2019 10:46:51 +0100 Subject: [PATCH 17/20] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a46feac37f5..142b1cac277 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ * **Login**: Anonymous usage stats for token auth [#15288](https://github.com/grafana/grafana/issues/15288) * **AzureMonitor**: improve autocomplete for Log Analytics and App Insights editor [#15131](https://github.com/grafana/grafana/issues/15131) * **LDAP**: Fix IPA/FreeIPA v4.6.4 does not allow LDAP searches with empty attributes [#14432](https://github.com/grafana/grafana/issues/14432) +* **Provisioning**: Allow testing data sources that were added by config [#12164](https://github.com/grafana/grafana/issues/12164) ### Breaking changes @@ -40,7 +41,7 @@ * **Gauge**: Accept decimal inputs for thresholds [#15372](https://github.com/grafana/grafana/issues/15372) * **UI**: Fix error caused by named colors that are not part of named colors palette [#15373](https://github.com/grafana/grafana/issues/15373) * **UI**: Bug pressing special regexp chars in input fields [#12972](https://github.com/grafana/grafana/issues/12972) - +* **Permissions**: No need to have edit permissions to be able to "Save as" [#13066](https://github.com/grafana/grafana/issues/13066) ### 6.0.0-beta1 fixes From 4df78fe7ac22de1886a53b82bf25ab6e983a9472 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Tue, 19 Feb 2019 10:47:57 +0100 Subject: [PATCH 18/20] Update CHANGELOG.md --- CHANGELOG.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 142b1cac277..faa2f49faff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,19 +40,9 @@ * **Gauge**: Fix issue with gauge requests being cancelled [#15366](https://github.com/grafana/grafana/issues/15366) * **Gauge**: Accept decimal inputs for thresholds [#15372](https://github.com/grafana/grafana/issues/15372) * **UI**: Fix error caused by named colors that are not part of named colors palette [#15373](https://github.com/grafana/grafana/issues/15373) -* **UI**: Bug pressing special regexp chars in input fields [#12972](https://github.com/grafana/grafana/issues/12972) +* **Search**: Bug pressing special regexp chars in input fields [#12972](https://github.com/grafana/grafana/issues/12972) * **Permissions**: No need to have edit permissions to be able to "Save as" [#13066](https://github.com/grafana/grafana/issues/13066) -### 6.0.0-beta1 fixes - -* **Postgres**: Fix default port not added when port not configured [#15189](https://github.com/grafana/grafana/issues/15189) -* **Alerting**: Fixes crash bug when alert notifier folders are missing [#15295](https://github.com/grafana/grafana/issues/15295) -* **Dashboard**: Fix save provisioned dashboard modal [#15219](https://github.com/grafana/grafana/pull/15219) -* **Dashboard**: Fix having a long query in prometheus dashboard query editor blocks 30% of the query field when on OSX and having native scrollbars [#15122](https://github.com/grafana/grafana/issues/15122) -* **Explore**: Fix issue with wrapping on long queries [#15222](https://github.com/grafana/grafana/issues/15222) -* **Explore**: Fix cut & paste adds newline before and after selection [#15223](https://github.com/grafana/grafana/issues/15223) -* **Dataproxy**: Fix global datasource proxy timeout not added to correct http client [#15258](https://github.com/grafana/grafana/issues/15258) [#5699](https://github.com/grafana/grafana/issues/5699) - # 6.0.0-beta1 (2019-01-30) ### New Features @@ -100,6 +90,13 @@ * **Prometheus**: Query for annotation always uses 60s step regardless of dashboard range, fixes [#14795](https://github.com/grafana/grafana/issues/14795) * **Annotations**: Fix creating annotation when graph panel has no data points position the popup outside viewport [#13765](https://github.com/grafana/grafana/issues/13765), thx [@banjeremy](https://github.com/banjeremy) * **Piechart/Flot**: Fixes multiple piechart instances with donut bug [#15062](https://github.com/grafana/grafana/pull/15062) +* **Postgres**: Fix default port not added when port not configured [#15189](https://github.com/grafana/grafana/issues/15189) +* **Alerting**: Fixes crash bug when alert notifier folders are missing [#15295](https://github.com/grafana/grafana/issues/15295) +* **Dashboard**: Fix save provisioned dashboard modal [#15219](https://github.com/grafana/grafana/pull/15219) +* **Dashboard**: Fix having a long query in prometheus dashboard query editor blocks 30% of the query field when on OSX and having native scrollbars [#15122](https://github.com/grafana/grafana/issues/15122) +* **Explore**: Fix issue with wrapping on long queries [#15222](https://github.com/grafana/grafana/issues/15222) +* **Explore**: Fix cut & paste adds newline before and after selection [#15223](https://github.com/grafana/grafana/issues/15223) +* **Dataproxy**: Fix global datasource proxy timeout not added to correct http client [#15258](https://github.com/grafana/grafana/issues/15258) [#5699](https://github.com/grafana/grafana/issues/5699) ### Breaking changes * **Text Panel**: The text panel does no longer by default allow unsantizied HTML. [#4117](https://github.com/grafana/grafana/issues/4117). This means that if you have text panels with scripts tags they will no longer work as before. To enable unsafe javascript execution in text panels enable the settings `disable_sanitize_html` under the section `[panels]` in your Grafana ini file, or set env variable `GF_PANELS_DISABLE_SANITIZE_HTML=true`. From 8876d17dc0a0d893d781253c94db207a5d4d3bee Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Tue, 19 Feb 2019 11:00:23 +0100 Subject: [PATCH 19/20] chore: graph2 panel plugin should use the new ReactPanelPlugin from @grafana/ui --- public/app/plugins/panel/graph2/module.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/panel/graph2/module.tsx b/public/app/plugins/panel/graph2/module.tsx index a3a3fadf6bf..6dd6d4a77c4 100644 --- a/public/app/plugins/panel/graph2/module.tsx +++ b/public/app/plugins/panel/graph2/module.tsx @@ -1,4 +1,8 @@ -import { GraphPanel } from './GraphPanel'; -import { GraphPanelEditor } from './GraphPanelEditor'; +import { ReactPanelPlugin } from '@grafana/ui'; -export { GraphPanel as Panel, GraphPanelEditor as PanelOptions }; +import { GraphPanelEditor } from './GraphPanelEditor'; +import { GraphPanel } from './GraphPanel'; +import { Options } from './types'; + +export const reactPanel = new ReactPanelPlugin(GraphPanel); +reactPanel.setEditor(GraphPanelEditor); From d2893c2d1ad1fb69105396d15b8385f61b78d697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Tue, 19 Feb 2019 11:17:40 +0100 Subject: [PATCH 20/20] Fixes #15506 --- .../src/components/Switch/Switch.tsx | 20 ++++++++++--------- public/sass/components/_switch.scss | 4 ++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/grafana-ui/src/components/Switch/Switch.tsx b/packages/grafana-ui/src/components/Switch/Switch.tsx index feee58386b8..f79de95fd2d 100644 --- a/packages/grafana-ui/src/components/Switch/Switch.tsx +++ b/packages/grafana-ui/src/components/Switch/Switch.tsx @@ -17,7 +17,7 @@ export interface State { export class Switch extends PureComponent { state = { - id: _.uniqueId(), + id: _.uniqueId('check-'), }; internalOnChange = (event: React.FormEvent) => { @@ -29,18 +29,20 @@ export class Switch extends PureComponent { render() { const { labelClass = '', switchClass = '', label, checked, transparent, className } = this.props; - const labelId = `check-${this.state.id}`; + const labelId = this.state.id; const labelClassName = `gf-form-label ${labelClass} ${transparent ? 'gf-form-label--transparent' : ''} pointer`; const switchClassName = `gf-form-switch ${switchClass} ${transparent ? 'gf-form-switch--transparent' : ''}`; return ( - +
+ +
); } } diff --git a/public/sass/components/_switch.scss b/public/sass/components/_switch.scss index 92756f81a76..f7980215659 100644 --- a/public/sass/components/_switch.scss +++ b/public/sass/components/_switch.scss @@ -13,6 +13,10 @@ gf-form-switch[disabled] { } } +.gf-form-switch-container-react { + display: flex; +} + .gf-form-switch-container { display: flex; cursor: pointer;