From db1257751ad140fe52a6bb2cb5c4fa976303217e Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Wed, 28 Aug 2024 13:22:37 +0300 Subject: [PATCH] RED-9887: fixed save button being disabled. --- ...le-structured-component-value.component.html | 2 +- ...able-structured-component-value.component.ts | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html index ee52fc338..b12b528d5 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html @@ -54,7 +54,7 @@
diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts index 923fc5b3c..128482377 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts @@ -48,14 +48,6 @@ export class EditableStructuredComponentValueComponent implements OnInit { protected entryLabel: string; protected editing = false; protected initialEntry: IComponentLogEntry; - disabled = computed(() => { - for (let i = 0; i < this.currentEntry().componentValues.length; i++) { - if (this.currentEntry().componentValues[i].value !== this.initialEntry.componentValues[i]?.value) { - return false; - } - } - return this.currentEntry().componentValues.length === this.initialEntry.componentValues.length; - }); protected readonly iconButtonTypes = IconButtonTypes; constructor( @@ -64,6 +56,15 @@ export class EditableStructuredComponentValueComponent implements OnInit { private readonly _state: FilePreviewStateService, ) {} + get disabled() { + for (let i = 0; i < this.currentEntry().componentValues.length; i++) { + if (this.currentEntry().componentValues[i].value !== this.initialEntry.componentValues[i]?.value) { + return false; + } + } + return this.currentEntry().componentValues.length === this.initialEntry.componentValues.length; + } + get #initialEntry() { return JSON.parse(JSON.stringify(this.entry())); }