@@ -65,29 +65,22 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
6565 tabbedPanelModel,
6666 } = perLhcPeriodOverviewModel ;
6767
68- const activeColumns = {
69-
70- } ;
71-
7268 /**
7369 * Render runs table with given detectors' active columns configuration
7470 *
75- * @param {Run[] } runs runs
76- * @param {object } detectorsActiveColumns active columns
71+ * @param {object } activeColumns common acctivte column
72+ * @param {object } detectorsActiveColumns detectors specific columns
7773 * @return {Component } table with pagination
7874 */
79- const getTableWithGivenDetectorsColumns = ( runs , detectorsActiveColumns ) =>
75+ const getTableWithGivenDetectorsColumns = ( activeColumns , detectorsActiveColumns ) =>
8076 table (
8177
8278 /*
8379 * Columns depends on detectors' list, it's not useful to render the table when detectors are missing
8480 */
8581 remoteRuns ,
8682 {
87- ...runsActiveColumns ,
88- ...runs . some ( ( run ) => run . pdpBeamType === PdpBeamType . LEAD_LEAD ) ? inelasticInteractionRateActiveColumnsForPbPb : { } ,
89- ...runs . some ( ( run ) => run . pdpBeamType === PdpBeamType . PROTON_PROTON )
90- ? inelasticInteractionRateActiveColumnsForProtonProton : { } ,
83+ ...activeColumns ,
9184 ...detectorsActiveColumns ,
9285 } ,
9386 { classes : getRowClasses } ,
@@ -106,37 +99,46 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
10699 NotAsked : ( ) => null ,
107100 Failure : ( errors ) => errorAlert ( errors ) ,
108101 Loading : ( ) => spinner ( ) ,
109- Success : ( [ lhcPeriod , runs , detectors ] ) => [
110- h ( '.flex-row.justify-between.items-center.g2' , [
111- filtersPanelPopover ( perLhcPeriodOverviewModel , activeColumns , { profile : 'runsPerLhcPeriod' } ) ,
112- h ( '.pl2#runOverviewFilter' , runNumbersFilter ( perLhcPeriodOverviewModel . filteringModel . get ( 'runNumbers' ) ) ) ,
113- h ( 'h2' , `Good, physics runs of ${ lhcPeriod . lhcPeriod . name } ` ) ,
102+ Success : ( [ lhcPeriod , runs , detectors ] ) => {
103+ const activeColumns = {
104+ ...runsActiveColumns ,
105+ ...runs . some ( ( run ) => run . pdpBeamType === PdpBeamType . LEAD_LEAD ) ? inelasticInteractionRateActiveColumnsForPbPb : { } ,
106+ ...runs . some ( ( run ) => run . pdpBeamType === PdpBeamType . PROTON_PROTON )
107+ ? inelasticInteractionRateActiveColumnsForProtonProton : { } ,
108+ } ;
114109
115- exportRunsTriggerAndModal ( perLhcPeriodOverviewModel , modalModel ) ,
116- ] ) ,
117- ...tabbedPanelComponent (
118- tabbedPanelModel ,
119- {
120- [ RUNS_PER_LHC_PERIOD_PANELS_KEYS . DETECTOR_QUALITIES ] : 'Qualities of detectors' ,
121- [ RUNS_PER_LHC_PERIOD_PANELS_KEYS . SYNCHRONOUS_FLAGS ] : 'Synchronous QC flags' ,
122- } ,
123- {
124- [ RUNS_PER_LHC_PERIOD_PANELS_KEYS . DETECTOR_QUALITIES ] :
110+ return [
111+ h ( '.flex-row.justify-between.items-center.g2' , [
112+ filtersPanelPopover ( perLhcPeriodOverviewModel , activeColumns , { profile : 'runsPerLhcPeriod' } ) ,
113+ h ( '.pl2#runOverviewFilter' , runNumbersFilter ( perLhcPeriodOverviewModel . filteringModel . get ( 'runNumbers' ) ) ) ,
114+ h ( 'h2' , `Good, physics runs of ${ lhcPeriod . lhcPeriod . name } ` ) ,
115+
116+ exportRunsTriggerAndModal ( perLhcPeriodOverviewModel , modalModel ) ,
117+ ] ) ,
118+ ...tabbedPanelComponent (
119+ tabbedPanelModel ,
120+ {
121+ [ RUNS_PER_LHC_PERIOD_PANELS_KEYS . DETECTOR_QUALITIES ] : 'Qualities of detectors' ,
122+ [ RUNS_PER_LHC_PERIOD_PANELS_KEYS . SYNCHRONOUS_FLAGS ] : 'Synchronous QC flags' ,
123+ } ,
124+ {
125+ [ RUNS_PER_LHC_PERIOD_PANELS_KEYS . DETECTOR_QUALITIES ] :
125126 ( ) => getTableWithGivenDetectorsColumns (
126- runs ,
127+ activeColumns ,
127128 runDetectorsQualitiesActiveColumns ( detectors , { profiles : 'runsPerLhcPeriod' } ) ,
128129 ) ,
129130
130- [ RUNS_PER_LHC_PERIOD_PANELS_KEYS . SYNCHRONOUS_FLAGS ] :
131- ( remoteSynchronousQcSummary ) => getTableWithGivenDetectorsColumns ( runs , runDetectorsSyncQcActiveColumns ( detectors , {
132- profiles : 'runsPerLhcPeriod' ,
133- qcSummary : remoteSynchronousQcSummary ?. match ( { Success : ( qcSummary ) => qcSummary , Other : ( ) => null } ) ,
134- } ) ) ,
135- } ,
136- { panelClass : [ 'scroll-auto' ] } ,
137- ) ,
138- paginationComponent ( perLhcPeriodOverviewModel . pagination ) ,
139- ] ,
131+ [ RUNS_PER_LHC_PERIOD_PANELS_KEYS . SYNCHRONOUS_FLAGS ] : ( remoteSynchronousQcSummary ) =>
132+ getTableWithGivenDetectorsColumns ( activeColumns , runDetectorsSyncQcActiveColumns ( detectors , {
133+ profiles : 'runsPerLhcPeriod' ,
134+ qcSummary : remoteSynchronousQcSummary ?. match ( { Success : ( qcSummary ) => qcSummary , Other : ( ) => null } ) ,
135+ } ) ) ,
136+ } ,
137+ { panelClass : [ 'scroll-auto' ] } ,
138+ ) ,
139+ paginationComponent ( perLhcPeriodOverviewModel . pagination ) ,
140+ ] ;
141+ } ,
140142 } ) ,
141143
142144 ) ;
0 commit comments