mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-7430] Make name optional in SortableByCategoryItem interface (#9735)
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface SortableByCategoryItem {
|
||||
name: string;
|
||||
name?: string;
|
||||
category?: string;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ export interface ItemsByCategory<T> {
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SortByCategoryMapperService<T extends SortableByCategoryItem = SortableByCategoryItem> {
|
||||
|
||||
private defaultCategories: string[] = [];
|
||||
|
||||
mapItems(items: T[], defaultCategories: string[]): ItemsByCategory<T>[] {
|
||||
@@ -83,15 +82,14 @@ export class SortByCategoryMapperService<T extends SortableByCategoryItem = Sort
|
||||
}
|
||||
|
||||
return itemA.category.localeCompare(itemB.category);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
private mapItemDefaultCategory(listItem: SortableByCategoryItem): string {
|
||||
const itemCategory = listItem.category;
|
||||
|
||||
if (!this.isDefaultCategory(itemCategory)) {
|
||||
return (itemCategory ?? '');
|
||||
return itemCategory ?? '';
|
||||
}
|
||||
|
||||
return '';
|
||||
|
Reference in New Issue
Block a user