Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion lib/public/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ th.text-center, td.text-center {
background: var(--color-gray-light);
position: sticky;
left: 0;
z-index: 2;
z-index: 3;
}

.freeze-first-column td:first-child {
Expand Down Expand Up @@ -207,6 +207,25 @@ th.text-center, td.text-center {
}


.sticky-table-wrapper {
flex: 1 1 auto;
overflow-y: auto;
height: 100%;
}

.sticky-table-wrapper thead {
position: sticky;
top: 0;
z-index: 3;
}

.intermediate-flex-column {
display: flex;
flex-direction: column;
height: 100%;
}


/* alerts */

.alert {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { tabLink } from '../common/navigation/tabLink.js';
*/
export const tabbedPanelComponent = (tabbedPanelModel, panelsTitles, panelsBodies, configuration) => {
const { panelClass = 'p2' } = configuration || {};

return [
h(
'ul.nav.nav-tabs',
Expand Down
49 changes: 34 additions & 15 deletions lib/public/components/common/table/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ const parseColumnsConfiguration = (columns, currentProfile) => {
* specific configuration. If not specified, any visible column will be displayed
* @property {boolean} horizontalScrollEnabled if true, enable horizontal scroll in case of overflow,
* fixed layout otherwise
* @property {boolean} verticallScrollEnabled if true, enable vertical (table internal) scroll in case of overflow,
* whole page vertical scroll otherwise. Note that for this option to work,
* all predecesors of the node returned by this function must have display property column-flex and height: 100%
*/

/**
Expand Down Expand Up @@ -126,7 +129,12 @@ export const table = (
}

// Extract the profile of the table
const { profile: currentProfile = profiles.none, horizontalScrollEnabled = false, freezeFirstColumn = false } = tableConfiguration || {};
const {
profile: currentProfile = profiles.none,
horizontalScrollEnabled = false,
freezeFirstColumn = false,
verticalScrollEnabled = false,
} = tableConfiguration || {};
const { idKey, displayedColumns } = parseColumnsConfiguration(columns, currentProfile);

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

return h(`${horizontalScrollEnabled ? '.scroll-auto.shadow-level1' : ''}`, h(
`table.table.table-hover.shadow-level1.no-z-index${freezeFirstColumn ? '.freeze-first-column' : ''}`,
{
style: `table-layout: ${horizontalScrollEnabled ? 'auto' : 'fixed'}`,
},
[
headers(displayedColumns, models),
remoteDataTableBody(
remoteData,
(payload) => rows(payload, idKey, displayedColumns, rowsConfiguration),
displayedColumns.length,
),
],
));
const scrollEnabled = horizontalScrollEnabled || verticalScrollEnabled;
const wrapperClassesExpression = scrollEnabled ? '.sticky-table-wrapper.scroll-auto' : '';

const optionalTableClassesExpression = freezeFirstColumn && horizontalScrollEnabled ? '.freeze-first-column' : '';

const wrappedTableNode = h(
wrapperClassesExpression,
h(
`table.table.table-hover.shadow-level1${optionalTableClassesExpression}`,
{
style: `table-layout: ${horizontalScrollEnabled ? 'auto' : 'fixed'}`,
},
[
headers(displayedColumns, models),
remoteDataTableBody(
remoteData,
(payload) => rows(payload, idKey, displayedColumns, rowsConfiguration),
displayedColumns.length,
),
],
),
);
return scrollEnabled && !verticalScrollEnabled
? h('', wrappedTableNode) // Disable y-scroll
: wrappedTableNode;
};
4 changes: 2 additions & 2 deletions lib/public/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default (model) => {
};

return [
h('.flex-column.absolute-fill', [
h('.intermediate-flex-column.absolute-fill', [
modalContainer(model.modalModel),
NavBar(model),
content(model, pages),
Expand All @@ -140,7 +140,7 @@ const content = (model, pages) => h(
'.flex-column',
{
key: model.router.params.page,
style: 'min-height: 100%',
style: 'height: 100%',
onupdate: () => {
},
},
Expand Down
6 changes: 5 additions & 1 deletion lib/public/views/Runs/Overview/RunsWithQcModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export class RunsWithQcModel extends RunsOverviewModel {
constructor(model) {
super(model);

this.patchDisplayOptions({ horizontalScrollEnabled: true, freezeFirstColumn: true });
this.patchDisplayOptions({
horizontalScrollEnabled: true,
verticalScrollEnabled: true,
freezeFirstColumn: true,
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ const skimmableControl = (dataPass, onclick, requestResult) => {
NotAsked: () => h('button.btn.primary', { onclick }, buttonContent),
});
}
return;
};

/**
Expand Down Expand Up @@ -131,7 +130,7 @@ export const RunsPerDataPassOverviewPage = ({
const runDetectorsSelectionIsEmpty = perDataPassOverviewModel.runDetectorsSelectionModel.selectedQueryString.length === 0;

return h(
'',
'.intermediate-flex-column',
{ onremove: () => perDataPassOverviewModel.reset(false) },
mergeRemoteData([remoteDataPass, remoteRuns, remoteDetectors, remoteQcSummary, remoteGaqSummary]).match({
NotAsked: () => null,
Expand Down Expand Up @@ -303,19 +302,17 @@ export const RunsPerDataPassOverviewPage = ({
Failure: (errors) => errorAlert(errors),
Other: () => null,
}),
h('.flex-column.w-100', [
table(
runs,
activeColumns,
{ classes: getRowClasses },
{
profile: 'runsPerDataPass',
...displayOptions,
},
{ sort: sortModel },
),
paginationComponent(perDataPassOverviewModel.pagination),
]),
table(
runs,
activeColumns,
{ classes: getRowClasses },
{
profile: 'runsPerDataPass',
...displayOptions,
},
{ sort: sortModel },
),
paginationComponent(perDataPassOverviewModel.pagination),
];
},
Loading: () => spinner(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
* @param {object} detectorsActiveColumns active columns
* @return {Component} table with pagination
*/
const getTableWithGivenDetectorsColumns = (detectorsActiveColumns) => h('.flex-column.w-100', [
const getTableWithGivenDetectorsColumns = (detectorsActiveColumns) =>
table(

/*
Expand All @@ -100,16 +100,14 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
...displayOptions,
},
{ sort: sortModel },
),
paginationComponent(perLhcPeriodOverviewModel.pagination),
]);
);

return h('', [
return h('.intermediate-flex-column', [
h('.flex-row.justify-between.g2', [
h('h2', `Good, physics runs of ${lhcPeriodName}`),
exportRunsTriggerAndModal(perLhcPeriodOverviewModel, modalModel),
]),
tabbedPanelComponent(
...tabbedPanelComponent(
tabbedPanelModel,
{
[RUNS_PER_LHC_PERIOD_PANELS_KEYS.DETECTOR_QUALITIES]: 'Qualities of detectors',
Expand All @@ -131,7 +129,10 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
},
)),
},
{
panelClass: ['p2', 'scroll-auto'],
},
),

paginationComponent(perLhcPeriodOverviewModel.pagination),
]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const RunsPerSimulationPassOverviewPage = ({

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

return h('', mergeRemoteData([remoteSimulationPass, remoteRuns, remoteDetectors, remoteQcSummary]).match({
return h('.intermediate-flex-column', mergeRemoteData([remoteSimulationPass, remoteRuns, remoteDetectors, remoteQcSummary]).match({
NotAsked: () => null,
Failure: (errors) => errorAlert(errors),
Success: ([simulationPass, runs, detectors, qcSummary]) => {
Expand Down Expand Up @@ -111,19 +111,17 @@ export const RunsPerSimulationPassOverviewPage = ({
},
),
]),
h('.flex-column.w-100', [
table(
runs,
activeColumns,
{ classes: getRowClasses },
{
profile: 'runsPerSimulationPass',
...displayOptions,
},
{ sort: sortModel },
),
paginationComponent(perSimulationPassOverviewModel.pagination),
]),
table(
runs,
activeColumns,
{ classes: getRowClasses },
{
profile: 'runsPerSimulationPass',
...displayOptions,
},
{ sort: sortModel },
),
paginationComponent(perSimulationPassOverviewModel.pagination),
];
},
Loading: () => spinner(),
Expand Down