Skip to content

Neeraj - Added Unsaved Changes for Refresh And Navigation Events#4414

Merged
one-community merged 4 commits intodevelopmentfrom
Neeraj_Add_Unsaved_Changes_Warning
Dec 17, 2025
Merged

Neeraj - Added Unsaved Changes for Refresh And Navigation Events#4414
one-community merged 4 commits intodevelopmentfrom
Neeraj_Add_Unsaved_Changes_Warning

Conversation

@Neeraj-Kondaveeti
Copy link
Copy Markdown
Contributor

@Neeraj-Kondaveeti Neeraj-Kondaveeti commented Nov 18, 2025

Description

image

Related PRS (if any):

This frontend PR is related to the development backend PR.
To test this frontend PR you need to checkout the development backend PR.

Main changes explained:

  • Updated JobFormbuilder.jsx to include an unsaved changes detection system.
  • Added page-refresh and internal navigation warnings using beforeunload and prompt tag
  • Performed small code clean ups and stability fixes while keeping all original behaviour intact.

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. log as admin user
  5. Navigate to : http://localhost:5173/jobformbuilder
  6. Perform the following checks:
    • Type into Field Label, Template Name -> Try refreshing the page -> Warning dialog should appear.
    • Type into Field Label, Template Name -> Try navigating to another page -> Warning should appear.

Screenshots or videos of changes:

image

This should appear when trying to navigating to another page internally such as clicking on Dashboard or Other Links:

image

Note:

This PR adds safety checks to prevent accidental loss of form configuration changes. No existing form behaviour,styles or backend integrations were modified outside this task's scope.

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 18, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 844e268
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69253356652ba60008ab650f
😎 Deploy Preview https://deploy-preview-4414--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Neeraj-Kondaveeti Neeraj-Kondaveeti added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Nov 18, 2025
Copy link
Copy Markdown
Contributor

@Prem203 Prem203 left a comment

Choose a reason for hiding this comment

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

Reviewed the PR with an admin account. The page gives a warning when trying to change or refresh page after changes are made to field label and template name.

Although, once I made the changes and removed them from template name, the dialog box still pops up. This should not happen as the state of the textbox has changed. The change in job title does not show a warning when refreshing as mentioned in the description.

image image image

Anusha-Gali
Anusha-Gali previously approved these changes Nov 22, 2025
Copy link
Copy Markdown

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

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

Hi Neeraj,

I have reviewed your PR locally and it works as expected in both the modes for the text boxes, by showing warnings for both reload and navigate
Screenshot 2025-11-21 at 9 03 58 PM
Screenshot 2025-11-21 at 9 04 30 PM

@sonarqubecloud
Copy link
Copy Markdown

@Neeraj-Kondaveeti
Copy link
Copy Markdown
Contributor Author

Reviewed the PR with an admin account. The page gives a warning when trying to change or refresh page after changes are made to field label and template name.

Although, once I made the changes and removed them from template name, the dialog box still pops up. This should not happen as the state of the textbox has changed. The change in job title does not show a warning when refreshing as mentioned in the description.

image image image

Hi Prem , I hope you are doing well. Thank You for the detailed review.

I have implemented the requested changes:

  • The warning dialog no longer appears after clearing the Template Name field (or any other field under Form Creation.
  • The Job Title textbox is not part of the form state and is intentionally excluded from unsaved-changes detection. I have updated the PR description to clarify this so reviewers don’t expect the Job Title field to trigger a warning.
    All other form fields now correctly trigger or dismiss the unsaved-changes prompt exactly as expected.
    Could you please re-test when you get a chance and let me know if everything looks good ?
    Thank you!

Copy link
Copy Markdown

@IndraAnuraag9 IndraAnuraag9 left a comment

Choose a reason for hiding this comment

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

I have reviewed this PR locally using an Admin account. Everything works as intended. Warnings are correctly shown for unsaved changes when reloading or navigating to a different page.
Screenshot 2025-11-27 at 9 57 17 PM
Screenshot 2025-11-27 at 9 57 51 PM

@one-community
Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community one-community merged commit 9ec8333 into development Dec 17, 2025
10 checks passed
@one-community one-community changed the title Neeraj_Added_Unsaved_Changes_for_Refresh_And_Navigation_Events Neeraj - Added Unsaved Changes for Refresh And Navigation Events Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants