Skip to content

Enforce: allowEditInvariantFromNonDefault configuration in the Backoffice UI #19265

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

Merged

Conversation

madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented May 7, 2025

This PR fixes the implementation of the allowEditInvariantFromNonDefault config.

This now means that when allowEditInvariantFromNonDefault is false, it won't be possible to edit invariant culture fields from other cultures than the default.

Fixes: #19241

@Copilot Copilot AI review requested due to automatic review settings May 7, 2025 10:42
Copy link
Contributor

@Copilot Copilot AI left a 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 aims to enforce the new behavior for the allowEditInvariantFromNonDefault configuration by preventing the editing of invariant culture fields outside the default language.

  • Removed configuration-based editing logic from the document workspace context.
  • Introduced invariant editing prevention logic into the document property dataset context.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace.context.ts Removed obsolete configuration consumption and prevention logic.
src/Umbraco.Web.UI.Client/src/packages/documents/documents/property-dataset-context/document-property-dataset.context.ts Added enforcement for invariant editing prevention using variant options and property rules.
Comments suppressed due to low confidence (1)

src/Umbraco.Web.UI.Client/src/packages/documents/documents/property-dataset-context/document-property-dataset.context.ts:47

  • The rule unique identifier naming here is different from the earlier approach in the workspace context. Consider consolidating the naming conventions (e.g., using consistent casing and format) across modules to improve clarity.
const unique = 'UMB_PREVENT_EDIT_INVARIANT_FROM_NON_DEFAULT_' + property.unique;

@madsrasmussen madsrasmussen marked this pull request as draft May 7, 2025 10:47
@madsrasmussen madsrasmussen marked this pull request as ready for review May 7, 2025 11:10
@madsrasmussen madsrasmussen requested a review from nielslyngsoe May 7, 2025 11:10
Copy link
Member

@nielslyngsoe nielslyngsoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautiful

@nielslyngsoe nielslyngsoe enabled auto-merge (squash) May 9, 2025 07:45
@nielslyngsoe nielslyngsoe merged commit f7bee37 into release/16.0 May 9, 2025
23 checks passed
@nielslyngsoe nielslyngsoe deleted the v16/hotfix/allow-edit-invariant-from-non-default branch May 9, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants