Skip to content

AMP-31123:Issue-Share M&E dashboard- open link leads to login page#4478

Open
brianbrix wants to merge 1 commit into
developfrom
fix/AMP-31123/Issue-Share-M&E-dashbaord
Open

AMP-31123:Issue-Share M&E dashboard- open link leads to login page#4478
brianbrix wants to merge 1 commit into
developfrom
fix/AMP-31123/Issue-Share-M&E-dashbaord

Conversation

@brianbrix
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.do when certain startup fetches fail.
  • Prevent a runtime crash when fetchFmReducer.data is still null by guarding .find(...) with optional chaining.
  • Fix the :id route definition to use the React Router v6 element prop 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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

3 participants