assign reviewer for approvers

This commit is contained in:
Dan Percic 2021-05-28 14:09:14 +03:00
parent 351dc05384
commit e305a461cf
2 changed files with 7 additions and 5 deletions

View File

@ -72,7 +72,8 @@
*ngIf="
!editingReviewer &&
!appStateService.activeFile.currentReviewer &&
permissionsService.canAssignUser()
permissionsService.canAssignUser() &&
appStateService.activeProject.hasMoreThanOneReviewer
"
class="assign-reviewer pointer"
translate="file-preview.assign-reviewer"

View File

@ -114,12 +114,13 @@ export class PermissionsService {
!fileStatus.isError &&
!fileStatus.isApproved;
const isNotCurrentReviewer = fileStatus.currentReviewer !== this._userService.userId;
const isTheOnlyReviewer = !this._appStateService.activeProject.hasMoreThanOneReviewer;
if (precondition) {
if (
(fileStatus.isUnassigned || fileStatus.isUnderReview) &&
(!this.isApprover() ||
!this._appStateService.activeProject.hasMoreThanOneReviewer) &&
fileStatus.currentReviewer !== this._userService.userId
(fileStatus.isUnassigned || (fileStatus.isUnderReview && isNotCurrentReviewer)) &&
(this.isApprover() || isTheOnlyReviewer)
) {
return true;
}