diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html index f0ecf0c69..8a063381a 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html @@ -1,11 +1,7 @@ -
+
- +
{{ 'file-preview.tabs.annotations.page-is' | translate }} - +
diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.ts index f6b6b8f96..5964fa174 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.ts @@ -23,6 +23,7 @@ import { IqserEventTarget, Required, shareDistinctLast, + shareLast, } from '@iqser/common-ui'; import { PermissionsService } from '@services/permissions.service'; import { WebViewerInstance } from '@pdftron/webviewer'; @@ -31,6 +32,7 @@ import { map, tap } from 'rxjs/operators'; import { File, IViewedPage } from '@red/domain'; import { ExcludedPagesService } from '../../services/excluded-pages.service'; import { MultiSelectService } from '../../services/multi-select.service'; +import { DocumentInfoService } from '../../services/document-info.service'; const COMMAND_KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Escape']; const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; @@ -66,13 +68,15 @@ export class FileWorkloadComponent { readonly displayedAnnotations$: Observable>; readonly multiSelectActive$: Observable; readonly multiSelectInactive$: Observable; + readonly showExcludedPages$: Observable; private _annotations$ = new BehaviorSubject([]); @ViewChild('annotationsElement') private readonly _annotationsElement: ElementRef; @ViewChild('quickNavigation') private readonly _quickNavigationElement: ElementRef; constructor( - readonly excludedPageService: ExcludedPagesService, + readonly excludedPagesService: ExcludedPagesService, readonly multiSelectService: MultiSelectService, + readonly documentInfoService: DocumentInfoService, private readonly _permissionsService: PermissionsService, private readonly _changeDetectorRef: ChangeDetectorRef, private readonly _filterService: FilterService, @@ -81,6 +85,7 @@ export class FileWorkloadComponent { this.displayedAnnotations$ = this._displayedAnnotations$; this.multiSelectActive$ = this._multiSelectActive$; this.multiSelectInactive$ = this._multiSelectInactive$; + this.showExcludedPages$ = this._showExcludedPages$; } @Input() @@ -100,6 +105,13 @@ export class FileWorkloadComponent { return this.file?.excludedPages?.includes(this.activeViewerPage); } + private get _showExcludedPages$() { + return this.excludedPagesService.shown$.pipe( + tap(() => this._disableMultiSelectAndDocumentInfo()), + shareLast(), + ); + } + private get _multiSelectInactive$() { return this.multiSelectService.inactive$.pipe( tap(value => { @@ -261,6 +273,11 @@ export class FileWorkloadComponent { this.selectPage.emit(this._nextPageWithAnnotations()); } + private _disableMultiSelectAndDocumentInfo(): void { + this.multiSelectService.deactivate(); + this.documentInfoService.hide(); + } + private _filterAnnotations( annotations: AnnotationWrapper[], primary: INestedFilter[], 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 1f44cd234..be2831925 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 @@ -81,7 +81,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni readonly dossierId: string; readonly canPerformAnnotationActions$: Observable; readonly dossier$: Observable; - readonly showExcludedPages$: Observable; readonly viewDocumentInfo$: Observable; readonly file$: Observable; readonly fileId: string; @@ -132,7 +131,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni }), shareLast(), ); - this.showExcludedPages$ = this._showExcludedPages$; this.viewDocumentInfo$ = this._viewDocumentInfo$; this.canPerformAnnotationActions$ = this._canPerformAnnotationActions$; @@ -171,10 +169,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni ); } - private get _showExcludedPages$() { - return this.excludedPagesService.shown$.pipe(tap(() => this._disableMultiSelectAndDocumentInfo())); - } - private get _canPerformAnnotationActions$() { return combineLatest([this.file$, this.viewModeService.viewMode$]).pipe( map(([file, viewMode]) => this.permissionsService.canPerformAnnotationActions(file) && viewMode === 'STANDARD'), diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/document-info.service.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/document-info.service.ts index 1b0651f8a..94b0625fd 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/document-info.service.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/document-info.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject, merge, Observable } from 'rxjs'; -import { shareDistinctLast } from '@iqser/common-ui'; +import { shareLast } from '@iqser/common-ui'; import { filter, map, startWith, withLatestFrom } from 'rxjs/operators'; import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service'; import { FileAttributesService } from '@services/entity-services/file-attributes.service'; @@ -18,10 +18,10 @@ export class DocumentInfoService { private readonly _fileAttributesService: FileAttributesService, private readonly _filesMapService: FilesMapService, ) { - this.shown$ = this._show$.asObservable().pipe(shareDistinctLast()); + this.shown$ = this._show$.asObservable().pipe(shareLast()); this.hidden$ = this.shown$.pipe( map(value => !value), - shareDistinctLast(), + shareLast(), ); }