From 9614dc2446eac438bedb0783654ccf77acb6dae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 2 May 2023 10:51:59 +0200 Subject: [PATCH] Connections: Simplify connections nav (#66813) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Connections: Simplify connections nav * rename Connections pages everywhere --------- Co-authored-by: Miklós Tolnai --- pkg/api/api.go | 8 +- .../navtree/navtreeimpl/applinks_test.go | 22 ++--- pkg/services/navtree/navtreeimpl/navtree.go | 31 +++---- .../features/connections/Connections.test.tsx | 65 ++++----------- .../app/features/connections/Connections.tsx | 21 ++--- .../__mocks__/store.navIndex.mock.ts | 80 ++++++------------- public/app/features/connections/constants.ts | 17 ++-- .../hooks/useDataSourceSettingsNav.ts | 4 +- .../pages/AddNewConnectionPage.tsx | 15 ++++ .../connections/pages/ConnectDataPage.tsx | 15 ---- .../pages/DataSourceDetailsPage.tsx | 6 +- .../connections/pages/DataSourcesListPage.tsx | 2 +- .../connections/pages/NewDataSourcePage.tsx | 2 +- .../app/features/connections/pages/index.tsx | 2 +- .../tabs/ConnectData/ConnectData.test.tsx | 6 +- .../tabs/ConnectData/ConnectData.tsx | 2 +- .../NoAccessModal/NoAccessModal.tsx | 2 +- .../components/DataSourceCategories.tsx | 2 +- .../features/plugins/admin/pages/Browse.tsx | 2 +- 19 files changed, 112 insertions(+), 192 deletions(-) create mode 100644 public/app/features/connections/pages/AddNewConnectionPage.tsx delete mode 100644 public/app/features/connections/pages/ConnectDataPage.tsx diff --git a/pkg/api/api.go b/pkg/api/api.go index b2b18d19fbb..f8aff7dd331 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -126,11 +126,11 @@ func (hs *HTTPServer) registerRoutes() { r.Get("/plugins/:id/edit", middleware.CanAdminPlugins(hs.Cfg), hs.Index) // deprecated r.Get("/plugins/:id/page/:page", middleware.CanAdminPlugins(hs.Cfg), hs.Index) - r.Get("/connections/your-connections/datasources", authorize(reqOrgAdmin, datasources.ConfigurationPageAccess), hs.Index) - r.Get("/connections/your-connections/datasources/new", authorize(reqOrgAdmin, datasources.NewPageAccess), hs.Index) - r.Get("/connections/your-connections/datasources/edit/*", authorize(reqOrgAdmin, datasources.EditPageAccess), hs.Index) + r.Get("/connections/your-datasources", authorize(reqOrgAdmin, datasources.ConfigurationPageAccess), hs.Index) + r.Get("/connections/your-datasources/new", authorize(reqOrgAdmin, datasources.NewPageAccess), hs.Index) + r.Get("/connections/your-datasources/edit/*", authorize(reqOrgAdmin, datasources.EditPageAccess), hs.Index) r.Get("/connections", authorize(reqOrgAdmin, datasources.ConfigurationPageAccess), hs.Index) - r.Get("/connections/connect-data", authorize(reqOrgAdmin, datasources.ConfigurationPageAccess), hs.Index) + r.Get("/connections/add-new-connection", authorize(reqOrgAdmin, datasources.ConfigurationPageAccess), hs.Index) r.Get("/connections/datasources/:id", middleware.CanAdminPlugins(hs.Cfg), hs.Index) r.Get("/connections/datasources/:id/page/:page", middleware.CanAdminPlugins(hs.Cfg), hs.Index) diff --git a/pkg/services/navtree/navtreeimpl/applinks_test.go b/pkg/services/navtree/navtreeimpl/applinks_test.go index 3fdbc794931..be4a6658fbb 100644 --- a/pkg/services/navtree/navtreeimpl/applinks_test.go +++ b/pkg/services/navtree/navtreeimpl/applinks_test.go @@ -93,8 +93,8 @@ func TestAddAppLinks(t *testing.T) { AddToNav: true, }, { - Name: "Connect data", - Path: "/connections/connect-data", + Name: "Add new connection", + Path: "/connections/add-new-connection", Type: "page", AddToNav: false, }, @@ -296,7 +296,7 @@ func TestAddAppLinks(t *testing.T) { service.features = featuremgmt.WithFeatures(featuremgmt.FlagDataConnectionsConsole) service.navigationAppConfig = map[string]NavigationAppConfig{} service.navigationAppPathConfig = map[string]NavigationAppConfig{ - "/connections/connect-data": {SectionID: "connections"}, + "/connections/add-new-connection": {SectionID: "connections"}, } // Build nav-tree and check if the "Connections" page is there @@ -306,10 +306,10 @@ func TestAddAppLinks(t *testing.T) { require.NotNil(t, connectionsNode) require.Equal(t, "Connections", connectionsNode.Text) - // Check if the original "Connect data" page (served by core) is there until we add the standalone plugin page + // Check if the original "Add new connection" page (served by core) is there until we add the standalone plugin page connectDataNode := connectionsNode.Children[0] - require.Equal(t, "Connect data", connectDataNode.Text) - require.Equal(t, "connections-connect-data", connectDataNode.Id) + require.Equal(t, "Add new connection", connectDataNode.Text) + require.Equal(t, "connections-add-new-connection", connectDataNode.Id) require.Equal(t, "", connectDataNode.PluginID) // Check if the standalone plugin page appears under the section where we registered it and if it overrides the original page @@ -317,8 +317,8 @@ func TestAddAppLinks(t *testing.T) { require.NoError(t, err) require.Equal(t, "Connections", connectionsNode.Text) - require.Equal(t, "Connect data", connectDataNode.Text) - require.Equal(t, "standalone-plugin-page-/connections/connect-data", connectDataNode.Id) // Overridden "Connect data" page + require.Equal(t, "Add new connection", connectDataNode.Text) + require.Equal(t, "standalone-plugin-page-/connections/add-new-connection", connectDataNode.Id) // Overridden "Add new connection" page require.Equal(t, "test-app3", connectDataNode.PluginID) // Check if the standalone plugin page does not appear under the app section anymore @@ -342,12 +342,12 @@ func TestAddAppLinks(t *testing.T) { require.NoError(t, err) // The original core page should exist under the section - connectDataNode := treeRoot.FindById("connections-connect-data") - require.Equal(t, "connections-connect-data", connectDataNode.Id) + connectDataNode := treeRoot.FindById("connections-add-new-connection") + require.Equal(t, "connections-add-new-connection", connectDataNode.Id) require.Equal(t, "", connectDataNode.PluginID) // The standalone plugin page should not be found in the navtree at all (as we didn't configure it) - standaloneConnectDataNode := treeRoot.FindById("standalone-plugin-page-/connections/connect-data") + standaloneConnectDataNode := treeRoot.FindById("standalone-plugin-page-/connections/add-new-connection") require.Nil(t, standaloneConnectDataNode) // Only the pages that have `AddToNav=true` appear under the plugin navigation diff --git a/pkg/services/navtree/navtreeimpl/navtree.go b/pkg/services/navtree/navtreeimpl/navtree.go index b8544cffc3a..09824547154 100644 --- a/pkg/services/navtree/navtreeimpl/navtree.go +++ b/pkg/services/navtree/navtreeimpl/navtree.go @@ -481,29 +481,22 @@ func (s *ServiceImpl) buildDataConnectionsNavLink(c *contextmodel.ReqContext) *n baseUrl := s.cfg.AppSubURL + "/connections" if hasAccess(ac.ReqOrgAdmin, datasources.ConfigurationPageAccess) { - // Connect data + // Add new connection children = append(children, &navtree.NavLink{ - Id: "connections-connect-data", - Text: "Connect data", - SubTitle: "Browse and create new connections", - IsSection: true, - Url: s.cfg.AppSubURL + "/connections/connect-data", - Children: []*navtree.NavLink{}, + Id: "connections-add-new-connection", + Text: "Add new connection", + SubTitle: "Browse and create new connections", + Url: baseUrl + "/add-new-connection", + Children: []*navtree.NavLink{}, }) - // Your connections + // Your data sources children = append(children, &navtree.NavLink{ - Id: "connections-your-connections", - Text: "Your connections", - SubTitle: "Manage your existing connections", - Url: baseUrl + "/your-connections", - // Datasources - Children: []*navtree.NavLink{{ - Id: "connections-your-connections-datasources", - Text: "Data sources", - SubTitle: "View and manage your connected data source connections", - Url: baseUrl + "/your-connections/datasources", - }}, + Id: "connections-your-datasources", + Text: "Your data sources", + SubTitle: "View and manage your connected data source connections", + Url: baseUrl + "/your-datasources", + Children: []*navtree.NavLink{}, }) } diff --git a/public/app/features/connections/Connections.test.tsx b/public/app/features/connections/Connections.test.tsx index 48a8c52201f..6519280a375 100644 --- a/public/app/features/connections/Connections.test.tsx +++ b/public/app/features/connections/Connections.test.tsx @@ -38,56 +38,49 @@ describe('Connections', () => { (contextSrv.hasPermission as jest.Mock) = jest.fn().mockReturnValue(true); }); - test('shows the "Connect data" page by default', async () => { + test('shows the "Add new connection" page by default', async () => { renderPage(); // Data sources group expect(await screen.findByText('Data sources')).toBeVisible(); // Heading - expect(await screen.findByText('Connect data')).toBeVisible(); + expect(await screen.findByText('Add new connection')).toBeVisible(); expect(await screen.findByText('Browse and create new connections')).toBeVisible(); }); - test('shows a landing page for Your connections', async () => { - renderPage(ROUTES.YourConnections); - - expect(await screen.findByRole('link', { name: 'Datasources' })).toBeVisible(); - expect(await screen.findByText('Manage your existing datasource connections')).toBeVisible(); - }); - test('renders the correct tab even if accessing it with a "sub-url"', async () => { - renderPage(ROUTES.ConnectData); + renderPage(ROUTES.AddNewConnection); - expect(await screen.findByText('Connect data')).toBeVisible(); + expect(await screen.findByText('Add new connection')).toBeVisible(); expect(await screen.findByText('Browse and create new connections')).toBeVisible(); // Should not render the "Your datasources" page expect(screen.queryByText('Manage your existing datasource connections')).not.toBeInTheDocument(); }); - test('renders the core "Connect data" page in case there is no standalone plugin page override for it', async () => { - renderPage(ROUTES.ConnectData); + test('renders the core "Add new connection" page in case there is no standalone plugin page override for it', async () => { + renderPage(ROUTES.AddNewConnection); // We expect to see no results and "Data sources" as a header (we only have data sources in OSS Grafana at this point) expect(await screen.findByText('Data sources')).toBeVisible(); expect(await screen.findByText('No results matching your query were found.')).toBeVisible(); }); - test('does not render anything for the "Connect data" page in case it is displayed by a standalone plugin page', async () => { - // We are overriding the navIndex to have the "Connect data" page registered by a plugin + test('does not render anything for the "Add new connection" page in case it is displayed by a standalone plugin page', async () => { + // We are overriding the navIndex to have the "Add new connection" page registered by a plugin const standalonePluginPage = { - id: 'standalone-plugin-page-/connections/connect-data', - text: 'Connect data', + id: 'standalone-plugin-page-/connections/add-new-connection', + text: 'Add new connection', subTitle: 'Browse and create new connections', - url: '/connections/connect-data', + url: '/connections/add-new-connection', pluginId: 'grafana-easystart-app', }; const connections = { ...navIndex.connections, children: navIndex.connections.children?.map((child) => { - if (child.id === 'connections-connect-data') { + if (child.id === 'connections-add-new-connection') { return standalonePluginPage; } @@ -100,40 +93,10 @@ describe('Connections', () => { plugins: getPluginsStateMock([]), }); - renderPage(ROUTES.ConnectData, store); + renderPage(ROUTES.AddNewConnection, store); - // We expect not to see the text that would be rendered by the core "Connect data" page + // We expect not to see the text that would be rendered by the core "Add new connection" page expect(screen.queryByText('Data sources')).not.toBeInTheDocument(); expect(screen.queryByText('No results matching your query were found.')).not.toBeInTheDocument(); }); - - test('Your connections redirects to Data sources if it has one child', async () => { - const navIndexCopy = { - ...navIndex, - 'connections-your-connections': { - id: 'connections-your-connections', - text: 'Your connections', - subTitle: 'Manage your existing connections', - url: '/connections/your-connections', - children: [ - { - id: 'connections-your-connections-datasources', - text: 'Datasources', - subTitle: 'Manage your existing datasource connections', - url: '/connections/your-connections/datasources', - }, - ], - }, - }; - - const store = configureStore({ - navIndex: navIndexCopy, - plugins: getPluginsStateMock([]), - }); - - renderPage(ROUTES.YourConnections, store); - - expect(await screen.findByPlaceholderText('Search by name or type')).toBeInTheDocument(); - expect(await screen.queryByRole('link', { name: 'Datasources' })).toBeNull(); - }); }); diff --git a/public/app/features/connections/Connections.tsx b/public/app/features/connections/Connections.tsx index 1a66576c825..952ed4a73ff 100644 --- a/public/app/features/connections/Connections.tsx +++ b/public/app/features/connections/Connections.tsx @@ -1,13 +1,12 @@ import * as React from 'react'; import { Redirect, Route, Switch } from 'react-router-dom'; -import { NavLandingPage } from 'app/core/components/NavLandingPage/NavLandingPage'; import { DataSourcesRoutesContext } from 'app/features/datasources/state'; import { StoreState, useSelector } from 'app/types'; import { ROUTES } from './constants'; import { - ConnectDataPage, + AddNewConnectionPage, DataSourceDashboardsPage, DataSourceDetailsPage, DataSourcesListPage, @@ -17,12 +16,7 @@ import { export default function Connections() { const navIndex = useSelector((state: StoreState) => state.navIndex); - const isConnectDataPageOverriden = Boolean(navIndex['standalone-plugin-page-/connections/connect-data']); - - const YourConnectionsPage = - navIndex['connections-your-connections'].children && navIndex['connections-your-connections'].children?.length > 1 - ? () => - : () => ; + const isAddNewConnectionPageOverridden = Boolean(navIndex['standalone-plugin-page-/connections/add-new-connection']); return ( - {/* Redirect to "Connect data" by default */} - } /> - + {/* Redirect to "Add new connection" by default */} + } /> - {/* "Connect data" page - we don't register a route in case a plugin already registers a standalone page for it */} - {!isConnectDataPageOverriden && } + {/* "Add new connection" page - we don't register a route in case a plugin already registers a standalone page for it */} + {!isAddNewConnectionPageOverridden && ( + + )} {/* Not found */} } /> diff --git a/public/app/features/connections/__mocks__/store.navIndex.mock.ts b/public/app/features/connections/__mocks__/store.navIndex.mock.ts index d944ccbf3ec..dc3774ad9c9 100644 --- a/public/app/features/connections/__mocks__/store.navIndex.mock.ts +++ b/public/app/features/connections/__mocks__/store.navIndex.mock.ts @@ -229,30 +229,22 @@ export const navIndex: NavIndex = { sortWeight: -1300, children: [ { - id: 'connections-your-connections', - text: 'Your connections', - subTitle: 'Manage your existing connections', - url: '/connections/your-connections', - children: [ - { - id: 'connections-your-connections-datasources', - text: 'Datasources', - subTitle: 'Manage your existing datasource connections', - url: '/connections/your-connections/datasources', - }, - { - id: 'standalone-plugin-page-/connections/your-connections/infrastructure', - text: 'Infrastructure', - url: '/connections/your-connections/infrastructure', - pluginId: 'grafana-easystart-app', - }, - ], + id: 'connections-add-new-connection', + text: 'Add new connection', + subTitle: 'Browse and create new connections', + url: '/connections/add-new-connection', }, { - id: 'connections-connect-data', - text: 'Connect data', - subTitle: 'Browse and create new connections', - url: '/connections/connect-data', + id: 'connections-your-datasources', + text: 'Your data sources', + subTitle: 'Manage your existing datasource connections', + url: '/connections/your-datasources', + }, + { + id: 'standalone-plugin-page-/connections/your-infrastructure', + text: 'Your infrastructure', + url: '/connections/your-infrastructure', + pluginId: 'grafana-easystart-app', }, ], parentItem: { @@ -263,43 +255,23 @@ export const navIndex: NavIndex = { sortWeight: -2000, }, }, - 'connections-your-connections': { - id: 'connections-your-connections', - text: 'Your connections', - subTitle: 'Manage your existing connections', - url: '/connections/your-connections', - children: [ - { - id: 'connections-your-connections-datasources', - text: 'Datasources', - subTitle: 'Manage your existing datasource connections', - url: '/connections/your-connections/datasources', - }, - { - id: 'standalone-plugin-page-/connections/your-connections/infrastructure', - text: 'Infrastructure', - url: '/connections/your-connections/infrastructure', - pluginId: 'grafana-easystart-app', - }, - ], - }, - 'connections-your-connections-datasources': { - id: 'connections-your-connections-datasources', - text: 'Datasources', + 'connections-your-datasources': { + id: 'connections-your-datasources', + text: 'Your data sources', subTitle: 'Manage your existing datasource connections', - url: '/connections/your-connections/datasources', + url: '/connections/your-datasources', }, - 'standalone-plugin-page-/connections/your-connections/infrastructure': { - id: 'standalone-plugin-page-/connections/your-connections/infrastructure', - text: 'Infrastructure', - url: '/connections/your-connections/infrastructure', + 'standalone-plugin-page-/connections/your-infrastructure': { + id: 'standalone-plugin-page-/connections/your-infrastructure', + text: 'Your infrastructure', + url: '/connections/your-infrastructure', pluginId: 'grafana-easystart-app', }, - 'connections-connect-data': { - id: 'connections-connect-data', - text: 'Connect data', + 'connections-add-new-connection': { + id: 'connections-add-new-connection', + text: 'Add new connection', subTitle: 'Browse and create new connections', - url: '/connections/connect-data', + url: '/connections/add-new-connection', }, cfg: { id: 'cfg', diff --git a/public/app/features/connections/constants.ts b/public/app/features/connections/constants.ts index faa38dfc749..f24f4015c8d 100644 --- a/public/app/features/connections/constants.ts +++ b/public/app/features/connections/constants.ts @@ -4,16 +4,13 @@ export const ROUTE_BASE_ID = 'connections'; export const ROUTES = { Base: `/${ROUTE_BASE_ID}`, - // Your Connections - YourConnections: `/${ROUTE_BASE_ID}/your-connections`, + // Your Datasources + DataSources: `/${ROUTE_BASE_ID}/your-datasources`, + DataSourcesNew: `/${ROUTE_BASE_ID}/your-datasources/new`, + DataSourcesEdit: `/${ROUTE_BASE_ID}/your-datasources/edit/:uid`, + DataSourcesDashboards: `/${ROUTE_BASE_ID}/your-datasources/edit/:uid/dashboards`, - // Your Connections / Datasources - DataSources: `/${ROUTE_BASE_ID}/your-connections/datasources`, - DataSourcesNew: `/${ROUTE_BASE_ID}/your-connections/datasources/new`, - DataSourcesEdit: `/${ROUTE_BASE_ID}/your-connections/datasources/edit/:uid`, - DataSourcesDashboards: `/${ROUTE_BASE_ID}/your-connections/datasources/edit/:uid/dashboards`, - - // Connect Data - ConnectData: `/${ROUTE_BASE_ID}/connect-data`, + // Add new connection + AddNewConnection: `/${ROUTE_BASE_ID}/add-new-connection`, DataSourcesDetails: `/${ROUTE_BASE_ID}/datasources/:id`, } as const; diff --git a/public/app/features/connections/hooks/useDataSourceSettingsNav.ts b/public/app/features/connections/hooks/useDataSourceSettingsNav.ts index cab99f7e016..eb745955dd4 100644 --- a/public/app/features/connections/hooks/useDataSourceSettingsNav.ts +++ b/public/app/features/connections/hooks/useDataSourceSettingsNav.ts @@ -23,12 +23,12 @@ export function useDataSourceSettingsNav(pageId?: string) { active: true, children: (nav.main.children || []).map((navModelItem) => ({ ...navModelItem, - url: navModelItem.url?.replace('datasources/edit/', '/connections/your-connections/datasources/edit/'), + url: navModelItem.url?.replace('datasources/edit/', '/connections/your-datasources/edit/'), })), }; return { - navId: 'connections-your-connections-datasources', + navId: 'connections-your-datasources', pageNav, }; } diff --git a/public/app/features/connections/pages/AddNewConnectionPage.tsx b/public/app/features/connections/pages/AddNewConnectionPage.tsx new file mode 100644 index 00000000000..84af4f0ea99 --- /dev/null +++ b/public/app/features/connections/pages/AddNewConnectionPage.tsx @@ -0,0 +1,15 @@ +import * as React from 'react'; + +import { Page } from 'app/core/components/Page/Page'; + +import { AddNewConnection } from '../tabs/ConnectData'; + +export function AddNewConnectionPage() { + return ( + + + + + + ); +} diff --git a/public/app/features/connections/pages/ConnectDataPage.tsx b/public/app/features/connections/pages/ConnectDataPage.tsx deleted file mode 100644 index ef8a25d8dbf..00000000000 --- a/public/app/features/connections/pages/ConnectDataPage.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import * as React from 'react'; - -import { Page } from 'app/core/components/Page/Page'; - -import { ConnectData } from '../tabs/ConnectData'; - -export function ConnectDataPage() { - return ( - - - - - - ); -} diff --git a/public/app/features/connections/pages/DataSourceDetailsPage.tsx b/public/app/features/connections/pages/DataSourceDetailsPage.tsx index 09e7a1795b5..1380efd0a30 100644 --- a/public/app/features/connections/pages/DataSourceDetailsPage.tsx +++ b/public/app/features/connections/pages/DataSourceDetailsPage.tsx @@ -8,11 +8,11 @@ import { StoreState, useSelector, AppNotificationSeverity } from 'app/types'; import { ROUTES } from '../constants'; export function DataSourceDetailsPage() { - const overrideNavId = 'standalone-plugin-page-/connections/connect-data'; + const overrideNavId = 'standalone-plugin-page-/connections/add-new-connection'; const { id } = useParams<{ id: string }>(); const navIndex = useSelector((state: StoreState) => state.navIndex); const isConnectDataPageOverriden = Boolean(navIndex[overrideNavId]); - const navId = isConnectDataPageOverriden ? overrideNavId : 'connections-connect-data'; // The nav id changes (gets a prefix) if it is overriden by a plugin + const navId = isConnectDataPageOverriden ? overrideNavId : 'connections-add-new-connection'; // The nav id changes (gets a prefix) if it is overriden by a plugin return ( Maybe you mistyped the URL or the plugin with the id is unavailable.
- To see a list of available datasources please click here. + To see a list of available datasources please click here. ); } diff --git a/public/app/features/connections/pages/DataSourcesListPage.tsx b/public/app/features/connections/pages/DataSourcesListPage.tsx index 394fc16ab2a..bfbe77d44d7 100644 --- a/public/app/features/connections/pages/DataSourcesListPage.tsx +++ b/public/app/features/connections/pages/DataSourcesListPage.tsx @@ -11,7 +11,7 @@ export function DataSourcesListPage() { const actions = dataSourcesCount > 0 ? : undefined; return ( - + diff --git a/public/app/features/connections/pages/NewDataSourcePage.tsx b/public/app/features/connections/pages/NewDataSourcePage.tsx index 08c659004e2..b16a6234f6a 100644 --- a/public/app/features/connections/pages/NewDataSourcePage.tsx +++ b/public/app/features/connections/pages/NewDataSourcePage.tsx @@ -6,7 +6,7 @@ import { NewDataSource } from 'app/features/datasources/components/NewDataSource export function NewDataSourcePage() { return ( diff --git a/public/app/features/connections/pages/index.tsx b/public/app/features/connections/pages/index.tsx index 1fdd3106fc5..64d2ec896ec 100644 --- a/public/app/features/connections/pages/index.tsx +++ b/public/app/features/connections/pages/index.tsx @@ -1,4 +1,4 @@ -export { ConnectDataPage } from './ConnectDataPage'; +export { AddNewConnectionPage } from './AddNewConnectionPage'; export { DataSourceDetailsPage } from './DataSourceDetailsPage'; export { DataSourcesListPage } from './DataSourcesListPage'; export { DataSourceDashboardsPage } from './DataSourceDashboardsPage'; diff --git a/public/app/features/connections/tabs/ConnectData/ConnectData.test.tsx b/public/app/features/connections/tabs/ConnectData/ConnectData.test.tsx index f726b80774a..9c1a89f4d45 100644 --- a/public/app/features/connections/tabs/ConnectData/ConnectData.test.tsx +++ b/public/app/features/connections/tabs/ConnectData/ConnectData.test.tsx @@ -9,7 +9,7 @@ import { CatalogPlugin } from 'app/features/plugins/admin/types'; import { configureStore } from 'app/store/configureStore'; import { AccessControlAction } from 'app/types'; -import { ConnectData } from './ConnectData'; +import { AddNewConnection } from './ConnectData'; jest.mock('app/features/datasources/api'); @@ -19,7 +19,7 @@ const renderPage = (plugins: CatalogPlugin[] = []): RenderResult => { return render( - + ); }; @@ -32,7 +32,7 @@ const mockCatalogDataSourcePlugin = getCatalogPluginMock({ const originalHasPermission = contextSrv.hasPermission; -describe('Connect Data', () => { +describe('Add new connection', () => { beforeEach(() => { contextSrv.hasPermission = originalHasPermission; }); diff --git a/public/app/features/connections/tabs/ConnectData/ConnectData.tsx b/public/app/features/connections/tabs/ConnectData/ConnectData.tsx index 64090c47740..52e2ac97b0f 100644 --- a/public/app/features/connections/tabs/ConnectData/ConnectData.tsx +++ b/public/app/features/connections/tabs/ConnectData/ConnectData.tsx @@ -27,7 +27,7 @@ const getStyles = () => ({ `, }); -export function ConnectData() { +export function AddNewConnection() { const [searchTerm, setSearchTerm] = useState(''); const [isNoAccessModalOpen, setIsNoAccessModalOpen] = useState(false); const [focusedItem, setFocusedItem] = useState(null); diff --git a/public/app/features/connections/tabs/ConnectData/NoAccessModal/NoAccessModal.tsx b/public/app/features/connections/tabs/ConnectData/NoAccessModal/NoAccessModal.tsx index c705162bcb1..e386f7b5a1f 100644 --- a/public/app/features/connections/tabs/ConnectData/NoAccessModal/NoAccessModal.tsx +++ b/public/app/features/connections/tabs/ConnectData/NoAccessModal/NoAccessModal.tsx @@ -91,7 +91,7 @@ export function NoAccessModal({ item, isOpen, onDismiss }: NoAccessModalProps) {

Editors cannot add new connections. You may check to see if it is already configured in{' '} - Your Connections. + Your data sources.

To add a new connection, contact your Grafana admin.

diff --git a/public/app/features/datasources/components/DataSourceCategories.tsx b/public/app/features/datasources/components/DataSourceCategories.tsx index 812dcfdbe65..c6b84fcdf5e 100644 --- a/public/app/features/datasources/components/DataSourceCategories.tsx +++ b/public/app/features/datasources/components/DataSourceCategories.tsx @@ -19,7 +19,7 @@ export type Props = { export function DataSourceCategories({ categories, onClickDataSourceType }: Props) { const moreDataSourcesLink = config.featureToggles.dataConnectionsConsole - ? `${ROUTES.ConnectData}?cat=data-source` + ? `${ROUTES.AddNewConnection}?cat=data-source` : '/plugins?filterBy=all&filterByType=datasource&utm_source=grafana_add_ds'; return ( diff --git a/public/app/features/plugins/admin/pages/Browse.tsx b/public/app/features/plugins/admin/pages/Browse.tsx index f6996282216..8a78fc20c4d 100644 --- a/public/app/features/plugins/admin/pages/Browse.tsx +++ b/public/app/features/plugins/admin/pages/Browse.tsx @@ -67,7 +67,7 @@ export default function Browse({ route }: GrafanaRouteComponentProps): ReactElem const subTitle = config.featureToggles.dataConnectionsConsole ? (
Extend the Grafana experience with panel plugins and apps. To find more data sources go to{' '} - + Connections .