diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/data-type/components/data-type-flow-input/data-type-flow-input.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/data-type/components/data-type-flow-input/data-type-flow-input.element.ts index 89f11b9ece..181c11f8de 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/data-type/components/data-type-flow-input/data-type-flow-input.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/data-type/components/data-type-flow-input/data-type-flow-input.element.ts @@ -63,7 +63,6 @@ export class UmbInputDataTypeElement extends FormControlMixin(UmbLitElement) { }; }) .onSubmit((submitData) => { - console.log('submit Data'); // TODO: we maybe should set the alias to null, if no selection? this.value = submitData?.selection.join(',') ?? ''; this.dispatchEvent(new UmbChangeEvent()); diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/data-type/modals/data-type-picker-flow/data-type-picker-flow-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/data-type/modals/data-type-picker-flow/data-type-picker-flow-modal.element.ts index 9f0b6696f4..5cd185fe4a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/data-type/modals/data-type-picker-flow/data-type-picker-flow-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/data-type/modals/data-type-picker-flow/data-type-picker-flow-modal.element.ts @@ -33,9 +33,6 @@ export class UmbDataTypePickerFlowModalElement extends UmbModalBaseElement< @state() private _groupedPropertyEditorUIs: GroupedItems = {}; - @state() - private _selection: Array = []; - @state() private _submitLabel = 'Select'; @@ -82,7 +79,7 @@ export class UmbDataTypePickerFlowModalElement extends UmbModalBaseElement< return { data: { entityType: 'data-type', preset: { propertyEditorUiAlias: params.uiAlias } } }; }) .onSubmit((value) => { - this._select(value?.id); + this._select(value?.unique); this._submitModal(); }); @@ -116,16 +113,6 @@ export class UmbDataTypePickerFlowModalElement extends UmbModalBaseElement< }); } - connectedCallback(): void { - super.connectedCallback(); - - if (this.modalContext) { - this.observe(this.modalContext.value, (value) => { - this._selection = value?.selection ?? []; - }); - } - } - private _handleDataTypeClick(dataType: EntityTreeItemResponseModel) { if (dataType.id) { this._select(dataType.id); @@ -134,7 +121,7 @@ export class UmbDataTypePickerFlowModalElement extends UmbModalBaseElement< } private _select(id: string | undefined) { - this._selection = id ? [id] : []; + this._value = { selection: id ? [id] : [] }; } private _handleFilterInput(event: UUIInputEvent) { @@ -284,7 +271,7 @@ export class UmbDataTypePickerFlowModalElement extends UmbModalBaseElement< dataTypes, (dataType) => dataType.id, (dataType) => - html`
  • + html`
  • diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/data-type/workspace/data-type-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/data-type/workspace/data-type-workspace.context.ts index 43ade5cca3..efa21b2d29 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/data-type/workspace/data-type-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/data-type/workspace/data-type-workspace.context.ts @@ -123,10 +123,8 @@ export class UmbDataTypeWorkspaceContext } private _mergeConfigProperties() { - console.log('schema properties', this._propertyEditorSchemaConfigProperties); - console.log('ui properties', this._propertyEditorUISettingsProperties); - if (this._propertyEditorSchemaConfigProperties && this._propertyEditorUISettingsProperties) { + // TODO: Consider the ability to to omit a schema config if a UI config has same alias. Otherwise we should make an error when this case happens. this.#properties.next([ ...this._propertyEditorSchemaConfigProperties, ...this._propertyEditorUISettingsProperties, @@ -203,8 +201,6 @@ export class UmbDataTypeWorkspaceContext async propertyValueByAlias(propertyAlias: string) { await this.#getDataPromise; - // TODO: Merge map.. - return combineLatest([ this.#data.asObservablePart((data) => data?.values?.find((x) => x.alias === propertyAlias)?.value as ReturnType), this.#defaults.asObservablePart( @@ -215,7 +211,6 @@ export class UmbDataTypeWorkspaceContext return value ?? defaultValue; }), ); - //return this.#data.asObservablePart((data) => data?.values?.find((x) => x.alias === propertyAlias)?.value ?? this.getPropertyDefaultValue(propertyAlias) as ReturnType); } getPropertyValue(propertyAlias: string) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/modal/token/workspace-modal.token.ts b/src/Umbraco.Web.UI.Client/src/packages/core/modal/token/workspace-modal.token.ts index b3b0ac1cb6..08f7b73805 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/modal/token/workspace-modal.token.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/modal/token/workspace-modal.token.ts @@ -6,9 +6,10 @@ export interface UmbWorkspaceData { preset: Partial; } +// TODO: It would be good with a WorkspaceValueBaseType, to avoid the hardcoded type for unique here: export type UmbWorkspaceValue = | { - id: string; + unique: string; } | undefined;