RED-6131: Added bulk select actions in workflow mode.

This commit is contained in:
Nicoleta Panaghiu 2023-04-11 15:30:03 +03:00
parent ada152a54b
commit e2b1b50f9f

View File

@ -1,7 +1,7 @@
import { Component, Input, OnChanges } from '@angular/core';
import { PermissionsService } from '@services/permissions.service';
import { Action, ActionTypes, Dossier, File, ProcessingFileStatuses } from '@red/domain';
import { CircleButtonType, CircleButtonTypes, ListingModes } from '@iqser/common-ui';
import { CircleButtonType, CircleButtonTypes } from '@iqser/common-ui';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { LongPressEvent } from '@shared/directives/long-press.directive';
import { UserPreferenceService } from '@users/user-preference.service';
@ -179,9 +179,6 @@ export class DossierOverviewBulkActionsComponent implements OnChanges {
if (!this.selectedFiles.length) {
return;
}
const isWorkflow = this._configService.listingMode === ListingModes.workflow;
const allFilesAreUnderReviewOrUnassigned = this.selectedFiles.reduce(
(acc, file) => acc && (file.isUnderReview || file.isNew),
true,
@ -213,17 +210,17 @@ export class DossierOverviewBulkActionsComponent implements OnChanges {
this.#canOcr = this._permissionsService.canOcrFile(this.selectedFiles, this.dossier);
this.#canSetToNew = this._permissionsService.canSetToNew(this.selectedFiles, this.dossier) && !isWorkflow;
this.#canSetToNew = this._permissionsService.canSetToNew(this.selectedFiles, this.dossier);
this.#canSetToUnderReview = this._permissionsService.canSetUnderReview(this.selectedFiles, this.dossier) && !isWorkflow;
this.#canSetToUnderReview = this._permissionsService.canSetUnderReview(this.selectedFiles, this.dossier);
this.#canSetToUnderApproval = this._permissionsService.canSetUnderApproval(this.selectedFiles, this.dossier) && !isWorkflow;
this.#canSetToUnderApproval = this._permissionsService.canSetUnderApproval(this.selectedFiles, this.dossier);
this.#isReadyForApproval = this._permissionsService.isReadyForApproval(this.selectedFiles, this.dossier) && !isWorkflow;
this.#isReadyForApproval = this._permissionsService.isReadyForApproval(this.selectedFiles, this.dossier);
this.#canApprove = this._permissionsService.canBeApproved(this.selectedFiles, this.dossier) && !isWorkflow;
this.#canApprove = this._permissionsService.canBeApproved(this.selectedFiles, this.dossier);
this.#canUndoApproval = this._permissionsService.canUndoApproval(this.selectedFiles, this.dossier) && !isWorkflow;
this.#canUndoApproval = this._permissionsService.canUndoApproval(this.selectedFiles, this.dossier);
this.#assignTooltip = allFilesAreUnderApproval ? _('dossier-overview.assign-approver') : _('dossier-overview.assign-reviewer');