mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ACS-6252] support disabling the tags and categories feature in the applications (#9106)
* ACS-6252 Added rules field to SearchCategory interface * ACS-6252 Hide aspects related with tags and categories if tags and categories features are disabled * ACS-6252 Return from services information if tags and categories are disabled * ACS-6252 Unit tests for changes in AspectListDialogComponent * ACS-6252 Unit tests for changes for AspectListComponent * ACS-6252 Unit tests for DialogAspectListService * ACS-6252 Unit tests for changes for TagService and CategoryService * ACS-6252 Updated documentation for changes * ACS-6252 Fixed imports formatting * ACS-6252 Fix after rebasing * ACS-6252 Addressed PR comments * ACS-6252 Excluded e2es
This commit is contained in:
@@ -35,6 +35,10 @@ export class AspectListComponent implements OnInit, OnDestroy {
|
||||
@Input()
|
||||
nodeId: string = '';
|
||||
|
||||
/** List of aspects' ids which should not be displayed. */
|
||||
@Input()
|
||||
excludedAspects?: string[] = [];
|
||||
|
||||
/** Emitted every time the user select a new aspect */
|
||||
@Output()
|
||||
valueChanged: EventEmitter<string[]> = new EventEmitter<string[]>();
|
||||
@@ -56,13 +60,14 @@ export class AspectListComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
let aspects$: Observable<AspectEntry[]>;
|
||||
if (this.nodeId) {
|
||||
const node$ = this.nodeApiService.getNode(this.nodeId);
|
||||
const customAspect$ = this.aspectListService.getCustomAspects(this.aspectListService.getVisibleAspects())
|
||||
.pipe(map(
|
||||
(customAspects) => customAspects.flatMap((customAspect) => customAspect.entry.id)
|
||||
));
|
||||
this.aspects$ = zip(node$, customAspect$).pipe(
|
||||
aspects$ = zip(node$, customAspect$).pipe(
|
||||
tap(([node, customAspects]) => {
|
||||
this.nodeAspects = node.aspectNames.filter((aspect) => this.aspectListService.getVisibleAspects().includes(aspect) || customAspects.includes(aspect));
|
||||
this.nodeAspectStatus = [ ...this.nodeAspects ];
|
||||
@@ -71,9 +76,11 @@ export class AspectListComponent implements OnInit, OnDestroy {
|
||||
concatMap(() => this.aspectListService.getAspects()),
|
||||
takeUntil(this.onDestroy$));
|
||||
} else {
|
||||
this.aspects$ = this.aspectListService.getAspects()
|
||||
aspects$ = this.aspectListService.getAspects()
|
||||
.pipe(takeUntil(this.onDestroy$));
|
||||
}
|
||||
this.aspects$ = aspects$.pipe(map((aspects) =>
|
||||
aspects.filter((aspect) => !this.excludedAspects.includes(aspect.entry.id))));
|
||||
}
|
||||
|
||||
onCheckBoxClick(event: Event) {
|
||||
|
Reference in New Issue
Block a user