-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
"Create screen" component context option #14255
base: master
Are you sure you want to change the base?
Conversation
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.
Nice one Dean! Happy to get this in if we remove the context stuff for now. Also one wee change suggested which should remove a bunch of code as we already have a utility for generating sequential names 👌
candidateUrl = makeCandidateUrl(screen, ++suffix) | ||
let candidateUrl = screenStore.makeCandidateUrl(screen, suffix) | ||
while (screenStore.hasExistingUrl(candidateUrl, screenAccessRole)) { | ||
candidateUrl = screenStore.makeCandidateUrl(screen, ++suffix) |
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.
Rather than all this logic (some of which I know was pre-existing), we should use our getSequentialName
utility which is designed to do exactly this!
globalContext.actions.clearComponentContext() | ||
} | ||
|
||
$: purgeGlobalComponentContext($screenStore?.activeScreen?._id) |
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.
I understand the purpose of this, but I think we should come up with a cleaner way of handling it than trying to whitelist all properties that we want to persist between screen changes. I have a few ideas in mind... For now I think it would be better to take this out of this PR as it's a separate issue, and we can tackle it elsewhere.
Description
A
Create screen
option has been added to the component context menu in the builder. Selecting the option will:Basic
role/new-screen
. If you create multiple screens in a row a suffix will be appended to avoid collision e.g./new-screen-2
Addresses
Fix
- component context options were being cached between screens. When pasting or cloning into new screens, it wasn't immediately clear what elements had become broken due to broken context references until full page refresh. The component options will now clear when the active screen is changed.Screenshots
Launchcontrol
Create a new screen from a selected component