[ACS-5611] Add custom metadata side panels as new extension feature (#3466)

* [ACS-5611] Add custom metadata panels as new extensions feature

* [ACS-5611] Add custom metadata panels unit tests

* [ACS-5611] Minor fixes

* [ACS-5611] Text ellipsis for name column to always display badges

* [ACS-5611] Use latest ADF and JS-API

* [ACS-5611] Unit test fix

* [ACS-5611] Click action only if exists
This commit is contained in:
MichalKinas
2023-10-16 10:43:04 +02:00
committed by GitHub
parent bc98af0968
commit 928c6b5731
12 changed files with 166 additions and 59 deletions

View File

@@ -29,8 +29,8 @@ import { AppStore, EditOfflineAction, infoDrawerMetadataAspect, NodeActionTypes
import { AppConfigService, NotificationService } from '@alfresco/adf-core';
import { Observable, Subject } from 'rxjs';
import { Store } from '@ngrx/store';
import { ContentMetadataModule, ContentMetadataService } from '@alfresco/adf-content-services';
import { filter, takeUntil } from 'rxjs/operators';
import { ContentMetadataModule, ContentMetadataService, ContentMetadataCustomPanel } from '@alfresco/adf-content-services';
import { filter, map, takeUntil } from 'rxjs/operators';
import { CommonModule } from '@angular/common';
import { Actions, ofType } from '@ngrx/effects';
@@ -44,6 +44,7 @@ import { Actions, ofType } from '@ngrx/effects';
[preset]="'custom'"
[node]="node"
[displayAspect]="displayAspect$ | async"
[customPanels]="customPanels | async"
[(editable)]="editable"
>
</adf-content-metadata-card>
@@ -60,6 +61,7 @@ export class MetadataTabComponent implements OnInit, OnDestroy {
displayAspect$: Observable<string>;
canUpdateNode = false;
editable = false;
customPanels: Observable<ContentMetadataCustomPanel[]>;
constructor(
private permission: NodePermissionService,
@@ -93,6 +95,14 @@ export class MetadataTabComponent implements OnInit, OnDestroy {
this.editable = false;
}
});
this.customPanels = this.extensions.getCustomMetadataPanels({ entry: this.node }).pipe(
map((panels) => {
return panels.map((panel) => {
return { panelTitle: panel.title, component: panel.component };
});
}),
takeUntil(this.onDestroy$)
);
}
ngOnDestroy() {