status / assignee updates
This commit is contained in:
parent
2c7194f6ef
commit
f34b6ce743
@ -492,7 +492,13 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
|
||||
const { dossierId, fileId, filename } = file;
|
||||
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._toaster.info(_('assignment.reviewer'), { params: { reviewerName, filename } });
|
||||
|
||||
@ -82,7 +82,14 @@ export class FileAssignService {
|
||||
private async _makeAssignFileRequest(userId: string, mode: 'reviewer' | 'approver', files: File[]) {
|
||||
this._loadingService.start();
|
||||
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
|
||||
.setReviewerFor(
|
||||
files.map(f => f.fileId),
|
||||
|
||||
@ -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()
|
||||
setUnderApprovalFor(@RequiredParam() fileIds: List, @RequiredParam() dossierId: string, asigneeId: string) {
|
||||
const url = `${this._defaultModelPath}/under-approval/${dossierId}/bulk`;
|
||||
|
||||
@ -405,7 +405,7 @@
|
||||
},
|
||||
"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?",
|
||||
"title": "Re-assign reviewer"
|
||||
"title": "Re-assign user"
|
||||
},
|
||||
"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?",
|
||||
@ -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.",
|
||||
"assign-approver": "Assign Approver",
|
||||
"assign-me": "Assign To Me",
|
||||
"assign-reviewer": "Assign Reviewer",
|
||||
"assign-reviewer": "Assign User",
|
||||
"bulk": {
|
||||
"delete": "Delete Documents",
|
||||
"reanalyse": "Analyze Documents"
|
||||
@ -1026,8 +1026,8 @@
|
||||
},
|
||||
"file-preview": {
|
||||
"assign-me": "Assign to me",
|
||||
"assign-reviewer": "Assign Reviewer",
|
||||
"change-reviewer": "Change Reviewer",
|
||||
"assign-reviewer": "Assign User",
|
||||
"change-reviewer": "Change User",
|
||||
"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",
|
||||
"document-info": "Your Document Info lives here. This includes metadata required on each document.",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user