Skip to content

Commit

Permalink
V15: Collection: Adds "Name" to Order By options (#17600)
Browse files Browse the repository at this point in the history
* Adds "Name" option to the Collection Order By configuration

* Localizes column headers
  • Loading branch information
leekelleher authored Nov 21, 2024
1 parent c363b78 commit 918448f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
Expand Down

0 comments on commit 918448f

Please sign in to comment.