2022-10-05 09:56:58 +02:00
|
|
|
// The ID of the main nav-tree item (the main item in the NavIndex)
|
|
|
|
|
export const ROUTE_BASE_ID = 'connections';
|
|
|
|
|
|
|
|
|
|
export const ROUTES = {
|
2022-11-10 11:14:23 +01:00
|
|
|
Base: `/${ROUTE_BASE_ID}`,
|
|
|
|
|
|
2023-05-03 09:39:13 +02:00
|
|
|
// Data sources
|
|
|
|
|
DataSources: `/${ROUTE_BASE_ID}/datasources`,
|
|
|
|
|
DataSourcesNew: `/${ROUTE_BASE_ID}/datasources/new`,
|
|
|
|
|
DataSourcesEdit: `/${ROUTE_BASE_ID}/datasources/edit/:uid`,
|
|
|
|
|
DataSourcesDashboards: `/${ROUTE_BASE_ID}/datasources/edit/:uid/dashboards`,
|
2022-11-10 11:14:23 +01:00
|
|
|
|
2023-05-02 10:51:59 +02:00
|
|
|
// Add new connection
|
|
|
|
|
AddNewConnection: `/${ROUTE_BASE_ID}/add-new-connection`,
|
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
|
|
|
DataSourcesDetails: `/${ROUTE_BASE_ID}/datasources/:id`,
|
2023-08-21 15:58:02 +02:00
|
|
|
|
|
|
|
|
// Outdated
|
|
|
|
|
ConnectDataOutdated: `/${ROUTE_BASE_ID}/connect-data`,
|
|
|
|
|
YourConnectionsOutdated: `/${ROUTE_BASE_ID}/your-connections`,
|
2022-10-05 09:56:58 +02:00
|
|
|
} as const;
|