reanalyse btn changes
This commit is contained in:
parent
a7f867781c
commit
c349122a6e
@ -178,14 +178,11 @@ export class DialogService {
|
||||
return ref;
|
||||
}
|
||||
|
||||
public openAssignFileToMeDialog(file: FileStatus, cb?: Function): MatDialogRef<ConfirmationDialogComponent> {
|
||||
public openAssignFileToMeDialog(file: FileStatus, cb?: Function) {
|
||||
const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig);
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
if (result && cb) cb(result);
|
||||
});
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
public openBulkAssignFileReviewerDialog(fileIds: string[], cb?: Function): MatDialogRef<AssignOwnerDialogComponent> {
|
||||
|
||||
@ -458,8 +458,8 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
public assignToMe() {
|
||||
this._fileActionService.assignToMe(this.fileData.fileStatus, async () => {
|
||||
public async assignToMe() {
|
||||
await this._fileActionService.assignToMe(this.fileData.fileStatus, async () => {
|
||||
this.canPerformAnnotationActions = this.permissionsService.canPerformAnnotationActions();
|
||||
});
|
||||
}
|
||||
|
||||
@ -36,14 +36,22 @@ export class FileActionService {
|
||||
});
|
||||
}
|
||||
|
||||
public assignToMe(file?: FileStatus, callback?: Function) {
|
||||
this._dialogService.openAssignFileToMeDialog(file ? file : this._appStateService.activeFile, async () => {
|
||||
await this._statusControllerService.assignProjectOwner(this._appStateService.activeProjectId, file.fileId, this._userService.userId).toPromise();
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
if (callback) {
|
||||
await callback();
|
||||
}
|
||||
});
|
||||
public async assignToMe(file?: FileStatus, callback?: Function) {
|
||||
if (file.currentReviewer) {
|
||||
await this._assignReviewerToCurrentUser(file, callback);
|
||||
} else {
|
||||
this._dialogService.openAssignFileToMeDialog(file ? file : this._appStateService.activeFile, async () => {
|
||||
await this._assignReviewerToCurrentUser(file, callback);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private async _assignReviewerToCurrentUser(file?: FileStatus, callback?: Function) {
|
||||
await this._statusControllerService.assignProjectOwner(this._appStateService.activeProjectId, file.fileId, this._userService.userId).toPromise();
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
if (callback) {
|
||||
await callback();
|
||||
}
|
||||
}
|
||||
|
||||
setFileUnderApproval(fileStatus: FileStatusWrapper) {
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
<div class="flex red-content-inner">
|
||||
<div class="left-container">
|
||||
<div class="grid-container bulk-select">
|
||||
<div class="header-item span-7">
|
||||
<div class="header-item span-4">
|
||||
<div class="select-all-container">
|
||||
<div
|
||||
(click)="toggleSelectAll()"
|
||||
@ -70,6 +70,14 @@
|
||||
|
||||
<redaction-bulk-actions [selectedFileIds]="selectedFileIds" (reload)="bulkActionPerformed()"></redaction-bulk-actions>
|
||||
</div>
|
||||
<div class="header-item span-3 justify-end">
|
||||
<ng-container *ngIf="displayReanalyseBtn">
|
||||
<strong>
|
||||
{{ 'project-overview.new-rule.toast.message-project' | translate }}
|
||||
</strong>
|
||||
<a (click)="reanalyseProject()" class="reanalyse-link"> {{ 'project-overview.new-rule.toast.actions.reanalyse-all' | translate }}</a>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
||||
<!-- Table column names-->
|
||||
<div class="select-oval-placeholder"></div>
|
||||
|
||||
@ -57,3 +57,11 @@
|
||||
overflow-y: scroll;
|
||||
@include no-scroll-bar();
|
||||
}
|
||||
|
||||
.reanalyse-link {
|
||||
color: $accent;
|
||||
text-decoration: underline;
|
||||
&:hover {
|
||||
color: lighten($accent, 10%);
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +81,6 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
.subscribe();
|
||||
this._fileDropOverlayService.initFileDropHandling();
|
||||
this.calculateData();
|
||||
this._displayOutdatedToast();
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
@ -89,32 +88,15 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
this.filesAutoUpdateTimer.unsubscribe();
|
||||
}
|
||||
|
||||
private _displayOutdatedToast() {
|
||||
if (this.permissionsService.isManagerAndOwner()) {
|
||||
// @ts-ignore
|
||||
if (!this.appStateService.activeProject.files.filter((file) => this.permissionsService.fileRequiresReanalysis(file)).length) {
|
||||
return;
|
||||
}
|
||||
get displayReanalyseBtn() {
|
||||
return !!(
|
||||
this.permissionsService.isManagerAndOwner() &&
|
||||
this.appStateService.activeProject.files.filter((file) => this.permissionsService.fileRequiresReanalysis(file)).length
|
||||
);
|
||||
}
|
||||
|
||||
this._notificationService.showToastNotification(
|
||||
`${this._translateService.instant('project-overview.new-rule.toast.message-project')}`,
|
||||
null,
|
||||
NotificationType.WARNING,
|
||||
{
|
||||
disableTimeOut: true,
|
||||
positionClass: 'toast-top-left',
|
||||
actions: [
|
||||
{
|
||||
title: this._translateService.instant('project-overview.new-rule.toast.actions.reanalyse-all'),
|
||||
action: () => this.appStateService.reanalyzeProject().then(() => this.reloadProjects())
|
||||
},
|
||||
{
|
||||
title: this._translateService.instant('project-overview.new-rule.toast.actions.later')
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
public reanalyseProject() {
|
||||
return this.appStateService.reanalyzeProject().then(() => this.reloadProjects());
|
||||
}
|
||||
|
||||
public isPending(fileStatusWrapper: FileStatusWrapper) {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"heading-with-link": "Ihr Benutzer verfügt nicht über die erforderlichen RED- * -Rollen, um auf diese Anwendung zuzugreifen. Bitte kontaktieren Sie <a href={{adminUrl}} target=_blank >Ihren Administrator</a> für den Zugriff!",
|
||||
"logout": "Ausloggen"
|
||||
},
|
||||
"app-name": "Redacto",
|
||||
"app-name": "DDA-R",
|
||||
"upload-status": { "dialog": { "title": "Datei-Upload", "actions": { "re-upload": "Wiederholen Sie den Upload", "cancel": "Upload abbrechen" } } },
|
||||
"pdf-viewer": { "text-popup": { "actions": { "search": "Suche nach Auswahl" } } },
|
||||
"common": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"heading-with-link": "Your user doesn't have the required RED-* roles to access this application. Please contact <a href={{adminUrl}} target=_blank >your admin</a> for access!",
|
||||
"logout": "Logout"
|
||||
},
|
||||
"app-name": "Redacto",
|
||||
"app-name": "DDA-R",
|
||||
"upload-status": {
|
||||
"dialog": {
|
||||
"title": "File Upload",
|
||||
@ -152,7 +152,7 @@
|
||||
"new-rule": {
|
||||
"label": "Outdated",
|
||||
"toast": {
|
||||
"message-project": "Documents need to be re-analyzed.",
|
||||
"message-project": "Renalysis required: ",
|
||||
"actions": {
|
||||
"reanalyse-all": "Reanalyze all",
|
||||
"reanalyse-file": "Reanalyze this file",
|
||||
|
||||
@ -17,10 +17,18 @@
|
||||
gap: 25px;
|
||||
}
|
||||
|
||||
&.span-3 {
|
||||
grid-column-end: span 3;
|
||||
}
|
||||
|
||||
&.span-7 {
|
||||
grid-column-end: span 7;
|
||||
}
|
||||
&.span-4 {
|
||||
grid-column-end: span 4;
|
||||
}
|
||||
|
||||
&.justify-end {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Redacto</title>
|
||||
<title>DDA-R</title>
|
||||
<base href="/" />
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport" />
|
||||
<link href="favicon.ico" rel="icon" type="image/x-icon" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user