mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[MNT-23821] Filter custom aspects (#8790)
* [MNT-23821] Filter custom aspects * [MNT-23821] getCustomAspects initialization * [MNT-23821] Added aspect list service tests * [MNT-23821] getCustomAspects - whiteList argument as optional. Added tests. * [MNT-23821] Changed from double to single quotes * [MNT-23821] Lint
This commit is contained in:
@@ -40,7 +40,7 @@ export class AspectListService {
|
||||
getAspects(): Observable<AspectEntry[]> {
|
||||
const visibleAspectList = this.getVisibleAspects();
|
||||
const standardAspects$ = this.getStandardAspects(visibleAspectList);
|
||||
const customAspects$ = this.getCustomAspects();
|
||||
const customAspects$ = this.getCustomAspects(visibleAspectList);
|
||||
return zip(standardAspects$, customAspects$).pipe(
|
||||
map(([standardAspectList, customAspectList]) => [...standardAspectList, ...customAspectList])
|
||||
);
|
||||
@@ -62,7 +62,7 @@ export class AspectListService {
|
||||
);
|
||||
}
|
||||
|
||||
getCustomAspects(): Observable<AspectEntry[]> {
|
||||
getCustomAspects(whiteList?: string[]): Observable<AspectEntry[]> {
|
||||
const where = `(not namespaceUri matches('http://www.alfresco.*'))`;
|
||||
const opts: any = {
|
||||
where,
|
||||
@@ -70,7 +70,7 @@ export class AspectListService {
|
||||
};
|
||||
return from(this.aspectsApi.listAspects(opts))
|
||||
.pipe(
|
||||
map((result: AspectPaging) => result?.list?.entries),
|
||||
map((result: AspectPaging) => this.filterAspectByConfig(whiteList, result?.list?.entries)),
|
||||
catchError((error) => {
|
||||
this.logService.error(error);
|
||||
return of([]);
|
||||
|
Reference in New Issue
Block a user