correct headline

This commit is contained in:
Niels Lyngsø
2024-07-04 16:00:02 +02:00
parent e5fb18ad71
commit 6f7b4b4c70

View File

@@ -7,6 +7,9 @@ export class UmbPropertyTypeWorkspaceEditorElement extends UmbLitElement {
//
#workspaceContext?: typeof UMB_PROPERTY_TYPE_WORKSPACE_CONTEXT.TYPE;
@state()
_isNew?: boolean;
@state()
_name?: string;
@@ -18,6 +21,9 @@ export class UmbPropertyTypeWorkspaceEditorElement extends UmbLitElement {
this.consumeContext(UMB_PROPERTY_TYPE_WORKSPACE_CONTEXT, (context) => {
this.#workspaceContext = context;
this.observe(context.isNew, (isNew) => {
this._isNew = isNew;
});
this.observe(context.name, (name) => {
this._name = name;
});
@@ -26,11 +32,14 @@ export class UmbPropertyTypeWorkspaceEditorElement extends UmbLitElement {
}
override render() {
return this.workspaceAlias
return this.workspaceAlias && this._isNew !== undefined
? html`
<umb-workspace-editor
alias=${this.workspaceAlias}
headline=${this.localize.term('blockEditor_blockConfigurationOverlayTitle', [this._name])}>
headline=${this.localize.term(
this._isNew ? 'contentTypeEditor_addProperty' : 'contentTypeEditor_editProperty',
[this._name],
)}>
</umb-workspace-editor>
`
: '';