From 3afabf5a10fb7ea4e284f77549a661539d48ed11 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Thu, 20 Jul 2023 16:11:53 +0300 Subject: [PATCH] RED-6973: Fix multiple editing. --- .../file-attribute/file-attribute.component.ts | 12 ++++++------ .../workflow-item/workflow-item.component.html | 2 +- .../workflow-item/workflow-item.component.ts | 3 ++- .../entity-services/file-attributes.service.ts | 6 ++++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.ts b/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.ts index 6b7e82b2a..c853cafb8 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.ts +++ b/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.ts @@ -26,14 +26,14 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr closedDatepicker = true; readonly #subscriptions = new Subscription(); readonly shouldClose$ = this.fileAttributesService.isEditingFileAttribute$.pipe( - filter(value => value === true), tap(value => { if ( - value && - !!this.file && - !!this.fileAttribute && - (this.fileAttribute.id !== this.fileAttributesService.openAttributeEdit$.value || - this.file.fileId !== this.fileAttributesService.fileEdit$.value) + (value && + !!this.file && + !!this.fileAttribute && + (this.fileAttribute.id !== this.fileAttributesService.openAttributeEdit$.value || + this.file.fileId !== this.fileAttributesService.fileEdit$.value)) || + !this.fileAttributesService.openAttributeEdits$.value.length ) { this.close(); } diff --git a/apps/red-ui/src/app/modules/dossier-overview/components/workflow-item/workflow-item.component.html b/apps/red-ui/src/app/modules/dossier-overview/components/workflow-item/workflow-item.component.html index 3b37ea586..e2afae74b 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/components/workflow-item/workflow-item.component.html +++ b/apps/red-ui/src/app/modules/dossier-overview/components/workflow-item/workflow-item.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/apps/red-ui/src/app/modules/dossier-overview/components/workflow-item/workflow-item.component.ts b/apps/red-ui/src/app/modules/dossier-overview/components/workflow-item/workflow-item.component.ts index f2a7488d8..e242710f4 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/components/workflow-item/workflow-item.component.ts +++ b/apps/red-ui/src/app/modules/dossier-overview/components/workflow-item/workflow-item.component.ts @@ -1,6 +1,7 @@ import { ChangeDetectorRef, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core'; import { Dossier, File, IFileAttributeConfig } from '@red/domain'; import { Debounce } from '@iqser/common-ui'; +import { FileAttributesService } from '@services/entity-services/file-attributes.service'; @Component({ selector: 'redaction-workflow-item [file] [dossier] [displayedAttributes]', @@ -15,7 +16,7 @@ export class WorkflowItemComponent implements OnInit { @ViewChild('actionsWrapper', { static: true }) private _actionsWrapper: ElementRef; - constructor(private readonly _changeRef: ChangeDetectorRef) {} + constructor(readonly fileAttributesService: FileAttributesService, private readonly _changeRef: ChangeDetectorRef) {} ngOnInit(): void { const _observer = new ResizeObserver((entries: ResizeObserverEntry[]) => { diff --git a/apps/red-ui/src/app/services/entity-services/file-attributes.service.ts b/apps/red-ui/src/app/services/entity-services/file-attributes.service.ts index 064dc1a01..206ae313d 100644 --- a/apps/red-ui/src/app/services/entity-services/file-attributes.service.ts +++ b/apps/red-ui/src/app/services/entity-services/file-attributes.service.ts @@ -35,6 +35,12 @@ export class FileAttributesService extends EntitiesService