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

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

Pull request #139: [EDELIVERY-13943] UI - add approve/reject/publish confirmation dialog

Merge in EDELIVERY/smp from bugfix/EDELIVERY-13943-ui-review-document-process-approving-reject-a-review-task-should-trigger-a to development

* commit 'e703cecb':
  [EDELIVERY-13943] UI - add approve/reject/publish confirmation dialog
parents 39f1af12 e703cecb
No related branches found
No related tags found
No related merge requests found
Pipeline #208893 failed
......@@ -323,7 +323,7 @@ export class DocumentEditPanelComponent implements BeforeLeaveGuard, OnInit {
if (this.documentVersionsExists && this.isNotReviewMode && !this.isNewDocumentVersion) {
this.documentForm.controls['payloadVersion'].enable();
}
if (!this.documentEditable && !this.isNewDocumentVersion ) {
if (!this.documentEditable && !this.isNewDocumentVersion) {
this.documentForm.controls['selectDocumentSource'].enable();
}
this.updateTextToEditor()
......@@ -471,6 +471,7 @@ export class DocumentEditPanelComponent implements BeforeLeaveGuard, OnInit {
}
onReviewRequestButtonClicked(): void {
// create lightweight document object
let docRequest: DocumentRo = {
documentId: this._document.documentId,
......@@ -484,7 +485,21 @@ export class DocumentEditPanelComponent implements BeforeLeaveGuard, OnInit {
onReviewRequestObservable.subscribe(this.loadDocumentObserver);
}
onApproveButtonClicked(): void {
async onApproveButtonClicked() {
this.dialog.open(ConfirmationDialogComponent, {
data: {
title: await lastValueFrom(this.translateService.get("document.edit.panel.review.dialog.confirmation.title")),
description: await lastValueFrom(this.translateService.get("document.edit.panel.review.dialog.confirmation.approve.description"))
}
}).afterClosed().subscribe(result => {
if (result) {
this.submitReviewApproveAction()
}
});
}
private submitReviewApproveAction() {
// create lightweight document object
let docRequest: DocumentRo = {
documentId: this._document.documentId,
......@@ -497,12 +512,26 @@ export class DocumentEditPanelComponent implements BeforeLeaveGuard, OnInit {
// request review
onReviewRequestObservable.subscribe(this.reviewActionDocumentObserver);
if (!this.isNotReviewMode){
if (!this.isNotReviewMode) {
this.onBackButtonClicked();
}
}
onRejectButtonClicked(): void {
async onRejectButtonClicked() {
this.dialog.open(ConfirmationDialogComponent, {
data: {
title: await lastValueFrom(this.translateService.get("document.edit.panel.review.dialog.confirmation.title")),
description: await lastValueFrom(this.translateService.get("document.edit.panel.review.dialog.confirmation.reject.description"))
}
}).afterClosed().subscribe(result => {
if (result) {
this.submitReviewRejectAction()
}
});
}
private submitReviewRejectAction() {
// create lightweight document object
let docRequest: DocumentRo = {
documentId: this._document.documentId,
......@@ -514,7 +543,7 @@ export class DocumentEditPanelComponent implements BeforeLeaveGuard, OnInit {
this.editResourceService.reviewRejectSubresourceDocumentObservable(this.subresource, this.resource, docRequest);
// request review
onReviewRequestObservable.subscribe(this.reviewActionDocumentObserver);
if (!this.isNotReviewMode){
if (!this.isNotReviewMode) {
this.onBackButtonClicked();
}
}
......@@ -523,7 +552,21 @@ export class DocumentEditPanelComponent implements BeforeLeaveGuard, OnInit {
* Publish the current document version
*
*/
onPublishButtonClicked(): void {
async onPublishButtonClicked() {
this.dialog.open(ConfirmationDialogComponent, {
data: {
title: await lastValueFrom(this.translateService.get("document.edit.panel.dialog.confirmation.publish.title")),
description: await lastValueFrom(this.translateService.get("document.edit.panel.dialog.confirmation.publish.description"))
}
}).afterClosed().subscribe(result => {
if (result) {
this.submitPublishAction()
}
});
}
private submitPublishAction() {
// create lightweight document object
let docRequest: DocumentRo = {
documentId: this._document.documentId,
......
......@@ -357,6 +357,7 @@
"resource.details.panel.button.save": "Save",
"resource.details.panel.review.disabled.confirmation.dialog.title": "Review disabled?",
"resource.details.panel.review.disabled.confirmation.dialog.description": "All document versions with review statuses (UNDER_REVIEW, APPROVED, REJECTED) will be set to DRAFT\nDo you want to continue?",
"document.edit.panel.button.back": "Back",
"document.edit.panel.button.cancel": "Cancel",
"document.edit.panel.button.document.wizard": "Document wizard",
......@@ -382,7 +383,6 @@
"document.edit.panel.select.item.reference": "Reference document",
"document.edit.panel.select.item.current": "Current document",
"document.edit.panel.label.show.document.type": "View document",
"document.edit.panel.error.document.null": "Can not show document because it is not selected.",
"document.edit.panel.title": "Resources",
"document.edit.panel.tooltip.document.wizard": "Show document wizard dialog",
......@@ -393,9 +393,15 @@
"document.edit.panel.tooltip.version.new": "Create new document version for the resource",
"document.edit.panel.tooltip.version.publish": "Publish selected document version",
"document.edit.panel.tooltip.version.request.review": "Submit selected document version for the review",
"document.edit.panel.tooltip.version.review.approve": "Approve document version",
"document.edit.panel.tooltip.version.review.reject": "Reject document version",
"document.edit.panel.tooltip.version.review.approve.description": "Approve document version",
"document.edit.panel.tooltip.version.review.reject.description": "Reject document version",
"document.edit.panel.note.editable": "Note: Only document payloads in following status can be edited: [{{editableDocStatusList}}]",
"document.edit.panel.dialog.confirmation.publish.title": "Document publish action confirmation",
"document.edit.panel.dialog.confirmation.publish.description": "Do you want to publish the document version?",
"document.edit.panel.review.dialog.confirmation.title": "Review action confirmation",
"document.edit.panel.review.dialog.confirmation.approve.description": "Do you want to <b>approve</b> the document version?",
"document.edit.panel.review.dialog.confirmation.reject.description": "Do you want to <b>reject</b> the document version?",
"document.configuration.panel.tab.title": "Document configuration",
"document.configuration.panel.tab.button.metadata": "Metadata",
......
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