fixed assign reviewer
This commit is contained in:
parent
d58f098c7b
commit
b46a5b4722
@ -30,7 +30,8 @@
|
||||
color="accent"
|
||||
mat-icon-button
|
||||
>
|
||||
<mat-icon svgIcon="red:assign"></mat-icon>
|
||||
<mat-icon svgIcon="red:assign" *ngIf="permissionsService.isManagerAndOwner()"></mat-icon>
|
||||
<mat-icon svgIcon="red:assign-me" *ngIf="!permissionsService.isManagerAndOwner()"></mat-icon>
|
||||
</button>
|
||||
|
||||
<button
|
||||
|
||||
@ -52,9 +52,9 @@ export class FileActionsComponent implements OnInit {
|
||||
this.appStateService.downloadFileRedactionReport(file);
|
||||
}
|
||||
|
||||
assignReviewer($event: MouseEvent, file: FileStatusWrapper) {
|
||||
async assignReviewer($event: MouseEvent, file: FileStatusWrapper) {
|
||||
$event.stopPropagation();
|
||||
this._fileActionService.assignProjectReviewer(file, () => this.actionPerformed.emit('assign-reviewer'));
|
||||
await this._fileActionService.assignProjectReviewerFromOverview(file, () => this.actionPerformed.emit('assign-reviewer'));
|
||||
}
|
||||
|
||||
reanalyseFile($event: MouseEvent, fileStatusWrapper: FileStatusWrapper) {
|
||||
|
||||
@ -46,9 +46,11 @@ export class AssignOwnerDialogComponent {
|
||||
if (this.data.type === 'file') {
|
||||
const uniqueReviewers = new Set<string>();
|
||||
for (const file of this.data.files) {
|
||||
uniqueReviewers.add(file.currentReviewer);
|
||||
if (file.currentReviewer) {
|
||||
uniqueReviewers.add(file.currentReviewer);
|
||||
}
|
||||
}
|
||||
const singleUser = uniqueReviewers.size === 1 ? uniqueReviewers.values().next().value : [];
|
||||
const singleUser = uniqueReviewers.size === 1 ? uniqueReviewers.values().next().value : this.userService.userId;
|
||||
this.usersForm = this._formBuilder.group({
|
||||
singleUser: [singleUser]
|
||||
});
|
||||
|
||||
@ -27,6 +27,23 @@ export class FileActionService {
|
||||
return this._reanalysisControllerService.reanalyzeFile(this._appStateService.activeProject.project.projectId, fileStatusWrapper.fileId);
|
||||
}
|
||||
|
||||
public async assignProjectReviewerFromOverview(file?: FileStatusWrapper, callback?: Function) {
|
||||
if (this._permissionsService.isManagerAndOwner()) {
|
||||
this._openAssignReviewerDialog(file, callback);
|
||||
} else {
|
||||
await this.assignToMe(file, callback);
|
||||
}
|
||||
}
|
||||
|
||||
private _openAssignReviewerDialog(file?: FileStatusWrapper, callback?: Function) {
|
||||
this._dialogService.openAssignFileReviewerDialog(file ? file : this._appStateService.activeFile, async () => {
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public assignProjectReviewer(file?: FileStatus, callback?: Function) {
|
||||
this._dialogService.openAssignFileReviewerDialog(file ? file : this._appStateService.activeFile, async () => {
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
|
||||
@ -11,13 +11,8 @@
|
||||
</defs>
|
||||
<g id="Assignee" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="01.-Unassigned" transform="translate(-1066.000000, -79.000000)">
|
||||
<rect fill="#FFFFFF" x="0" y="0" width="1440" height="750"></rect>
|
||||
<g id="Header-Document">
|
||||
<g id="Rectangle">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
|
||||
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
<g id="Group-13" transform="translate(917.000000, 69.000000)" fill="#283241" fill-rule="nonzero">
|
||||
<g id="Group-13" transform="translate(917.000000, 69.000000)" fill="currentColor" fill-rule="nonzero">
|
||||
<g id="Group-6" transform="translate(139.000000, 0.000000)">
|
||||
<g id="status" transform="translate(10.000000, 10.000000)">
|
||||
<path d="M4.61951123,7.00768239 L4.6192693,8.41063592 C2.85882948,8.544763 1.4982383,9.93223022 1.40509185,11.7054415 L1.4,11.9 L1.4,12.6 L4.619,12.599 L4.62,14 L0,14 L0,11.9 C0,9.26418483 2.0228531,7.15039627 4.61951123,7.00768239 Z M4.9,0.7 C6.44,0.7 7.7,1.96 7.7,3.5 C7.7,5.04 6.44,6.3 4.9,6.3 C3.36,6.3 2.1,5.04 2.1,3.5 C2.1,1.96 3.36,0.7 4.9,0.7 Z M4.9,2.1 C4.13,2.1 3.5,2.73 3.5,3.5 C3.5,4.27 4.13,4.9 4.9,4.9 C5.67,4.9 6.3,4.27 6.3,3.5 C6.3,2.73 5.67,2.1 4.9,2.1 Z" id="Combined-Shape"></path>
|
||||
@ -28,4 +23,4 @@
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.1 KiB |
Loading…
x
Reference in New Issue
Block a user