-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix(pwa): fix SW update UX #672
Conversation
// Makes sure to take control of available clients when the SW is activated | ||
clientsClaim() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this prevents automatic reload on first installation (because of the resulting controllerchange
event that triggers a reload). clients.claim()
is now only used in response to a user confirming reload after first activation (paired with a reload for all tabs, if a user confirms that too) -- see its implementation below in utils.js and usage in OfflineInterface > init > handleNewSW > onConfirm
Includes OfflineInterface and adapter refactor to use DHIS UI. LIBS-237
e3d32ad
to
db1f8cb
Compare
permanent: true, | ||
actions: [ | ||
{ label: i18n.t('Update and reload'), onClick: onConfirm }, | ||
{ label: i18n.t('Not now'), onClick: () => {} }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will clicking the Not now
action close the alert or do we need to implement hide
for alerts? If it currently does not work then we can omit this action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It closes the alert; the 'Not now' was part of Joe's design spec (although I'm not sure an onClick
prop is necessary for a no-op action on the alert bar, now that I think about it -- I'll take a look)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like onClick
is required
🎉 This PR is included in version 8.2.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Addresses https://jira.dhis2.org/browse/LIBS-237
Includes a substantial refactor of
OfflineInterface
to become a better, well, offline interface; so update logic can be moved to a React component in the App Adapter that can use things like alerts and DHIS2 UI elements. Update alert logic can be removed from the App-Runtime components now too, which simplifies this update flow and makes it much easier to reason about.To do:
init
handling in App Runtime (fix(offline): remove offlineInterface.init() functionality app-runtime#1041)init
here and bump App Runtime dependency inshell
Known issues:
To test:
pwa
andadapter
packages, then start PWA app (with--force
)