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 ModuleRecoveryAlert
to show with notices
#5550
Comments
ModuleRecoveryAlert
to show with notices
Hi @jimmymadon, I've spotted a few issues with this IB. A couple of minor ones - the link to the branch doesn't work, and More substantially though, I can see some problems with the proposed approach of rendering the Note that although we want to enable the dismiss button, we don't want the Recover button to dismiss the banner - this would cause problems in usage, as we need the banner to stick around after pressing Recover in order to show any errors or remaining unrecovered modules, etc. However in order to show the dismiss button the Additionally, in order to display the CTA the What to do?Taking the above into consideration, it occurs to me that a viable solution could be to leave the Recover button as it is now, and instead pass a new prop into However...There is one more thing we might want to consider which is the spinner placement. If we go ahead with the An alternative placement could be to the right of both buttons, it looks slightly out of place at to me at first glance but is probably OK, however this would require more changes to Or maybe we could consider a totally different placement. I'm not sure about this, so am going to ask @aaemnnosttv for his thoughts on this one. |
Thanks @techanvil – there are indeed some tricky bits to this that I didn't foresee. It seems to me that the first part which is making this more difficult than it needs to be is the added spinner, but we'll come back to that. I feel like the Recover action should be able to work within the notice's In this case, I think we can work around the dismissal by allowing the const { dismiss = true } = await onCTAClick( e ) || {} The only part left to address is the spinner, which can probably move to the I think that addresses everything here, and going forward |
Thanks for taking a look at this @aaemnnosttv. I like your proposed solution, bringing the spinner into |
That's a good point, although in most cases I would expect a user would be recovering all available modules (as the default unless they unselected some), in which case the entire notification would disappear so I think this is an acceptable edge case for now. I would argue this flicker from fast requests is possible in many other places today as well. IMO it would be good to introduce a small amount of artificial latency in such cases as a kind of minimum visible time to improve the stability of the interface, but I'd say that's out of scope here. |
@aaemnnosttv @techanvil Thanks both for these suggestions - have updated the IB to incorporate them. 👍 For some of these reasons, we can consider using buttons which show the loading spinner within the button itself preventing any awkward shifts or needing any additional space. |
Thanks @jimmymadon – this looks good overall, just one question.
Do we need an added prop for this? Are you suggesting this would set the |
@aaemnnosttv Makes sense since we've moved the spinner to Banner Notification. Thanks - have updated the IB. |
Great, thanks @jimmymadon 👍 IB ✅ |
QA Update: ✅Verified:
|
Bug Description
Asana bug bash issue: https://app.asana.com/0/1202258919887896/1202583202387112 please see Asana task for background and additional comments.
It's possible to encounter multiple stacked notices, as per the screenshot within this task.
In my case I never dismissed the "Congrats" notice, and then from another admin account disconnected from SK. When revisiting and refreshing the dashboard for admin2, I encounter the module recovery notice below the congrats notice.
See #4689 for context
Steps to reproduce
Screenshots
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
<BannerNotifications>
while preserving the same conditions for display (one exception here is theisDashboard
check as banner notifications are only shown on the main dashboard)CoreSiteBannerNotifications
Remind me later
Implementation Brief
ModuleRecoveryAlert
intoBannerNotifications
.<ModuleRecovery>
component, the "Recover"Button
component is defined and passed down within thechildren
prop ofBannerNotification
instead using itsctaLabel
/onCTAClick
props. To fix this, definectaLabel
andonCTAClick
only when the "Recover"<Button>
component is defined within thechildren
variable. If defined, thectaLabel
should always be__( 'Recover', 'google-site-kit' )
and theonCTAClick
prop should always behandleRecoverModules
. Otherwise they should be false. Pass these two variables as props to theBannerNotification
component.handleRecoverModules
so that the callback returns an object{ dismiss: false }
. Within<BannerNotification>
, modifyhandleCTAClick
so as to expect an object fromonCTAClick()
, i.e.const { dismiss = true } = await onCTAClick( e ) || {}
. Read this comment for better context.<BannerNotification>
, add the<Spinner>
component after thectaLink
Button
component (and before theDismissLinkComponent
). Use a local state variable, sayshowSpinner
which by default is false. Set this variable to true within thehandleCTAClick()
function, before the call toonCTAClick
. Set this back to false after the call as mentioned in this comment. Use the same state variable to disable the CTA button.Test Coverage
QA Brief
ModuleRecoveryAlert
and show error message to the user. #5318) are displayed correctly (use the last two steps in that issue's QAB).Changelog entry
The text was updated successfully, but these errors were encountered: