Skip to content

Commit

Permalink
feat(cb2-14457): change conditions for displaying ADR details message
Browse files Browse the repository at this point in the history
  • Loading branch information
pbardy2000 committed Nov 22, 2024
1 parent ec3584a commit 70000bb
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 70000bb

Please sign in to comment.