Skip to content

Commit 940089f

Browse files
authored
Merge branch 'main' into release/1.10.0
2 parents 5394dbf + d0ae17e commit 940089f

8 files changed

Lines changed: 93 additions & 56 deletions

File tree

lib/public/app.css

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ th.text-center, td.text-center {
176176
background: var(--color-gray-light);
177177
position: sticky;
178178
left: 0;
179-
z-index: 2;
179+
z-index: 3;
180180
}
181181

182182
.freeze-first-column td:first-child {
@@ -207,6 +207,25 @@ th.text-center, td.text-center {
207207
}
208208

209209

210+
.sticky-table-wrapper {
211+
flex: 1 1 auto;
212+
overflow-y: auto;
213+
height: 100%;
214+
}
215+
216+
.sticky-table-wrapper thead {
217+
position: sticky;
218+
top: 0;
219+
z-index: 3;
220+
}
221+
222+
.intermediate-flex-column {
223+
display: flex;
224+
flex-direction: column;
225+
height: 100%;
226+
}
227+
228+
210229
/* alerts */
211230

212231
.alert {

lib/public/components/TabbedPanel/tabbedPanelComponent.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { tabLink } from '../common/navigation/tabLink.js';
1414
*/
1515
export const tabbedPanelComponent = (tabbedPanelModel, panelsTitles, panelsBodies, configuration) => {
1616
const { panelClass = 'p2' } = configuration || {};
17-
1817
return [
1918
h(
2019
'ul.nav.nav-tabs',

lib/public/components/common/table/table.js

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ const parseColumnsConfiguration = (columns, currentProfile) => {
8989
* specific configuration. If not specified, any visible column will be displayed
9090
* @property {boolean} horizontalScrollEnabled if true, enable horizontal scroll in case of overflow,
9191
* fixed layout otherwise
92+
* @property {boolean} verticallScrollEnabled if true, enable vertical (table internal) scroll in case of overflow,
93+
* whole page vertical scroll otherwise. Note that for this option to work,
94+
* all predecesors of the node returned by this function must have display property column-flex and height: 100%
9295
*/
9396

9497
/**
@@ -126,7 +129,12 @@ export const table = (
126129
}
127130

128131
// Extract the profile of the table
129-
const { profile: currentProfile = profiles.none, horizontalScrollEnabled = false, freezeFirstColumn = false } = tableConfiguration || {};
132+
const {
133+
profile: currentProfile = profiles.none,
134+
horizontalScrollEnabled = false,
135+
freezeFirstColumn = false,
136+
verticalScrollEnabled = false,
137+
} = tableConfiguration || {};
130138
const { idKey, displayedColumns } = parseColumnsConfiguration(columns, currentProfile);
131139

132140
let remoteData;
@@ -138,18 +146,29 @@ export const table = (
138146
Error(`Unhandled type <${typeof data}> of data : ${data ? JSON.stringify(data) : data}`);
139147
}
140148

141-
return h(`${horizontalScrollEnabled ? '.scroll-auto.shadow-level1' : ''}`, h(
142-
`table.table.table-hover.shadow-level1.no-z-index${freezeFirstColumn ? '.freeze-first-column' : ''}`,
143-
{
144-
style: `table-layout: ${horizontalScrollEnabled ? 'auto' : 'fixed'}`,
145-
},
146-
[
147-
headers(displayedColumns, models),
148-
remoteDataTableBody(
149-
remoteData,
150-
(payload) => rows(payload, idKey, displayedColumns, rowsConfiguration),
151-
displayedColumns.length,
152-
),
153-
],
154-
));
149+
const scrollEnabled = horizontalScrollEnabled || verticalScrollEnabled;
150+
const wrapperClassesExpression = scrollEnabled ? '.sticky-table-wrapper.scroll-auto' : '';
151+
152+
const optionalTableClassesExpression = freezeFirstColumn && horizontalScrollEnabled ? '.freeze-first-column' : '';
153+
154+
const wrappedTableNode = h(
155+
wrapperClassesExpression,
156+
h(
157+
`table.table.table-hover.shadow-level1${optionalTableClassesExpression}`,
158+
{
159+
style: `table-layout: ${horizontalScrollEnabled ? 'auto' : 'fixed'}`,
160+
},
161+
[
162+
headers(displayedColumns, models),
163+
remoteDataTableBody(
164+
remoteData,
165+
(payload) => rows(payload, idKey, displayedColumns, rowsConfiguration),
166+
displayedColumns.length,
167+
),
168+
],
169+
),
170+
);
171+
return scrollEnabled && !verticalScrollEnabled
172+
? h('', wrappedTableNode) // Disable y-scroll
173+
: wrappedTableNode;
155174
};

lib/public/view.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default (model) => {
120120
};
121121

122122
return [
123-
h('.flex-column.absolute-fill', [
123+
h('.intermediate-flex-column.absolute-fill', [
124124
modalContainer(model.modalModel),
125125
NavBar(model),
126126
content(model, pages),
@@ -140,7 +140,7 @@ const content = (model, pages) => h(
140140
'.flex-column',
141141
{
142142
key: model.router.params.page,
143-
style: 'min-height: 100%',
143+
style: 'height: 100%',
144144
onupdate: () => {
145145
},
146146
},

lib/public/views/Runs/Overview/RunsWithQcModel.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export class RunsWithQcModel extends RunsOverviewModel {
2626
constructor(model) {
2727
super(model);
2828

29-
this.patchDisplayOptions({ horizontalScrollEnabled: true, freezeFirstColumn: true });
29+
this.patchDisplayOptions({
30+
horizontalScrollEnabled: true,
31+
verticalScrollEnabled: true,
32+
freezeFirstColumn: true,
33+
});
3034
}
3135
}

lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ const skimmableControl = (dataPass, onclick, requestResult) => {
9191
NotAsked: () => h('button.btn.primary', { onclick }, buttonContent),
9292
});
9393
}
94-
return;
9594
};
9695

9796
/**
@@ -131,7 +130,7 @@ export const RunsPerDataPassOverviewPage = ({
131130
const runDetectorsSelectionIsEmpty = perDataPassOverviewModel.runDetectorsSelectionModel.selectedQueryString.length === 0;
132131

133132
return h(
134-
'',
133+
'.intermediate-flex-column',
135134
{ onremove: () => perDataPassOverviewModel.reset(false) },
136135
mergeRemoteData([remoteDataPass, remoteRuns, remoteDetectors, remoteQcSummary, remoteGaqSummary]).match({
137136
NotAsked: () => null,
@@ -303,19 +302,17 @@ export const RunsPerDataPassOverviewPage = ({
303302
Failure: (errors) => errorAlert(errors),
304303
Other: () => null,
305304
}),
306-
h('.flex-column.w-100', [
307-
table(
308-
runs,
309-
activeColumns,
310-
{ classes: getRowClasses },
311-
{
312-
profile: 'runsPerDataPass',
313-
...displayOptions,
314-
},
315-
{ sort: sortModel },
316-
),
317-
paginationComponent(perDataPassOverviewModel.pagination),
318-
]),
305+
table(
306+
runs,
307+
activeColumns,
308+
{ classes: getRowClasses },
309+
{
310+
profile: 'runsPerDataPass',
311+
...displayOptions,
312+
},
313+
{ sort: sortModel },
314+
),
315+
paginationComponent(perDataPassOverviewModel.pagination),
319316
];
320317
},
321318
Loading: () => spinner(),

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
8282
* @param {object} detectorsActiveColumns active columns
8383
* @return {Component} table with pagination
8484
*/
85-
const getTableWithGivenDetectorsColumns = (detectorsActiveColumns) => h('.flex-column.w-100', [
85+
const getTableWithGivenDetectorsColumns = (detectorsActiveColumns) =>
8686
table(
8787

8888
/*
@@ -100,16 +100,14 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
100100
...displayOptions,
101101
},
102102
{ sort: sortModel },
103-
),
104-
paginationComponent(perLhcPeriodOverviewModel.pagination),
105-
]);
103+
);
106104

107-
return h('', [
105+
return h('.intermediate-flex-column', [
108106
h('.flex-row.justify-between.g2', [
109107
h('h2', `Good, physics runs of ${lhcPeriodName}`),
110108
exportRunsTriggerAndModal(perLhcPeriodOverviewModel, modalModel),
111109
]),
112-
tabbedPanelComponent(
110+
...tabbedPanelComponent(
113111
tabbedPanelModel,
114112
{
115113
[RUNS_PER_LHC_PERIOD_PANELS_KEYS.DETECTOR_QUALITIES]: 'Qualities of detectors',
@@ -131,7 +129,10 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
131129
},
132130
)),
133131
},
132+
{
133+
panelClass: ['p2', 'scroll-auto'],
134+
},
134135
),
135-
136+
paginationComponent(perLhcPeriodOverviewModel.pagination),
136137
]);
137138
};

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const RunsPerSimulationPassOverviewPage = ({
6868

6969
const commonTitle = h('h2', 'Runs per MC');
7070

71-
return h('', mergeRemoteData([remoteSimulationPass, remoteRuns, remoteDetectors, remoteQcSummary]).match({
71+
return h('.intermediate-flex-column', mergeRemoteData([remoteSimulationPass, remoteRuns, remoteDetectors, remoteQcSummary]).match({
7272
NotAsked: () => null,
7373
Failure: (errors) => errorAlert(errors),
7474
Success: ([simulationPass, runs, detectors, qcSummary]) => {
@@ -111,19 +111,17 @@ export const RunsPerSimulationPassOverviewPage = ({
111111
},
112112
),
113113
]),
114-
h('.flex-column.w-100', [
115-
table(
116-
runs,
117-
activeColumns,
118-
{ classes: getRowClasses },
119-
{
120-
profile: 'runsPerSimulationPass',
121-
...displayOptions,
122-
},
123-
{ sort: sortModel },
124-
),
125-
paginationComponent(perSimulationPassOverviewModel.pagination),
126-
]),
114+
table(
115+
runs,
116+
activeColumns,
117+
{ classes: getRowClasses },
118+
{
119+
profile: 'runsPerSimulationPass',
120+
...displayOptions,
121+
},
122+
{ sort: sortModel },
123+
),
124+
paginationComponent(perSimulationPassOverviewModel.pagination),
127125
];
128126
},
129127
Loading: () => spinner(),

0 commit comments

Comments
 (0)