Skip to content

Commit

Permalink
Merge pull request #62 from elixir-europe/elixir-bsc
Browse files Browse the repository at this point in the history
cohorts bug fixed
  • Loading branch information
Gemma Milla authored Feb 20, 2024
2 parents d75a183 + faae7f0 commit d9081b3
Show file tree
Hide file tree
Showing 9 changed files with 146 additions and 105 deletions.
4 changes: 2 additions & 2 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -1315,8 +1315,8 @@ h5 {
justify-content: center;
align-items: center;
z-index: 0;
height: 84px;
margin-top: -21px;
height: 73px;
margin-top: 11px;
}

.bulbLogo {
Expand Down
40 changes: 24 additions & 16 deletions frontend/src/components/Cohorts/Cohorts.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,33 +77,41 @@ function Cohorts (props) {
const fetchDataCohorts = async () => {
try {
let res = await axios.get(configData.API_URL + '/cohorts')

res.data.response.collections.forEach(element => {
if (optionsCohorts.length > 0) {
let found = 0
optionsCohorts.forEach(cohort => {
found = 0
if (cohort.value === element.id) {
let obj = {
value: element.id + count,
label: element.id
}
setCount(count + 1)
element.id = element.id + count
optionsCohorts.push(obj)
} else {
let obj = {
value: element.id,
label: element.id
}
optionsCohorts.push(obj)
console.log(element.id)
found = 1
}
})
if (found === 0) {
let obj = {
value: element.id,
label: element.id
}
optionsCohorts.push(obj)
}
if (found === 1) {
let obj = {
value: element.id + count,
label: element.id + count
}
setCount(count + 1)
element.id = element.id + count
optionsCohorts.push(obj)
}
} else {
let obj = {
value: element.id,
label: element.id
}
optionsCohorts.push(obj)
}

console.log(optionsCohorts)
arrayCohorts.push(element)
const timer = setTimeout(() => {
setTriggerLayout(true)
Expand Down Expand Up @@ -201,7 +209,7 @@ function Cohorts (props) {
let entriesGeo = ''
let valuesDiseases = ''
let labelsDiseases = ''

// for (var i = 0; i < res.data.response.collections.length; i++) {
if (element2.eventGenders !== undefined) {
sexs = element2.eventGenders.distribution.genders
Expand Down Expand Up @@ -262,7 +270,7 @@ function Cohorts (props) {
if (labelsEthnicities !== '') {
setLabelsEthnicities(labelsEthnicities)
}

if (geoData !== '') {
valuesGeo = Object.values(geoData)
labelsGeo = Object.keys(geoData)
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/components/Datasets/ResultsDatasets.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,25 @@ p a {
justify-content: center;
height: 100%;
width: 100%;
margin-top: 7px;
margin-bottom: 7px;
}

.resultSetsContainer h5 {
/* padding: 0px; */
margin-top: 6px !important;
margin-bottom: 6px !important;
margin-right: 0px;
margin-left: 5px;
}

.resultSetsContainer h6 {
background: #86e4a8;
border-radius: 2px;
width: fit-content !important;
margin-left: 5px;
padding: 3px;
margin-top: 0px;
margin-bottom: 0px;
}

.tittleResults h2 {
Expand Down
23 changes: 13 additions & 10 deletions frontend/src/components/FilteringTerms/FilteringTerms.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.search-box {
margin: 10px;
margin-top: 10px;
margin-bottom: 10px;
width: 100%;
}

.search-tr {
display: flex;
width: 40%;
}

thead {
Expand All @@ -23,7 +23,7 @@ thead {

.thead2 {
position: sticky;
top: 73.6px;
top: 61.4px;
z-index: 2;
}

Expand All @@ -36,8 +36,11 @@ thead {

.tableWrapper {
height: 100vh;
width: 90vw;
width: 95vw;
overflow: scroll;
display: flex;

justify-content: center;
}

.generalContainer {
Expand Down Expand Up @@ -214,14 +217,14 @@ thead {
}

.searchTermInput {
margin: 10px;
width: 90%;
margin: 5px;
width: 60%;
height: 28px;
}

.searchTermInput1 {
margin: 10px;
width: 90%;
margin: 5px;
width: 60%;
height: 28px;
}

Expand All @@ -231,8 +234,8 @@ tr {
}

.terms1 {
background-color: #efedf4;
border-bottom: solid #8985c1;
background-color: #e7eef5;
border-bottom: solid #3d72a6;
}

.checkbox {
Expand Down
134 changes: 73 additions & 61 deletions frontend/src/components/FilteringTerms/FilteringTerms.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function FilteringTerms (props) {

const [trigger, setTrigger] = useState(false)

const [hide, setHide] = useState(true)
const remove = tag => {
setSelected(selected.filter(t => t.value !== tag.value))

Expand Down Expand Up @@ -230,7 +231,7 @@ function FilteringTerms (props) {
label: infoValue[0],
value: infoValue[0]
}

selected.push(newTag)
}

Expand Down Expand Up @@ -276,7 +277,6 @@ function FilteringTerms (props) {
}

const handleCheck2 = e => {

if (e.target.checked === false) {
let newValueChosen = valueChosen.filter(valor => valor !== e.target.value)
setValueChosen(newValueChosen)
Expand Down Expand Up @@ -345,53 +345,57 @@ function FilteringTerms (props) {
</form>
</th>
</tr>
<tr className='search-tr'>
<th
className='search-box sorting'
tabIndex='0'
aria-controls='DataTables_Table_0'
rowSpan='1'
colSpan='2'
aria-sort='ascending'
aria-label=': activate to sort column descending'
>
<form>
<input
className='searchTermInput'
type='search'
onChange={handleChange3}
placeholder='Search by type'
/>
</form>
</th>
</tr>
<tr className='search-tr'>
<th
className='search-box sorting'
tabIndex='0'
aria-controls='DataTables_Table_0'
rowSpan='1'
colSpan='2'
aria-sort='ascending'
aria-label=': activate to sort column descending'
>
<form>
<input
className='searchTermInput'
type='search'
onChange={handleChange4}
placeholder='Search by scope'
/>
</form>
</th>
</tr>
{hide === false && (
<tr className='search-tr'>
<th
className='search-box sorting'
tabIndex='0'
aria-controls='DataTables_Table_0'
rowSpan='1'
colSpan='2'
aria-sort='ascending'
aria-label=': activate to sort column descending'
>
<form>
<input
className='searchTermInput'
type='search'
onChange={handleChange3}
placeholder='Search by type'
/>
</form>
</th>
</tr>
)}
{hide === false && (
<tr className='search-tr'>
<th
className='search-box sorting'
tabIndex='0'
aria-controls='DataTables_Table_0'
rowSpan='1'
colSpan='2'
aria-sort='ascending'
aria-label=': activate to sort column descending'
>
<form>
<input
className='searchTermInput'
type='search'
onChange={handleChange4}
placeholder='Search by scope'
/>
</form>
</th>
</tr>
)}
</thead>
<thead className='thead2'>
<tr>
<th className='th4'>term</th>
<th className='th5'>label</th>
<th className='th6'>type</th>
<th className='th7'>scopes</th>
{hide === false && <th className='th6'>type</th>}
{hide === false && <th className='th7'>scopes</th>}
</tr>
</thead>
{props.filteringTerms.data !== undefined &&
Expand Down Expand Up @@ -436,16 +440,20 @@ function FilteringTerms (props) {
<td className='th1'>-</td>
)}

<td className='th3'>{term.type}</td>
{hide === false && (
<td className='th3'>{term.type}</td>
)}

<td className='th1'>
{term.scopes !== undefined &&
term.scopes.map((term2, index) => {
return index < term.scopes.length - 1
? term2 + '' + ','
: term2 + ''
})}
</td>
{hide === false && (
<td className='th1'>
{term.scopes !== undefined &&
term.scopes.map((term2, index) => {
return index < term.scopes.length - 1
? term2 + '' + ','
: term2 + ''
})}
</td>
)}
</tr>
)}
{index % 2 == !0 && (
Expand Down Expand Up @@ -484,15 +492,19 @@ function FilteringTerms (props) {
<td className='th1'>-</td>
)}

<td className='th3'>{term.type}</td>
{hide === false && (
<td className='th3'>{term.type}</td>
)}

<td className='th1'>
{term.scopes.map((term2, index) => {
return index < term.scopes.length - 1
? term2 + '' + ','
: term2 + ''
})}
</td>
{hide === false && (
<td className='th1'>
{term.scopes.map((term2, index) => {
return index < term.scopes.length - 1
? term2 + '' + ','
: term2 + ''
})}
</td>
)}
</tr>
)}

Expand Down
14 changes: 8 additions & 6 deletions frontend/src/components/Individuals/Individuals.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
margin: 0px !important;
}

.granularityActive {
color: rgb(92, 165, 211) !important;
font-size: 14px;
}
.granularityNoActive {
color: rgb(222, 82, 82) !important;
font-size: 14px;
}
.measuresContainer {
display: flex;
}
Expand Down Expand Up @@ -94,11 +102,6 @@ h4 {
margin-left: 10px;
}

.selectGranularity h5 {
font-size: 14px;
color: #8985c1;
}

.selectGranularity h4 {
font-size: 14px;
}
Expand All @@ -118,7 +121,6 @@ h4 {
.results {
flex-wrap: wrap;
justify-content: center;

}

.typeResults {
Expand Down
Loading

0 comments on commit d9081b3

Please sign in to comment.