Skip to content

Commit

Permalink
Merge pull request #61 from elixir-europe/elixir-bsc
Browse files Browse the repository at this point in the history
Elixir bsc
  • Loading branch information
Gemma Milla authored Feb 14, 2024
2 parents 2a54ca3 + f2a1e4e commit d75a183
Show file tree
Hide file tree
Showing 14 changed files with 1,571 additions and 1,188 deletions.
71 changes: 41 additions & 30 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -499,20 +499,26 @@ html {
}

.exampleQuery:hover .text-example {
margin-right: 14px;
display: flex;
align-items: center;
justify-content: center;
border: solid #c8c8c8;
background-color: #c8c8c8;
color: black;
width: -moz-fit-content;
width: fit-content;
border-radius: 6px;
margin-left: 10px;
padding: 1px;
margin-left: -98px;

padding-top: 1px;
padding-bottom: 1px;
padding-left: 2px;
padding-right: 2px;
}

.examplesQueriesList {
width: 111px;
width: fit-content;
display: flex;
flex-direction: column;
justify-content: center;
Expand Down Expand Up @@ -653,8 +659,9 @@ select {
/* justify-content: center; */
align-content: center;
align-items: center;
padding-bottom: 10px;
min-height: 630px;
padding-bottom: 55px;
min-height: 280px;

}

.resultSet2 {
Expand Down Expand Up @@ -692,17 +699,20 @@ hr {
sans-serif;
text-transform: uppercase;
font-size: 12px;
margin-left: 33px;
}

.exampleQueries:hover {
color: rgb(118, 151, 228);
}

.bulbExample {
margin-right: 48px;
padding-right: 19px;
border-right: 1.7px solid #f1f1f1;
display: flex;
justify-content: center;
align-items: center;
border-left: 1.7px solid #f1f1f1;
flex-direction: row-reverse;
}

.helpButton {
Expand Down Expand Up @@ -780,10 +790,10 @@ hr {
.example {
display: flex;
align-items: center;
margin-right: -117px;
/* margin-right: -117px; */
margin-top: 22px;
margin-bottom: 22px;
flex-direction: row-reverse;
flex-direction: row;
align-content: space-between;
justify-content: center;
}
Expand All @@ -803,7 +813,7 @@ hr {
padding: 5px;
cursor: pointer;
display: flex;
flex-direction: row-reverse;
flex-direction: row;
align-content: center;
justify-content: center;
align-items: center;
Expand Down Expand Up @@ -1063,8 +1073,8 @@ h5 {
sans-serif;
text-transform: uppercase;
font-size: 12px;
margin-right: 36px;
margin-left: 27px;
margin-right: 32px;
margin-left: -20px;
}

.filters:hover {
Expand Down Expand Up @@ -1177,7 +1187,7 @@ h5 {
padding: 5px;
cursor: pointer;
display: flex;
flex-direction: row-reverse;
flex-direction: row;
align-content: center;
justify-content: center;
align-items: center;
Expand Down Expand Up @@ -1264,10 +1274,8 @@ h5 {
'Helvetica Neue', sans-serif;
text-transform: uppercase;
font-size: 10px;
margin-left: 2px !important;
margin-right: 7px !important;
/* margin-right: 36px; */
/* margin-left: 27px; */
margin-right: 3px;
margin-left: -23px;
}

.container-fluid {
Expand All @@ -1285,7 +1293,7 @@ h5 {
margin-right: 0px;
margin-top: 22px;
margin-bottom: 22px;
flex-direction: row-reverse;
flex-direction: row;
align-content: space-between;
justify-content: center;
}
Expand Down Expand Up @@ -1327,13 +1335,14 @@ h5 {
height: 27px;
}
.bulbExample {
margin-right: 48px;
padding-right: 19px;
border-right: 1.7px solid #f1f1f1;
display: flex;
border-left: 1.7px solid #f1f1f1;
flex-direction: column;
justify-content: center;
align-content: center;
align-items: center;
width: 112px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
'Helvetica Neue', sans-serif;
text-transform: uppercase;
}
.searchIcon {
width: 26px;
Expand Down Expand Up @@ -1364,20 +1373,22 @@ h5 {
justify-content: center;
align-content: center;
align-items: flex-start;
width: 189px;
width: fit-content;
border-radius: 5px;
font-size: 9px;
margin-left: 10px !important;
background: #8dbde0;
}

.bulbExample {
margin-right: 49px;
display: flex;
border-left: 1.7px solid #f1f1f1;
flex-direction: column;
justify-content: center;
align-content: center;
align-items: center;
padding-right: 13px;
border-right: 1.7px solid #f1f1f1;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
'Helvetica Neue', sans-serif;
text-transform: uppercase;
}

.NavlinkVerifier {
Expand Down
52 changes: 38 additions & 14 deletions frontend/src/components/Analyses/AnalysesResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,21 @@ function AnalysesResults (props) {
}
arrayFilter.push(alphaNumFilter)
} else {
const filter2 = {
let filter2 = {
id: element,
includeDescendantTerms: props.descendantTerm
}
props.filteringTerms.data.response.filteringTerms.forEach(
element2 => {
if (element === element2.label) {
filter2 = {
id: element2.id,
includeDescendantTerms: props.descendantTerm
}
}
}
)

arrayFilter.push(filter2)
}
})
Expand Down Expand Up @@ -133,9 +144,18 @@ function AnalysesResults (props) {
}
arrayFilter.push(alphaNumFilter)
} else {
const filter = {
id: props.query
}
let filter = { id: props.query }
let labelToOntology = 0
props.filteringTerms.data.response.filteringTerms.forEach(
element => {
if (props.query === element.label) {
labelToOntology = element.id
filter = {
id: labelToOntology
}
}
}
)
arrayFilter.push(filter)
}
}
Expand Down Expand Up @@ -178,7 +198,10 @@ function AnalysesResults (props) {
}

if (token === null) {
res = await axios.post(configData.API_URL + '/analyses', jsonData1)
res = await axios.post(
configData.API_URL + '/analyses',
jsonData1
)
} else {
const headers = { Authorization: `Bearer ${token}` }

Expand Down Expand Up @@ -215,7 +238,6 @@ function AnalysesResults (props) {
[element.resultsCount]
]
let found = false

resultsPerDataset.forEach(element => {
if (element[0] === arrayResultsPerDataset[0]) {
found = true
Expand All @@ -233,14 +255,14 @@ function AnalysesResults (props) {
[element.exists],
[element.resultsCount]
]

resultsPerDataset.push(arrayResultsPerDataset)
}
}

if (element.id === undefined || element.id === '') {
let arrayResultsNoDatasets = [element.beaconId]
resultsNotPerDataset.push(arrayResultsNoDatasets)
console.log(arrayResultsNoDatasets)
}

if (res.data.response.resultSets[index].results) {
Expand Down Expand Up @@ -273,6 +295,7 @@ function AnalysesResults (props) {
}
}
jsonData2 = JSON.stringify(jsonData2)
console.log(jsonData2)
let token = null
if (auth.userData === null) {
token = getStoredToken()
Expand All @@ -282,25 +305,28 @@ function AnalysesResults (props) {

if (token === null) {
console.log('Querying without token')
res = await axios.post(configData.API_URL + '/analyses', jsonData2)
res = await axios.post(
configData.API_URL + '/analyses',
jsonData2
)
} else {
console.log('Querying WITH token')
const headers = { Authorization: `Bearer ${token}` }

res = await axios.post(
configData.API_URL + '/analyses',
jsonData2,
{ headers: headers }
)
}
setTimeOut(true)

setTimeOut(true)
console.log(res.data)
if (
(res.data.responseSummary.numTotalResults < 1 ||
res.data.responseSummary.numTotalResults === undefined) &&
props.resultSets !== 'MISS'
) {
setError('. Please try another query')
setError('No results. Please try another query')
setNumberResults(0)
setBoolean(false)
} else {
Expand Down Expand Up @@ -361,9 +387,7 @@ function AnalysesResults (props) {
}
}
} catch (error) {
setError(
'No results. Please check the query and the connection and retry'
)
setError('Connection error. Please retry')
setTimeOut(true)
}
}
Expand Down
35 changes: 28 additions & 7 deletions frontend/src/components/Biosamples/BiosamplesResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,21 @@ function BiosamplesResults (props) {
}
arrayFilter.push(alphaNumFilter)
} else {
const filter2 = {
let filter2 = {
id: element,
includeDescendantTerms: props.descendantTerm
}
props.filteringTerms.data.response.filteringTerms.forEach(
element2 => {
if (element === element2.label) {
filter2 = {
id: element2.id,
includeDescendantTerms: props.descendantTerm
}
}
}
)

arrayFilter.push(filter2)
}
})
Expand Down Expand Up @@ -133,9 +144,18 @@ function BiosamplesResults (props) {
}
arrayFilter.push(alphaNumFilter)
} else {
const filter = {
id: props.query
}
let filter = { id: props.query }
let labelToOntology = 0
props.filteringTerms.data.response.filteringTerms.forEach(
element => {
if (props.query === element.label) {
labelToOntology = element.id
filter = {
id: labelToOntology
}
}
}
)
arrayFilter.push(filter)
}
}
Expand Down Expand Up @@ -242,6 +262,7 @@ function BiosamplesResults (props) {
if (element.id === undefined || element.id === '') {
let arrayResultsNoDatasets = [element.beaconId]
resultsNotPerDataset.push(arrayResultsNoDatasets)
console.log(arrayResultsNoDatasets)
}

if (res.data.response.resultSets[index].results) {
Expand Down Expand Up @@ -274,6 +295,7 @@ function BiosamplesResults (props) {
}
}
jsonData2 = JSON.stringify(jsonData2)
console.log(jsonData2)
let token = null
if (auth.userData === null) {
token = getStoredToken()
Expand All @@ -290,15 +312,15 @@ function BiosamplesResults (props) {
} else {
console.log('Querying WITH token')
const headers = { Authorization: `Bearer ${token}` }

res = await axios.post(
configData.API_URL + '/biosamples',
jsonData2,
{ headers: headers }
)
}
setTimeOut(true)

setTimeOut(true)
console.log(res.data)
if (
(res.data.responseSummary.numTotalResults < 1 ||
res.data.responseSummary.numTotalResults === undefined) &&
Expand All @@ -324,7 +346,6 @@ function BiosamplesResults (props) {
[element.resultsCount]
]
let found = false

resultsPerDataset.forEach(element => {
if (element[0] === arrayResultsPerDataset[0]) {
found = true
Expand Down
Loading

0 comments on commit d75a183

Please sign in to comment.