Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

Commit

Permalink
Merge pull request #82 from gabrielmscampos/fix/json-portal-empty-rr-…
Browse files Browse the repository at this point in the history
…runs
  • Loading branch information
gabrielmscampos authored Nov 8, 2024
2 parents 3a67286 + aa1d738 commit 82ba7f9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions frontend/src/views/machineLearning/jsonPortal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const JsonPortal = () => {
}, [activeModels, datasetRegex, rrClassName, rrDatasetName])

useEffect(() => {
const fetchBrilLumiByRun = () => {
const fetchElegibleBrilRuns = () => {
API.brilws.brilcalc
.lumi({
beamStatus: brilBeamStatus,
Expand All @@ -182,8 +182,8 @@ const JsonPortal = () => {
})
}

if (rrOpenRuns !== undefined) {
fetchBrilLumiByRun()
if (rrOpenRuns !== undefined && rrOpenRuns.length > 0) {
fetchElegibleBrilRuns()
}
}, [rrOpenRuns])

Expand Down Expand Up @@ -458,16 +458,21 @@ const JsonPortal = () => {
{activeModels === undefined && (
<div>
<Spinner animation='border' role='status' />
<span className='ms-1'>Fetching the active ML models...</span>
<span className='ms-1'>Fetching active ML models...</span>
</div>
)}
{datasetIds === undefined && (
<div>
<Spinner animation='border' role='status' />
<span className='ms-1'>{`Fetching data ids for pattern: ${datasetRegex}`}</span>
<span className='ms-1'>{`Fetching dataset ids for pattern: ${datasetRegex}`}</span>
</div>
)}
{rrOpenRuns !== undefined && brilRuns === undefined && (
{rrOpenRuns !== undefined && rrOpenRuns.length === 0 && (
<div>
<span className='ms-1'>{`There are no OPEN runs in Run Registry for (${rrClassName}, ${rrDatasetName}), thus no ML JSON will be generated.`}</span>
</div>
)}
{rrOpenRuns !== undefined && rrOpenRuns.length > 0 && brilRuns === undefined && (
<div>
<Spinner animation='border' role='status' />
<span className='ms-1'>{`Fetching luminosity data from Bril for ${rrOpenRuns.length} runs.`}</span>
Expand Down

0 comments on commit 82ba7f9

Please sign in to comment.