displayed 'Unassigned' option only when 'Assign Reviewer' button is pressed
This commit is contained in:
parent
865ff5b1a6
commit
7f09c4c045
@ -13,6 +13,7 @@ class DialogData {
|
|||||||
mode: 'approver' | 'reviewer';
|
mode: 'approver' | 'reviewer';
|
||||||
files: File[];
|
files: File[];
|
||||||
ignoreChanged?: boolean;
|
ignoreChanged?: boolean;
|
||||||
|
withUnassignedOption?: boolean;
|
||||||
withCurrentUserAsDefault?: boolean;
|
withCurrentUserAsDefault?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ export class AssignReviewerApproverDialogComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get userOptions() {
|
get userOptions() {
|
||||||
const unassignUser = this._canUnassignFiles ? [undefined] : [];
|
const unassignUser = this._canUnassignFiles && this.data.withUnassignedOption ? [undefined] : [];
|
||||||
return this.data.mode === 'approver'
|
return this.data.mode === 'approver'
|
||||||
? [...this.dossier.approverIds, ...unassignUser]
|
? [...this.dossier.approverIds, ...unassignUser]
|
||||||
: [...this.dossier.memberIds, ...unassignUser];
|
: [...this.dossier.memberIds, ...unassignUser];
|
||||||
|
|||||||
@ -126,7 +126,9 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
|||||||
assign($event: MouseEvent) {
|
assign($event: MouseEvent) {
|
||||||
const mode = this.file.isUnderApproval ? 'approver' : 'reviewer';
|
const mode = this.file.isUnderApproval ? 'approver' : 'reviewer';
|
||||||
const files = [this.file];
|
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) {
|
async assignToMe($event: MouseEvent) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user