-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to react-router@6
#979
base: main
Are you sure you want to change the base?
Changes from all commits
ba787a7
41fc361
e57dabc
abedd6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
import * as React from 'react'; | ||
import { Redirect, Route, Switch } from 'react-router-dom'; | ||
import { prefixRoute } from '../../utils/utils.routing'; | ||
import { Route, Routes } from 'react-router-dom'; | ||
import { ROUTES } from '../../constants'; | ||
import { DemoListPage } from '../../pages/DemoListPage'; | ||
import GrafanaMonitoringApp from '../../monitoring-app/GrafanaMonitoringApp'; | ||
import { ReactDemoPage } from '../../react-demo/Home'; | ||
|
||
export const Routes = () => { | ||
export function AppRoutes() { | ||
return ( | ||
<Switch> | ||
{/* Default page */} | ||
<Route path={prefixRoute(`${ROUTES.Demos}`)} component={DemoListPage} /> | ||
<Route path={prefixRoute(`${ROUTES.GrafanaMonitoring}`)} component={GrafanaMonitoringApp} /> | ||
<Route path={prefixRoute(`${ROUTES.ReactDemo}`)} component={ReactDemoPage} /> | ||
<Redirect to={prefixRoute(ROUTES.Demos)} /> | ||
</Switch> | ||
<Routes> | ||
<Route path={`${ROUTES.Demos}/*`} Component={DemoListPage} /> | ||
<Route path={`${ROUTES.GrafanaMonitoring}/*`} Component={GrafanaMonitoringApp} /> | ||
<Route path={`${ROUTES.ReactDemo}/*`} Component={ReactDemoPage} /> | ||
{/* <Redirect to={prefixRoute(ROUTES.Demos)} /> */} | ||
</Routes> | ||
); | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ export function getVariablesDemo(defaults: SceneAppPageState) { | |
new SceneAppPage({ | ||
title: 'Async and chained', | ||
url: `${defaults.url}/query`, | ||
routePath: 'query', | ||
getScene: () => { | ||
return new EmbeddedScene({ | ||
controls: [new VariableValueSelectors({})], | ||
|
@@ -116,6 +117,7 @@ export function getVariablesDemo(defaults: SceneAppPageState) { | |
new SceneAppPage({ | ||
title: 'Data source and textbox', | ||
url: `${defaults.url}/ds`, | ||
routePath: 'ds', | ||
getScene: () => { | ||
return new EmbeddedScene({ | ||
controls: [new VariableValueSelectors({})], | ||
|
@@ -158,6 +160,7 @@ export function getVariablesDemo(defaults: SceneAppPageState) { | |
new SceneAppPage({ | ||
title: 'Search filter', | ||
url: `${defaults.url}/search`, | ||
routePath: 'search', | ||
getScene: () => { | ||
return new EmbeddedScene({ | ||
controls: [new VariableValueSelectors({})], | ||
|
@@ -191,6 +194,7 @@ export function getVariablesDemo(defaults: SceneAppPageState) { | |
new SceneAppPage({ | ||
title: 'Many variable options', | ||
url: `${defaults.url}/many-values`, | ||
routePath: 'many-values', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if we shouldn't make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I think that's a good point, I couldn't think of any scenario where it wouldn't be necessary from now on (unless I am missing something). It could also help with migration I think for plugins (showing type errors for wherever it's missing). What do you think @torkelo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dprokop yea, I agree. Should be mandatory |
||
getScene: () => { | ||
return new EmbeddedScene({ | ||
controls: [new VariableValueSelectors({})], | ||
|
@@ -224,6 +228,7 @@ export function getVariablesDemo(defaults: SceneAppPageState) { | |
new SceneAppPage({ | ||
title: 'Many adhoc variable values', | ||
url: `${defaults.url}/many-adhoc-values`, | ||
routePath: 'many-adhoc-values', | ||
getScene: () => { | ||
return new EmbeddedScene({ | ||
controls: [new VariableValueSelectors({})], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add a v6 redirect here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just make
DemoListPage
a fallback page instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's still missing, isn' it?