RED-10531: disabled more buttons for file with error state.
This commit is contained in:
parent
3be593f464
commit
315fa5a440
@ -26,6 +26,7 @@ export class DossierOverviewBulkActionsComponent {
|
||||
readonly maxWidth = input<number>();
|
||||
readonly buttons = computed(() => this.#buttons);
|
||||
readonly IqserTooltipPositions = IqserTooltipPositions;
|
||||
readonly #areFilesInErrorState = computed(() => this.selectedFiles().some(file => file.isError));
|
||||
readonly #areRulesLocked = computed(() => this._rulesService.currentTemplateRules().timeoutDetected);
|
||||
readonly #allFilesAreUnderReviewOrUnassigned = computed(() =>
|
||||
this.selectedFiles().reduce((acc, file) => acc && (file.isUnderReview || file.isNew), true),
|
||||
@ -47,18 +48,34 @@ export class DossierOverviewBulkActionsComponent {
|
||||
);
|
||||
readonly #canDelete = computed(() => this._permissionsService.canSoftDeleteFile(this.selectedFiles(), this.dossier()));
|
||||
readonly #canReanalyse = computed(() => this._permissionsService.canReanalyseFile(this.selectedFiles(), this.dossier()));
|
||||
readonly #canDisableAutoAnalysis = computed(() =>
|
||||
this._permissionsService.canDisableAutoAnalysis(this.selectedFiles(), this.dossier()),
|
||||
readonly #canDisableAutoAnalysis = computed(
|
||||
() => this._permissionsService.canDisableAutoAnalysis(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(),
|
||||
);
|
||||
readonly #canEnableAutoAnalysis = computed(
|
||||
() => this._permissionsService.canEnableAutoAnalysis(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(),
|
||||
);
|
||||
readonly #canEnableAutoAnalysis = computed(() => this._permissionsService.canEnableAutoAnalysis(this.selectedFiles(), this.dossier()));
|
||||
readonly #canToggleAnalysis = computed(() => this._permissionsService.canToggleAnalysis(this.selectedFiles(), this.dossier()));
|
||||
readonly #canOcr = computed(() => this._permissionsService.canOcrFile(this.selectedFiles(), this.dossier()));
|
||||
readonly #canSetToNew = computed(() => this._permissionsService.canSetToNew(this.selectedFiles(), this.dossier()));
|
||||
readonly #canSetToUnderReview = computed(() => this._permissionsService.canSetUnderReview(this.selectedFiles(), this.dossier()));
|
||||
readonly #canSetToUnderApproval = computed(() => this._permissionsService.canSetUnderApproval(this.selectedFiles(), this.dossier()));
|
||||
readonly #isReadyForApproval = computed(() => this._permissionsService.isReadyForApproval(this.selectedFiles(), this.dossier()));
|
||||
readonly #canApprove = computed(() => this._permissionsService.canBeApproved(this.selectedFiles(), this.dossier()));
|
||||
readonly #canUndoApproval = computed(() => this._permissionsService.canUndoApproval(this.selectedFiles(), this.dossier()));
|
||||
readonly #canOcr = computed(
|
||||
() => this._permissionsService.canOcrFile(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(),
|
||||
);
|
||||
readonly #canSetToNew = computed(
|
||||
() => this._permissionsService.canSetToNew(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(),
|
||||
);
|
||||
readonly #canSetToUnderReview = computed(
|
||||
() => this._permissionsService.canSetUnderReview(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(),
|
||||
);
|
||||
readonly #canSetToUnderApproval = computed(
|
||||
() => this._permissionsService.canSetUnderApproval(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(),
|
||||
);
|
||||
readonly #isReadyForApproval = computed(
|
||||
() => this._permissionsService.isReadyForApproval(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(),
|
||||
);
|
||||
readonly #canApprove = computed(
|
||||
() => this._permissionsService.canBeApproved(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(),
|
||||
);
|
||||
readonly #canUndoApproval = computed(
|
||||
() => this._permissionsService.canUndoApproval(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(),
|
||||
);
|
||||
readonly #assignTooltip = computed(() =>
|
||||
this.#allFilesAreUnderApproval() ? _('dossier-overview.assign-approver') : _('dossier-overview.assign-reviewer'),
|
||||
);
|
||||
|
||||
@ -13,7 +13,7 @@ import {
|
||||
} from '@iqser/common-ui';
|
||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||
import { IqserTooltipPositions } from '@iqser/common-ui/lib/utils';
|
||||
import { Action, ActionTypes, ApproveResponse, Dossier, File, ProcessingFileStatuses, User } from '@red/domain';
|
||||
import { Action, ActionTypes, ApproveResponse, Dossier, File, User } from '@red/domain';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||
import { FileManagementService } from '@services/files/file-management.service';
|
||||
@ -69,15 +69,21 @@ export class FileActionsComponent {
|
||||
this.file().isUnderApproval ? _('dossier-overview.assign-approver') : _('dossier-overview.assign-reviewer'),
|
||||
);
|
||||
readonly #showSetToNew = computed(
|
||||
() => this._permissionsService.canSetToNew(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow(),
|
||||
() =>
|
||||
this._permissionsService.canSetToNew(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow() && !this.file().isError,
|
||||
);
|
||||
readonly #showUndoApproval = computed(
|
||||
() => this._permissionsService.canUndoApproval(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow(),
|
||||
() =>
|
||||
this._permissionsService.canUndoApproval(this.file(), this.dossier()) &&
|
||||
!this.isDossierOverviewWorkflow() &&
|
||||
!this.file().isError,
|
||||
);
|
||||
readonly #showAssignToSelf = computed(
|
||||
() => this._permissionsService.canAssignToSelf(this.file(), this.dossier()) && this.isDossierOverview(),
|
||||
);
|
||||
readonly #showImportRedactions = computed(() => this._permissionsService.canImportRedactions(this.file(), this.dossier()));
|
||||
readonly #showImportRedactions = computed(
|
||||
() => this._permissionsService.canImportRedactions(this.file(), this.dossier()) && !this.file().isError,
|
||||
);
|
||||
readonly #showAssign = computed(
|
||||
() =>
|
||||
(this._permissionsService.canAssignUser(this.file(), this.dossier()) ||
|
||||
@ -87,15 +93,26 @@ export class FileActionsComponent {
|
||||
readonly #showDelete = computed(() => this._permissionsService.canSoftDeleteFile(this.file(), this.dossier()));
|
||||
readonly #showOCR = computed(() => this._permissionsService.canOcrFile(this.file(), this.dossier()) && !this.file().isError);
|
||||
readonly #canReanalyse = computed(() => this._permissionsService.canReanalyseFile(this.file(), this.dossier()));
|
||||
readonly #canEnableAutoAnalysis = computed(() => this._permissionsService.canEnableAutoAnalysis([this.file()], this.dossier()));
|
||||
readonly #canEnableAutoAnalysis = computed(
|
||||
() => this._permissionsService.canEnableAutoAnalysis([this.file()], this.dossier()) && !this.file().isError,
|
||||
);
|
||||
readonly #showUnderReview = computed(
|
||||
() => this._permissionsService.canSetUnderReview(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow(),
|
||||
() =>
|
||||
this._permissionsService.canSetUnderReview(this.file(), this.dossier()) &&
|
||||
!this.isDossierOverviewWorkflow() &&
|
||||
!this.file().isError,
|
||||
);
|
||||
readonly #showUnderApproval = computed(
|
||||
() => this._permissionsService.canSetUnderApproval(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow(),
|
||||
() =>
|
||||
this._permissionsService.canSetUnderApproval(this.file(), this.dossier()) &&
|
||||
!this.isDossierOverviewWorkflow() &&
|
||||
!this.file().isError,
|
||||
);
|
||||
readonly #showApprove = computed(
|
||||
() => this._permissionsService.isReadyForApproval(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow(),
|
||||
() =>
|
||||
this._permissionsService.isReadyForApproval(this.file(), this.dossier()) &&
|
||||
!this.isDossierOverviewWorkflow() &&
|
||||
!this.file().isError,
|
||||
);
|
||||
readonly #canToggleAnalysis = computed(() => this._permissionsService.canToggleAnalysis(this.file(), this.dossier()));
|
||||
readonly #toggleTooltip? = computed(() => {
|
||||
@ -130,7 +147,7 @@ export class FileActionsComponent {
|
||||
|
||||
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
||||
readonly #canDisableAutoAnalysis = computed(
|
||||
() => !this.#isDocumine && this._permissionsService.canDisableAutoAnalysis([this.file()], this.dossier()),
|
||||
() => !this.#isDocumine && this._permissionsService.canDisableAutoAnalysis([this.file()], this.dossier()) && !this.file().isError,
|
||||
);
|
||||
|
||||
constructor(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user