[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:
tiagosalvado10
2023-08-22 15:27:31 +01:00
committed by GitHub
parent 9a349f27d9
commit b58e6f628a
3 changed files with 117 additions and 4 deletions

View File

@@ -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([]);