Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
}
}
}
34 changes: 21 additions & 13 deletions src/components/questionCreation/QuestionForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ const QuestionForm = props => {
questionTypeTerm
};

const addToEpad = () => {};
const addToEpad = () => {
// prettier-ignore
};

const filterOntologyList = () => {
let filteredOntology = [];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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
Expand All @@ -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'
});
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1146,13 +1156,11 @@ const QuestionForm = props => {
<FormControlLabel
className={classes.checkbox}
value={formInput.showConfidence}
// checked={formInput.showConfidence}
checked={formInput.showConfidence}
control={<Checkbox color="primary" />}
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 });
Expand Down