better fix for RED-2810

This commit is contained in:
Dan Percic 2021-12-13 20:22:16 +02:00
parent 27d148b3d0
commit f132a8824a
2 changed files with 25 additions and 34 deletions

View File

@ -1,14 +1,4 @@
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
HostListener,
NgZone,
OnDestroy,
OnInit,
TemplateRef,
ViewChild,
} from '@angular/core';
import { ChangeDetectorRef, Component, HostListener, NgZone, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
import { ActivatedRoute, ActivatedRouteSnapshot, NavigationExtras, Router } from '@angular/router';
import { AppStateService } from '@state/app-state.service';
import { Core, WebViewerInstance } from '@pdftron/webviewer';
@ -64,7 +54,6 @@ const ALL_HOTKEY_ARRAY = ['Escape', 'F', 'f'];
templateUrl: './file-preview-screen.component.html',
styleUrls: ['./file-preview-screen.component.scss'],
providers: [FilterService, ExcludedPagesService, ViewModeService, MultiSelectService, DocumentInfoService],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnInit, OnDestroy, OnAttach, OnDetach {
readonly circleButtonTypes = CircleButtonTypes;

View File

@ -21,7 +21,6 @@ import {
ConfirmationDialogInput,
IqserTooltipPosition,
LoadingService,
Required,
Toaster,
} from '@iqser/common-ui';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
@ -40,7 +39,7 @@ import { DocumentInfoService } from '../../../screens/file-preview-screen/servic
import { ExpandableFileActionsComponent } from '@shared/components/expandable-file-actions/expandable-file-actions.component';
@Component({
selector: 'redaction-file-actions',
selector: 'redaction-file-actions [file] [type]',
templateUrl: './file-actions.component.html',
styleUrls: ['./file-actions.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
@ -49,8 +48,8 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
readonly circleButtonTypes = CircleButtonTypes;
readonly currentUser = this._userService.currentUser;
@Input() @Required() file: File;
@Input() @Required() type: 'file-preview' | 'dossier-overview-list' | 'dossier-overview-workflow';
@Input() file: File;
@Input() type: 'file-preview' | 'dossier-overview-list' | 'dossier-overview-workflow';
@Input() maxWidth: number;
@Output() readonly ocredFile = new EventEmitter<void>();
@ -58,28 +57,30 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
assignTooltip?: string;
buttonType?: CircleButtonType;
showUndoApproval: boolean;
showAssignToSelf: boolean;
showAssign: boolean;
showDelete: boolean;
showOCR: boolean;
canReanalyse: boolean;
showUnderReview: boolean;
showUnderApproval: boolean;
showApprove: boolean;
canToggleAnalysis: boolean;
showStatusBar: boolean;
showOpenDocument: boolean;
showReanalyseFilePreview: boolean;
showReanalyseDossierOverview: boolean;
analysisForced: boolean;
showUndoApproval = false;
showAssignToSelf = false;
showAssign = false;
showDelete = false;
showOCR = false;
canReanalyse = false;
showUnderReview = false;
showUnderApproval = false;
showApprove = false;
canToggleAnalysis = false;
showStatusBar = false;
showOpenDocument = false;
showReanalyseFilePreview = false;
showReanalyseDossierOverview = false;
analysisForced = false;
isDossierOverview = false;
isDossierOverviewList = false;
isDossierOverviewWorkflow = false;
isFilePreview = false;
tooltipPosition: IqserTooltipPosition;
buttons: Action[];
@ViewChild(ExpandableFileActionsComponent) _expandableActionsComponent: ExpandableFileActionsComponent;
@ViewChild(ExpandableFileActionsComponent)
private readonly _expandableActionsComponent: ExpandableFileActionsComponent;
constructor(
@Optional() private readonly _excludedPagesService: ExcludedPagesService,
@ -100,8 +101,9 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
super();
}
@HostBinding('class.keep-visible') get expanded() {
return this._expandableActionsComponent?.expanded;
@HostBinding('class.keep-visible')
get expanded() {
return !!this._expandableActionsComponent?.expanded;
}
private get _toggleTooltip(): string {