Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CARE prompt when new version available #4298

Merged
merged 8 commits into from
Dec 20, 2022

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Dec 13, 2022

Proposed Changes

Technical changes:

  • Uses the existing /build-meta.json generation flow.
  • Finds out the latest available version from the /build-meta.json file and compares it with the app-version stored in localStorage. If both versions mismatch (or even if app-version does not exist in localStorage) hasUpdate is set to true, which shows the popup.
  • Once updateApp is invoked by button onClick, it empties the cache and invokes window.locations.reload, and sets two items in localStorage:
app-version: <the new version from build-meta.json>
app-updated: true
  • After the app is loaded again and after a set timeout, app-updated is cleared.
  • app-updated key is used just to show the update success popup when the app has been updated after the reload.
2022-12-13.16-45-26.mp4

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

@rithviknishad rithviknishad requested a review from a team December 13, 2022 10:50
@rithviknishad rithviknishad requested a review from a team as a code owner December 13, 2022 10:50
@vercel
Copy link

vercel bot commented Dec 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
care-storybook ✅ Ready (Inspect) Visit Preview Dec 15, 2022 at 7:28AM (UTC)

@netlify
Copy link

netlify bot commented Dec 13, 2022

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 9e983a8
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/639acc6a4fc55200098a98da
😎 Deploy Preview https://deploy-preview-4298--care-egov-staging.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 site settings.

@rithviknishad
Copy link
Member Author

@gigincg regd. if build-meta.json is cached: Nope, its not.

image

Copy link
Member

@shivankacker shivankacker left a comment

Choose a reason for hiding this comment

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

LGTM, great stuff! 🚀
Maybe we can provide an option to snooze updates. Snoozing will make it popup every 5 hours or so. User can then manually update the software in the user account page. What say?

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Dec 15, 2022
@github-actions
Copy link

👋 Hi, @rithviknishad,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@rithviknishad rithviknishad removed the merge conflict pull requests with merge conflict label Dec 15, 2022
@sonarcloud
Copy link

sonarcloud bot commented Dec 15, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
7.1% 7.1% Duplication

@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit fa60cfc into ohcnetwork:develop Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants