From 2156980edba7241beee77b0edb37b1c3fff05e38 Mon Sep 17 00:00:00 2001 From: Tharun Rajendran Date: Mon, 23 Aug 2021 20:53:49 +0530 Subject: [PATCH] Datasource: add button to navigate to explore from settings (#36119) Fixes #13737 --- .../datasources/settings/ButtonRow.test.tsx | 1 + .../datasources/settings/ButtonRow.tsx | 8 ++++++-- .../settings/DataSourceSettingsPage.tsx | 10 +++++++++- .../__snapshots__/ButtonRow.test.tsx.snap | 18 ++++++++++++++++-- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/public/app/features/datasources/settings/ButtonRow.test.tsx b/public/app/features/datasources/settings/ButtonRow.test.tsx index 84b16d829d5..2e177755493 100644 --- a/public/app/features/datasources/settings/ButtonRow.test.tsx +++ b/public/app/features/datasources/settings/ButtonRow.test.tsx @@ -8,6 +8,7 @@ const setup = (propOverrides?: object) => { onSubmit: jest.fn(), onDelete: jest.fn(), onTest: jest.fn(), + exploreUrl: '/explore', }; Object.assign(props, propOverrides); diff --git a/public/app/features/datasources/settings/ButtonRow.tsx b/public/app/features/datasources/settings/ButtonRow.tsx index 7631b47bd40..8b744f68667 100644 --- a/public/app/features/datasources/settings/ButtonRow.tsx +++ b/public/app/features/datasources/settings/ButtonRow.tsx @@ -5,18 +5,22 @@ import config from 'app/core/config'; import { Button, LinkButton } from '@grafana/ui'; export interface Props { + exploreUrl: string; isReadOnly: boolean; onDelete: () => void; onSubmit: (event: any) => void; onTest: (event: any) => void; } -const ButtonRow: FC = ({ isReadOnly, onDelete, onSubmit, onTest }) => { +const ButtonRow: FC = ({ isReadOnly, onDelete, onSubmit, onTest, exploreUrl }) => { return (
- + Back + + Explore +