displayed 'Unassigned' option only when 'Assign Reviewer' button is pressed

This commit is contained in:
Valentin 2021-11-22 23:16:43 +02:00
parent 865ff5b1a6
commit 7f09c4c045
2 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@ class DialogData {
mode: 'approver' | 'reviewer';
files: File[];
ignoreChanged?: boolean;
withUnassignedOption?: boolean;
withCurrentUserAsDefault?: boolean;
}
@ -44,7 +45,7 @@ export class AssignReviewerApproverDialogComponent {
}
get userOptions() {
const unassignUser = this._canUnassignFiles ? [undefined] : [];
const unassignUser = this._canUnassignFiles && this.data.withUnassignedOption ? [undefined] : [];
return this.data.mode === 'approver'
? [...this.dossier.approverIds, ...unassignUser]
: [...this.dossier.memberIds, ...unassignUser];

View File

@ -126,7 +126,9 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
assign($event: MouseEvent) {
const mode = this.file.isUnderApproval ? 'approver' : 'reviewer';
const files = [this.file];
this._dialogService.openDialog('assignFile', $event, { mode, files, withCurrentUserAsDefault: true });
const withCurrentUserAsDefault = true;
const withUnassignedOption = mode === 'reviewer';
this._dialogService.openDialog('assignFile', $event, { mode, files, withCurrentUserAsDefault, withUnassignedOption });
}
async assignToMe($event: MouseEvent) {