Skip to content

Prevent loss of unsaved model configuration changes - #63

Open
utsinboots wants to merge 1 commit into
OSeMOSYS:masterfrom
utsinboots:fix/unsaved-model-config-guard
Open

Prevent loss of unsaved model configuration changes#63
utsinboots wants to merge 1 commit into
OSeMOSYS:masterfrom
utsinboots:fix/unsaved-model-config-guard

Conversation

@utsinboots

Copy link
Copy Markdown

Summary

What it changes:
-Adds NavigationGuard.Class.js to prevent users from leaving model configuration with unsaved changes.
-Adds one confirmation-dialog method to Message.Class.js.
-Refactors existing model-data collection in AddCase.js into a helper.
-Adds a guard around the existing hash-based navigation in Routes.Class.js.
-Does not change the backend, API endpoints, stored JSON format, model schema, or simulation workflow.

What it does:
-Warns users before leaving Model Configuration with unsaved changes.
-Supports saving or discarding changes before navigating.
-Covers page navigation, model selection, creating a new model, and browser reload or close.

Testing
-Verified that navigation without changes proceeds normally.
-Verified that unsaved changes trigger a confirmation prompt.
-Verified the Save and Don't save actions.
-Verified model selection, new model, browser navigation, and page reload behavior.

(cherry picked from commit c44061e8e9304844831ead78fc8be6b426e0455f)
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.

1 participant