Skip to content

fix: prevent plan page infinite loading on refresh before approval#1008

Open
NirajC-Microsoft wants to merge 1 commit into
feature/TAS27from
psl-bug-44078
Open

fix: prevent plan page infinite loading on refresh before approval#1008
NirajC-Microsoft wants to merge 1 commit into
feature/TAS27from
psl-bug-44078

Conversation

@NirajC-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

This pull request introduces enhancements to the user experience on the PlanPage component, specifically addressing how the page behaves during reloads and navigation. The changes ensure users are redirected appropriately and warned before leaving the page when a plan is pending approval.

User experience improvements:

  • Added logic to detect page reloads and automatically redirect users to the Home page if the plan is still pending approval, preventing users from accidentally staying on an incomplete approval page.
  • Implemented a warning dialog that prompts users before they refresh or close the page when a plan is pending approval, reducing the risk of losing unsaved progress.

Technical implementation:

  • Introduced a module-level hasHandledReload flag to ensure the reload redirect logic only executes once per actual page reload.
  • Added and cleaned up event listeners for the beforeunload event based on the approval state of the plan.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

This comment was marked as resolved.

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