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:
@@ -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>`,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user