From 420a564a8371396f70c196a645e7a25d93a4c78d Mon Sep 17 00:00:00 2001 From: Irmantas Kaukas Date: Thu, 18 Jan 2024 17:00:01 +0100 Subject: [PATCH] fix: adding new value for optional resource #DEV-3031 (#1360) --- .../add-value/add-value.component.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/dsp-app/src/app/workspace/resource/operations/add-value/add-value.component.ts b/apps/dsp-app/src/app/workspace/resource/operations/add-value/add-value.component.ts index cc9c73bafe..b76d4e7d3d 100644 --- a/apps/dsp-app/src/app/workspace/resource/operations/add-value/add-value.component.ts +++ b/apps/dsp-app/src/app/workspace/resource/operations/add-value/add-value.component.ts @@ -1,4 +1,15 @@ -import { AfterViewInit, Component, EventEmitter, Inject, Input, OnInit, Output, ViewChild } from '@angular/core'; +import { + AfterViewInit, + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + EventEmitter, + Inject, + Input, + OnInit, + Output, + ViewChild, +} from '@angular/core'; import { ApiResponseError, Constants, @@ -21,6 +32,7 @@ import { import { ValueService } from '../../services/value.service'; @Component({ + changeDetection: ChangeDetectionStrategy.OnPush, selector: 'app-add-value', templateUrl: './add-value.component.html', styleUrls: ['./add-value.component.scss'], @@ -62,7 +74,8 @@ export class AddValueComponent implements OnInit, AfterViewInit { @Inject(DspApiConnectionToken) private _dspApiConnection: KnoraApiConnection, private _valueOperationEventService: ValueOperationEventService, - private _valueService: ValueService + private _valueService: ValueService, + private _cd: ChangeDetectorRef ) {} ngOnInit() { @@ -140,6 +153,7 @@ export class AddValueComponent implements OnInit, AfterViewInit { // hide the progress indicator this.submittingValue = false; + this._cd.markForCheck(); }, (error: ApiResponseError) => { // hide the progress indicator