Content Workspace: not displaying varying composition values in a not varying context (Fixes #20707) (#20758)

* only vary if context varies

* add controller aliases to these observations
This commit is contained in:
Niels Lyngsø
2025-11-10 10:05:56 +01:00
committed by GitHub
parent 6f2b7ab1a0
commit 2067db1c3c
2 changed files with 7 additions and 2 deletions

View File

@@ -428,6 +428,8 @@ export abstract class UmbContentDetailWorkspaceContextBase<
const repo = new UmbDataTypeDetailRepository(this); const repo = new UmbDataTypeDetailRepository(this);
const propertyTypes = await this.structure.getContentTypeProperties(); const propertyTypes = await this.structure.getContentTypeProperties();
const contentTypeVariesByCulture = this.structure.getVariesByCulture();
const contentTypeVariesBySegment = this.structure.getVariesByCulture();
const valueDefinitions = await Promise.all( const valueDefinitions = await Promise.all(
propertyTypes.map(async (property) => { propertyTypes.map(async (property) => {
// TODO: Implement caching for data-type requests. [NL] // TODO: Implement caching for data-type requests. [NL]
@@ -446,8 +448,9 @@ export abstract class UmbContentDetailWorkspaceContextBase<
propertyEditorSchemaAlias: dataType.editorAlias, propertyEditorSchemaAlias: dataType.editorAlias,
config: dataType.values, config: dataType.values,
typeArgs: { typeArgs: {
variesByCulture: property.variesByCulture, // Only vary if the content type varies:
variesBySegment: property.variesBySegment, variesByCulture: contentTypeVariesByCulture ? property.variesByCulture : false,
variesBySegment: contentTypeVariesBySegment ? property.variesBySegment : false,
} as UmbPropertyTypePresetModelTypeModel, } as UmbPropertyTypePresetModelTypeModel,
} as UmbPropertyTypePresetModel; } as UmbPropertyTypePresetModel;
}), }),

View File

@@ -66,10 +66,12 @@ export class UmbPropertyTypeWorkspaceViewSettingsElement extends UmbLitElement i
this.observe( this.observe(
instance?.variesByCulture, instance?.variesByCulture,
(variesByCulture) => (this._contentTypeVariesByCulture = variesByCulture), (variesByCulture) => (this._contentTypeVariesByCulture = variesByCulture),
'observeVariesByCulture',
); );
this.observe( this.observe(
instance?.variesBySegment, instance?.variesBySegment,
(variesBySegment) => (this._contentTypeVariesBySegment = variesBySegment), (variesBySegment) => (this._contentTypeVariesBySegment = variesBySegment),
'observeVariesBySegment',
); );
this._entityType = instance?.getEntityType(); this._entityType = instance?.getEntityType();
}).passContextAliasMatches(); }).passContextAliasMatches();