From a1db5561e02b3f94dee13148ff24ecd897d51c4d Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Tue, 6 Mar 2018 20:07:28 +0100 Subject: [PATCH 1/4] scrolling: faster wheelspeed ref #11053 (cherry picked from commit 8e81dc1e7903256c4b84048537f63d5b1b93497c) --- public/app/core/components/scroll/scroll.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/public/app/core/components/scroll/scroll.ts b/public/app/core/components/scroll/scroll.ts index 720334d8973..fbf5fd6cd37 100644 --- a/public/app/core/components/scroll/scroll.ts +++ b/public/app/core/components/scroll/scroll.ts @@ -8,6 +8,7 @@ export function geminiScrollbar() { link: function(scope, elem, attrs) { let scrollbar = new PerfectScrollbar(elem[0], { wheelPropagation: true, + wheelSpeed: 3, }); let lastPos = 0; From 55809ee92ad841ba6274706b1662326f418a915a Mon Sep 17 00:00:00 2001 From: Patrick O'Carroll Date: Tue, 6 Mar 2018 14:16:10 +0100 Subject: [PATCH 2/4] changed background for mobile menu background on light theme, increased font size in and added border-right in menu (cherry picked from commit 9b3863a150ab1acd2789adf9c47430bfd7d6ad8d) --- public/sass/_variables.dark.scss | 1 + public/sass/_variables.light.scss | 1 + public/sass/components/_sidemenu.scss | 11 +++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index ef9f1a06996..6e86aa1872e 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -259,6 +259,7 @@ $navbar-button-border: #2f2f32; // Sidemenu // ------------------------- $side-menu-bg: $black; +$side-menu-bg-mobile: $side-menu-bg; $side-menu-item-hover-bg: $dark-2; $side-menu-shadow: 0 0 20px black; $side-menu-link-color: $link-color; diff --git a/public/sass/_variables.light.scss b/public/sass/_variables.light.scss index eb598f27d4c..a59350d2195 100644 --- a/public/sass/_variables.light.scss +++ b/public/sass/_variables.light.scss @@ -200,6 +200,7 @@ $input-invalid-border-color: lighten($red, 5%); // Sidemenu // ------------------------- $side-menu-bg: $dark-2; +$side-menu-bg-mobile: rgba(0, 0, 0, 0); //$gray-6; $side-menu-item-hover-bg: $gray-1; $side-menu-shadow: 5px 0px 10px -5px $gray-1; $side-menu-link-color: $gray-6; diff --git a/public/sass/components/_sidemenu.scss b/public/sass/components/_sidemenu.scss index 5f21bbc8cd0..8a5c3779714 100644 --- a/public/sass/components/_sidemenu.scss +++ b/public/sass/components/_sidemenu.scss @@ -71,7 +71,7 @@ // important to overlap it otherwise it can be hidden // again by the mouse getting outside the hover space left: $side-menu-width - 2px; - @include animation("dropdown-anim 150ms ease-in-out 100ms forwards"); + @include animation('dropdown-anim 150ms ease-in-out 100ms forwards'); z-index: $zindex-sidemenu; } } @@ -193,9 +193,13 @@ li.sidemenu-org-switcher { @include media-breakpoint-down(xs) { .sidemenu-open--xs { + li { + font-size: $font-size-lg; + } + .sidemenu { width: 100%; - background: $side-menu-bg; + background: $side-menu-bg-mobile; position: initial; height: auto; box-shadow: $side-menu-shadow; @@ -214,6 +218,9 @@ li.sidemenu-org-switcher { .sidemenu__bottom { display: block; } + .sidemenu-item { + border-right: 2px solid transparent; + } } .sidemenu { From f13ffa3a52f96388208f818a8267c67f7caced4a Mon Sep 17 00:00:00 2001 From: Patrick O'Carroll Date: Mon, 5 Mar 2018 14:09:04 +0100 Subject: [PATCH 3/4] made drop-menu into link (cherry picked from commit 42cd462cbfae2cab7636a0842bc46ab8dbcd41b5) --- .../core/components/sidemenu/sidemenu.html | 125 +++++++++--------- 1 file changed, 65 insertions(+), 60 deletions(-) diff --git a/public/app/core/components/sidemenu/sidemenu.html b/public/app/core/components/sidemenu/sidemenu.html index e97d34739ba..1b301363e62 100644 --- a/public/app/core/components/sidemenu/sidemenu.html +++ b/public/app/core/components/sidemenu/sidemenu.html @@ -1,73 +1,78 @@ -  Close + +  Close
- +
- From 5c6fd4f20242f4dfd3f18c71c38bde06799bbb89 Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 6 Mar 2018 12:32:17 +0100 Subject: [PATCH 4/4] hide row actions for viewers closes #11112 (cherry picked from commit d3b23b01d899638e8e1301f142be9b7abc59700e) --- .../dashboard/dashgrid/DashboardRow.tsx | 19 ++++++++------- .../dashboard/specs/DashboardRow.jest.tsx | 23 ++++++++++++++++--- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/public/app/features/dashboard/dashgrid/DashboardRow.tsx b/public/app/features/dashboard/dashgrid/DashboardRow.tsx index 7a4d6cf8070..c2a84cb7da9 100644 --- a/public/app/features/dashboard/dashgrid/DashboardRow.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardRow.tsx @@ -4,6 +4,7 @@ import { PanelModel } from '../panel_model'; import { PanelContainer } from './PanelContainer'; import templateSrv from 'app/features/templating/template_srv'; import appEvents from 'app/core/app_events'; +import config from 'app/core/config'; export interface DashboardRowProps { panel: PanelModel; @@ -94,14 +95,16 @@ export class DashboardRow extends React.Component { {title} ({hiddenPanels} hidden panels) - + {config.bootData.user.orgRole !== 'Viewer' && ( + + )}
); diff --git a/public/app/features/dashboard/specs/DashboardRow.jest.tsx b/public/app/features/dashboard/specs/DashboardRow.jest.tsx index 2d44f2e0e74..c0ac172aa26 100644 --- a/public/app/features/dashboard/specs/DashboardRow.jest.tsx +++ b/public/app/features/dashboard/specs/DashboardRow.jest.tsx @@ -2,19 +2,26 @@ import React from 'react'; import { shallow } from 'enzyme'; import { DashboardRow } from '../dashgrid/DashboardRow'; import { PanelModel } from '../panel_model'; +import config from '../../../core/config'; describe('DashboardRow', () => { let wrapper, panel, getPanelContainer, dashboardMock; beforeEach(() => { - dashboardMock = {toggleRow: jest.fn()}; + dashboardMock = { toggleRow: jest.fn() }; + + config.bootData = { + user: { + orgRole: 'Admin', + }, + }; getPanelContainer = jest.fn().mockReturnValue({ getDashboard: jest.fn().mockReturnValue(dashboardMock), - getPanelLoader: jest.fn() + getPanelLoader: jest.fn(), }); - panel = new PanelModel({collapsed: false}); + panel = new PanelModel({ collapsed: false }); wrapper = shallow(); }); @@ -30,4 +37,14 @@ describe('DashboardRow', () => { expect(dashboardMock.toggleRow.mock.calls).toHaveLength(1); }); + it('should have two actions as admin', () => { + expect(wrapper.find('.dashboard-row__actions .pointer')).toHaveLength(2); + }); + + it('should have zero actions as viewer', () => { + config.bootData.user.orgRole = 'Viewer'; + panel = new PanelModel({ collapsed: false }); + wrapper = shallow(); + expect(wrapper.find('.dashboard-row__actions .pointer')).toHaveLength(0); + }); });