rename to umb-datatype-based-property

This commit is contained in:
Niels Lyngsø
2023-02-20 15:55:23 +01:00
parent 1439eb7ca1
commit 9415f2a80b
7 changed files with 16 additions and 11 deletions

View File

@@ -236,8 +236,8 @@ export class UmbDocumentWorkspaceContext
return data.filter((x) => x.name === name && x.type === containerType);
});
}
setPropertyValue(alias: string, value: unknown) {
const entry = { alias: alias, value: value };
setPropertyValue(alias: string, value: unknown, culture: string | null, segment: string | null) {
const entry = { alias, value, culture, segment };
const currentData = this.#draft.value;
if (currentData) {

View File

@@ -133,9 +133,9 @@ export class UmbDocumentWorkspaceViewEditPropertiesElement extends UmbLitElement
this._propertyStructure,
(property) => property.alias,
(property) =>
html`<umb-content-property
html`<umb-datatype-based-property
.property=${property}
.value=${this._propertyValueMap.get(property.alias!)?.value}></umb-content-property> `
.value=${this._propertyValueMap.get(property.alias!)?.value}></umb-datatype-based-property> `
);
}
}

View File

@@ -8,8 +8,8 @@ import '../workspace-property/workspace-property.element';
import { UmbLitElement } from '@umbraco-cms/element';
import { UmbObserverController } from '@umbraco-cms/observable-api';
@customElement('umb-content-property')
export class UmbContentPropertyElement extends UmbLitElement {
@customElement('umb-datatype-based-property')
export class UmbDataTypeBasedPropertyElement extends UmbLitElement {
static styles = [
UUITextStyles,
css`
@@ -71,6 +71,6 @@ export class UmbContentPropertyElement extends UmbLitElement {
declare global {
interface HTMLElementTagNameMap {
'umb-content-property': UmbContentPropertyElement;
'umb-datatype-based-property': UmbDataTypeBasedPropertyElement;
}
}

View File

@@ -5,7 +5,7 @@ import './backoffice-frame/backoffice-modal-container.element';
import './backoffice-frame/backoffice-notification-container.element';
import './ref-property-editor-ui/ref-property-editor-ui.element';
import './content-property/content-property.element';
import './data-type-based-property/data-type-based-property.element';
import './table/table.element';
import './code-block/code-block.element';
import './extension-slot/extension-slot.element';

View File

@@ -24,6 +24,9 @@ export class UmbWorkspacePropertyContext<ValueType = unknown> {
public readonly value = this._data.getObservablePart((data) => data.value);
public readonly config = this._data.getObservablePart((data) => data.config);
// culture
// segment
private _workspaceContext?: UmbWorkspaceEntityContextInterface;
constructor(host: UmbControllerHostInterface) {

View File

@@ -60,7 +60,7 @@ export class UmbWorkspaceViewContentEditElement extends UmbLitElement {
this._properties = content?.properties || [];
console.log('content', content);
//Maybe we should not give the value(Data), but the umb-content-property should get the context and observe its own data.
//Maybe we should not give the value(Data), but the umb-datatype-based-property should get the context and observe its own data.
//This would become a more specific Observer therefor better performance?.. Note to self: Debate with Mads how he sees this perspective.
},
'observeWorkspaceContextData'
@@ -75,7 +75,9 @@ export class UmbWorkspaceViewContentEditElement extends UmbLitElement {
this._properties,
(property) => property.alias,
(property) =>
html`<umb-content-property .property=${property} .value=${property.label}></umb-content-property> `
html`<umb-datatype-based-property
.property=${property}
.value=${property.label}></umb-datatype-based-property> `
)}
</uui-box>
`;

View File

@@ -8,7 +8,7 @@ export interface UmbWorkspaceEntityContextInterface<T = unknown> extends UmbWork
getData(): T;
setPropertyValue(alias: string, value: unknown): void;
//setPropertyValue(alias: string, value: unknown): void;
save(): Promise<void>;
}