Merge branch 'VM/DM-536' into 'master'

DM-536 - Extraction output bulk download for dossiers

Closes DM-536

See merge request redactmanager/red-ui!182
This commit is contained in:
Dan Percic 2023-11-10 19:33:22 +01:00
commit 5bcee3c5c4
5 changed files with 17 additions and 8 deletions

View File

@ -8,20 +8,21 @@
<ng-container slot="right">
<iqser-circle-button
*allow="roles.getRss"
[attr.help-mode-key]="'editor_scm'"
[attr.help-mode-key]="'component_download'"
[icon]="'red:extract'"
[tooltip]="
((this.entitiesService.allLength$ | async) === 0 ? 'component-download.disabled-tooltip' : 'component-download.tooltip')
((downloadComponentLogsDisabled$ | async) ? 'component-download.disabled-tooltip' : 'component-download.tooltip')
| translate
"
[matMenuTriggerFor]="bulkComponentDownloadMenu"
[disabled]="(this.entitiesService.allLength$ | async) === 0"
[disabled]="downloadComponentLogsDisabled$ | async"
[dropdownButton]="true"
></iqser-circle-button>
<redaction-file-download-btn
[attr.help-mode-key]="'download_dossier_in_dossier'"
[buttonId]="'download-files-btn'"
[disabled]="downloadBtnDisabled$ | async"
[disabled]="downloadFilesDisabled$ | async"
[dossier]="dossier"
[files]="entitiesService.all$ | async"
></redaction-file-download-btn>

View File

@ -26,7 +26,8 @@ export class DossierOverviewScreenHeaderComponent implements OnInit {
readonly circleButtonTypes = CircleButtonTypes;
readonly roles = Roles;
actionConfigs: List<ActionConfig>;
readonly downloadBtnDisabled$: Observable<boolean>;
readonly downloadFilesDisabled$: Observable<boolean>;
readonly downloadComponentLogsDisabled$: Observable<boolean>;
readonly isDocumine = getConfig().IS_DOCUMINE;
constructor(
@ -45,9 +46,12 @@ export class DossierOverviewScreenHeaderComponent implements OnInit {
private readonly _componentLogService: ComponentLogService,
) {
const someNotProcessed$ = this.entitiesService.all$.pipe(some(file => !file.lastProcessed));
this.downloadBtnDisabled$ = combineLatest([this.listingService.areSomeSelected$, someNotProcessed$]).pipe(
this.downloadFilesDisabled$ = combineLatest([this.listingService.areSomeSelected$, someNotProcessed$]).pipe(
map(([someSelected, someNotProcessed]) => someSelected || someNotProcessed),
);
this.downloadComponentLogsDisabled$ = combineLatest([this.entitiesService.allLength$, someNotProcessed$]).pipe(
map(([length, someNotProcessed]) => !length || someNotProcessed),
);
}
ngOnInit() {

View File

@ -616,5 +616,9 @@
{
"elementKey": "editor_exclude_pages",
"documentKey": "editor_exclude_pages"
},
{
"elementKey": "component_download",
"documentKey": "component_download"
}
]

View File

@ -494,7 +494,7 @@
}
},
"component-download": {
"disabled-tooltip": "You need to upload at least one file to be able to export the components as JSON or XML",
"disabled-tooltip": "All files must be processed to be able to export the components as JSON or XML",
"json": "Download as JSON",
"tooltip": "Component Download",
"xml": "Download as XML"

@ -1 +1 @@
Subproject commit 052bf3a5d76fa5bb1697a01a532af553c96922b1
Subproject commit 63df71a6aa5a4e3984c2b7807750098b5fe74e87