RED-3525: Disable switch to highlights if no highlights in file
This commit is contained in:
parent
cf2d935c0b
commit
2a46fdb95a
@ -34,7 +34,7 @@
|
|||||||
<button
|
<button
|
||||||
(click)="switchView.emit('TEXT_HIGHLIGHTS')"
|
(click)="switchView.emit('TEXT_HIGHLIGHTS')"
|
||||||
[class.active]="viewModeService.isTextHighlights"
|
[class.active]="viewModeService.isTextHighlights"
|
||||||
[disabled]="(canSwitchToRedactedView$ | async) === false"
|
[disabled]="(canSwitchToHighlightsView$ | async) === false"
|
||||||
[matTooltip]="'file-preview.text-highlights-tooltip' | translate"
|
[matTooltip]="'file-preview.text-highlights-tooltip' | translate"
|
||||||
class="red-tab"
|
class="red-tab"
|
||||||
iqserHelpMode="highlights_view"
|
iqserHelpMode="highlights_view"
|
||||||
|
|||||||
@ -17,6 +17,7 @@ export class ViewSwitchComponent {
|
|||||||
|
|
||||||
readonly canSwitchToDeltaView$: Observable<boolean>;
|
readonly canSwitchToDeltaView$: Observable<boolean>;
|
||||||
readonly canSwitchToRedactedView$: Observable<boolean>;
|
readonly canSwitchToRedactedView$: Observable<boolean>;
|
||||||
|
readonly canSwitchToHighlightsView$: Observable<boolean>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly viewModeService: ViewModeService,
|
readonly viewModeService: ViewModeService,
|
||||||
@ -28,5 +29,9 @@ export class ViewSwitchComponent {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.canSwitchToRedactedView$ = _stateService.file$.pipe(map(file => !file.analysisRequired && !file.excluded));
|
this.canSwitchToRedactedView$ = _stateService.file$.pipe(map(file => !file.analysisRequired && !file.excluded));
|
||||||
|
|
||||||
|
this.canSwitchToHighlightsView$ = _stateService.file$.pipe(
|
||||||
|
map(file => file.hasHighlights && !file.analysisRequired && !file.excluded),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 70b61282309cb290406c538b5218341cb4f1c40a
|
Subproject commit 37edb34d0fc3cf49dd889e98f5ec3d39227649f5
|
||||||
@ -50,6 +50,7 @@ export class File extends Entity<IFile> implements IFile, IRouterPath {
|
|||||||
readonly fileManipulationDate: string;
|
readonly fileManipulationDate: string;
|
||||||
readonly redactionModificationDate: string;
|
readonly redactionModificationDate: string;
|
||||||
readonly lastManualChangeDate?: string;
|
readonly lastManualChangeDate?: string;
|
||||||
|
readonly hasHighlights: boolean;
|
||||||
|
|
||||||
readonly statusSort: number;
|
readonly statusSort: number;
|
||||||
readonly cacheIdentifier?: string;
|
readonly cacheIdentifier?: string;
|
||||||
@ -110,6 +111,7 @@ export class File extends Entity<IFile> implements IFile, IRouterPath {
|
|||||||
this.fileManipulationDate = file.fileManipulationDate ?? '';
|
this.fileManipulationDate = file.fileManipulationDate ?? '';
|
||||||
this.redactionModificationDate = file.redactionModificationDate ?? '';
|
this.redactionModificationDate = file.redactionModificationDate ?? '';
|
||||||
this.lastManualChangeDate = file.lastManualChangeDate;
|
this.lastManualChangeDate = file.lastManualChangeDate;
|
||||||
|
this.hasHighlights = file.hasHighlights;
|
||||||
|
|
||||||
this.statusSort = StatusSorter[this.workflowStatus];
|
this.statusSort = StatusSorter[this.workflowStatus];
|
||||||
this.cacheIdentifier = btoa(this.fileManipulationDate ?? '');
|
this.cacheIdentifier = btoa(this.fileManipulationDate ?? '');
|
||||||
|
|||||||
@ -147,6 +147,8 @@ export interface IFile {
|
|||||||
|
|
||||||
readonly workflowStatus: WorkflowFileStatus;
|
readonly workflowStatus: WorkflowFileStatus;
|
||||||
|
|
||||||
|
readonly hasHighlights: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Last time the actual file was touched
|
* Last time the actual file was touched
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user