status / assignee updates

This commit is contained in:
Timo Bejan 2021-11-23 12:12:50 +02:00
parent 2c7194f6ef
commit f34b6ce743
4 changed files with 25 additions and 6 deletions

View File

@ -492,7 +492,13 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
const { dossierId, fileId, filename } = file; const { dossierId, fileId, filename } = file;
this._loadingService.start(); this._loadingService.start();
await this._filesService.setReviewerFor([fileId], dossierId, assigneeId).toPromise(); if (!assigneeId) {
await this._filesService.setUnassigned([fileId], dossierId).toPromise();
} else if (file.isUnderReview) {
await this._filesService.setReviewerFor([fileId], dossierId, assigneeId).toPromise();
} else if (file.isUnderApproval) {
await this._filesService.setUnderApprovalFor([fileId], dossierId, assigneeId).toPromise();
}
this._loadingService.stop(); this._loadingService.stop();
this._toaster.info(_('assignment.reviewer'), { params: { reviewerName, filename } }); this._toaster.info(_('assignment.reviewer'), { params: { reviewerName, filename } });

View File

@ -82,7 +82,14 @@ export class FileAssignService {
private async _makeAssignFileRequest(userId: string, mode: 'reviewer' | 'approver', files: File[]) { private async _makeAssignFileRequest(userId: string, mode: 'reviewer' | 'approver', files: File[]) {
this._loadingService.start(); this._loadingService.start();
try { try {
if (mode === 'reviewer') { if (!userId) {
await this._filesService
.setUnassigned(
files.map(f => f.fileId),
files[0].dossierId,
)
.toPromise();
} else if (mode === 'reviewer') {
await this._filesService await this._filesService
.setReviewerFor( .setReviewerFor(
files.map(f => f.fileId), files.map(f => f.fileId),

View File

@ -35,6 +35,12 @@ export class FilesService extends EntitiesService<File, IFile> {
); );
} }
@Validate()
setUnassigned(@RequiredParam() fileIds: List, @RequiredParam() dossierId: string) {
const url = `${this._defaultModelPath}/set-assignee/${dossierId}/bulk`;
return this._post<unknown>(fileIds, url).pipe(switchMapTo(this.loadAll(dossierId)));
}
@Validate() @Validate()
setUnderApprovalFor(@RequiredParam() fileIds: List, @RequiredParam() dossierId: string, asigneeId: string) { setUnderApprovalFor(@RequiredParam() fileIds: List, @RequiredParam() dossierId: string, asigneeId: string) {
const url = `${this._defaultModelPath}/under-approval/${dossierId}/bulk`; const url = `${this._defaultModelPath}/under-approval/${dossierId}/bulk`;

View File

@ -405,7 +405,7 @@
}, },
"assign-file-to-me": { "assign-file-to-me": {
"question": "This document is currently reviewed by someone else. Do you want to become the reviewer and assign yourself to this document?", "question": "This document is currently reviewed by someone else. Do you want to become the reviewer and assign yourself to this document?",
"title": "Re-assign reviewer" "title": "Re-assign user"
}, },
"compare-file": { "compare-file": {
"question": "<strong>Warning!</strong> <br><br> Number of pages does not match, current document has <strong>{currentDocumentPageCount} page(s)</strong>. Uploaded document has <strong>{compareDocumentPageCount} page(s)</strong>. <br><br> Do you wish to proceed?", "question": "<strong>Warning!</strong> <br><br> Number of pages does not match, current document has <strong>{currentDocumentPageCount} page(s)</strong>. Uploaded document has <strong>{compareDocumentPageCount} page(s)</strong>. <br><br> Do you wish to proceed?",
@ -666,7 +666,7 @@
"approve-disabled": "File can only be approved once it has been analysed with the latest dictionaries and all suggestions have been processed.", "approve-disabled": "File can only be approved once it has been analysed with the latest dictionaries and all suggestions have been processed.",
"assign-approver": "Assign Approver", "assign-approver": "Assign Approver",
"assign-me": "Assign To Me", "assign-me": "Assign To Me",
"assign-reviewer": "Assign Reviewer", "assign-reviewer": "Assign User",
"bulk": { "bulk": {
"delete": "Delete Documents", "delete": "Delete Documents",
"reanalyse": "Analyze Documents" "reanalyse": "Analyze Documents"
@ -1026,8 +1026,8 @@
}, },
"file-preview": { "file-preview": {
"assign-me": "Assign to me", "assign-me": "Assign to me",
"assign-reviewer": "Assign Reviewer", "assign-reviewer": "Assign User",
"change-reviewer": "Change Reviewer", "change-reviewer": "Change User",
"delta": "Delta", "delta": "Delta",
"delta-tooltip": "Delta View shows only the changes since last re-analysis. This view is only available if there is at least 1 change", "delta-tooltip": "Delta View shows only the changes since last re-analysis. This view is only available if there is at least 1 change",
"document-info": "Your Document Info lives here. This includes metadata required on each document.", "document-info": "Your Document Info lives here. This includes metadata required on each document.",