-
Notifications
You must be signed in to change notification settings - Fork 2.8k
React on late read only guard rules #19621
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
Conversation
Added observation of read-only guard rules in the workspace split view variant selector to ensure read-only cultures are updated when rules change.
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.
Pull Request Overview
This PR ensures that the save button and variant selector respond to read-only guard rules added after initial render by observing guard rule changes and updating UI state accordingly.
- Save action now observes both
variantsandreadOnlyGuard.rules, running a check to enable/disable the save button based on variant permissions. - Split-view variant selector observes
readOnlyGuard.rulesto refresh read-only cultures dynamically. - Introduced private fields to store variants (and an unused read-only rules field).
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/actions/save.action.ts | Observe readOnlyGuard.rules and variants, add #checkReadOnlyGuardRules() to toggle save action. |
| src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view-variant-selector.element.ts | Add observer on readOnlyGuard.rules to call #setReadOnlyCultures when rules change. |
Comments suppressed due to low confidence (2)
src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/actions/save.action.ts:10
- This type import isn’t used in this file; consider removing it to keep imports clean.
type UmbVariantDatasetWorkspaceContext,
src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view-variant-selector.element.ts:156
- Ensure
UmbVariantDatasetWorkspaceContextis imported at the top of this file; otherwise this will cause a compilation error.
#observeReadOnlyGuardRules(workspaceContext?: UmbVariantDatasetWorkspaceContext) {
src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/actions/save.action.ts
Outdated
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/actions/save.action.ts
Show resolved
Hide resolved
Once 16.1.0 out and this PR is in CMS - then remove this HACKY workaround umbraco/Umbraco-CMS#19621 Still need to use readonlyGuard for the node name readonly and its not deprecated by core yet as they still use it
This is a fix for the name field and save button to respond to late-coming readOnlyGuard rules. Eventually, we should consider supporting propertyGuards for these cases. This fix makes sure that the read-only guard we currently have also works as intended.
Before fixing:
Screen.Recording.2025-06-27.at.09.47.29.mov
Code that can be used for testing:
Manifest
Entity Action
After fixing:
Screen.Recording.2025-06-27.at.11.20.20.mov