Block List: Fixed clipboard label for nested block items (closes #19929) (#20223)

* Clipboard label for nested block item

* Falsey check
This commit is contained in:
Lee Kelleher
2025-09-23 13:10:46 +01:00
committed by GitHub
parent 9f2d404ca3
commit 85cf3d835e
3 changed files with 10 additions and 2 deletions

View File

@@ -84,7 +84,12 @@ export class UmbBlockElementManager<LayoutDataType extends UmbBlockLayoutBaseMod
// Ugly, but we just inherit these from the workspace context: [NL]
this.name = host.name;
this.getName = host.getName;
this.getName = () => {
const contentTypeLabel = this.structure.getOwnerContentType()?.name;
const blockLabel = host.getName();
return contentTypeLabel ? `${contentTypeLabel} ${blockLabel}` : blockLabel;
};
this.propertyViewGuard.fallbackToPermitted();
this.propertyWriteGuard.fallbackToPermitted();
@@ -94,6 +99,7 @@ export class UmbBlockElementManager<LayoutDataType extends UmbBlockLayoutBaseMod
this.structure.loadType(id);
}
});
this.observe(this.unique, (key) => {
if (key) {
this.validation.setDataPath('$.' + dataPathPropertyName + `[?(@.key == '${key}')]`);

View File

@@ -26,6 +26,7 @@ import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
import type { UUIModalSidebarSize } from '@umbraco-cms/backoffice/external/uui';
export type UmbBlockWorkspaceElementManagerNames = 'content' | 'settings';
export class UmbBlockWorkspaceContext<LayoutDataType extends UmbBlockLayoutBaseModel = UmbBlockLayoutBaseModel>
extends UmbSubmittableWorkspaceContextBase<LayoutDataType>
implements UmbRoutableWorkspaceContext
@@ -470,7 +471,7 @@ export class UmbBlockWorkspaceContext<LayoutDataType extends UmbBlockLayoutBaseM
}
getName() {
return 'block name content element type here...';
return '';
}
/**

View File

@@ -70,4 +70,5 @@ export class UmbCopyToClipboardPropertyAction extends UmbPropertyActionBase<Meta
});
}
}
export { UmbCopyToClipboardPropertyAction as api };