update documentInfoService
This commit is contained in:
parent
d593a01162
commit
4fca8621fa
@ -95,7 +95,11 @@
|
|||||||
icon="red:needs-work"
|
icon="red:needs-work"
|
||||||
></iqser-empty-state>
|
></iqser-empty-state>
|
||||||
|
|
||||||
<redaction-document-info *ngIf="viewDocumentInfo$ | async" [dossier]="dossier" [file]="file"></redaction-document-info>
|
<redaction-document-info
|
||||||
|
*ngIf="documentInfoService.shown$ | async"
|
||||||
|
[dossier]="dossier"
|
||||||
|
[file]="file"
|
||||||
|
></redaction-document-info>
|
||||||
|
|
||||||
<redaction-file-workload
|
<redaction-file-workload
|
||||||
#fileWorkloadComponent
|
#fileWorkloadComponent
|
||||||
|
|||||||
@ -70,7 +70,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
readonly dossierId: string;
|
readonly dossierId: string;
|
||||||
readonly canPerformAnnotationActions$: Observable<boolean>;
|
readonly canPerformAnnotationActions$: Observable<boolean>;
|
||||||
readonly dossier$: Observable<Dossier>;
|
readonly dossier$: Observable<Dossier>;
|
||||||
readonly viewDocumentInfo$: Observable<boolean>;
|
|
||||||
readonly file$: Observable<File>;
|
readonly file$: Observable<File>;
|
||||||
readonly fileId: string;
|
readonly fileId: string;
|
||||||
ready = false;
|
ready = false;
|
||||||
@ -121,7 +120,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
}),
|
}),
|
||||||
shareLast(),
|
shareLast(),
|
||||||
);
|
);
|
||||||
this.viewDocumentInfo$ = this._viewDocumentInfo$;
|
|
||||||
this.canPerformAnnotationActions$ = this._canPerformAnnotationActions$;
|
this.canPerformAnnotationActions$ = this._canPerformAnnotationActions$;
|
||||||
|
|
||||||
document.documentElement.addEventListener('fullscreenchange', () => {
|
document.documentElement.addEventListener('fullscreenchange', () => {
|
||||||
@ -147,18 +145,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
return this.viewModeService.isStandard ? currentPage : currentPage % 2 === 0 ? currentPage / 2 : (currentPage + 1) / 2;
|
return this.viewModeService.isStandard ? currentPage : currentPage % 2 === 0 ? currentPage / 2 : (currentPage + 1) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private get _viewDocumentInfo$() {
|
|
||||||
return this.documentInfoService.shown$.pipe(
|
|
||||||
tap(value => {
|
|
||||||
if (value) {
|
|
||||||
this.multiSelectService.deactivate();
|
|
||||||
this.excludedPagesService.hide();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
shareDistinctLast(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private get _canPerformAnnotationActions$() {
|
private get _canPerformAnnotationActions$() {
|
||||||
return combineLatest([this.file$, this.viewModeService.viewMode$]).pipe(
|
return combineLatest([this.file$, this.viewModeService.viewMode$]).pipe(
|
||||||
map(([file, viewMode]) => this.permissionsService.canPerformAnnotationActions(file) && viewMode === 'STANDARD'),
|
map(([file, viewMode]) => this.permissionsService.canPerformAnnotationActions(file) && viewMode === 'STANDARD'),
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { BehaviorSubject, merge, Observable } from 'rxjs';
|
import { BehaviorSubject, merge, Observable } from 'rxjs';
|
||||||
import { shareLast } from '@iqser/common-ui';
|
import { shareLast } from '@iqser/common-ui';
|
||||||
import { filter, map, startWith, withLatestFrom } from 'rxjs/operators';
|
import { filter, map, startWith, tap, withLatestFrom } from 'rxjs/operators';
|
||||||
import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service';
|
import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service';
|
||||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||||
import { FilesMapService } from '@services/entity-services/files-map.service';
|
import { FilesMapService } from '@services/entity-services/files-map.service';
|
||||||
import { File, IFileAttributeConfig } from '@red/domain';
|
import { File, IFileAttributeConfig } from '@red/domain';
|
||||||
|
import { MultiSelectService } from './multi-select.service';
|
||||||
|
import { ExcludedPagesService } from './excluded-pages.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DocumentInfoService {
|
export class DocumentInfoService {
|
||||||
@ -17,8 +19,18 @@ export class DocumentInfoService {
|
|||||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||||
private readonly _fileAttributesService: FileAttributesService,
|
private readonly _fileAttributesService: FileAttributesService,
|
||||||
private readonly _filesMapService: FilesMapService,
|
private readonly _filesMapService: FilesMapService,
|
||||||
|
private readonly _multiSelectService: MultiSelectService,
|
||||||
|
private readonly _excludedPagesService: ExcludedPagesService,
|
||||||
) {
|
) {
|
||||||
this.shown$ = this._show$.asObservable().pipe(shareLast());
|
this.shown$ = this._show$.asObservable().pipe(
|
||||||
|
tap(show => {
|
||||||
|
if (show) {
|
||||||
|
this._multiSelectService.deactivate();
|
||||||
|
this._excludedPagesService.hide();
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
shareLast(),
|
||||||
|
);
|
||||||
this.hidden$ = this.shown$.pipe(
|
this.hidden$ = this.shown$.pipe(
|
||||||
map(value => !value),
|
map(value => !value),
|
||||||
shareLast(),
|
shareLast(),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user