V15: Collection: Adds "Name" to Order By options (#17600)

* Adds "Name" option to the Collection Order By configuration

* Localizes column headers
This commit is contained in:
Lee Kelleher
2024-11-21 07:45:51 +00:00
committed by GitHub
parent c363b785da
commit 918448f419
4 changed files with 8 additions and 4 deletions

View File

@@ -158,7 +158,7 @@ export class UmbDocumentGridCollectionViewElement extends UmbLitElement {
const value = getPropertyValueByAlias(item, column.alias);
return html`
<li>
<span>${column.header}:</span>
<span>${this.localize.string(column.header)}:</span>
${when(
column.nameTemplate,
() => html`<umb-ufm-render inline .markdown=${column.nameTemplate} .value=${{ value }}></umb-ufm-render>`,

View File

@@ -128,7 +128,7 @@ export class UmbDocumentTableCollectionViewElement extends UmbLitElement {
if (this._userDefinedProperties && this._userDefinedProperties.length > 0) {
const userColumns: Array<UmbTableColumn> = this._userDefinedProperties.map((item) => {
return {
name: item.header,
name: this.localize.string(item.header),
alias: item.alias,
elementName: item.elementName,
labelTemplate: item.nameTemplate,

View File

@@ -118,7 +118,7 @@ export class UmbMediaTableCollectionViewElement extends UmbLitElement {
if (this._userDefinedProperties && this._userDefinedProperties.length > 0) {
const userColumns: Array<UmbTableColumn> = this._userDefinedProperties.map((item) => {
return {
name: item.header,
name: this.localize.string(item.header),
alias: item.alias,
elementName: item.elementName,
allowSorting: true,

View File

@@ -31,11 +31,15 @@ export class UmbPropertyEditorUICollectionOrderByElement extends UmbLitElement i
await workspace.propertyValueByAlias<Array<UmbCollectionColumnConfiguration>>('includeProperties'),
(includeProperties) => {
if (!includeProperties) return;
this._options = includeProperties.map((property) => ({
const options = includeProperties.map((property) => ({
name: property.header,
value: property.alias,
selected: property.alias === this.value,
}));
this._options = [
{ name: this.localize.term('general_name'), value: 'name', selected: 'name' === this.value },
...options,
];
},
'_observeIncludeProperties',
);