From 82ecbcfd245d11e6dac5a721c459281ca40daebc Mon Sep 17 00:00:00 2001 From: Elena Grednikova Date: Tue, 15 Aug 2023 15:48:58 +0200 Subject: [PATCH] Fix type errors --- .../containers/Main/MappingEditor/index.tsx | 39 ++++++++++--------- .../Main/QuestionnaireEditor/index.tsx | 31 ++++++++------- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/web/src/containers/Main/MappingEditor/index.tsx b/web/src/containers/Main/MappingEditor/index.tsx index a1c21c79..257bfc17 100644 --- a/web/src/containers/Main/MappingEditor/index.tsx +++ b/web/src/containers/Main/MappingEditor/index.tsx @@ -1,3 +1,4 @@ +import classNames from 'classnames'; import { Questionnaire, QuestionnaireResponse, Parameters } from 'fhir/r4b'; import { useEffect, useState } from 'react'; import { SingleValue } from 'react-select'; @@ -19,7 +20,7 @@ interface Props { questionnaireRD: RemoteData; onSave: (resource: WithId) => void; onChange: (resource: WithId) => void; - mappingRD: RemoteData; + mappingRD: RemoteData>; launchContext: Parameters; questionnaireResponseRD: RemoteData; reload: () => void; @@ -32,7 +33,7 @@ export function MappingEditor(props: Props) { const { mappingsRD } = useMappingEditor(questionnaireRD); const [showSelect, setShowSelect] = useState(false); const [showModal, setShowModal] = useState(false); - const [updatedResource, setUpdatedResource] = useState(); + const [updatedResource, setUpdatedResource] = useState | undefined>(); useEffect(() => { if (isFailure(questionnaireResponseRD) || isLoading(questionnaireResponseRD)) { @@ -86,10 +87,10 @@ export function MappingEditor(props: Props) { ); }; - const renderEditor = (mapping: Mapping) => { + const renderEditor = (mapping: WithId) => { return ( <> - + > {...props} resource={mapping} onChange={setUpdatedResource} @@ -104,20 +105,22 @@ export function MappingEditor(props: Props) { > remove - {/* */} + {false && ( + + )} ); diff --git a/web/src/containers/Main/QuestionnaireEditor/index.tsx b/web/src/containers/Main/QuestionnaireEditor/index.tsx index 2510918d..d73035bc 100644 --- a/web/src/containers/Main/QuestionnaireEditor/index.tsx +++ b/web/src/containers/Main/QuestionnaireEditor/index.tsx @@ -1,3 +1,4 @@ +import classNames from 'classnames'; import { Questionnaire, Parameters, QuestionnaireResponse } from 'fhir/r4b'; import { useEffect, useState } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; @@ -87,20 +88,22 @@ export function QuestionnaireEditor(props: Props) { > remove - {/* */} + {false && ( + + )} )}