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:
@@ -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 { ExploreId } from 'app/types/explore';
|
||||
import { PageToolbar, SetInterval, ToolbarButton, ToolbarButtonRow } from '@grafana/ui';
|
||||
import { DataSourceInstanceSettings, RawTimeRange } from '@grafana/data';
|
||||
import { DataSourcePicker } from '@grafana/runtime';
|
||||
import { config, DataSourcePicker } from '@grafana/runtime';
|
||||
import { StoreState } from 'app/types/store';
|
||||
import { createAndCopyShortLink } from 'app/core/utils/shortLinks';
|
||||
import { changeDatasource } from './state/datasource';
|
||||
@@ -18,7 +18,10 @@ import { LiveTailControls } from './useLiveTailControls';
|
||||
import { cancelQueries, runQueries } from './state/query';
|
||||
import { isSplit } from './state/selectors';
|
||||
import { DashNavButton } from '../dashboard/components/DashNav/DashNavButton';
|
||||
import { AddToDashboard } from './AddToDashboard';
|
||||
|
||||
const AddToDashboard = lazy(() =>
|
||||
import('./AddToDashboard').then(({ AddToDashboard }) => ({ default: AddToDashboard }))
|
||||
);
|
||||
|
||||
interface OwnProps {
|
||||
exploreId: ExploreId;
|
||||
@@ -116,7 +119,11 @@ class UnConnectedExploreToolbar extends PureComponent<Props> {
|
||||
</ToolbarButton>
|
||||
)}
|
||||
|
||||
<AddToDashboard exploreId={exploreId} />
|
||||
{config.featureToggles.explore2Dashboard && (
|
||||
<Suspense fallback={null}>
|
||||
<AddToDashboard exploreId={exploreId} />
|
||||
</Suspense>
|
||||
)}
|
||||
|
||||
{!isLive && (
|
||||
<ExploreTimeControls
|
||||
|
||||
Reference in New Issue
Block a user