Skip to content

Commit 97f8704

Browse files
authored
Fix [O2B-1291] Remove unnecessary space between runs table and pagination controller (#1938)
* a * add CSS * abstraction * tmp tmp tmp * WIP step 1 * a * works * works * cleanup * cleanup * cleanup * cleanup * fix verticall scroll * fix per simulation pass * fix pe rLHC periods * linter * linter * linter * fix fng puppeteer * last fix * typo * cleanup * fix * Revert "fix" This reverts commit 35a28ed. * fixes * typo
1 parent 229c895 commit 97f8704

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ const parseColumnsConfiguration = (columns, currentProfile) => {
9292
* @property {boolean} verticallScrollEnabled if true, enable vertical (table internal) scroll in case of overflow,
9393
* whole page vertical scroll otherwise. Note that for this option to work,
9494
* all predecesors of the node returned by this function must have display property column-flex and height: 100%
95+
* @property {boolean} singleWrapper have effect only when some scroll is enabled.
96+
* If true all divs wrapping table element are merged to single on.
9597
*/
9698

9799
/**
@@ -134,6 +136,7 @@ export const table = (
134136
horizontalScrollEnabled = false,
135137
freezeFirstColumn = false,
136138
verticalScrollEnabled = false,
139+
singleWrapper = false,
137140
} = tableConfiguration || {};
138141
const { idKey, displayedColumns } = parseColumnsConfiguration(columns, currentProfile);
139142

@@ -147,12 +150,14 @@ export const table = (
147150
}
148151

149152
const scrollEnabled = horizontalScrollEnabled || verticalScrollEnabled;
150-
const wrapperClassesExpression = scrollEnabled ? '.sticky-table-wrapper.scroll-auto' : '';
151-
152153
const optionalTableClassesExpression = freezeFirstColumn && horizontalScrollEnabled ? '.freeze-first-column' : '';
153154

154-
const wrappedTableNode = h(
155-
wrapperClassesExpression,
155+
const firstLevelWrapperClasses =
156+
(verticalScrollEnabled ? '.sticky-table-wrapper' : '') +
157+
(singleWrapper && scrollEnabled ? '.scroll-auto' : '');
158+
159+
let wrappedTableNode = h(
160+
firstLevelWrapperClasses,
156161
h(
157162
`table.table.table-hover.shadow-level1${optionalTableClassesExpression}`,
158163
{
@@ -168,6 +173,11 @@ export const table = (
168173
],
169174
),
170175
);
176+
177+
if (scrollEnabled && !singleWrapper) {
178+
wrappedTableNode = h('.scroll-auto', wrappedTableNode);
179+
}
180+
171181
return scrollEnabled && !verticalScrollEnabled
172182
? h('', wrappedTableNode) // Disable y-scroll
173183
: wrappedTableNode;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
9898
{
9999
profile: 'runsPerLhcPeriod',
100100
...displayOptions,
101+
singleWrapper: true,
101102
},
102103
{ sort: sortModel },
103104
);
@@ -130,7 +131,7 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
130131
)),
131132
},
132133
{
133-
panelClass: ['p2', 'scroll-auto'],
134+
panelClass: ['scroll-auto'],
134135
},
135136
),
136137
paginationComponent(perLhcPeriodOverviewModel.pagination),

0 commit comments

Comments
 (0)