has settings

This commit is contained in:
Niels Lyngsø
2024-01-30 10:24:54 +01:00
parent 38ca799b71
commit 5b1139d9e8

View File

@@ -28,6 +28,9 @@ export class UmbPropertyEditorUIBlockListBlockElement extends UmbLitElement impl
@state()
_contentUdi?: string;
@state()
_hasSettings = false;
@state()
_label = '';
@@ -52,6 +55,10 @@ export class UmbPropertyEditorUIBlockListBlockElement extends UmbLitElement impl
this.observe(this.#context.contentUdi, (contentUdi) => {
this._contentUdi = contentUdi;
});
this.observe(this.#context.blockTypeSettingsElementTypeKey, (blockTypeSettingsElementTypeKey) => {
console.log(blockTypeSettingsElementTypeKey, !!blockTypeSettingsElementTypeKey);
this._hasSettings = blockTypeSettingsElementTypeKey !== undefined;
});
this.observe(this.#context.label, (label) => {
this._blockViewProps.label = label;
this._label = label;
@@ -98,6 +105,11 @@ export class UmbPropertyEditorUIBlockListBlockElement extends UmbLitElement impl
<uui-icon name="icon-edit"></uui-icon>
</uui-button>`
: ''}
${this._workspaceEditPath && this._hasSettings
? html`<uui-button label="Edit settings" compact href=${this._workspaceEditPath + '/view/settings'}>
<uui-icon name="icon-settings"></uui-icon>
</uui-button>`
: ''}
<uui-button label="delete" compact @click=${this.#requestDelete}>
<uui-icon name="icon-remove"></uui-icon>
</uui-button>