mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Remove feature toggle data source page header (#77751)
* remove feature toggle:dataSourcePageHeader * remove feature flag: dataSourcePageHeader * remove unused prop:alertingSupported
This commit is contained in:
parent
352905e195
commit
4fbd9a55b2
@ -74,7 +74,6 @@ Some features are enabled by default. You can disable these feature by setting t
|
|||||||
| `refactorVariablesTimeRange` | Refactor time range variables flow to reduce number of API calls made when query variables are chained |
|
| `refactorVariablesTimeRange` | Refactor time range variables flow to reduce number of API calls made when query variables are chained |
|
||||||
| `faroDatasourceSelector` | Enable the data source selector within the Frontend Apps section of the Frontend Observability |
|
| `faroDatasourceSelector` | Enable the data source selector within the Frontend Apps section of the Frontend Observability |
|
||||||
| `enableDatagridEditing` | Enables the edit functionality in the datagrid panel |
|
| `enableDatagridEditing` | Enables the edit functionality in the datagrid panel |
|
||||||
| `dataSourcePageHeader` | Apply new pageHeader UI in data source edit page |
|
|
||||||
| `sqlDatasourceDatabaseSelection` | Enables previous SQL data source dataset dropdown behavior |
|
| `sqlDatasourceDatabaseSelection` | Enables previous SQL data source dataset dropdown behavior |
|
||||||
| `awsAsyncQueryCaching` | Enable caching for async queries for Redshift and Athena. Requires that the `useCachingService` feature toggle is enabled and the datasource has caching and async query support enabled |
|
| `awsAsyncQueryCaching` | Enable caching for async queries for Redshift and Athena. Requires that the `useCachingService` feature toggle is enabled and the datasource has caching and async query support enabled |
|
||||||
| `splitScopes` | Support faster dashboard and folder search by splitting permission scopes into parts |
|
| `splitScopes` | Support faster dashboard and folder search by splitting permission scopes into parts |
|
||||||
|
@ -86,7 +86,6 @@ export interface FeatureToggles {
|
|||||||
advancedDataSourcePicker?: boolean;
|
advancedDataSourcePicker?: boolean;
|
||||||
faroDatasourceSelector?: boolean;
|
faroDatasourceSelector?: boolean;
|
||||||
enableDatagridEditing?: boolean;
|
enableDatagridEditing?: boolean;
|
||||||
dataSourcePageHeader?: boolean;
|
|
||||||
extraThemes?: boolean;
|
extraThemes?: boolean;
|
||||||
lokiPredefinedOperations?: boolean;
|
lokiPredefinedOperations?: boolean;
|
||||||
pluginsFrontendSandbox?: boolean;
|
pluginsFrontendSandbox?: boolean;
|
||||||
|
@ -497,13 +497,6 @@ var (
|
|||||||
Stage: FeatureStagePublicPreview,
|
Stage: FeatureStagePublicPreview,
|
||||||
Owner: grafanaBiSquad,
|
Owner: grafanaBiSquad,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "dataSourcePageHeader",
|
|
||||||
Description: "Apply new pageHeader UI in data source edit page",
|
|
||||||
FrontendOnly: true,
|
|
||||||
Stage: FeatureStagePublicPreview,
|
|
||||||
Owner: enterpriseDatasourcesSquad,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: "extraThemes",
|
Name: "extraThemes",
|
||||||
Description: "Enables extra themes",
|
Description: "Enables extra themes",
|
||||||
|
@ -67,7 +67,6 @@ enableElasticsearchBackendQuerying,GA,@grafana/observability-logs,false,false,fa
|
|||||||
advancedDataSourcePicker,GA,@grafana/dashboards-squad,false,false,false,true
|
advancedDataSourcePicker,GA,@grafana/dashboards-squad,false,false,false,true
|
||||||
faroDatasourceSelector,preview,@grafana/app-o11y,false,false,false,true
|
faroDatasourceSelector,preview,@grafana/app-o11y,false,false,false,true
|
||||||
enableDatagridEditing,preview,@grafana/grafana-bi-squad,false,false,false,true
|
enableDatagridEditing,preview,@grafana/grafana-bi-squad,false,false,false,true
|
||||||
dataSourcePageHeader,preview,@grafana/enterprise-datasources,false,false,false,true
|
|
||||||
extraThemes,experimental,@grafana/grafana-frontend-platform,false,false,false,true
|
extraThemes,experimental,@grafana/grafana-frontend-platform,false,false,false,true
|
||||||
lokiPredefinedOperations,experimental,@grafana/observability-logs,false,false,false,true
|
lokiPredefinedOperations,experimental,@grafana/observability-logs,false,false,false,true
|
||||||
pluginsFrontendSandbox,experimental,@grafana/plugins-platform-backend,false,false,false,true
|
pluginsFrontendSandbox,experimental,@grafana/plugins-platform-backend,false,false,false,true
|
||||||
|
|
@ -279,10 +279,6 @@ const (
|
|||||||
// Enables the edit functionality in the datagrid panel
|
// Enables the edit functionality in the datagrid panel
|
||||||
FlagEnableDatagridEditing = "enableDatagridEditing"
|
FlagEnableDatagridEditing = "enableDatagridEditing"
|
||||||
|
|
||||||
// FlagDataSourcePageHeader
|
|
||||||
// Apply new pageHeader UI in data source edit page
|
|
||||||
FlagDataSourcePageHeader = "dataSourcePageHeader"
|
|
||||||
|
|
||||||
// FlagExtraThemes
|
// FlagExtraThemes
|
||||||
// Enables extra themes
|
// Enables extra themes
|
||||||
FlagExtraThemes = "extraThemes"
|
FlagExtraThemes = "extraThemes"
|
||||||
|
@ -1,31 +1,13 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { useLocation, useParams } from 'react-router-dom';
|
import { useLocation, useParams } from 'react-router-dom';
|
||||||
|
|
||||||
import { config } from '@grafana/runtime';
|
|
||||||
import { Page } from 'app/core/components/Page/Page';
|
|
||||||
import DataSourceTabPage from 'app/features/datasources/components/DataSourceTabPage';
|
import DataSourceTabPage from 'app/features/datasources/components/DataSourceTabPage';
|
||||||
import { EditDataSource } from 'app/features/datasources/components/EditDataSource';
|
|
||||||
import { EditDataSourceActions } from 'app/features/datasources/components/EditDataSourceActions';
|
|
||||||
|
|
||||||
import { useDataSourceSettingsNav } from '../hooks/useDataSourceSettingsNav';
|
|
||||||
|
|
||||||
export function EditDataSourcePage() {
|
export function EditDataSourcePage() {
|
||||||
const { uid } = useParams<{ uid: string }>();
|
const { uid } = useParams<{ uid: string }>();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const params = new URLSearchParams(location.search);
|
const params = new URLSearchParams(location.search);
|
||||||
const pageId = params.get('page');
|
const pageId = params.get('page');
|
||||||
const dataSourcePageHeader = config.featureToggles.dataSourcePageHeader;
|
|
||||||
const { navId, pageNav } = useDataSourceSettingsNav();
|
|
||||||
|
|
||||||
if (dataSourcePageHeader) {
|
return <DataSourceTabPage uid={uid} pageId={pageId} />;
|
||||||
return <DataSourceTabPage uid={uid} pageId={pageId} />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Page navId={navId} pageNav={pageNav} actions={<EditDataSourceActions uid={uid} />}>
|
|
||||||
<Page.Contents>
|
|
||||||
<EditDataSource uid={uid} pageId={pageId} />
|
|
||||||
</Page.Contents>
|
|
||||||
</Page>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ const setup = () => {
|
|||||||
isDefault: false,
|
isDefault: false,
|
||||||
onDefaultChange: jest.fn(),
|
onDefaultChange: jest.fn(),
|
||||||
onNameChange: jest.fn(),
|
onNameChange: jest.fn(),
|
||||||
alertingSupported: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return render(<BasicSettings {...props} />);
|
return render(<BasicSettings {...props} />);
|
||||||
|
@ -3,7 +3,6 @@ import React from 'react';
|
|||||||
|
|
||||||
import { GrafanaTheme2 } from '@grafana/data';
|
import { GrafanaTheme2 } from '@grafana/data';
|
||||||
import { selectors } from '@grafana/e2e-selectors';
|
import { selectors } from '@grafana/e2e-selectors';
|
||||||
import { config } from '@grafana/runtime';
|
|
||||||
import { InlineField, InlineSwitch, Input, Badge, useStyles2 } from '@grafana/ui';
|
import { InlineField, InlineSwitch, Input, Badge, useStyles2 } from '@grafana/ui';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
@ -11,22 +10,12 @@ export interface Props {
|
|||||||
isDefault: boolean;
|
isDefault: boolean;
|
||||||
onNameChange: (name: string) => void;
|
onNameChange: (name: string) => void;
|
||||||
onDefaultChange: (value: boolean) => void;
|
onDefaultChange: (value: boolean) => void;
|
||||||
alertingSupported: boolean;
|
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function BasicSettings({
|
export function BasicSettings({ dataSourceName, isDefault, onDefaultChange, onNameChange, disabled }: Props) {
|
||||||
dataSourceName,
|
|
||||||
isDefault,
|
|
||||||
onDefaultChange,
|
|
||||||
onNameChange,
|
|
||||||
alertingSupported,
|
|
||||||
disabled,
|
|
||||||
}: Props) {
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!config.featureToggles.dataSourcePageHeader && <AlertingEnabled enabled={alertingSupported} />}
|
|
||||||
|
|
||||||
<div className="gf-form-group" aria-label="Datasource settings page basic settings">
|
<div className="gf-form-group" aria-label="Datasource settings page basic settings">
|
||||||
<div className="gf-form-inline">
|
<div className="gf-form-inline">
|
||||||
{/* Name */}
|
{/* Name */}
|
||||||
|
@ -120,10 +120,6 @@ export function EditDataSourceView({
|
|||||||
|
|
||||||
const dsi = getDataSourceSrv()?.getInstanceSettings(dataSource.uid);
|
const dsi = getDataSourceSrv()?.getInstanceSettings(dataSource.uid);
|
||||||
|
|
||||||
const hasAlertingEnabled = Boolean(dsi?.meta?.alerting ?? false);
|
|
||||||
const isAlertManagerDatasource = dsi?.type === 'alertmanager';
|
|
||||||
const alertingSupported = hasAlertingEnabled || isAlertManagerDatasource;
|
|
||||||
|
|
||||||
const onSubmit = async (e: React.MouseEvent<HTMLButtonElement> | React.FormEvent<HTMLFormElement>) => {
|
const onSubmit = async (e: React.MouseEvent<HTMLButtonElement> | React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
trackDsConfigClicked('save_and_test');
|
trackDsConfigClicked('save_and_test');
|
||||||
@ -190,7 +186,6 @@ export function EditDataSourceView({
|
|||||||
isDefault={dataSource.isDefault}
|
isDefault={dataSource.isDefault}
|
||||||
onDefaultChange={onDefaultChange}
|
onDefaultChange={onDefaultChange}
|
||||||
onNameChange={onNameChange}
|
onNameChange={onNameChange}
|
||||||
alertingSupported={alertingSupported}
|
|
||||||
disabled={readOnly || !hasWriteRights}
|
disabled={readOnly || !hasWriteRights}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ const loadingDSType = 'Loading';
|
|||||||
export function buildNavModel(dataSource: DataSourceSettings, plugin: GenericDataSourcePlugin): NavModelItem {
|
export function buildNavModel(dataSource: DataSourceSettings, plugin: GenericDataSourcePlugin): NavModelItem {
|
||||||
const pluginMeta = plugin.meta;
|
const pluginMeta = plugin.meta;
|
||||||
const highlightsEnabled = config.featureToggles.featureHighlights;
|
const highlightsEnabled = config.featureToggles.featureHighlights;
|
||||||
const dataSourcePageHeader = config.featureToggles.dataSourcePageHeader;
|
|
||||||
const navModel: NavModelItem = {
|
const navModel: NavModelItem = {
|
||||||
img: pluginMeta.info.logos.large,
|
img: pluginMeta.info.logos.large,
|
||||||
id: 'datasource-' + dataSource.uid,
|
id: 'datasource-' + dataSource.uid,
|
||||||
@ -30,10 +29,6 @@ export function buildNavModel(dataSource: DataSourceSettings, plugin: GenericDat
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!dataSourcePageHeader) {
|
|
||||||
navModel.subTitle = `Type: ${pluginMeta.name}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plugin.configPages) {
|
if (plugin.configPages) {
|
||||||
for (const page of plugin.configPages) {
|
for (const page of plugin.configPages) {
|
||||||
navModel.children!.push({
|
navModel.children!.push({
|
||||||
|
Loading…
Reference in New Issue
Block a user