Skip to content

Commit

Permalink
elixir-bsc
Browse files Browse the repository at this point in the history
  • Loading branch information
GMILLA92 committed Jan 18, 2024
1 parent 1ed0083 commit dec8165
Show file tree
Hide file tree
Showing 4 changed files with 255 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ function TableResultsAnalyses (props) {
const [resultsSelectedFinal, setResultsSelectedFinal] = useState([])

const [openDatasetArray, setOpenDataset] = useState([])
const [openDatasetArray2, setOpenDataset2] = useState([])

const [editable, setEditable] = useState([])

const [trigger, setTrigger] = useState(false)
const [trigger2, setTrigger2] = useState(false)

const [triggerArray, setTriggerArray] = useState([])
const [triggerArray2, setTriggerArray2] = useState([])

const getSelectedRowsToExport = ({ apiRef }) => {
const selectedRowIds = selectedGridRowsSelector(apiRef)
Expand All @@ -65,6 +67,14 @@ function TableResultsAnalyses (props) {
setTrigger(!trigger)
}

const handleClickDatasets2 = e => {
openDatasetArray2[e] = true

triggerArray2[e] = true
console.log(triggerArray)
setTrigger(!trigger)
}

let columns = [
{
field: 'id',
Expand Down Expand Up @@ -394,7 +404,7 @@ function TableResultsAnalyses (props) {

return (
<div className='containerBeaconResults'>
{showDatsets === true &&
{showDatsets === true &&
beaconsArrayResultsOrdered.length > 0 &&
beaconsArrayResultsOrdered.map(result => {
return (
Expand Down Expand Up @@ -465,7 +475,7 @@ function TableResultsAnalyses (props) {
)
})}

{props.resultsNotPerDataset.map(element => {
{props.resultsNotPerDataset.map((element, index) => {
return (
<>
{result[2] === true &&
Expand All @@ -487,8 +497,19 @@ function TableResultsAnalyses (props) {
</div>

<div className='resultSetsContainer'>
<h7>No datasets available</h7>
<h6>FOUND </h6>
<button
className='resultSetsButton'
onClick={() =>
handleClickDatasets2([index])
}
>
{' '}
<h7>NO DATASETS AVAILABLE</h7>
</button>
{openDatasetArray2[[index]] === true &&
triggerArray2[[index]] === true && (
<h6>FOUND </h6>
)}
</div>
</div>
</div>
Expand All @@ -511,8 +532,21 @@ function TableResultsAnalyses (props) {
</h4>
</div>
<div className='resultSetsContainer'>
<h7>No datasets available</h7>
<h5 className='buttonResults'>NOT FOUND</h5>
<button
className='resultSetsButton'
onClick={() =>
handleClickDatasets2([index])
}
>
{' '}
<h7>NO DATASETS AVAILABLE</h7>
</button>
{openDatasetArray2[[index]] === true &&
triggerArray2[[index]] === true && (
<h5 className='buttonResults'>
NOT FOUND
</h5>
)}
</div>
</div>
</div>
Expand All @@ -535,22 +569,34 @@ function TableResultsAnalyses (props) {
</h4>
</div>
<div className='resultSetsContainer'>
<h7>No datasets available</h7>
<h6 className='buttonResults'>
{result[1]} results
</h6>
<button
className='resultSetsButton'
onClick={() =>
handleClickDatasets2([index])
}
>
{' '}
<h7>NO DATASETS AVAILABLE</h7>
</button>
{openDatasetArray2[[index]] === true &&
triggerArray2[[index]] === true &&
result[1] !== 0 && <h6 className='buttonResults'>
{result[1]} results
</h6>
}
{openDatasetArray2[[index]] === true &&
triggerArray2[[index]] === true &&
result[1] === 0 && <h5 className='buttonResults'>
{result[1]} results
</h5>
}
</div>
<button
className='buttonResults'
onClick={() => {
handleSeeResults(result[0].meta.beaconId)
}}
>
{result[2] === true &&
props.show === 'full' && (
<h7>See results</h7>
)}
</button>
></button>
</div>
</div>
)}
Expand Down Expand Up @@ -607,4 +653,4 @@ function TableResultsAnalyses (props) {
)
}

export default TableResultsAnalyses
export default TableResultsAnalyses
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ function TableResultsBiosamples (props) {
const [resultsSelectedFinal, setResultsSelectedFinal] = useState([])

const [openDatasetArray, setOpenDataset] = useState([])
const [openDatasetArray2, setOpenDataset2] = useState([])

const [editable, setEditable] = useState([])

const [trigger, setTrigger] = useState(false)
const [trigger2, setTrigger2] = useState(false)

const [triggerArray, setTriggerArray] = useState([])
const [triggerArray2, setTriggerArray2] = useState([])

const getSelectedRowsToExport = ({ apiRef }) => {
const selectedRowIds = selectedGridRowsSelector(apiRef)
Expand All @@ -66,6 +68,14 @@ function TableResultsBiosamples (props) {
setTrigger(!trigger)
}

const handleClickDatasets2 = e => {
openDatasetArray2[e] = true

triggerArray2[e] = true
console.log(triggerArray)
setTrigger(!trigger)
}

let columns = [
{
field: 'id',
Expand Down Expand Up @@ -994,7 +1004,7 @@ function TableResultsBiosamples (props) {
)
})}

{props.resultsNotPerDataset.map(element => {
{props.resultsNotPerDataset.map((element, index) => {
return (
<>
{result[2] === true &&
Expand All @@ -1016,8 +1026,19 @@ function TableResultsBiosamples (props) {
</div>

<div className='resultSetsContainer'>
<h7>No datasets available</h7>
<h6>FOUND </h6>
<button
className='resultSetsButton'
onClick={() =>
handleClickDatasets2([index])
}
>
{' '}
<h7>NO DATASETS AVAILABLE</h7>
</button>
{openDatasetArray2[[index]] === true &&
triggerArray2[[index]] === true && (
<h6>FOUND </h6>
)}
</div>
</div>
</div>
Expand All @@ -1040,8 +1061,21 @@ function TableResultsBiosamples (props) {
</h4>
</div>
<div className='resultSetsContainer'>
<h7>No datasets available</h7>
<h5 className='buttonResults'>NOT FOUND</h5>
<button
className='resultSetsButton'
onClick={() =>
handleClickDatasets2([index])
}
>
{' '}
<h7>NO DATASETS AVAILABLE</h7>
</button>
{openDatasetArray2[[index]] === true &&
triggerArray2[[index]] === true && (
<h5 className='buttonResults'>
NOT FOUND
</h5>
)}
</div>
</div>
</div>
Expand All @@ -1064,22 +1098,36 @@ function TableResultsBiosamples (props) {
</h4>
</div>
<div className='resultSetsContainer'>
<h7>No datasets available</h7>
<h6 className='buttonResults'>
{result[1]} results
</h6>
<button
className='resultSetsButton'
onClick={() =>
handleClickDatasets2([index])
}
>
{' '}
<h7>NO DATASETS AVAILABLE</h7>
</button>
{openDatasetArray2[[index]] === true &&
triggerArray2[[index]] === true &&
result[1] !== 0 && (
<h6 className='buttonResults'>
{result[1]} results
</h6>
)}
{openDatasetArray2[[index]] === true &&
triggerArray2[[index]] === true &&
result[1] === 0 && (
<h5 className='buttonResults'>
{result[1]} results
</h5>
)}
</div>
<button
className='buttonResults'
onClick={() => {
handleSeeResults(result[0].meta.beaconId)
}}
>
{result[2] === true &&
props.show === 'full' && (
<h7>See results</h7>
)}
</button>
></button>
</div>
</div>
)}
Expand Down Expand Up @@ -1136,4 +1184,4 @@ function TableResultsBiosamples (props) {
)
}

export default TableResultsBiosamples
export default TableResultsBiosamples
Loading

0 comments on commit dec8165

Please sign in to comment.