From 3e2bf64daa110d59f0629420aa83405a4715b6fa Mon Sep 17 00:00:00 2001 From: Donald Kibet Date: Thu, 5 Oct 2023 16:29:24 +0300 Subject: [PATCH] (enhc) Update alert feature to show when an expression evalutes (#87) --- .../afe-form-control.ts | 1 + .../afe-form-group.ts | 3 ++ .../form-renderer.component.html | 41 +++++++++++++++---- .../form-renderer.component.scss | 4 ++ src/app/adult-1.6.json | 4 ++ 5 files changed, 45 insertions(+), 8 deletions(-) diff --git a/projects/ngx-formentry/src/abstract-controls-extension/afe-form-control.ts b/projects/ngx-formentry/src/abstract-controls-extension/afe-form-control.ts index 8a30deaa..15a0e218 100644 --- a/projects/ngx-formentry/src/abstract-controls-extension/afe-form-control.ts +++ b/projects/ngx-formentry/src/abstract-controls-extension/afe-form-control.ts @@ -147,6 +147,7 @@ class AfeFormControl ) { this._valueChangeListener(value); } + this.alerts.length > 0 && this.updateAlert(); } setValue(value: any) { diff --git a/projects/ngx-formentry/src/abstract-controls-extension/afe-form-group.ts b/projects/ngx-formentry/src/abstract-controls-extension/afe-form-group.ts index 910fc01f..0700b0a6 100644 --- a/projects/ngx-formentry/src/abstract-controls-extension/afe-form-group.ts +++ b/projects/ngx-formentry/src/abstract-controls-extension/afe-form-group.ts @@ -112,5 +112,8 @@ export class AfeFormGroup } setValue(value: any) { super.setValue(value); + if (this.alerts.length > 0) { + this.updateAlert(); + } } } diff --git a/projects/ngx-formentry/src/form-entry/form-renderer/form-renderer.component.html b/projects/ngx-formentry/src/form-entry/form-renderer/form-renderer.component.html index 4dafc20b..f667c7b4 100644 --- a/projects/ngx-formentry/src/form-entry/form-renderer/form-renderer.component.html +++ b/projects/ngx-formentry/src/form-entry/form-renderer/form-renderer.component.html @@ -122,14 +122,6 @@ - -
- × {{ node.control.alert }} -
-
+ + + +
= 40", + "message": "The patient temperature is too high" + }, "type": "obs", "validators": [], "id": "__yuHJFKyxE"