Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 6f177dd

Browse files
committed
comments
1 parent f7cda1b commit 6f177dd

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

src/packages/data-type/workspace/data-type-workspace.context.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ import {
3030
} from '@umbraco-cms/backoffice/entity-action';
3131

3232
type EntityType = UmbDataTypeDetailModel;
33+
34+
/**
35+
* @class uUmbDataTypeWorkspaceContext
36+
* @description - Context for handling data type workspace
37+
* There is two overall code flows to be aware about:
38+
*
39+
* propertyEditorUiAlias is observed
40+
* loads propertyEditorUi manifest
41+
* then the propertyEditorSchemaAlias is set to what the UI is configured for.
42+
*
43+
* propertyEditorSchemaAlias is observed
44+
* loads the propertyEditorSchema manifest
45+
* if no UI is defined then the propertyEditorSchema manifest default ui is set for the propertyEditorUiAlias.
46+
*
47+
* This supports two cases:
48+
* - when editing an existing data type that only has a schema alias set, then it gets the UI set.
49+
* - a new property editor ui is picked for a data-type, uses the data-type configuration to set the schema, if such is configured for the Property Editor UI. (The user picks the UI via the UI, the schema comes from the UI that the user picked, we store both on the data-type)
50+
*/
3351
export class UmbDataTypeWorkspaceContext
3452
extends UmbSubmittableWorkspaceContextBase<EntityType>
3553
implements UmbInvariantDatasetWorkspaceContext, UmbRoutableWorkspaceContext
@@ -137,7 +155,7 @@ export class UmbDataTypeWorkspaceContext
137155
// we only want to react on the change if the alias is set or null. When it is undefined something is still loading
138156
if (propertyEditorUiAlias === undefined) return;
139157

140-
this.#observePropertyEditorUIConfig(propertyEditorUiAlias);
158+
this.#observePropertyEditorUIManifest(propertyEditorUiAlias);
141159
},
142160
'editorUiAlias',
143161
);
@@ -149,13 +167,13 @@ export class UmbDataTypeWorkspaceContext
149167
(propertyEditorSchemaAlias) => {
150168
this.#propertyEditorSchemaSettingsProperties = [];
151169
this.#propertyEditorSchemaSettingsDefaultData = [];
152-
this.#observePropertyEditorSchemaConfig(propertyEditorSchemaAlias);
170+
this.#observePropertyEditorSchemaManifest(propertyEditorSchemaAlias);
153171
},
154172
'schemaAlias',
155173
);
156174
}
157175

158-
#observePropertyEditorSchemaConfig(propertyEditorSchemaAlias?: string) {
176+
#observePropertyEditorSchemaManifest(propertyEditorSchemaAlias?: string) {
159177
if (!propertyEditorSchemaAlias) {
160178
this.removeUmbControllerByAlias('schema');
161179
return;
@@ -182,7 +200,7 @@ export class UmbDataTypeWorkspaceContext
182200
);
183201
}
184202

185-
#observePropertyEditorUIConfig(propertyEditorUIAlias: string | null) {
203+
#observePropertyEditorUIManifest(propertyEditorUIAlias: string | null) {
186204
if (!propertyEditorUIAlias) {
187205
this.removeUmbControllerByAlias('editorUi');
188206
return;

0 commit comments

Comments
 (0)