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:
Taewoo K 2023-11-06 15:21:15 -05:00 committed by GitHub
parent 352905e195
commit 4fbd9a55b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 2 additions and 56 deletions

View File

@ -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 |
| `faroDatasourceSelector` | Enable the data source selector within the Frontend Apps section of the Frontend Observability |
| `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 |
| `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 |

View File

@ -86,7 +86,6 @@ export interface FeatureToggles {
advancedDataSourcePicker?: boolean;
faroDatasourceSelector?: boolean;
enableDatagridEditing?: boolean;
dataSourcePageHeader?: boolean;
extraThemes?: boolean;
lokiPredefinedOperations?: boolean;
pluginsFrontendSandbox?: boolean;

View File

@ -497,13 +497,6 @@ var (
Stage: FeatureStagePublicPreview,
Owner: grafanaBiSquad,
},
{
Name: "dataSourcePageHeader",
Description: "Apply new pageHeader UI in data source edit page",
FrontendOnly: true,
Stage: FeatureStagePublicPreview,
Owner: enterpriseDatasourcesSquad,
},
{
Name: "extraThemes",
Description: "Enables extra themes",

View File

@ -67,7 +67,6 @@ enableElasticsearchBackendQuerying,GA,@grafana/observability-logs,false,false,fa
advancedDataSourcePicker,GA,@grafana/dashboards-squad,false,false,false,true
faroDatasourceSelector,preview,@grafana/app-o11y,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
lokiPredefinedOperations,experimental,@grafana/observability-logs,false,false,false,true
pluginsFrontendSandbox,experimental,@grafana/plugins-platform-backend,false,false,false,true

1 Name Stage Owner requiresDevMode RequiresLicense RequiresRestart FrontendOnly
67 advancedDataSourcePicker GA @grafana/dashboards-squad false false false true
68 faroDatasourceSelector preview @grafana/app-o11y false false false true
69 enableDatagridEditing preview @grafana/grafana-bi-squad false false false true
dataSourcePageHeader preview @grafana/enterprise-datasources false false false true
70 extraThemes experimental @grafana/grafana-frontend-platform false false false true
71 lokiPredefinedOperations experimental @grafana/observability-logs false false false true
72 pluginsFrontendSandbox experimental @grafana/plugins-platform-backend false false false true

View File

@ -279,10 +279,6 @@ const (
// Enables the edit functionality in the datagrid panel
FlagEnableDatagridEditing = "enableDatagridEditing"
// FlagDataSourcePageHeader
// Apply new pageHeader UI in data source edit page
FlagDataSourcePageHeader = "dataSourcePageHeader"
// FlagExtraThemes
// Enables extra themes
FlagExtraThemes = "extraThemes"

View File

@ -1,31 +1,13 @@
import * as React from 'react';
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 { EditDataSource } from 'app/features/datasources/components/EditDataSource';
import { EditDataSourceActions } from 'app/features/datasources/components/EditDataSourceActions';
import { useDataSourceSettingsNav } from '../hooks/useDataSourceSettingsNav';
export function EditDataSourcePage() {
const { uid } = useParams<{ uid: string }>();
const location = useLocation();
const params = new URLSearchParams(location.search);
const pageId = params.get('page');
const dataSourcePageHeader = config.featureToggles.dataSourcePageHeader;
const { navId, pageNav } = useDataSourceSettingsNav();
if (dataSourcePageHeader) {
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>
);
return <DataSourceTabPage uid={uid} pageId={pageId} />;
}

View File

@ -11,7 +11,6 @@ const setup = () => {
isDefault: false,
onDefaultChange: jest.fn(),
onNameChange: jest.fn(),
alertingSupported: false,
};
return render(<BasicSettings {...props} />);

View File

@ -3,7 +3,6 @@ import React from 'react';
import { GrafanaTheme2 } from '@grafana/data';
import { selectors } from '@grafana/e2e-selectors';
import { config } from '@grafana/runtime';
import { InlineField, InlineSwitch, Input, Badge, useStyles2 } from '@grafana/ui';
export interface Props {
@ -11,22 +10,12 @@ export interface Props {
isDefault: boolean;
onNameChange: (name: string) => void;
onDefaultChange: (value: boolean) => void;
alertingSupported: boolean;
disabled?: boolean;
}
export function BasicSettings({
dataSourceName,
isDefault,
onDefaultChange,
onNameChange,
alertingSupported,
disabled,
}: Props) {
export function BasicSettings({ dataSourceName, isDefault, onDefaultChange, onNameChange, disabled }: Props) {
return (
<>
{!config.featureToggles.dataSourcePageHeader && <AlertingEnabled enabled={alertingSupported} />}
<div className="gf-form-group" aria-label="Datasource settings page basic settings">
<div className="gf-form-inline">
{/* Name */}

View File

@ -120,10 +120,6 @@ export function EditDataSourceView({
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>) => {
e.preventDefault();
trackDsConfigClicked('save_and_test');
@ -190,7 +186,6 @@ export function EditDataSourceView({
isDefault={dataSource.isDefault}
onDefaultChange={onDefaultChange}
onNameChange={onNameChange}
alertingSupported={alertingSupported}
disabled={readOnly || !hasWriteRights}
/>

View File

@ -13,7 +13,6 @@ const loadingDSType = 'Loading';
export function buildNavModel(dataSource: DataSourceSettings, plugin: GenericDataSourcePlugin): NavModelItem {
const pluginMeta = plugin.meta;
const highlightsEnabled = config.featureToggles.featureHighlights;
const dataSourcePageHeader = config.featureToggles.dataSourcePageHeader;
const navModel: NavModelItem = {
img: pluginMeta.info.logos.large,
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) {
for (const page of plugin.configPages) {
navModel.children!.push({