From e8fe8a993ed73be418ea50b21042e75c6c106f0e Mon Sep 17 00:00:00 2001 From: veronikaslc Date: Thu, 28 Sep 2023 22:54:59 -0400 Subject: [PATCH] [code-cleanup] Cleanup and minor optimisation of the Questions components params interchange --- .../frontend/src/questionnaire/Answer.jsx | 12 ++--- .../src/questionnaire/AutocreatedQuestion.jsx | 7 +-- .../src/questionnaire/BooleanQuestion.jsx | 16 +++--- .../src/questionnaire/ChromosomeQuestion.jsx | 12 ++--- .../src/questionnaire/ComputedQuestion.jsx | 5 +- .../src/questionnaire/DateQuestionFull.jsx | 9 +--- .../src/questionnaire/DateQuestionMonth.jsx | 9 +--- .../src/questionnaire/DateQuestionYear.jsx | 25 ++++------ .../src/questionnaire/DicomQuestion.jsx | 6 +-- .../src/questionnaire/FileQuestion.jsx | 11 ++-- .../src/questionnaire/MultipleChoice.jsx | 6 +-- .../src/questionnaire/NumberQuestion.jsx | 50 +++---------------- .../src/questionnaire/PedigreeQuestion.jsx | 2 - .../src/questionnaire/QuestionMatrix.jsx | 1 - .../src/questionnaire/ResourceQuestion.jsx | 1 - .../src/questionnaire/TimeQuestion.jsx | 10 +--- .../src/questionnaire/VocabularyQuestion.jsx | 2 - 17 files changed, 50 insertions(+), 134 deletions(-) diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/Answer.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/Answer.jsx index 6308ae21a6..e91ff5c3d5 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/Answer.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/Answer.jsx @@ -35,11 +35,14 @@ export const IS_DEFAULT_ANSWER_POS = 4; // Holds answers and automatically generates hidden inputs // for form submission function Answer (props) { - let { answers, answerMetadata, answerNodeType, existingAnswer, pageActive, path, questionName, questionDefinition, valueType, isMultivalued, onChangeNote, noteComponent, noteProps, onAddedAnswerPath, onDecidedOutputPath, sectionAnswersState } = props; - let { enableNotes } = { ...props, ...questionDefinition }; + let { answers, answerMetadata, existingAnswer, pageActive, path, questionName, questionDefinition, valueType, onChangeNote, noteComponent, noteProps, onAddedAnswerPath, onDecidedOutputPath, sectionAnswersState } = props; + let { dataType, enableNotes } = { ...props, ...questionDefinition }; let { onAddSuggestion } = { ...props, ...noteProps }; let [ answerID ] = useState((existingAnswer && existingAnswer[0]) || uuidv4()); - let answerPath = path + "/" + answerID; + + const answerPath = path + "/" + answerID; + const answerNodeType = props.answerNodeType || "cards:" + dataType.charAt(0).toUpperCase() + dataType.slice(1) + "Answer"; + const isMultivalued = questionDefinition.maxAnswers != 1; useEffect(() => { if (sectionAnswersState !== undefined) { @@ -133,15 +136,12 @@ Answer.propTypes = { answers: PropTypes.array, answerNodeType: PropTypes.string, valueType: PropTypes.string, - isMultivalued: PropTypes.bool, noteComponent: PropTypes.elementType, pageActive: PropTypes.bool }; Answer.defaultProps = { - answerNodeType: "cards:TextAnswer", valueType: 'String', - isMultivalued: false, noteComponent: Note, pageActive: true }; diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/AutocreatedQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/AutocreatedQuestion.jsx index 01cf951ce6..410ff13e03 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/AutocreatedQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/AutocreatedQuestion.jsx @@ -19,7 +19,6 @@ import React, { useEffect, useState } from "react"; import PropTypes from 'prop-types'; -import { InputAdornment, TextField } from "@mui/material"; import withStyles from '@mui/styles/withStyles'; @@ -34,13 +33,11 @@ import { useFormWriterContext } from "./FormContext"; // Other options are passed to the widget let AutocreatedQuestion = (props) => { const { isEdit, ...rest } = props; - const { existingAnswer, classes, pageActive, questionName} = rest; - const { unitOfMeasurement, displayMode } = {...props.questionDefinition, ...rest}; + const { existingAnswer, questionName } = rest; + const { displayMode } = props.questionDefinition; - const [muiInputProps, changeMuiInputProps] = useState({}); const [isFormatted, changeIsFormatted] = useState(false); - // If we are in edit mode, upon loading the pre-filled answers, place them // in the form context where they can be accessed by computed answers const changeFormContext = useFormWriterContext(); diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/BooleanQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/BooleanQuestion.jsx index 6c3228de22..78960d1efc 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/BooleanQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/BooleanQuestion.jsx @@ -56,8 +56,8 @@ import AnswerComponentManager from "./AnswerComponentManager"; // unknownLabel="Does not compute" // /> function BooleanQuestion(props) { - const {classes, ...rest} = props; - const {yesLabel, noLabel, unknownLabel, enableUnknown} = { ...props.questionDefinition, ...props } + const {classes, questionDefinition, ...rest} = props; + const {yesLabel, noLabel, unknownLabel, enableUnknown} = questionDefinition; // Define the defaults for yesLabel, etc. here because we want questionDefinition to be able to // override them, and the props to be able to override the questionDefinition @@ -72,10 +72,9 @@ function BooleanQuestion(props) { {...props} > ); @@ -85,12 +84,11 @@ BooleanQuestion.propTypes = { classes: PropTypes.object.isRequired, questionDefinition: PropTypes.shape({ text: PropTypes.string, + enableUnknown: PropTypes.bool, + yesLabel: PropTypes.string, + noLabel: PropTypes.string, + unknownLabel: PropTypes.string }).isRequired, - text: PropTypes.string, - enableUnknown: PropTypes.bool, - yesLabel: PropTypes.string, - noLabel: PropTypes.string, - unknownLabel: PropTypes.string }; const StyledBooleanQuestion = withStyles(QuestionnaireStyle)(BooleanQuestion) diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/ChromosomeQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/ChromosomeQuestion.jsx index 8605a05963..85b500c8bb 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/ChromosomeQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/ChromosomeQuestion.jsx @@ -62,15 +62,14 @@ function ChromosomeQuestion(props) { 'MT': false }; - let { chromosomeNumber } = {...defaultValues, ...props.questionDefinition, ...props}; + let { chromosomeNumber } = {...defaultValues, ...props.questionDefinition}; let defaults = []; for (let i = 1; i <= chromosomeNumber; i++) { defaults.push([i.toString(), i.toString(), true]); } - // We override the defaults above with the questionnaire definition, - // and then we override with explicit properties - const enabledChromosomes = {...Object.entries(defaultValues).reduce((accumulator, [key, value]) => {accumulator[`enable${key}`] = value; return accumulator;}, {}), ...props.questionDefinition, ...props}; + // We override the defaults above with the questionnaire definition + const enabledChromosomes = {...Object.entries(defaultValues).reduce((accumulator, [key, value]) => {accumulator[`enable${key}`] = value; return accumulator;}, {}), ...props.questionDefinition}; // Whatever is left enabled, we display for (let chromosome of Object.keys(defaultValues)) { @@ -85,7 +84,6 @@ function ChromosomeQuestion(props) { {...props} > @@ -100,10 +98,6 @@ ChromosomeQuestion.propTypes = { maxAnswers: PropTypes.number, chromosomeNumber: PropTypes.number }).isRequired, - text: PropTypes.string, - minAnswers: PropTypes.number, - maxAnswers: PropTypes.number, - chromosomeNumber: PropTypes.number }; const StyledChromosomeQuestion = withStyles(QuestionnaireStyle)(ChromosomeQuestion) diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/ComputedQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/ComputedQuestion.jsx index c96247f5d1..9916050f08 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/ComputedQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/ComputedQuestion.jsx @@ -52,8 +52,8 @@ import { MakeRequest } from "../vocabQuery/util.jsx"; // expression="if (@{question_b} === 0) setError('Can not divide by 0'); return @{question_a}/@{question_b}" // /> let ComputedQuestion = (props) => { - const { existingAnswer, classes, pageActive, questionDefinition, ...rest} = props; - const { text, expression, unitOfMeasurement, dataType, displayMode, dateFormat, yesLabel, noLabel, unknownLabel } = {...props.questionDefinition, ...props}; + const { existingAnswer, classes, pageActive, ...rest} = props; + const { expression, unitOfMeasurement, dataType, displayMode, dateFormat, yesLabel, noLabel, unknownLabel } = {...props.questionDefinition, ...props}; const [error, changeError] = useState(false); const [errorMessage, changeErrorMessage] = useState(false); @@ -354,7 +354,6 @@ let ComputedQuestion = (props) => { } function DateQuestionFull(props) { - let {existingAnswer, classes, pageActive, ...rest} = props; - let {text, dateFormat, minAnswers, type, lowerLimit, upperLimit} = {dateFormat: "yyyy-MM-dd", minAnswers: 0, type: DateQuestionUtilities.TIMESTAMP_TYPE, ...props.questionDefinition, ...props}; + let {classes, ...rest} = props; + let {dateFormat, type, lowerLimit, upperLimit, existingAnswer, pageActive} = {dateFormat: "yyyy-MM-dd", minAnswers: 0, type: DateQuestionUtilities.TIMESTAMP_TYPE, ...props.questionDefinition, ...props}; let startValues = existingAnswer && existingAnswer[1].value || ""; @@ -165,11 +164,7 @@ function DateQuestionFull(props) { } ); diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/DateQuestionMonth.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/DateQuestionMonth.jsx index 3e6f0801f2..9788d853b1 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/DateQuestionMonth.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/DateQuestionMonth.jsx @@ -44,15 +44,14 @@ import DateQuestionUtilities from "./DateQuestionUtilities"; // // Sample usage: // function DateQuestionMonth(props) { - let {existingAnswer, classes, pageActive, ...rest} = props; - let {text, dateFormat, minAnswers, type, lowerLimit, upperLimit} = {dateFormat: "yyyy/MM", minAnswers: 0, type: DateQuestionUtilities.TIMESTAMP_TYPE, ...props.questionDefinition, ...props}; + let {classes, ...rest} = props; + let {dateFormat, minAnswers, type, lowerLimit, upperLimit, existingAnswer, pageActive} = {dateFormat: "yyyy/MM", minAnswers: 0, type: DateQuestionUtilities.TIMESTAMP_TYPE, ...props.questionDefinition, ...props}; let startValues = existingAnswer && existingAnswer[1].value || ""; @@ -207,11 +206,7 @@ function DateQuestionMonth(props) { } ); diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/DateQuestionYear.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/DateQuestionYear.jsx index c2df09299b..d29d898c90 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/DateQuestionYear.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/DateQuestionYear.jsx @@ -32,36 +32,31 @@ import DateQuestionUtilities from "./DateQuestionUtilities"; // submission. // // Optional props: -// text: the question to be displayed // type: "timestamp" for a single date or "interval" for two dates -// dateFormat: yyyy // lowerLimit: lower date limit (inclusive) given as an object or string parsable by luxon // upperLimit: upper date limit (inclusive) given as an object or string parsable by luxon // Other options are passed to the widget // // Sample usage: // function DateQuestionYear(props) { - let {existingAnswer, classes, ...rest} = props; - let {text, dateFormat, minAnswers, type, lowerLimit, upperLimit} = {dateFormat: "yyyy", minAnswers: 0, type: DateQuestionUtilities.TIMESTAMP_TYPE, ...props.questionDefinition, ...props}; + let {classes, questionDefinition, ...rest} = props; + let {minAnswers, type, lowerLimit, upperLimit} = {minAnswers: 0, type: DateQuestionUtilities.TIMESTAMP_TYPE, ...questionDefinition, ...props}; return ( diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/DicomQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/DicomQuestion.jsx index 26caff1f14..05f639be73 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/DicomQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/DicomQuestion.jsx @@ -71,7 +71,7 @@ const useStyles = makeStyles(theme => ({ // submission. // function DicomQuestion(props) { - const { existingAnswer, questionDefinition, ...rest } = props; + const { questionDefinition, ...rest } = props; let [ dicomMetadataNote, setDicomMetadataNote ] = useState(); let [ dicomImagePreviewURL, setDicomImagePreviewURL ] = useState(); @@ -123,7 +123,7 @@ function DicomQuestion(props) { } let fetchDicomFile = () => { - let dicomFilePath = existingAnswer?.[1] + let dicomFilePath = props.existingAnswer?.[1] .value?.split("/") .map(s => encodeURIComponent(s)) .join("/"); @@ -310,7 +310,6 @@ function DicomQuestion(props) { { @@ -318,7 +317,6 @@ function DicomQuestion(props) { setDicomImagePreviewURL(undefined); }} previewRenderer={previewRenderer} - answerNodeType="cards:DicomAnswer" noteProps={{ fullSize: true, placeholder: "Dicom metadata", diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/FileQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/FileQuestion.jsx index e8f823d354..2e095b4662 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/FileQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/FileQuestion.jsx @@ -46,9 +46,9 @@ import AnswerComponentManager from "./AnswerComponentManager"; // Sample usage: // (TODO) function FileQuestion(props) { - const { classes, existingAnswer, pageActive, ...rest } = props; - const { maxAnswers, namePattern } = { ...props.questionDefinition, ...props } - const { onBeforeUpload, onAfterUpload, onDelete, previewRenderer, answerNodeType } = props; + const { classes, ...rest } = props; + const { maxAnswers, namePattern } = props.questionDefinition; + const { existingAnswer, onBeforeUpload, onAfterUpload, onDelete, pageActive, previewRenderer } = props; let initialValues = // Check whether or not we have an initial value (!existingAnswer || existingAnswer[1].value === undefined) ? [] : @@ -348,13 +348,8 @@ function FileQuestion(props) { } ); diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/MultipleChoice.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/MultipleChoice.jsx index c5c95fd916..55f95f37ec 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/MultipleChoice.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/MultipleChoice.jsx @@ -53,7 +53,7 @@ const GHOST_SENTINEL = "custom-input"; */ function MultipleChoice(props) { let { classes, customInput, customInputProps, existingAnswer, input, textbox, onUpdate, onChange, additionalInputProps, muiInputProps, naValue, noneOfTheAboveValue, error, questionName, ...rest } = props; - let { maxAnswers, minAnswers, displayMode, enableSeparatorDetection } = {...props.questionDefinition, ...props}; + let { maxAnswers, displayMode, enableSeparatorDetection } = {...props.questionDefinition, ...props}; let { validate, validationErrorText, liveValidation } = {...props.questionDefinition, ...props}; // pageActive should be passed to the Answer component, so we make sure to include it in the `rest` variable above let { instanceId, pageActive } = props; @@ -584,7 +584,6 @@ function MultipleChoice(props) { answers={answers} existingAnswer={existingAnswer} questionName={questionName} - isMultivalued={true} onAddSuggestion={acceptOptionFromWidget} {...rest} /> @@ -690,9 +689,6 @@ function ResponseChild(props) { MultipleChoice.propTypes = { classes: PropTypes.object.isRequired, - text: PropTypes.string, - description: PropTypes.string, - maxAnswers: PropTypes.number, defaults: PropTypes.array, input: PropTypes.bool, additionalInputProps: PropTypes.object, diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/NumberQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/NumberQuestion.jsx index 921762cf6d..c67383633c 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/NumberQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/NumberQuestion.jsx @@ -40,12 +40,6 @@ import MultipleChoice from "./MultipleChoice"; import AnswerComponentManager from "./AnswerComponentManager"; -/** Conversion between the `dataType` setting in the question definition and the corresponding primary node type of the `Answer` node for that question. */ -const DATA_TO_NODE_TYPE = { - "long": "cards:LongAnswer", - "double": "cards:DoubleAnswer", - "decimal": "cards:DecimalAnswer", -}; /** Conversion between the `dataType` setting in the question definition and the corresponding value type for storing the value in the `Answer` node. */ const DATA_TO_VALUE_TYPE = { "long": "Long", @@ -97,21 +91,11 @@ const useSliderStyles = makeStyles(theme => ({ })); // Component that renders a multiple choice question, with optional number input. -// Selected answers are placed in a series of tags for -// submission. +// Selected answers are placed in a series of tags for submission. // // Optional props: -// minAnswers: Integer denoting minimum number of options that may be selected -// maxAnswers: Integer denoting maximum number of options that may be selected -// text: String containing the question to ask // defaults: Array of arrays, each with two values, a "label" which will be displayed to the user, // and a "value" denoting what will actually be stored -// displayMode: Either "input", "list", "list+input", "slider", or undefined denoting the type of -// user input. If nothing is specified or if displayMode is "slider" but the conditions -// are not met (minValue or maxValue missing), "input" is used by default. -// maxValue: The maximum allowed input value -// minValue: The minimum allowed input value -// type: One of "integer" or "float" (default: "float") // errorText: String to display when the input is not valid (default: "") // isRange: Whether or not to display a range instead of a single value // sliderStep: The increment between selectable slider values @@ -120,22 +104,18 @@ const useSliderStyles = makeStyles(theme => ({ // // Sample usage: // function NumberQuestion(props) { - const { existingAnswer, errorText, classes, pageActive, disableValueInstructions, ...rest} = props; - const { dataType,displayMode, minAnswers, minValue, maxValue, isRange, - sliderStep, sliderMarkStep, sliderOrientation, minValueLabel, maxValueLabel } + const { errorText, classes, disableValueInstructions, ...rest} = props; + const { dataType, displayMode, minAnswers, minValue, maxValue, isRange, + sliderStep, sliderMarkStep, sliderOrientation, minValueLabel, maxValueLabel, pageActive, existingAnswer } = {sliderOrientation: "horizontal", ...props.questionDefinition, ...props}; - const answerNodeType = props.answerNodeType || DATA_TO_NODE_TYPE[dataType]; - const valueType = props.valueType || DATA_TO_VALUE_TYPE[dataType]; + + const valueType = DATA_TO_VALUE_TYPE[dataType]; const [ minMaxError, setMinMaxError ] = useState(false); const [ rangeError, setRangeError ] = useState(false); @@ -401,10 +381,7 @@ function NumberQuestion(props) { } @@ -425,16 +402,12 @@ function NumberQuestion(props) { } ) : } @@ -487,17 +458,12 @@ NumberQuestion.propTypes = { minValue: PropTypes.number, maxValue: PropTypes.number, displayMode: PropTypes.oneOf([undefined, "input", "list", "list+input", "slider"]), + dataType: PropTypes.oneOf(['long', 'double', 'decimal']), }).isRequired, - text: PropTypes.string, - minAnswers: PropTypes.number, - maxAnswers: PropTypes.number, defaults: PropTypes.array, - displayMode: PropTypes.oneOf([undefined, "input", "list", "list+input", "slider"]), - dataType: PropTypes.oneOf(['long', 'double', 'decimal']), - minValue: PropTypes.number, - maxValue: PropTypes.number, errorText: PropTypes.string, isRange: PropTypes.bool, + disableValueInstructions: PropTypes.bool, }; NumberQuestion.defaultProps = { diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/PedigreeQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/PedigreeQuestion.jsx index 15c214000a..a534c988d6 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/PedigreeQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/PedigreeQuestion.jsx @@ -161,9 +161,7 @@ function PedigreeQuestion(props) { { && value["question"]["jcr:uuid"] === question[1]["jcr:uuid"])} answerNodeType={DATA_TO_NODE_TYPE[sectionDefinition.dataType]} valueType={valueType} - isMultivalued={maxAnswers != 1} questionName={question[0]} {...rest} /> diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/ResourceQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/ResourceQuestion.jsx index 88ab09777d..b17b0db94c 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/ResourceQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/ResourceQuestion.jsx @@ -94,7 +94,6 @@ function ResourceQuestion(props) { clearOnClick: !singleEntryInput, enableUserEntry: enableUserEntry, }} - answerNodeType="cards:ResourceAnswer" valueType="String" defaults={props.defaults || (options.length > 0 ? options : undefined)} {...rest} diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/TimeQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/TimeQuestion.jsx index 660cf55c61..2cf4d0a5ed 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/TimeQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/TimeQuestion.jsx @@ -85,13 +85,12 @@ export class Time { // // Sample usage: // function TimeQuestion(props) { - let {existingAnswer, classes, pageActive, ...rest} = props; - let {text, lowerLimit, upperLimit, errorText, minAnswers, dateFormat} = {...props.questionDefinition, ...props}; + let {classes, ...rest} = props; + let {lowerLimit, upperLimit, errorText, minAnswers, dateFormat, existingAnswer, pageActive} = {...props.questionDefinition, ...props}; let currentStartValue = (existingAnswer && existingAnswer[1].value && new Time(existingAnswer[1].value).isValid) ? existingAnswer[1].value : ""; const [selectedTime, changeTime] = useState(currentStartValue); @@ -156,11 +155,7 @@ function TimeQuestion(props) { } ); @@ -168,7 +163,6 @@ function TimeQuestion(props) { TimeQuestion.propTypes = { classes: PropTypes.object.isRequired, - text: PropTypes.string, minAnswers: PropTypes.number, lowerLimit: PropTypes.string, upperLimit: PropTypes.string, diff --git a/modules/data-entry/src/main/frontend/src/questionnaire/VocabularyQuestion.jsx b/modules/data-entry/src/main/frontend/src/questionnaire/VocabularyQuestion.jsx index 30a4214889..ad09be5aae 100644 --- a/modules/data-entry/src/main/frontend/src/questionnaire/VocabularyQuestion.jsx +++ b/modules/data-entry/src/main/frontend/src/questionnaire/VocabularyQuestion.jsx @@ -68,7 +68,6 @@ function VocabularyQuestion(props) { clearOnClick: !singleInput, enableSelection: true }} - answerNodeType = "cards:VocabularyAnswer" noteComponent={NCRNote} noteProps={{ vocabulary: questionDefinition.sourceVocabularies @@ -84,7 +83,6 @@ VocabularyQuestion.propTypes = { text: PropTypes.string, sourceVocabularies: PropTypes.array.isRequired }).isRequired, - text: PropTypes.string };