From 70000bb38ca03fec7e4a366d94498bf4bf52e018 Mon Sep 17 00:00:00 2001 From: pbardy2000 <146740183+pbardy2000@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:10:50 +0000 Subject: [PATCH] feat(cb2-14457): change conditions for displaying ADR details message --- .../adr-section-edit/adr-section-edit.component.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/forms/custom-sections/adr-section/adr-section-edit/adr-section-edit.component.ts b/src/app/forms/custom-sections/adr-section/adr-section-edit/adr-section-edit.component.ts index 4b5409513c..e6ffb8d5d8 100644 --- a/src/app/forms/custom-sections/adr-section/adr-section-edit/adr-section-edit.component.ts +++ b/src/app/forms/custom-sections/adr-section/adr-section-edit/adr-section-edit.component.ts @@ -368,9 +368,10 @@ export class AdrSectionEditComponent implements OnInit, OnDestroy { } canDisplayDangerousGoodsWarning(value: TechRecordType<'hgv' | 'lgv' | 'trl'>) { - return ( - value.techRecord_adrDetails_dangerousGoods === false && - this.form.controls.techRecord_adrDetails_dangerousGoods.touched - ); + const touched = Object.entries(this.form.controls).some(([key, control]) => { + return key !== 'techRecord_adrDetails_dangerousGoods' && control.touched; + }); + + return value.techRecord_adrDetails_dangerousGoods === false && touched; } }