Skip to content

Commit 54f04bb

Browse files
author
GuustMetz
committed
implment header table loading separation for runsperSimulationPassOverviewpAGE
1 parent 6369c8d commit 54f04bb

File tree

1 file changed

+59
-54
lines changed

1 file changed

+59
-54
lines changed

lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js

Lines changed: 59 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -71,56 +71,61 @@ export const RunsPerSimulationPassOverviewPage = ({
7171

7272
const commonTitle = h('h2', 'Runs per MC');
7373

74-
return h(
75-
'.intermediate-flex-column',
76-
mergeRemoteData([remoteSimulationPass, remoteRuns, remoteDetectors, remoteQcSummary]).match({
77-
NotAsked: () => null,
78-
Failure: (errors) => errorAlert(errors),
79-
Success: ([simulationPass, runs, detectors, qcSummary]) => {
80-
const activeColumns = {
81-
...runsActiveColumns,
82-
...getInelasticInteractionRateColumns(pdpBeamTypes),
83-
...createRunDetectorsAsyncQcActiveColumns(
84-
perSimulationPassOverviewModel.runDetectorsSelectionModel,
85-
detectors,
86-
remoteDplDetectorsUserHasAccessTo,
87-
{ simulationPass },
88-
{
89-
profile: 'runsPerSimulationPass',
90-
qcSummary,
91-
},
92-
),
93-
};
74+
const fullPageData = mergeRemoteData([remoteRuns, remoteSimulationPass, remoteDetectors, remoteQcSummary]);
75+
const simulationPass = remoteSimulationPass.match({ Other: () => null, Success: (data) => data });
76+
const detectors = remoteDetectors.match({ Other: () => null, Success: (data) => data });
77+
const qcSummary = remoteQcSummary.match({ Other: () => null, Success: (data) => data });
9478

95-
return [
96-
h('.flex-row.justify-between.items-center.g2', [
97-
filtersPanelPopover(perSimulationPassOverviewModel, activeColumns, { profile: 'runsPerSimulationPass' }),
98-
h('.pl2#runOverviewFilter', runNumbersFilter(perSimulationPassOverviewModel.filteringModel.get('runNumbers'))),
99-
h(
100-
'.flex-row.g1.items-center',
101-
breadcrumbs([commonTitle, h('h2#breadcrumb-simulation-pass-name', simulationPass.name)]),
102-
),
103-
mcReproducibleAsNotBadToggle(
104-
mcReproducibleAsNotBad,
105-
() => perSimulationPassOverviewModel.setMcReproducibleAsNotBad(!mcReproducibleAsNotBad),
106-
),
107-
h('.mlauto', qcSummaryLegendTooltip()),
108-
exportTriggerAndModal(perSimulationPassOverviewModel.exportModel, modalModel, { autoMarginLeft: false }),
109-
frontLink(
110-
h(
111-
'button.btn.btn-primary.w-100.h2}#set-qc-flags-trigger',
112-
{
113-
disabled: perSimulationPassOverviewModel.runDetectorsSelectionModel.selectedQueryString.length < 1,
114-
},
115-
'Set QC Flags',
116-
),
117-
'qc-flag-creation-for-simulation-pass',
118-
{
119-
runNumberDetectorsMap: perSimulationPassOverviewModel.runDetectorsSelectionModel.selectedQueryString,
120-
simulationPassId,
121-
},
122-
),
123-
]),
79+
const activeColumns = {
80+
...runsActiveColumns,
81+
...getInelasticInteractionRateColumns(pdpBeamTypes),
82+
...detectors && qcSummary && createRunDetectorsAsyncQcActiveColumns(
83+
perSimulationPassOverviewModel.runDetectorsSelectionModel,
84+
detectors,
85+
remoteDplDetectorsUserHasAccessTo,
86+
{ simulationPass },
87+
{
88+
profile: 'runsPerSimulationPass',
89+
qcSummary,
90+
},
91+
),
92+
};
93+
94+
return [
95+
h('.flex-row.justify-between.items-center.g2', [
96+
filtersPanelPopover(perSimulationPassOverviewModel, activeColumns, { profile: 'runsPerSimulationPass' }),
97+
h('.pl2#runOverviewFilter', runNumbersFilter(perSimulationPassOverviewModel.filteringModel.get('runNumbers'))),
98+
h(
99+
'.flex-row.g1.items-center',
100+
breadcrumbs([commonTitle, h('h2#breadcrumb-simulation-pass-name', simulationPass?.name)]),
101+
),
102+
mcReproducibleAsNotBadToggle(
103+
mcReproducibleAsNotBad,
104+
() => perSimulationPassOverviewModel.setMcReproducibleAsNotBad(!mcReproducibleAsNotBad),
105+
),
106+
h('.mlauto', qcSummaryLegendTooltip()),
107+
exportTriggerAndModal(perSimulationPassOverviewModel.exportModel, modalModel, { autoMarginLeft: false }),
108+
frontLink(
109+
h(
110+
'button.btn.btn-primary.w-100.h2}#set-qc-flags-trigger',
111+
{
112+
disabled: perSimulationPassOverviewModel.runDetectorsSelectionModel.selectedQueryString.length < 1,
113+
},
114+
'Set QC Flags',
115+
),
116+
'qc-flag-creation-for-simulation-pass',
117+
{
118+
runNumberDetectorsMap: perSimulationPassOverviewModel.runDetectorsSelectionModel.selectedQueryString,
119+
simulationPassId,
120+
},
121+
),
122+
]),
123+
h(
124+
'.intermediate-flex-column',
125+
fullPageData.match({
126+
NotAsked: () => null,
127+
Failure: (errors) => errorAlert(errors),
128+
Success: ([runs]) => [
124129
table(
125130
runs,
126131
activeColumns,
@@ -132,9 +137,9 @@ export const RunsPerSimulationPassOverviewPage = ({
132137
{ sort: sortModel },
133138
),
134139
paginationComponent(perSimulationPassOverviewModel.pagination),
135-
];
136-
},
137-
Loading: () => spinner(),
138-
}),
139-
);
140+
],
141+
Loading: () => spinner(),
142+
}),
143+
),
144+
];
140145
};

0 commit comments

Comments
 (0)