Shared status: improve for segmented scenario (#20354)

* improve shared status messages

* Update src/Umbraco.Web.UI.Client/src/packages/core/property/components/property/property.context.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Niels Lyngsø
2025-10-03 09:59:07 +02:00
committed by GitHub
parent d45a8f2049
commit c5b4571cd5

View File

@@ -183,17 +183,25 @@ export class UmbPropertyContext<ValueType = any> extends UmbContextBase {
// TODO: Do not use the content variant id, but know wether the property is configured to vary by segment.
// Because we can view a default segment, then we do not know if the property is shared or not. [NL]
if (contextVariantId.segment !== null && propertyVariantId.segment === null) {
if (contextVariantId.culture !== null) {
// If the property does not have culture, then we know this also will be shared across cultures.
if (propertyVariantId.culture === null) {
shareMessage = 'content_sharedAcrossCultures';
} else {
// If not, then we know it will be only be shared across segments.
shareMessage = 'content_sharedAcrossSegments';
}
}
// TODO: Do not use the content variant id, but know wether the property is configured to vary by culture. (this is first a problem when we introduce the invariant-variant)
if (contextVariantId.culture !== null && propertyVariantId.culture === null) {
// If the property does have segment, then we know this will be shared across cultures and not across segments.
if (propertyVariantId.segment !== null) {
shareMessage = 'content_sharedAcrossCultures';
} else {
// if not then we know it's shared across everything.
shareMessage = 'content_shared';
}
}
}
this.#variantDifference.setValue(shareMessage);
}