Pull request #334: RED-3164: Disable dossier actions when files are selected

Merge in RED/ui from RED-3164 to master

* commit 'dfc09def05179a81a2a6518d6639ac420450ad2a':
  Disable dossier actions when files are selected
This commit is contained in:
Adina Teudan 2022-01-19 08:01:07 +01:00 committed by Timo Bejan
commit 7f528ef95e
4 changed files with 12 additions and 5 deletions

View File

@ -5,10 +5,15 @@
[showCloseButton]="true"
[viewModeSelection]="viewModeSelection"
>
<redaction-file-download-btn [files]="entitiesService.all$ | async" tooltipPosition="below"></redaction-file-download-btn>
<redaction-file-download-btn
[disabled]="listingService.areSomeSelected$ | async"
[files]="entitiesService.all$ | async"
tooltipPosition="below"
></redaction-file-download-btn>
<iqser-circle-button
(action)="exportFilesAsCSV()"
[disabled]="listingService.areSomeSelected$ | async"
[tooltip]="'dossier-overview.header-actions.download-csv' | translate"
icon="iqser:csv"
tooltipPosition="below"
@ -17,7 +22,8 @@
<iqser-circle-button
(action)="reanalyseDossier()"
*ngIf="permissionsService.displayReanalyseBtn(dossier) && analysisForced"
[tooltipClass]="'small ' + ((listingService.areSomeSelected$ | async) ? '' : 'warn')"
[disabled]="listingService.areSomeSelected$ | async"
[tooltipClass]="'small warn'"
[tooltip]="'dossier-overview.new-rule.toast.actions.reanalyse-all' | translate"
[type]="circleButtonTypes.warn"
icon="iqser:refresh"

View File

@ -47,7 +47,7 @@ export class ScreenHeaderComponent implements OnInit {
) {}
ngOnInit() {
this.actionConfigs = this.configService.actionConfig(this.dossier.dossierId);
this.actionConfigs = this.configService.actionConfig(this.dossier.dossierId, this.listingService.areSomeSelected$);
}
async reanalyseDossier() {

View File

@ -102,7 +102,7 @@ export class ConfigService {
};
}
actionConfig(dossierId: string): List<ActionConfig> {
actionConfig(dossierId: string, disabled$: Observable<boolean>): List<ActionConfig> {
return [
{
label: this._translateService.instant('dossier-overview.header-actions.edit'),
@ -110,6 +110,7 @@ export class ConfigService {
icon: 'iqser:edit',
hide: !this._userService.currentUser.isManager,
helpModeKey: 'edit-dossier-attributes',
disabled$,
},
];
}

@ -1 +1 @@
Subproject commit d11b54bb118e639274c011c41594703c71018292
Subproject commit 1b8ce8ef1d295efc5b02b39b631b5e654938de29