diff --git a/frontend/src/App.css b/frontend/src/App.css index da4f55d8..dd687da9 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -166,8 +166,8 @@ html { margin-top: -1px; } .searchIcon:hover { - width: 40px; - margin-top: -4px; + width: 37px; + margin-top: -3px; } .forwardIcon { @@ -955,7 +955,6 @@ h5 { display: flex; align-content: center; justify-content: center; - width: 70%; } .searchButton { diff --git a/frontend/src/components/GenomicVariations/VariantsResults.js b/frontend/src/components/GenomicVariations/VariantsResults.js index cb5297a7..c068d31c 100644 --- a/frontend/src/components/GenomicVariations/VariantsResults.js +++ b/frontend/src/components/GenomicVariations/VariantsResults.js @@ -10,7 +10,7 @@ import TableResultsVariant from '../Results/VariantResults/TableResultsVariant' function VariantsResults (props) { const [error, setError] = useState('') - + const [timeOut, setTimeOut] = useState(false) const [logInRequired, setLoginRequired] = useState(true) const [messageLogin, setMessageLogin] = useState('') const [results, setResults] = useState([]) @@ -22,6 +22,8 @@ function VariantsResults (props) { const [boolean, setBoolean] = useState(false) const [arrayFilter, setArrayFilter] = useState([]) + const [showVariantsResults, setShowVariantsResults] = useState(false) + let queryStringTerm = '' const handleTypeResults1 = () => { setShow1(true) @@ -49,11 +51,13 @@ function VariantsResults (props) { useEffect(() => { const apiCall = async () => { + if (isAuthenticated) { setLoginRequired(false) try { if (props.showBar === true) { + setShowVariantsResults(true) if (props.query.includes(',')) { queryStringTerm = props.query.split(',') @@ -89,15 +93,20 @@ function VariantsResults (props) { } } jsonData1 = JSON.stringify(jsonData1) - + console.log(jsonData1) // const token = auth.userData.access_token // console.log(token) //const headers = { 'Authorization': `Bearer ${token}` } // const res = await axios.post("https://beacons.bsc.es/beacon-network/v2.0.0/g_variants", jsonData1, {headers: headers}) + // const res = await axios.post( + // configData.API_URL + '/g_variants', + //jsonData1 + // ) const res = await axios.post( - configData.API_URL + '/g_variants', + 'https://beacon-apis-test.ega-archive.org/api/g_variants', jsonData1 ) + setTimeOut(true) console.log(res) if (res.data.responseSummary.exists === false) { setBoolean(false) @@ -105,9 +114,10 @@ function VariantsResults (props) { setError('No results found. Please retry') } } else { + setShowVariantsResults(false) // referenceName={referenceName} start={start} end={end} variantType={variantType} alternateBases={alternateBases} referenceBases={referenceBases} aminoacid={aminoacid} geneID={geneID} /> // - + var requestParameters = {} if (props.referenceName !== '') { @@ -217,6 +227,7 @@ function VariantsResults (props) { } } } catch (error) { + setTimeOut(true) console.log(error) setError(error) } @@ -226,51 +237,66 @@ function VariantsResults (props) { } } apiCall() - }, []) + }, [props.showBar]) return ( -
YES
} - {show1 && !boolean &&NO
} - {show2 && numberResults !== 1 && ( -{numberResults} Results
- )} - {show2 && numberResults === 1 && ( -{numberResults} Result
- )} - {show3 && error !== '' && ( -YES
} + {show1 && !boolean &&NO
} + {show2 && numberResults !== 1 && ( +{numberResults} Results
+ )} + {show2 && numberResults === 1 && ( +{numberResults} Result
+ )} + {show3 && error !== '' && ( +