Pull request #89: RED-914: Added success/error notification for project reanalysis

Merge in RED/ui from RED-914 to master

* commit '05716f8dbb193cd75fb858ebb177b416e67026e4':
  Fixed disabled buttons styling
  Added success/error notification for project reanalysis
This commit is contained in:
Timo Bejan 2021-01-12 14:13:07 +01:00
commit 2157f0ffa6
6 changed files with 33 additions and 20 deletions

View File

@ -99,15 +99,14 @@
</ace-editor>
</div>
<div class="changes-box" *ngIf="hasChanges">
<div class="changes-box" *ngIf="hasChanges && permissionsService.isAdmin()">
<redaction-icon-button
*ngIf="permissionsService.isAdmin()"
icon="red:check-alt"
(action)="saveEntries()"
text="dictionary-overview.save-changes"
type="primary"
></redaction-icon-button>
<div class="all-caps-label cancel" *ngIf="permissionsService.isAdmin()" (click)="revert()" translate="dictionary-overview.revert-changes"></div>
<div class="all-caps-label cancel" (click)="revert()" translate="dictionary-overview.revert-changes"></div>
</div>
</div>

View File

@ -26,15 +26,9 @@
>
</ace-editor>
</div>
<div class="changes-box" *ngIf="hasChanges">
<redaction-icon-button
*ngIf="permissionsService.isAdmin()"
icon="red:check"
(action)="save()"
text="rules-screen.save-changes"
type="primary"
></redaction-icon-button>
<div *ngIf="permissionsService.isAdmin()" (click)="revert()" translate="rules-screen.revert-changes" class="all-caps-label cancel"></div>
<div class="changes-box" *ngIf="hasChanges && permissionsService.isAdmin()">
<redaction-icon-button icon="red:check-alt" (action)="save()" text="rules-screen.save-changes" type="primary"></redaction-icon-button>
<div (click)="revert()" translate="rules-screen.revert-changes" class="all-caps-label cancel"></div>
</div>
</div>
</section>

View File

@ -20,16 +20,15 @@
<div class="left-container">
<div class="overlay-shadow"></div>
<div #viewer class="viewer"></div>
<div class="changes-box" *ngIf="changed">
<div class="changes-box" *ngIf="changed && permissionsService.isAdmin()">
<redaction-icon-button
*ngIf="permissionsService.isAdmin()"
[disabled]="configForm.invalid"
icon="red:check-alt"
(action)="save()"
text="watermark-screen.action.save"
type="primary"
></redaction-icon-button>
<div *ngIf="permissionsService.isAdmin()" (click)="revert()" translate="watermark-screen.action.revert" class="all-caps-label cancel"></div>
<div (click)="revert()" translate="watermark-screen.action.revert" class="all-caps-label cancel"></div>
</div>
</div>

View File

@ -1,6 +1,6 @@
import { ChangeDetectorRef, Component, HostListener, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { NotificationService } from '../../notification/notification.service';
import { NotificationService, NotificationType } from '../../notification/notification.service';
import { AppStateService } from '../../state/app-state.service';
import { FileDropOverlayService } from '../../upload/file-drop/service/file-drop-overlay.service';
import { FileUploadModel } from '../../upload/model/file-upload.model';
@ -114,7 +114,23 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
}
public reanalyseProject() {
return this.appStateService.reanalyzeProject().then(() => this.reloadProjects());
return this.appStateService
.reanalyzeProject()
.then(() => {
this.reloadProjects();
this._notificationService.showToastNotification(
this._translateService.instant('project-overview.reanalyse-project.success'),
null,
NotificationType.SUCCESS
);
})
.catch(() => {
this._notificationService.showToastNotification(
this._translateService.instant('project-overview.reanalyse-project.error'),
null,
NotificationType.ERROR
);
});
}
public isPending(fileStatusWrapper: FileStatusWrapper) {

View File

@ -260,6 +260,10 @@
"assign": "Assign Reviewer",
"reanalyse": "Analyze Documents",
"reanalyse-error-outdated": "Not all selected documents can be analyzed, some may not be assigned to you or are already analyzed."
},
"reanalyse-project": {
"success": "Files scheduled for reanalysis.",
"error": "Failed to schedule files for reanalysis. Please try again."
}
},
"file-preview": {

View File

@ -31,16 +31,17 @@
opacity: 0 !important;
}
.mat-flat-button.mat-primary {
.mat-flat-button.mat-primary,
.mat-button.primary {
padding: 0 14px;
transition: background-color 0.2s, color 0.2s;
background-color: $red-1;
&.mat-button-disabled {
background-color: $red-1;
color: $white;
> * {
.mat-button-wrapper {
color: $white;
opacity: 0.5;
}
}