From a838d2b30adb7bb6ea45e92d3626b783de4506e7 Mon Sep 17 00:00:00 2001 From: kay delaney <45561153+kaydelaney@users.noreply.github.com> Date: Thu, 5 Sep 2019 13:44:37 +0100 Subject: [PATCH] Explore: Adds ability to save a panel's query from Explore (#17982) * Explore: Adds ability to return to origin dashboard --- .../RefreshPicker/RefreshPicker.tsx | 2 +- .../RefreshPicker/_RefreshPicker.scss | 2 +- .../src/components/Select/ButtonSelect.tsx | 5 +- public/app/core/services/backend_srv.ts | 13 ++- public/app/core/services/keybindingSrv.ts | 3 +- public/app/core/utils/explore.test.ts | 1 + public/app/core/utils/explore.ts | 17 ++- .../SaveModals/SaveDashboardModalCtrl.ts | 6 +- .../dashboard/services/ChangeTracker.ts | 2 +- .../dashboard/services/DashboardSrv.ts | 96 ++++++++-------- .../dashboard/state/initDashboard.test.ts | 105 +++++++++++++++++- .../features/dashboard/state/initDashboard.ts | 37 +++++- public/app/features/explore/Explore.tsx | 19 +++- .../app/features/explore/ExploreToolbar.tsx | 68 +++++++++++- public/app/features/explore/Wrapper.tsx | 2 +- .../app/features/explore/state/actionTypes.ts | 22 +++- public/app/features/explore/state/actions.ts | 27 ++++- public/app/features/explore/state/reducers.ts | 33 +++++- .../app/features/panel/metrics_panel_ctrl.ts | 9 +- .../datasource/prometheus/datasource.ts | 19 ++-- public/app/types/dashboard.ts | 1 + public/app/types/explore.ts | 2 + 22 files changed, 404 insertions(+), 87 deletions(-) diff --git a/packages/grafana-ui/src/components/RefreshPicker/RefreshPicker.tsx b/packages/grafana-ui/src/components/RefreshPicker/RefreshPicker.tsx index 64a022ccf0b..92a55d71ac0 100644 --- a/packages/grafana-ui/src/components/RefreshPicker/RefreshPicker.tsx +++ b/packages/grafana-ui/src/components/RefreshPicker/RefreshPicker.tsx @@ -61,7 +61,7 @@ export class RefreshPicker extends PureComponent {
- diff --git a/packages/grafana-ui/src/components/RefreshPicker/_RefreshPicker.scss b/packages/grafana-ui/src/components/RefreshPicker/_RefreshPicker.scss index 4dcd204ced3..3dff6721740 100644 --- a/packages/grafana-ui/src/components/RefreshPicker/_RefreshPicker.scss +++ b/packages/grafana-ui/src/components/RefreshPicker/_RefreshPicker.scss @@ -6,7 +6,7 @@ display: flex; } - .navbar-button--refresh { + .navbar-button--border-right-0 { border-right: 0; } diff --git a/packages/grafana-ui/src/components/Select/ButtonSelect.tsx b/packages/grafana-ui/src/components/Select/ButtonSelect.tsx index b15fd9e2152..ab35c12a599 100644 --- a/packages/grafana-ui/src/components/Select/ButtonSelect.tsx +++ b/packages/grafana-ui/src/components/Select/ButtonSelect.tsx @@ -43,6 +43,7 @@ export interface Props { onOpenMenu?: () => void; onCloseMenu?: () => void; tabSelectsValue?: boolean; + autoFocus?: boolean; } export class ButtonSelect extends PureComponent> { @@ -65,14 +66,16 @@ export class ButtonSelect extends PureComponent> { onOpenMenu, onCloseMenu, tabSelectsValue, + autoFocus = true, } = this.props; const combinedComponents = { ...components, Control: ButtonComponent({ label, className, iconClass }), }; + return (