From 684ea1a538d59a125d285378b766dd2d08be444b Mon Sep 17 00:00:00 2001 From: "aqeel.tapia" Date: Wed, 21 Aug 2024 14:02:32 -0600 Subject: [PATCH] fixed compile warnings --- .../AdvancedQuestionOptions.tsx | 2 +- .../Languages/Translation/TranslateSettings.tsx | 2 +- src/components/Metadata/MetadataEditor.tsx | 12 ------------ src/components/Navbar/Navbar.tsx | 2 +- src/components/Question/Question.tsx | 9 ++------- src/components/Question/QuestionType/Choice.tsx | 2 +- 6 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/components/AdvancedQuestionOptions/AdvancedQuestionOptions.tsx b/src/components/AdvancedQuestionOptions/AdvancedQuestionOptions.tsx index ae20457..79835b3 100644 --- a/src/components/AdvancedQuestionOptions/AdvancedQuestionOptions.tsx +++ b/src/components/AdvancedQuestionOptions/AdvancedQuestionOptions.tsx @@ -263,7 +263,7 @@ const AdvancedQuestionOptions = ({ item, parentArray }: AdvancedQuestionOptionsP
{`${t('LinkId is already in use')} `}
diff --git a/src/components/Languages/Translation/TranslateSettings.tsx b/src/components/Languages/Translation/TranslateSettings.tsx index 8153f28..51a9284 100644 --- a/src/components/Languages/Translation/TranslateSettings.tsx +++ b/src/components/Languages/Translation/TranslateSettings.tsx @@ -35,7 +35,7 @@ const TranslateSettings = ({
{t('Questionnaire settings')}
{Object.values(translatableSettings).map((extensionToTranslate) => { - if (!extensionToTranslate) return; + if (!extensionToTranslate) return []; const mainExtension = (extensions || []).find((e) => e.url === extensionToTranslate.extension); let baseValue; diff --git a/src/components/Metadata/MetadataEditor.tsx b/src/components/Metadata/MetadataEditor.tsx index b889cf3..f3b72c7 100644 --- a/src/components/Metadata/MetadataEditor.tsx +++ b/src/components/Metadata/MetadataEditor.tsx @@ -15,7 +15,6 @@ import { TreeContext } from '../../store/treeStore/treeStore'; import { updateQuestionnaireMetadataAction } from '../../store/treeStore/treeActions'; import RadioBtn from '../RadioBtn/RadioBtn'; import InputField from '../InputField/inputField'; -import { UseContextSystem } from '../../types/IQuestionnareItemType'; const MetadataEditor = (): JSX.Element => { const { t } = useTranslation(); @@ -31,17 +30,6 @@ const MetadataEditor = (): JSX.Element => { dispatch(updateQuestionnaireMetadataAction(propName, value)); }; - const getUseContextSystem = (): string => { - const system = - qMetadata.useContext && - qMetadata.useContext.length > 0 && - qMetadata.useContext[0].valueCodeableConcept?.coding && - qMetadata.useContext[0].valueCodeableConcept.coding.length > 0 && - qMetadata.useContext[0].valueCodeableConcept.coding[0].system; - - return system || UseContextSystem.helsetjeneste_full; - }; - return (
diff --git a/src/components/Navbar/Navbar.tsx b/src/components/Navbar/Navbar.tsx index 9c1a1c2..5a0be5f 100644 --- a/src/components/Navbar/Navbar.tsx +++ b/src/components/Navbar/Navbar.tsx @@ -116,7 +116,7 @@ const Navbar = ({ <>
diff --git a/src/components/Question/Question.tsx b/src/components/Question/Question.tsx index c0fcee9..e59d3fe 100644 --- a/src/components/Question/Question.tsx +++ b/src/components/Question/Question.tsx @@ -15,7 +15,7 @@ import { IExtentionType, IItemProperty, IQuestionnaireItemType } from '../../typ import { updateItemAction } from '../../store/treeStore/treeActions'; import { isRecipientList } from '../../helpers/QuestionHelper'; import { createMarkdownExtension, removeItemExtension, setItemExtension, hasExtension } from '../../helpers/extensionHelper'; -import { isItemControlInline, isItemControlReceiverComponent, isItemControlHighlight } from '../../helpers/itemControl'; +import { isItemControlInline, isItemControlHighlight } from '../../helpers/itemControl'; import Accordion from '../Accordion/Accordion'; import { ActionType } from '../../store/treeStore/treeStore'; @@ -36,7 +36,6 @@ import { ValidationErrors } from '../../helpers/orphanValidation'; import { canTypeBeRequired, canTypeBeValidated, - canTypeHaveSublabel, getItemDisplayType, } from '../../helpers/questionTypeFeatures'; import SliderSettings from './SliderSettings/SliderSettings'; @@ -54,7 +53,7 @@ interface QuestionProps { const Question = (props: QuestionProps): JSX.Element => { const { t } = useTranslation(); - const [isMarkdownActivated, setIsMarkdownActivated] = React.useState(!!props.item._text); + const [isMarkdownActivated] = React.useState(!!props.item._text); const codeElements = props.item.code ? `(${props.item.code.length})` : '(0)'; // eslint-disable-next-line @typescript-eslint/no-var-requires const removeMd = require('remove-markdown'); @@ -75,10 +74,6 @@ const Question = (props: QuestionProps): JSX.Element => { return labelText || props.item.text || ''; }; - const getSublabelText = (): string => { - return props.item.extension?.find((x) => x.url === IExtentionType.sublabel)?.valueMarkdown || ''; - }; - const convertToPlaintext = (stringToBeConverted: string) => { let plainText = removeMd(stringToBeConverted); plainText = plainText.replaceAll('\\*', '*'); diff --git a/src/components/Question/QuestionType/Choice.tsx b/src/components/Question/QuestionType/Choice.tsx index a64b452..52e23f8 100644 --- a/src/components/Question/QuestionType/Choice.tsx +++ b/src/components/Question/QuestionType/Choice.tsx @@ -21,7 +21,7 @@ import SwitchBtn from '../../SwitchBtn/SwitchBtn'; import { createUriUUID } from '../../../helpers/uriHelper'; import DraggableAnswerOptions from '../../AnswerOption/DraggableAnswerOptions'; import PredefinedValueSets from './PredefinedValueSets'; -import { ItemControlType, isItemControlCheckbox, isItemControlDropDown } from '../../../helpers/itemControl'; +import { ItemControlType, isItemControlCheckbox } from '../../../helpers/itemControl'; import { checkboxExtension } from '../../../helpers/QuestionHelper'; type Props = {