Feature/refresh popup on version change #240
Merged
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.
This pull request introduces a new mechanism to notify users when a new version of the frontend is available, prompting them to refresh the page to get the latest updates. It does this by adding a version popup component, updating the build process to include version information, and adding the necessary dependencies for the popup functionality.
Version update notification feature:
useVersionPopupthat checks for frontend updates by comparing the current version tag in/version.jsonwith the last seen version in local storage, and displays a popup usingreact-update-popupwhen a new version is available. (frontend/src/hooks/useVersionPopup.jsx)VersionPopupcomponent into the mainAppcomponent so users are notified of new frontend versions. (frontend/src/App.jsx)Build and environment improvements:
APP_VERSION_TAG,APP_COMMIT,APP_BRANCH, and build file) into the environment and write it to/usr/share/nginx/html/version.jsonfor use by the update notification system. (frontend/Dockerfile.prod)Dependency management:
react-update-popupas a new dependency to support the version notification popup. (frontend/package.json,frontend/package-lock.json) [1] [2] [3]swrand updateduse-sync-external-storeto support the new popup component's requirements. (frontend/package-lock.json) [1] [2]