Skip to content

Commit

Permalink
Remove spurious detectors from Runs views (#1506)
Browse files Browse the repository at this point in the history
* emove spurious detectors

* fix test
  • Loading branch information
xsalonx authored Apr 12, 2024
1 parent c3a895a commit 5d0650e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export const createRunDetectorsAsyncQcActiveColumns = (dplDetectors, { profiles,
if (dataPassId && simulationPassId) {
throw new Error('`dataPassId` are `simulationPassId` are exclusive options');
}

const detectorWasActiveDuringRun = Boolean(run.detectorsQualities.find(({ name }) => name === detectorName));
if (!detectorWasActiveDuringRun) {
return null;
}
const detectorQualityDisplay = h('.btn.white.bg-primary', 'QC');

if (dataPassId) {
Expand Down
2 changes: 1 addition & 1 deletion test/public/runs/runsPerDataPass.overview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module.exports = () => {
timeTrgEnd: (date) => !isNaN(Date.parse(date)),
aliceL3Current: (current) => !isNaN(Number(current)),
aliceL3Dipole: (current) => !isNaN(Number(current)),
...Object.fromEntries(DETECTORS.map((detectorName) => [detectorName, (quality) => expect(quality).to.be.equal('QC')])),
...Object.fromEntries(DETECTORS.map((detectorName) => [detectorName, (quality) => expect(quality).to.be.oneOf(['QC', ''])])),
};

// We find the headers matching the datatype keys
Expand Down
2 changes: 1 addition & 1 deletion test/public/runs/runsPerSimulationPass.overview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module.exports = () => {

aliceL3Current: (current) => !isNaN(Number(current.replace(/,/g, ''))),
dipoleCurrent: (current) => !isNaN(Number(current.replace(/,/g, ''))),
...Object.fromEntries(DETECTORS.map((detectorName) => [detectorName, (quality) => expect(quality).to.be.equal('QC')])),
...Object.fromEntries(DETECTORS.map((detectorName) => [detectorName, (quality) => expect(quality).to.be.oneOf(['QC', ''])])),
};

await validateTableData(page, new Map(Object.entries(tableDataValidators)));
Expand Down

0 comments on commit 5d0650e

Please sign in to comment.