diff --git a/Dockerfile b/Dockerfile index ff8d0a3..20e30ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ USER node RUN mkdir -p /home/node/app WORKDIR /home/node/app -RUN git clone -b feat/docker https://github.com/RubinLab/template-builder.git /home/node/app/ +RUN git clone -b fix/confidence1 https://github.com/RubinLab/template-builder.git /home/node/app/ #COPY keys.js /home/node/app/src/services RUN sed -i 's/react-scripts build/react-scripts --max_old_space_size=4096 build/g' /home/node/app/package.json diff --git a/package.json b/package.json index 9531d55..c1199c0 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "selenium-webdriver": "^4.0.0-alpha.7" }, "scripts": { - "start": "react-scripts start", + "start": "react-scripts --openssl-legacy-provider start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" @@ -61,7 +61,6 @@ "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", "eslint-plugin-react-hooks": "^2.5.0", - "prettier": "^1.19.1", - "puppeteer": "^5.3.1" + "prettier": "^1.19.1" } -} +} \ No newline at end of file diff --git a/src/components/questionCreation/QuestionForm.jsx b/src/components/questionCreation/QuestionForm.jsx index 7d22645..88dd768 100644 --- a/src/components/questionCreation/QuestionForm.jsx +++ b/src/components/questionCreation/QuestionForm.jsx @@ -210,7 +210,9 @@ const QuestionForm = props => { questionTypeTerm }; - const addToEpad = () => {}; + const addToEpad = () => { + // prettier-ignore + }; const filterOntologyList = () => { let filteredOntology = []; @@ -240,14 +242,14 @@ const QuestionForm = props => { const populateAlternativeSearch = (status, data) => { const trimmedTerm = searchTerm.trim(); const ontList = filterOntologyList().join(', '); + // prettier-ignore switch (status) { case 'showOther': return { explanation: `Couldn't find ${trimmedTerm || 'the term'} in ${ontList || 'supported ontologies'} `, - link: `Show ${ - data ? data.collection.length : 'all' - } results from other ontologies!`, + link: `Show ${data ? data.collection.length : 'all' + } results from other ontologies!`, onClick: () => { setSearchResults(data); setShowSearchResults(true); @@ -403,19 +405,29 @@ const QuestionForm = props => { }, []); const filFormInputOnEdit = () => { + // AnatomicEntity, ImagingObservation + // annotatorConfidence try { + // prettier-ignore + const confidence = edit.AnatomicEntity + ? edit.AnatomicEntity : edit.ImagingObservation; + const editFormInput = { explanatoryText: edit.explanatoryText, maxCard: edit.maxCardinality, minCard: edit.minCardinality, question: edit.label, - questionTypeTerm: edit.QuestionType || null + questionTypeTerm: edit.QuestionType || null, + requireComment: edit.requireComment, + showConfidence: confidence.annotatorConfidence }; setQuestion(edit.label); setExplanatoryText(edit.explanatoryText); setMinCard(edit.minCardinality); setMaxCard(edit.maxCardinality); setQuestionTypeTerm(edit.QuestionType || null); + setRequireComment(edit.requireComment); + setshowConfidence(confidence.annotatorConfidence); if (edit.maxCardinality === 1 && edit.minCardinality === 1) { setAnswerType('single'); @@ -584,7 +596,7 @@ const QuestionForm = props => { let allowedTerm = {}; let newSelected = selectedTerms ? { ...selectedTerms } : {}; const id = createID(); - console.log('title', title, searchResults.collection); + // prettier-ignore if (title !== '99EPAD') { console.log('not epad'); const acronym = searchResults.collection[termIndex].links.ontology @@ -604,9 +616,8 @@ const QuestionForm = props => { newSelected = { ...selectedTerms, ...newTerm }; } else { setShowSearchResults(false); - const message = `Couldnt find ${ - allowedTerm ? 'preferred name' : 'cui or notation' - } for this term in ${acronym}. You can upload the term with a .csv file!`; + const message = `Couldnt find ${allowedTerm ? 'preferred name' : 'cui or notation' + } for this term in ${acronym}. You can upload the term with a .csv file!`; enqueueSnackbar(message, { variant: 'error' }); @@ -957,7 +968,6 @@ const QuestionForm = props => { 'data:text/csv;charset=utf-8,codeMeaning,codeValue,codingSchemeDesignator\n'; const arr = Object.values(selectedTerms); for (let i = 0; i < arr.length; i += 1) { - console.log(arr[i]); const term = arr[i].allowedTerm; const termKeys = [ term.codeMeaning, @@ -1146,13 +1156,11 @@ const QuestionForm = props => { } label="Show annotator confidence" labelPlacement="end" onChange={e => { - console.log(typeof formInput.showConfidence); - console.log(formInput.showConfidence); const newConfidence = !(e.target.value === 'true'); setshowConfidence(newConfidence); postQuestion({ ...formInput, showConfidence: newConfidence });