RED-6956 - Document Info is open when I re-visit a document
This commit is contained in:
parent
d2cce57319
commit
e251c29af8
@ -10,7 +10,7 @@
|
|||||||
></iqser-circle-button>
|
></iqser-circle-button>
|
||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="documentInfoService.hide()"
|
(action)="closeView()"
|
||||||
[tooltip]="'file-preview.tabs.document-info.close' | translate"
|
[tooltip]="'file-preview.tabs.document-info.close' | translate"
|
||||||
buttonId="close-document-info-btn"
|
buttonId="close-document-info-btn"
|
||||||
icon="iqser:close"
|
icon="iqser:close"
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import { FilePreviewDialogService } from '../../services/file-preview-dialog.ser
|
|||||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||||
import { ContextComponent } from '@iqser/common-ui/lib/utils';
|
import { ContextComponent } from '@iqser/common-ui/lib/utils';
|
||||||
import { toSignal } from '@angular/core/rxjs-interop';
|
import { toSignal } from '@angular/core/rxjs-interop';
|
||||||
|
import { setLocalStorageDataByFileId } from '@utils/local-storage';
|
||||||
|
|
||||||
interface FileAttribute {
|
interface FileAttribute {
|
||||||
label: string;
|
label: string;
|
||||||
@ -29,7 +30,7 @@ export class DocumentInfoComponent extends ContextComponent<Context> {
|
|||||||
protected readonly _dossierTemplate = toSignal(inject(DossierTemplatesService).getEntityChanged$(this._state.dossierTemplateId));
|
protected readonly _dossierTemplate = toSignal(inject(DossierTemplatesService).getEntityChanged$(this._state.dossierTemplateId));
|
||||||
protected readonly _fileAttributesConfig = toSignal(inject(FileAttributesService).fileAttributesConfig$);
|
protected readonly _fileAttributesConfig = toSignal(inject(FileAttributesService).fileAttributesConfig$);
|
||||||
protected readonly _attributes = toSignal(
|
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(() => {
|
protected readonly _fileAttributes = computed(() => {
|
||||||
this._fileAttributesConfig();
|
this._fileAttributesConfig();
|
||||||
@ -38,7 +39,7 @@ export class DocumentInfoComponent extends ContextComponent<Context> {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly permissionsService: PermissionsService,
|
readonly permissionsService: PermissionsService,
|
||||||
readonly documentInfoService: DocumentInfoService,
|
private readonly _documentInfoService: DocumentInfoService,
|
||||||
private readonly _dialogService: FilePreviewDialogService,
|
private readonly _dialogService: FilePreviewDialogService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
@ -51,4 +52,9 @@ export class DocumentInfoComponent extends ContextComponent<Context> {
|
|||||||
isDate(attribute: FileAttribute) {
|
isDate(attribute: FileAttribute) {
|
||||||
return attribute.type === FileAttributeConfigTypes.DATE;
|
return attribute.type === FileAttributeConfigTypes.DATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeView() {
|
||||||
|
this._documentInfoService.hide();
|
||||||
|
setLocalStorageDataByFileId(this._state.fileId, 'show-document-info', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -456,18 +456,18 @@ export class FileActionsComponent implements OnChanges {
|
|||||||
this._loadingService.stop();
|
this._loadingService.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
async #toggleExcludePages() {
|
#toggleExcludePages() {
|
||||||
this._excludedPagesService.toggle();
|
this._excludedPagesService.toggle();
|
||||||
const shown = await this._excludedPagesService.shown();
|
const shown = this._excludedPagesService.shown();
|
||||||
setLocalStorageDataByFileId(this.file.id, 'show-exclude-pages', shown);
|
setLocalStorageDataByFileId(this.file.id, 'show-exclude-pages', shown);
|
||||||
if (shown) {
|
if (shown) {
|
||||||
setLocalStorageDataByFileId(this.file.id, 'show-document-info', false);
|
setLocalStorageDataByFileId(this.file.id, 'show-document-info', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async #toggleDocumentInfo() {
|
#toggleDocumentInfo() {
|
||||||
this._documentInfoService.toggle();
|
this._documentInfoService.toggle();
|
||||||
const shown = await this._documentInfoService.shown();
|
const shown = this._documentInfoService.shown();
|
||||||
setLocalStorageDataByFileId(this.file.id, 'show-document-info', shown);
|
setLocalStorageDataByFileId(this.file.id, 'show-document-info', shown);
|
||||||
if (shown) {
|
if (shown) {
|
||||||
setLocalStorageDataByFileId(this.file.id, 'show-exclude-pages', false);
|
setLocalStorageDataByFileId(this.file.id, 'show-exclude-pages', false);
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 04a69f5e689cf4d90efbd550cbf6938ae7c0a200
|
Subproject commit a52f55b5d4b7a18c8e921a193b34619f85912a1b
|
||||||
Loading…
x
Reference in New Issue
Block a user