mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2503] conditional visibility for content actions (#3325)
* conditional visibility for content actions * fix typo * workaround for "target: all"
This commit is contained in:
committed by
Eugenio Romano
parent
7154eb1e84
commit
d67f160fdc
@@ -273,6 +273,25 @@
|
||||
</data-columns>
|
||||
|
||||
<content-actions>
|
||||
<!-- Conditional actions demo -->
|
||||
<content-action
|
||||
icon="get_app"
|
||||
title="Download this file now!"
|
||||
handler="download"
|
||||
[visible]="canDownloadNode">
|
||||
</content-action>
|
||||
<content-action
|
||||
icon="get_app"
|
||||
title="Never see this action again"
|
||||
handler="download"
|
||||
[visible]="false">
|
||||
</content-action>
|
||||
<content-action
|
||||
icon="get_app"
|
||||
title="This can be toggled"
|
||||
handler="download"
|
||||
[visible]="showCustomDownloadAction">
|
||||
</content-action>
|
||||
<!-- common actions -->
|
||||
<content-action
|
||||
icon="get_app"
|
||||
@@ -417,6 +436,12 @@
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle color="primary" [(ngModel)]="showCustomDownloadAction">
|
||||
Toggle custom download action
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [color]="'primary'" [(ngModel)]="multiselect">{{'DOCUMENT_LIST.MULTISELECT_CHECKBOXES' |
|
||||
translate}}
|
||||
|
@@ -152,6 +152,8 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
@ViewChild(InfinitePaginationComponent)
|
||||
infinitePaginationComponent: InfinitePaginationComponent;
|
||||
|
||||
@Input()
|
||||
showCustomDownloadAction = false;
|
||||
|
||||
permissionsStyle: PermissionStyleModel[] = [];
|
||||
infiniteScrolling: boolean;
|
||||
@@ -491,4 +493,11 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.infinitePaginationComponent.reset();
|
||||
this.reloadForInfiniteScrolling();
|
||||
}
|
||||
|
||||
canDownloadNode = (node: MinimalNodeEntity): boolean => {
|
||||
if (node && node.entry && node.entry.name === 'For Sale.docx') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user