AMP-31123:Issue-Share M&E dashboard- open link leads to login page#4478
Open
brianbrix wants to merge 1 commit into
Open
AMP-31123:Issue-Share M&E dashboard- open link leads to login page#4478brianbrix wants to merge 1 commit into
brianbrix wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an issue in the NDD/M&E dashboard share flow where navigating to a shared link could fail to render the dashboard (and/or crash early), by fixing routing and making startup/data-loading more resilient.
Changes:
- Add error awareness to the dashboard startup flow and redirect to
/login.dowhen certain startup fetches fail. - Prevent a runtime crash when
fetchFmReducer.datais stillnullby guarding.find(...)with optional chaining. - Fix the
:idroute definition to use the React Router v6elementprop so shared-link routes render correctly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| amp/TEMPLATE/reampv2/packages/reampv2-app/src/modules/ndddashboard/components/StartUp.jsx | Adds fmReducerError/settingsError handling and redirects to login on error during startup loading. |
| amp/TEMPLATE/reampv2/packages/reampv2-app/src/modules/ndddashboard/components/NDDDashboardHome.jsx | Guards access checks against fetchFmReducer.data being null to avoid .find crashes. |
| amp/TEMPLATE/reampv2/packages/reampv2-app/src/modules/ndddashboard/components/NDDDashboard.router.jsx | Corrects the shared-link route to use element (React Router v6) instead of an invalid component prop usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
42
to
+46
| if (translationPending || programConfigurationPending || fmReducerPending || sectorClassificationPending || settingsPending) { | ||
| return (<Loading />); | ||
| } else if (fmReducerError || settingsError) { | ||
| window.location.replace('/login.do'); | ||
| return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.