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 |
|
||||
| `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 |
|
||||
|
@ -86,7 +86,6 @@ export interface FeatureToggles {
|
||||
advancedDataSourcePicker?: boolean;
|
||||
faroDatasourceSelector?: boolean;
|
||||
enableDatagridEditing?: boolean;
|
||||
dataSourcePageHeader?: boolean;
|
||||
extraThemes?: boolean;
|
||||
lokiPredefinedOperations?: boolean;
|
||||
pluginsFrontendSandbox?: boolean;
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
|
@ -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"
|
||||
|
@ -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} />;
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ const setup = () => {
|
||||
isDefault: false,
|
||||
onDefaultChange: jest.fn(),
|
||||
onNameChange: jest.fn(),
|
||||
alertingSupported: false,
|
||||
};
|
||||
|
||||
return render(<BasicSettings {...props} />);
|
||||
|
@ -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 */}
|
||||
|
@ -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}
|
||||
/>
|
||||
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user