RED-6956 - Document Info is open when I re-visit a document

This commit is contained in:
Valentin Mihai 2023-08-09 13:00:25 +03:00
parent d2cce57319
commit e251c29af8
4 changed files with 14 additions and 8 deletions

View File

@ -10,7 +10,7 @@
></iqser-circle-button>
<iqser-circle-button
(action)="documentInfoService.hide()"
(action)="closeView()"
[tooltip]="'file-preview.tabs.document-info.close' | translate"
buttonId="close-document-info-btn"
icon="iqser:close"

View File

@ -8,6 +8,7 @@ import { FilePreviewDialogService } from '../../services/file-preview-dialog.ser
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
import { ContextComponent } from '@iqser/common-ui/lib/utils';
import { toSignal } from '@angular/core/rxjs-interop';
import { setLocalStorageDataByFileId } from '@utils/local-storage';
interface FileAttribute {
label: string;
@ -29,7 +30,7 @@ export class DocumentInfoComponent extends ContextComponent<Context> {
protected readonly _dossierTemplate = toSignal(inject(DossierTemplatesService).getEntityChanged$(this._state.dossierTemplateId));
protected readonly _fileAttributesConfig = toSignal(inject(FileAttributesService).fileAttributesConfig$);
protected readonly _attributes = toSignal(
this.documentInfoService.fileAttributes$(this._state.fileId, this._state.dossierId, this._state.dossierTemplateId),
this._documentInfoService.fileAttributes$(this._state.fileId, this._state.dossierId, this._state.dossierTemplateId),
);
protected readonly _fileAttributes = computed(() => {
this._fileAttributesConfig();
@ -38,7 +39,7 @@ export class DocumentInfoComponent extends ContextComponent<Context> {
constructor(
readonly permissionsService: PermissionsService,
readonly documentInfoService: DocumentInfoService,
private readonly _documentInfoService: DocumentInfoService,
private readonly _dialogService: FilePreviewDialogService,
) {
super();
@ -51,4 +52,9 @@ export class DocumentInfoComponent extends ContextComponent<Context> {
isDate(attribute: FileAttribute) {
return attribute.type === FileAttributeConfigTypes.DATE;
}
closeView() {
this._documentInfoService.hide();
setLocalStorageDataByFileId(this._state.fileId, 'show-document-info', false);
}
}

View File

@ -456,18 +456,18 @@ export class FileActionsComponent implements OnChanges {
this._loadingService.stop();
}
async #toggleExcludePages() {
#toggleExcludePages() {
this._excludedPagesService.toggle();
const shown = await this._excludedPagesService.shown();
const shown = this._excludedPagesService.shown();
setLocalStorageDataByFileId(this.file.id, 'show-exclude-pages', shown);
if (shown) {
setLocalStorageDataByFileId(this.file.id, 'show-document-info', false);
}
}
async #toggleDocumentInfo() {
#toggleDocumentInfo() {
this._documentInfoService.toggle();
const shown = await this._documentInfoService.shown();
const shown = this._documentInfoService.shown();
setLocalStorageDataByFileId(this.file.id, 'show-document-info', shown);
if (shown) {
setLocalStorageDataByFileId(this.file.id, 'show-exclude-pages', false);

@ -1 +1 @@
Subproject commit 04a69f5e689cf4d90efbd550cbf6938ae7c0a200
Subproject commit a52f55b5d4b7a18c8e921a193b34619f85912a1b