Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 50c50d6a authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

[EDELIVERY-13997] Allow user to reject the approved document

parent 1104bc91
No related tags found
No related merge requests found
Pipeline #210256 failed
......@@ -233,7 +233,7 @@
*ngIf="!isNotReviewMode || hasReviewPermission"
color="primary"
matTooltip="{{ 'document.edit.panel.tooltip.version.review.approve' | translate }}"
[disabled]="reviewActionButtonDisabled"
[disabled]="reviewApproveButtonDisabled"
(click)="onApproveButtonClicked()">
<mat-icon>check_circle</mat-icon>
<span>{{ "document.edit.panel.button.version.review.approve" | translate }}</span>
......@@ -241,7 +241,7 @@
<button mat-raised-button
color="primary"
matTooltip="{{ 'document.edit.panel.tooltip.version.review.reject' | translate }}"
[disabled]="reviewActionButtonDisabled"
[disabled]="reviewRejectButtonDisabled"
(click)="onRejectButtonClicked()">
<mat-icon>unpublished</mat-icon>
<span>{{ "document.edit.panel.button.version.review.reject" | translate }}</span>
......
......@@ -750,11 +750,17 @@ export class DocumentEditPanelComponent implements BeforeLeaveGuard, OnInit {
|| this.isDirty();
}
get reviewActionButtonDisabled(): boolean {
get reviewApproveButtonDisabled(): boolean {
return !this.reviewEnabled
|| this.documentForm.controls['documentVersionStatus']?.value !== DocumentVersionsStatus.UNDER_REVIEW
}
get reviewRejectButtonDisabled(): boolean {
let status = this.documentForm.controls['documentVersionStatus']?.value
return !this.reviewEnabled
|| status !== DocumentVersionsStatus.UNDER_REVIEW && status !== DocumentVersionsStatus.APPROVED;
}
get publishButtonDisabled(): boolean {
// can not publish changed document
if (this.isDirty()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment