mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: Add explore2Dashboard feature toggle (#47395)
This commit is contained in:
parent
25235b3167
commit
ca286a238d
@ -52,4 +52,5 @@ export interface FeatureToggles {
|
|||||||
alertProvisioning?: boolean;
|
alertProvisioning?: boolean;
|
||||||
storageLocalUpload?: boolean;
|
storageLocalUpload?: boolean;
|
||||||
azureMonitorResourcePickerForMetrics?: boolean;
|
azureMonitorResourcePickerForMetrics?: boolean;
|
||||||
|
explore2Dashboard?: boolean;
|
||||||
}
|
}
|
||||||
|
@ -201,5 +201,11 @@ var (
|
|||||||
RequiresDevMode: true,
|
RequiresDevMode: true,
|
||||||
FrontendOnly: true,
|
FrontendOnly: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "explore2Dashboard",
|
||||||
|
Description: "Experimental Explore to Dashboard workflow",
|
||||||
|
State: FeatureStateBeta,
|
||||||
|
FrontendOnly: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -150,4 +150,8 @@ const (
|
|||||||
// FlagAzureMonitorResourcePickerForMetrics
|
// FlagAzureMonitorResourcePickerForMetrics
|
||||||
// New UI for Azure Monitor Metrics Query
|
// New UI for Azure Monitor Metrics Query
|
||||||
FlagAzureMonitorResourcePickerForMetrics = "azureMonitorResourcePickerForMetrics"
|
FlagAzureMonitorResourcePickerForMetrics = "azureMonitorResourcePickerForMetrics"
|
||||||
|
|
||||||
|
// FlagExplore2Dashboard
|
||||||
|
// Experimental Explore to Dashboard workflow
|
||||||
|
FlagExplore2Dashboard = "explore2Dashboard"
|
||||||
)
|
)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React, { PureComponent, RefObject } from 'react';
|
import React, { lazy, PureComponent, RefObject, Suspense } from 'react';
|
||||||
import { connect, ConnectedProps } from 'react-redux';
|
import { connect, ConnectedProps } from 'react-redux';
|
||||||
import { ExploreId } from 'app/types/explore';
|
import { ExploreId } from 'app/types/explore';
|
||||||
import { PageToolbar, SetInterval, ToolbarButton, ToolbarButtonRow } from '@grafana/ui';
|
import { PageToolbar, SetInterval, ToolbarButton, ToolbarButtonRow } from '@grafana/ui';
|
||||||
import { DataSourceInstanceSettings, RawTimeRange } from '@grafana/data';
|
import { DataSourceInstanceSettings, RawTimeRange } from '@grafana/data';
|
||||||
import { DataSourcePicker } from '@grafana/runtime';
|
import { config, DataSourcePicker } from '@grafana/runtime';
|
||||||
import { StoreState } from 'app/types/store';
|
import { StoreState } from 'app/types/store';
|
||||||
import { createAndCopyShortLink } from 'app/core/utils/shortLinks';
|
import { createAndCopyShortLink } from 'app/core/utils/shortLinks';
|
||||||
import { changeDatasource } from './state/datasource';
|
import { changeDatasource } from './state/datasource';
|
||||||
@ -18,7 +18,10 @@ import { LiveTailControls } from './useLiveTailControls';
|
|||||||
import { cancelQueries, runQueries } from './state/query';
|
import { cancelQueries, runQueries } from './state/query';
|
||||||
import { isSplit } from './state/selectors';
|
import { isSplit } from './state/selectors';
|
||||||
import { DashNavButton } from '../dashboard/components/DashNav/DashNavButton';
|
import { DashNavButton } from '../dashboard/components/DashNav/DashNavButton';
|
||||||
import { AddToDashboard } from './AddToDashboard';
|
|
||||||
|
const AddToDashboard = lazy(() =>
|
||||||
|
import('./AddToDashboard').then(({ AddToDashboard }) => ({ default: AddToDashboard }))
|
||||||
|
);
|
||||||
|
|
||||||
interface OwnProps {
|
interface OwnProps {
|
||||||
exploreId: ExploreId;
|
exploreId: ExploreId;
|
||||||
@ -116,7 +119,11 @@ class UnConnectedExploreToolbar extends PureComponent<Props> {
|
|||||||
</ToolbarButton>
|
</ToolbarButton>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<AddToDashboard exploreId={exploreId} />
|
{config.featureToggles.explore2Dashboard && (
|
||||||
|
<Suspense fallback={null}>
|
||||||
|
<AddToDashboard exploreId={exploreId} />
|
||||||
|
</Suspense>
|
||||||
|
)}
|
||||||
|
|
||||||
{!isLive && (
|
{!isLive && (
|
||||||
<ExploreTimeControls
|
<ExploreTimeControls
|
||||||
|
Loading…
Reference in New Issue
Block a user