approval
This commit is contained in:
parent
9d6bdb7b80
commit
5b5a01de4d
@ -86,11 +86,12 @@
|
||||
<!-- Approved-->
|
||||
<redaction-circle-button
|
||||
(action)="setFileApproved($event, fileStatus)"
|
||||
*ngIf="permissionsService.canApprove(fileStatus)"
|
||||
*ngIf="permissionsService.isReadyForApproval(fileStatus)"
|
||||
[disabled]="!permissionsService.canApprove(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:approved"
|
||||
tooltip="project-overview.approve"
|
||||
[tooltip]="permissionsService.canApprove(fileStatus) ? 'project-overview.approve' : 'project-overview.approve-disabled'"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
|
||||
@ -120,6 +120,16 @@ export class PermissionsService {
|
||||
return fileStatus.status === 'UNDER_APPROVAL' && this.isManagerAndOwner();
|
||||
}
|
||||
|
||||
isReadyForApproval(fileStatus?: FileStatusWrapper) {
|
||||
if (!fileStatus) {
|
||||
fileStatus = this._appStateService.activeFile;
|
||||
}
|
||||
if (!fileStatus) {
|
||||
return false;
|
||||
}
|
||||
return this.canSetUnderReview(fileStatus);
|
||||
}
|
||||
|
||||
canApprove(fileStatus?: FileStatusWrapper) {
|
||||
if (!fileStatus) {
|
||||
fileStatus = this._appStateService.activeFile;
|
||||
@ -127,12 +137,7 @@ export class PermissionsService {
|
||||
if (!fileStatus) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
this.canSetUnderReview(fileStatus) &&
|
||||
!fileStatus.hasRequests &&
|
||||
!fileStatus.hasUnappliedSuggestions &&
|
||||
this._appStateService.isFileUpToDateWithDictionaryAndRules(fileStatus)
|
||||
);
|
||||
return !fileStatus.hasRequests && !fileStatus.hasUnappliedSuggestions && this._appStateService.isFileUpToDateWithDictionaryAndRules(fileStatus);
|
||||
}
|
||||
|
||||
canSetUnderApproval(fileStatus?: FileStatusWrapper) {
|
||||
|
||||
@ -29,13 +29,16 @@
|
||||
<redaction-circle-button (action)="setToUnderReview()" *ngIf="canSetToUnderReview" tooltip="project-overview.under-review" type="dark-bg" icon="red:undo">
|
||||
</redaction-circle-button>
|
||||
|
||||
<!-- Approved-->
|
||||
<redaction-circle-button
|
||||
(action)="approveDocuments()"
|
||||
*ngIf="canApprove"
|
||||
tooltip="project-overview.approve"
|
||||
*ngIf="isReadyForApproval"
|
||||
[disabled]="!canApprove"
|
||||
type="dark-bg"
|
||||
icon="red:approved"
|
||||
></redaction-circle-button>
|
||||
[tooltip]="canApprove ? 'project-overview.approve' : 'project-overview.approve-disabled'"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<!-- Back to approval -->
|
||||
<redaction-circle-button (action)="setToUnderApproval()" *ngIf="canUndoApproval" tooltip="project-overview.under-approval" type="dark-bg" icon="red:undo">
|
||||
|
||||
@ -106,6 +106,10 @@ export class BulkActionsComponent {
|
||||
}
|
||||
|
||||
// Approve
|
||||
public get isReadyForApproval() {
|
||||
return this.selectedFiles.reduce((acc, file) => acc && this._permissionsService.isReadyForApproval(file), true);
|
||||
}
|
||||
|
||||
public get canApprove() {
|
||||
return this.selectedFiles.reduce((acc, file) => acc && this._permissionsService.canApprove(file), true);
|
||||
}
|
||||
|
||||
@ -202,6 +202,7 @@
|
||||
"download-redacted-file-preview": "Download Redacted File(s) Preview",
|
||||
"under-approval": "For Approval",
|
||||
"approve": "Approve",
|
||||
"approve-disabled": "File can only be approved once it has been analysed with the latest dictionaries and all suggestions have been processed",
|
||||
"under-review": "Under Review",
|
||||
"no-files-match": "No File match your current filters",
|
||||
"upload-files": "Drag & Drop files anywhere",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user