RED-3800 check conditions assing/change state

This commit is contained in:
Timo Bejan 2022-05-24 15:20:46 +03:00
parent 87b7f7f2e8
commit 9ca5d22b21
3 changed files with 12 additions and 5 deletions

View File

@ -28,7 +28,11 @@ export class FileAssignService {
async assignToMe(files: File[]): Promise<unknown> {
const assignReq = async () => {
this._loadingService.start();
await firstValueFrom(this._filesService.setAssignee(files, files[0].dossierId, this.currentUser.id));
if (files[0].isNew) {
await this._makeAssignFileRequest(this.currentUser.id, 'UNDER_REVIEW', files);
} else {
await firstValueFrom(this._filesService.setAssignee(files, files[0].dossierId, this.currentUser.id));
}
this._loadingService.stop();
};
if (atLeastOneAssignee(files)) {

View File

@ -294,9 +294,12 @@ export class PermissionsService {
return dossier.isActive && file.isUnderReview && this.isDossierMember(dossier);
}
/** UNDER_APPROVAL => UNDER_REVIEW */
/** UNDER_APPROVAL => UNDER_REVIEW OR NEW => UNDER_REVIEW */
private _canSetUnderReview(file: File, dossier: Dossier): boolean {
return dossier.isActive && file.isUnderApproval && this.isAssigneeOrApprover(file, dossier);
return (
dossier.isActive &&
((file.isUnderApproval && this.isAssigneeOrApprover(file, dossier)) || (file.isNew && this.isDossierMember(dossier)))
);
}
/** UNDER_APPROVAL => APPROVED */

View File

@ -1,7 +1,7 @@
{
"ADMIN_CONTACT_NAME": null,
"ADMIN_CONTACT_URL": null,
"API_URL": "https://dev-05.iqser.cloud/redaction-gateway-v1",
"API_URL": "https://dev-08.iqser.cloud/redaction-gateway-v1",
"APP_NAME": "RedactManager",
"AUTO_READ_TIME": 3,
"BACKEND_APP_VERSION": "4.4.40",
@ -16,7 +16,7 @@
"MAX_RETRIES_ON_SERVER_ERROR": 3,
"OAUTH_CLIENT_ID": "redaction",
"OAUTH_IDP_HINT": null,
"OAUTH_URL": "https://dev-05.iqser.cloud/auth/realms/redaction",
"OAUTH_URL": "https://dev-08.iqser.cloud/auth/realms/redaction",
"RECENT_PERIOD_IN_HOURS": 24,
"SELECTION_MODE": "structural",
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview"