-
Notifications
You must be signed in to change notification settings - Fork 446
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
feat(releases, core): supporting banner display for remote deleted bundles #7371
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
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.
Most of the logic here is a copy from the existing DocumentDeletedBanner
and useBundleDeletedToast
. However now there is a single entry point - DocumentDeletedBanners
(there are 2 banners that might display for a deleted document - bundle deleted, and non-bundle deleted).
A check if done to see if the bundle has been deleted, and then the relevant Banner component is rendered
) | ||
|
||
useEffect(() => { | ||
if (currentGlobalBundleSlug !== LATEST.slug) { |
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.
The checkedout bundle slug is the version. Latest ie. draft slug, is not considered checkedout, since it's the default and fallback, so the state value never reflects drafts. This allows for support in cases where usePerspective
returns drafts
quicker than deletedBundles
updates, and in this case the remote deleted bundle would never be tracked and the banner would never be displayed
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.
Great point, I think that adding a similar comment on the code itself would do us good for the future so we can keep this context :)
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.
- Comment on the esoteric logic in
DeletedDocumentBanners
1d121ff
to
c0a4232
Compare
Component Testing Report Updated Aug 19, 2024 12:13 PM (UTC)
|
c0a4232
to
2ccf035
Compare
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.
Logic and render moved to DeletedDocumentBanners.DeletedDocumentBanner
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.
🚀 great job!
…ndles (#7371) * feat(releases, core): remote deleted version documents will show as banner instead of toast warning * chore(releases, core): using UI components where available and supported * chore(core, releases): removing padding and using ui-component buttons * tests(structure): adding tests for new deleted document banner consolidation * chore(structure): fixing test imports and mocks
…ndles (#7371) * feat(releases, core): remote deleted version documents will show as banner instead of toast warning * chore(releases, core): using UI components where available and supported * chore(core, releases): removing padding and using ui-component buttons * tests(structure): adding tests for new deleted document banner consolidation * chore(structure): fixing test imports and mocks
…ndles (#7371) * feat(releases, core): remote deleted version documents will show as banner instead of toast warning * chore(releases, core): using UI components where available and supported * chore(core, releases): removing padding and using ui-component buttons * tests(structure): adding tests for new deleted document banner consolidation * chore(structure): fixing test imports and mocks
…ndles (#7371) * feat(releases, core): remote deleted version documents will show as banner instead of toast warning * chore(releases, core): using UI components where available and supported * chore(core, releases): removing padding and using ui-component buttons * tests(structure): adding tests for new deleted document banner consolidation * chore(structure): fixing test imports and mocks
…ndles (#7371) * feat(releases, core): remote deleted version documents will show as banner instead of toast warning * chore(releases, core): using UI components where available and supported * chore(core, releases): removing padding and using ui-component buttons * tests(structure): adding tests for new deleted document banner consolidation * chore(structure): fixing test imports and mocks
…ndles (#7371) * feat(releases, core): remote deleted version documents will show as banner instead of toast warning * chore(releases, core): using UI components where available and supported * chore(core, releases): removing padding and using ui-component buttons * tests(structure): adding tests for new deleted document banner consolidation * chore(structure): fixing test imports and mocks
…ndles (#7371) * feat(releases, core): remote deleted version documents will show as banner instead of toast warning * chore(releases, core): using UI components where available and supported * chore(core, releases): removing padding and using ui-component buttons * tests(structure): adding tests for new deleted document banner consolidation * chore(structure): fixing test imports and mocks
…ndles (#7371) * feat(releases, core): remote deleted version documents will show as banner instead of toast warning * chore(releases, core): using UI components where available and supported * chore(core, releases): removing padding and using ui-component buttons * tests(structure): adding tests for new deleted document banner consolidation * chore(structure): fixing test imports and mocks
…ndles (#7371) * feat(releases, core): remote deleted version documents will show as banner instead of toast warning * chore(releases, core): using UI components where available and supported * chore(core, releases): removing padding and using ui-component buttons * tests(structure): adding tests for new deleted document banner consolidation * chore(structure): fixing test imports and mocks
Description
When you have a document form open for a bundle which is deleted by another user, previously a toast would temporarily show to warn you that the version has been deleted. Now a banner will persist on the document until you navigate away- to make it clear that edits are no longer being applied to where you initially selected:
The exact UX, eg icon/copy/tone are not yet confirmed, but are small fast follows to apply.
What to review
BundleMenu
toBundlesMenu
to differentiate it fromBundleMenuButton
(BundlesMenu
is a list of Bundles anyway)setPerspective
as this was changing quite frequently forcing rerendersuseBundleDeletedToast
DeletedBundleBanner
to move this warning to a bannerTesting
Updated tests where necessary
Notes for release
N/A