Pull request #193: assign reviewer for approvers

Merge in RED/ui from RED-1543 to master

* commit 'e305a461cff16c685eefa617ee145c6721f761fb':
  assign reviewer for approvers
This commit is contained in:
Timo Bejan 2021-05-31 09:19:29 +02:00
commit e457589896
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;
}