From 08b8c7990adfea5d7e33de649ce358b2898dc1dd Mon Sep 17 00:00:00 2001 From: Darren Walker Date: Wed, 9 Oct 2024 14:42:58 +0100 Subject: [PATCH] fix problem where targets, technical goals, and fields are undefined rather than having a length of zero if none of these are added to a proposal --- .../observations/observationPanel.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/webui/src/ProposalEditorView/observations/observationPanel.tsx b/src/main/webui/src/ProposalEditorView/observations/observationPanel.tsx index 8cbf17e3..c306aa27 100644 --- a/src/main/webui/src/ProposalEditorView/observations/observationPanel.tsx +++ b/src/main/webui/src/ProposalEditorView/observations/observationPanel.tsx @@ -159,28 +159,28 @@ function Observations() { ) } - if (proposal.data?.targets?.length === 0 || - proposal.data?.technicalGoals?.length === 0 || - proposal.data?.fields?.length === 0) { + if (proposal.data?.targets === undefined || + proposal.data?.technicalGoals === undefined || + proposal.data?.fields === undefined) { return (
To create an observation please add the following: { - proposal.data?.targets?.length === 0 && + !proposal.data?.targets && } { - proposal.data?.technicalGoals?.length == 0 && + !proposal.data?.technicalGoals && } { - proposal.data.fields?.length == 0 && + !proposal.data?.fields &&