Skip to content
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

tweak(tupaiaWeb): RN-1420: Use dashboard codes in URLs #5884

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

alexd-bes
Copy link
Contributor

Issue RN-1420: Use dashboard codes in URLs

Changes:

  • Added redirect handling to update URLs in Tupaia Web with correct dashboard code if url param is actually a name
  • Updated references to dashboardName to be dashboardCode

project?.code === projectCode &&
!activeDashboard;

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bonus to replace this but of code I reckon

@@ -92,7 +134,7 @@ export const Routes = () => {
<Route path="/:projectCode/:entityCode" element={<ProjectPageDashboardRedirect />} />

{/* The Dashboard has to be rendered below the Map, otherwise the map will re-mount on route changes */}
<Route path={ROUTE_STRUCTURE} element={<Dashboard />} />
<Route path={ROUTE_STRUCTURE} element={<DashboardNameToCodeRedirect />} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty minor but I was initially confused by the naming of DashboardNameToCodeRedirect as I didn't realise that it included the Dashboard component. Maybe it should be just called DashboardRoute or DashboardCodeRoute or something?

Copy link
Contributor

@tcaiger tcaiger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - it really helps having discussed it first 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants