mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 23:55:47 -06:00
Connections: Stop using dataConnectionsConsole
feature toggle (#72111)
* remove dataConnectionsConsole feature toggle * fix imports * reintroduce dataConnectionsConsole To prevent breaking change
This commit is contained in:
parent
84f94cdc24
commit
b08271da32
@ -294,7 +294,6 @@ func TestAddAppLinks(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Should replace page from plugin", func(t *testing.T) {
|
||||
service.features = featuremgmt.WithFeatures(featuremgmt.FlagDataConnectionsConsole)
|
||||
service.navigationAppConfig = map[string]NavigationAppConfig{}
|
||||
service.navigationAppPathConfig = map[string]NavigationAppConfig{
|
||||
"/connections/add-new-connection": {SectionID: "connections"},
|
||||
@ -334,7 +333,6 @@ func TestAddAppLinks(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Should not register pages under the app plugin section unless AddToNav=true", func(t *testing.T) {
|
||||
service.features = featuremgmt.WithFeatures(featuremgmt.FlagDataConnectionsConsole)
|
||||
service.navigationAppPathConfig = map[string]NavigationAppConfig{} // We don't configure it as a standalone plugin page
|
||||
|
||||
treeRoot := navtree.NavTreeRoot{}
|
||||
|
@ -142,10 +142,8 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, prefs *pref.Prefere
|
||||
}
|
||||
}
|
||||
|
||||
if s.features.IsEnabled(featuremgmt.FlagDataConnectionsConsole) {
|
||||
if connectionsSection := s.buildDataConnectionsNavLink(c); connectionsSection != nil {
|
||||
treeRoot.AddSection(connectionsSection)
|
||||
}
|
||||
if connectionsSection := s.buildDataConnectionsNavLink(c); connectionsSection != nil {
|
||||
treeRoot.AddSection(connectionsSection)
|
||||
}
|
||||
|
||||
orgAdminNode, err := s.getAdminNode(c)
|
||||
|
@ -1,21 +1,16 @@
|
||||
import { SafeDynamicImport } from 'app/core/components/DynamicImports/SafeDynamicImport';
|
||||
import { config } from 'app/core/config';
|
||||
import { RouteDescriptor } from 'app/core/navigation/types';
|
||||
|
||||
import { ROUTE_BASE_ID } from './constants';
|
||||
|
||||
export function getRoutes(): RouteDescriptor[] {
|
||||
if (config.featureToggles.dataConnectionsConsole) {
|
||||
return [
|
||||
{
|
||||
path: `/${ROUTE_BASE_ID}`,
|
||||
exact: false,
|
||||
component: SafeDynamicImport(
|
||||
() => import(/* webpackChunkName: "Connections"*/ 'app/features/connections/Connections')
|
||||
),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
return [];
|
||||
return [
|
||||
{
|
||||
path: `/${ROUTE_BASE_ID}`,
|
||||
exact: false,
|
||||
component: SafeDynamicImport(
|
||||
() => import(/* webpackChunkName: "Connections"*/ 'app/features/connections/Connections')
|
||||
),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import { DataSourcePluginMeta } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { LinkButton } from '@grafana/ui';
|
||||
import { DataSourcePluginCategory } from 'app/types';
|
||||
|
||||
@ -18,9 +17,7 @@ export type Props = {
|
||||
};
|
||||
|
||||
export function DataSourceCategories({ categories, onClickDataSourceType }: Props) {
|
||||
const moreDataSourcesLink = config.featureToggles.dataConnectionsConsole
|
||||
? `${ROUTES.AddNewConnection}?cat=data-source`
|
||||
: '/plugins?filterBy=all&filterByType=datasource&utm_source=grafana_add_ds';
|
||||
const moreDataSourcesLink = `${ROUTES.AddNewConnection}?cat=data-source`;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -1,10 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { LinkButton, ButtonVariant } from '@grafana/ui';
|
||||
import { config } from 'app/core/config';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { ROUTES as CONNECTIONS_ROUTES } from 'app/features/connections/constants';
|
||||
import { DATASOURCES_ROUTES } from 'app/features/datasources/constants';
|
||||
import { AccessControlAction } from 'app/types';
|
||||
|
||||
interface AddNewDataSourceButtonProps {
|
||||
@ -14,9 +12,7 @@ interface AddNewDataSourceButtonProps {
|
||||
|
||||
export function AddNewDataSourceButton({ variant, onClick }: AddNewDataSourceButtonProps) {
|
||||
const hasCreateRights = contextSrv.hasPermission(AccessControlAction.DataSourcesCreate);
|
||||
const newDataSourceURL = config.featureToggles.dataConnectionsConsole
|
||||
? CONNECTIONS_ROUTES.DataSourcesNew
|
||||
: DATASOURCES_ROUTES.New;
|
||||
const newDataSourceURL = CONNECTIONS_ROUTES.DataSourcesNew;
|
||||
|
||||
return (
|
||||
<LinkButton
|
||||
|
@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
import { ConnectionsRedirectNotice } from 'app/features/connections/components/ConnectionsRedirectNotice';
|
||||
import { StoreState, useSelector } from 'app/types';
|
||||
@ -16,7 +15,7 @@ export function DataSourcesListPage() {
|
||||
return (
|
||||
<Page navId="datasources" actions={actions}>
|
||||
<Page.Contents>
|
||||
{config.featureToggles.dataConnectionsConsole && <ConnectionsRedirectNotice />}
|
||||
<ConnectionsRedirectNotice />
|
||||
<DataSourcesList />
|
||||
</Page.Contents>
|
||||
</Page>
|
||||
|
@ -298,9 +298,7 @@ export function deleteLoadedDataSource(): ThunkResult<void> {
|
||||
await api.deleteDataSource(uid);
|
||||
await getDatasourceSrv().reload();
|
||||
|
||||
const datasourcesUrl = config.featureToggles.dataConnectionsConsole
|
||||
? CONNECTIONS_ROUTES.DataSources
|
||||
: '/datasources';
|
||||
const datasourcesUrl = CONNECTIONS_ROUTES.DataSources;
|
||||
|
||||
locationService.push(datasourcesUrl);
|
||||
} catch (err) {
|
||||
|
@ -3,7 +3,7 @@ import React, { ReactElement } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { SelectableValue, GrafanaTheme2, PluginType } from '@grafana/data';
|
||||
import { config, locationSearchToObject } from '@grafana/runtime';
|
||||
import { locationSearchToObject } from '@grafana/runtime';
|
||||
import { LoadingPlaceholder, Select, RadioButtonGroup, useStyles2, Tooltip, Field } from '@grafana/ui';
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
|
||||
@ -67,7 +67,7 @@ export default function Browse({ route }: GrafanaRouteComponentProps): ReactElem
|
||||
return null;
|
||||
}
|
||||
|
||||
const subTitle = config.featureToggles.dataConnectionsConsole ? (
|
||||
const subTitle = (
|
||||
<div>
|
||||
Extend the Grafana experience with panel plugins and apps. To find more data sources go to{' '}
|
||||
<a className="external-link" href={`${CONNECTIONS_ROUTES.AddNewConnection}?cat=data-source`}>
|
||||
@ -75,8 +75,6 @@ export default function Browse({ route }: GrafanaRouteComponentProps): ReactElem
|
||||
</a>
|
||||
.
|
||||
</div>
|
||||
) : (
|
||||
<div>Extend the Grafana experience with panel plugins and apps.</div>
|
||||
);
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user