From f20c5bfa775c61feea94f0bd00b2d24b97485b30 Mon Sep 17 00:00:00 2001 From: Ozge Yurtsever Date: Thu, 14 Sep 2023 11:17:27 -0700 Subject: [PATCH 1/4] Enable downloading if click DONE instead of CANCEL --- .../questionCreation/QuestionForm.jsx | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/components/questionCreation/QuestionForm.jsx b/src/components/questionCreation/QuestionForm.jsx index 7d22645..84b77f6 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'); @@ -585,6 +597,7 @@ const QuestionForm = props => { 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 +617,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' }); From a3ada60e03957272abbd658fd870ff4ead1f7081 Mon Sep 17 00:00:00 2001 From: Ozge Yurtsever Date: Fri, 15 Sep 2023 00:25:12 -0700 Subject: [PATCH 2/4] Display confidence checkbox status correctly --- src/components/questionCreation/QuestionForm.jsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/questionCreation/QuestionForm.jsx b/src/components/questionCreation/QuestionForm.jsx index 84b77f6..88dd768 100644 --- a/src/components/questionCreation/QuestionForm.jsx +++ b/src/components/questionCreation/QuestionForm.jsx @@ -596,7 +596,6 @@ 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'); @@ -969,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, @@ -1158,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 }); From f57bf8ea71c30766147e412b66b4772a9b7dd9d7 Mon Sep 17 00:00:00 2001 From: Ozge Yurtsever Date: Fri, 15 Sep 2023 07:06:45 -0700 Subject: [PATCH 3/4] Update package.json --- package.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 From a322d41fafd7b51486d9bc6f1f4cb21c46747786 Mon Sep 17 00:00:00 2001 From: Emel ALKIM Date: Fri, 15 Sep 2023 12:40:21 -0700 Subject: [PATCH 4/4] update branch in dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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