grafana/public/app/features/connections
mikkancso 899b035087
Connections: Update datasource details url (#60521)
update datasource details url

My ultimate goal is to make the cloud-onboarding plugin link to
datasource details page inside Connections.
I tried to do that, so that it linked to
`/connections/connect-data/datasources/:id`, but it didn't work. Details
below:

We have a problem with the datasources details page url:
If the plugin is not present, then the
`/connections/connect-data/datasources/:id` url is finely served by Grafana.
However, when the plugin is present, we register a Route entry like this:
`<Route exact=false path='/connections/connect-data' component={AppPlugin} />`
And this entry will be higher in the routes list than the datasources Route.
This means that every path under `/connections/connect-data` will be served
by the plugin. That's why exact is false. Otherwise the plugin couldn't
serve integrations details at `connect-data/infrastructure/:id`.
So `exact=false` is needed.

What can we do?
1. Put Grafana's Connection routes higher in the list of routes.
2. Find a different URL for datasources details page

Unfortunately, we can't do 1., because:
Routes roughly look like this (in this order):
- exact: false, path: connections/connect-data, component: AppPlugin
- exact: false, path: connections/your-connections/infrastructure,
    component: AppPlugin
- exact: false, path: connections, component: Connections
So if a request comes for `/connections` or `/connections/your-connections`
or `/connections/your-connections/datasources`, it will be served by
Connections.

Therefore, we can't really put the route for Connections higher in the list
of routes, because then it will match all routes beginning with
`/connections`, and the plugin's routes will have no effect.

So the only alternative left is to find another path :/

Since we set the DataSourceDetailsPage's navId explicitly to
`connections-connect-data`, the breadcrumbs will continue to show the
data source page as a child item of the Connect Data page :)
2023-01-03 13:57:16 +01:00
..
__mocks__ Chore: Update version (#58750) 2022-11-15 10:03:05 -03:00
hooks refactor: rename Data Connections to Connections (#56353) 2022-10-05 09:56:58 +02:00
pages DataSources: fix DataSourceAddButton component (#60176) 2022-12-15 09:25:03 +01:00
tabs/ConnectData Connections: Support standalone plugin pages (#57772) 2022-11-10 11:14:23 +01:00
Connections.test.tsx Connections: Render a landing page for pages without actual content (#60369) 2022-12-16 11:00:35 +01:00
Connections.tsx Connections: Render a landing page for pages without actual content (#60369) 2022-12-16 11:00:35 +01:00
constants.ts Connections: Update datasource details url (#60521) 2023-01-03 13:57:16 +01:00
routes.tsx Connections: Support standalone plugin pages (#57772) 2022-11-10 11:14:23 +01:00