Redacted view no longer available if data is out of sync

This commit is contained in:
Timo Bejan 2020-11-06 22:08:18 +02:00
parent cf1132745a
commit 081a25d3d6
4 changed files with 31 additions and 3 deletions

View File

@ -1,9 +1,24 @@
<section [class.hidden]="!viewReady">
<div class="page-header">
<div class="flex-1">
<mat-slide-toggle [(ngModel)]="redactedView" color="primary" labelPosition="after">
{{ 'file-preview.view-toggle' | translate }}
</mat-slide-toggle>
<div
class="fit-content"
[matTooltip]="
(canNotSwitchToRedactedView
? 'file-preview.cannot-show-redacted-view'
: 'file-preview.show-redacted-view'
) | translate
"
>
<mat-slide-toggle
[(ngModel)]="redactedView"
color="primary"
labelPosition="after"
[disabled]="canNotSwitchToRedactedView"
>
{{ 'file-preview.view-toggle' | translate }}
</mat-slide-toggle>
</div>
</div>
<div class="flex-1 filename page-title">

View File

@ -118,6 +118,13 @@ export class FilePreviewScreenComponent implements OnInit {
canPerformAnnotationActions: boolean;
get canNotSwitchToRedactedView() {
return (
this.appStateService.fileNotUpToDateWithDictionary() ||
this.fileData?.entriesToAdd?.length > 0
);
}
public ngOnInit(): void {
this.canPerformAnnotationActions = this.appStateService.canPerformAnnotationActionsOnCurrentFile();
this._loadFileData().subscribe(() => {});

View File

@ -247,6 +247,8 @@
}
},
"file-preview": {
"show-redacted-view": "Show Redacted Preview",
"cannot-show-redacted-view": "Redactions out of sync. Redacted Preview only available after reanalysis",
"reanalyse-file": "File reanalysis in progress... ",
"view-toggle": "Redacted View",
"tabs": {

View File

@ -198,3 +198,7 @@ body {
height: calc(100vh - 61px);
position: relative;
}
.fit-content {
width: fit-content;
}