diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 5be2282b7..4f1bbc0ae 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -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; diff --git a/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts index f13b86b1a..964825091 100644 --- a/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts @@ -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(); @@ -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 {