Skip to content

Commit 38910ec

Browse files
committed
a
1 parent d1932be commit 38910ec

3 files changed

Lines changed: 49 additions & 4 deletions

File tree

lib/public/views/Runs/RunPerPeriod/RunsPerLhcPeriodOverviewModel.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ export class RunsPerLhcPeriodOverviewModel extends RunsWithQcModel {
101101
this._tabbedPanelModel.lhcPeriodId = lhcPeriodId;
102102
}
103103

104+
/**
105+
* Set mcReproducibleAsNotBad flag
106+
*
107+
* @param {boolean} mcReproducibleAsNotBad new value
108+
*/
109+
setMcReproducibleAsNotBad(mcReproducibleAsNotBad) {
110+
super.setMcReproducibleAsNotBad(mcReproducibleAsNotBad);
111+
this._tabbedPanelModel.mcReproducibleAsNotBad = mcReproducibleAsNotBad;
112+
}
113+
104114
/**
105115
* Get all detectors
106116
*
@@ -155,7 +165,13 @@ class RunsPerLhcPeriodTabbedPanelModel extends TabbedPanelModel {
155165
this.currentPanelData = RemoteData.loading();
156166
this.notify();
157167
try {
158-
const { data: qcSummary } = await jsonFetch(`/api/qcFlags/summary?lhcPeriodId=${this._lhcPeriodId}`);
168+
const { data: qcSummary } = await jsonFetch(buildUrl(
169+
'/api/qcFlags/summary',
170+
{
171+
lhcPeriodId: this._lhcPeriodId,
172+
mcReproducibleAsNotBad: this._mcReproducibleAsNotBad,
173+
},
174+
));
159175
this.currentPanelData = RemoteData.success(qcSummary);
160176
} catch (errors) {
161177
this.currentPanelData = RemoteData.failure(errors);
@@ -167,10 +183,20 @@ class RunsPerLhcPeriodTabbedPanelModel extends TabbedPanelModel {
167183
/**
168184
* Set LHC period id
169185
*
170-
* @param {string} lhcPeriodId id of LHC period
186+
* @param {id} lhcPeriodId id of LHC period
171187
*/
172188
set lhcPeriodId(lhcPeriodId) {
173189
this._lhcPeriodId = lhcPeriodId;
174190
this._fetchCurrentPanelData();
175191
}
192+
193+
/**
194+
* Set mcReproducibleAsNotBad flag
195+
*
196+
* @param {boolean} mcReproducibleAsNotBad new value
197+
*/
198+
set mcReproducibleAsNotBad(mcReproducibleAsNotBad) {
199+
this._mcReproducibleAsNotBad = mcReproducibleAsNotBad;
200+
this._fetchCurrentPanelData();
201+
}
176202
}

lib/public/views/Runs/RunPerPeriod/RunsPerLhcPeriodOverviewPage.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { runNumbersFilter } from '../../../components/Filters/RunsFilter/runNumb
3030
import { mergeRemoteData } from '../../../utilities/mergeRemoteData.js';
3131
import errorAlert from '../../../components/common/errorAlert.js';
3232
import spinner from '../../../components/common/spinner.js';
33+
import { mcReproducibleAsNotBadToggle } from '../mcReproducibleAsNotBadToggle.js';
3334

3435
const TABLEROW_HEIGHT = 62;
3536
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -63,6 +64,7 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
6364
displayOptions,
6465
sortModel,
6566
tabbedPanelModel,
67+
mcReproducibleAsNotBad,
6668
} = perLhcPeriodOverviewModel;
6769

6870
/**
@@ -112,7 +114,10 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
112114
filtersPanelPopover(perLhcPeriodOverviewModel, activeColumns, { profile: 'runsPerLhcPeriod' }),
113115
h('.pl2#runOverviewFilter', runNumbersFilter(perLhcPeriodOverviewModel.filteringModel.get('runNumbers'))),
114116
h('h2', `Good, physics runs of ${lhcPeriod.lhcPeriod.name}`),
115-
117+
mcReproducibleAsNotBadToggle(
118+
mcReproducibleAsNotBad,
119+
() => perLhcPeriodOverviewModel.setMcReproducibleAsNotBad(!mcReproducibleAsNotBad),
120+
),
116121
exportRunsTriggerAndModal(perLhcPeriodOverviewModel, modalModel),
117122
]),
118123
...tabbedPanelComponent(

test/public/runs/runsPerLhcPeriod.overview.test.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module.exports = () => {
7373
});
7474

7575
it('loads the page successfully', async () => {
76-
const response = await goToPage(page, 'runs-per-lhc-period', { queryParameters: { lhcPeriodName: 'LHC22a' } });
76+
const response = await goToPage(page, 'runs-per-lhc-period', { queryParameters: { lhcPeriodId: 1 } });
7777

7878
expect(response.status()).to.equal(200);
7979

@@ -236,5 +236,19 @@ module.exports = () => {
236236
const expectedRunNumber = await getInnerText(await page.waitForSelector('tbody tr:first-of-type a'));
237237
await waitForNavigation(page, () => pressElement(page, 'tbody tr:first-of-type a'));
238238
expectUrlParams(page, { page: 'run-detail', runNumber: expectedRunNumber });
239+
await page.goBack()
240+
});
241+
242+
it('should successfully apply detectors notBadFraction filters', async () => {
243+
await pressElement(page, '#openFilterToggle', true);
244+
245+
await page.waitForSelector('#inelasticInteractionRateAvg-operator');
246+
await page.select('#inelasticInteractionRateAvg-operator', '<=');
247+
await fillInput(page, '#inelasticInteractionRateAvg-operand', '100000', ['change']);
248+
await expectColumnValues(page, 'runNumber', ['56', '54']);
249+
250+
await pressElement(page, '#openFilterToggle', true);
251+
await pressElement(page, '#reset-filters', true);
252+
await expectColumnValues(page, 'runNumber', ['105', '56', '54', '49']);
239253
});
240254
};

0 commit comments

Comments
 (0)