Skip to content

Commit ee42c74

Browse files
author
NarrowsProjects
committed
chore: add warning component to the toolbar of every overview page
1 parent 239a966 commit ee42c74

13 files changed

Lines changed: 74 additions & 84 deletions

File tree

lib/public/views/DataPasses/PerLhcPeriodOverview/DataPassesPerLhcPeriodOverviewPage.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { filtersPanelPopover } from '../../../components/Filters/common/filtersP
1919
import { estimateDisplayableRowsCount } from '../../../utilities/estimateDisplayableRowsCount.js';
2020
import { dataPassesActiveColumns } from '../ActiveColumns/dataPassesActiveColumns.js';
2121
import { DataPassVersionStatus } from '../../../domain/enums/DataPassVersionStatus.js';
22+
import { warningComponent } from '../../../components/common/messages/warningComponent.js';
2223

2324
const TABLEROW_HEIGHT = 42;
2425
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -42,24 +43,20 @@ const getRowClasses = ({ versions }) => {
4243
* @returns {Component} The overview screen
4344
*/
4445
export const DataPassesPerLhcPeriodOverviewPage = ({ dataPasses: { perLhcPeriodOverviewModel: dataPassesPerLhcPeriodOverviewModel } }) => {
45-
dataPassesPerLhcPeriodOverviewModel.pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(
46+
const { filteringModel, warnings, sortModel, pagination, items } = dataPassesPerLhcPeriodOverviewModel;
47+
48+
pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(
4649
TABLEROW_HEIGHT,
4750
PAGE_USED_HEIGHT,
4851
));
4952

5053
return h('', {
5154
onremove: () => dataPassesPerLhcPeriodOverviewModel.reset(),
5255
}, [
53-
h('.flex-row.header-container.pv2', filtersPanelPopover(dataPassesPerLhcPeriodOverviewModel.filteringModel, dataPassesActiveColumns)),
56+
h('.flex-row.header-container.pv2.g2', filtersPanelPopover(filteringModel, dataPassesActiveColumns), warningComponent(warnings)),
5457
h('.w-100.flex-column', [
55-
table(
56-
dataPassesPerLhcPeriodOverviewModel.items,
57-
dataPassesActiveColumns,
58-
{ classes: getRowClasses },
59-
null,
60-
{ sort: dataPassesPerLhcPeriodOverviewModel.sortModel },
61-
),
62-
paginationComponent(dataPassesPerLhcPeriodOverviewModel.pagination),
58+
table(items, dataPassesActiveColumns, { classes: getRowClasses }, null, { sort: sortModel }),
59+
paginationComponent(pagination),
6360
]),
6461
]);
6562
};

lib/public/views/DataPasses/PerSimulationPassOverview/DataPassesPerSimulationPassOverviewPage.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { breadcrumbs } from '../../../components/common/navigation/breadcrumbs.j
2222
import spinner from '../../../components/common/spinner.js';
2323
import { tooltip } from '../../../components/common/popover/tooltip.js';
2424
import { DataPassVersionStatus } from '../../../domain/enums/DataPassVersionStatus.js';
25+
import { warningComponent } from '../../../components/common/messages/warningComponent.js';
2526

2627
const TABLEROW_HEIGHT = 42;
2728
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -46,20 +47,17 @@ const getRowClasses = ({ versions }) => {
4647
*/
4748
export const DataPassesPerSimulationPassOverviewPage = ({ dataPasses: {
4849
perSimulationPassOverviewModel: dataPassesPerSimulationPassOverviewModel } }) => {
49-
dataPassesPerSimulationPassOverviewModel.pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(
50-
TABLEROW_HEIGHT,
51-
PAGE_USED_HEIGHT,
52-
));
50+
const { items, simulationPass, pagination, warnings, filteringModel, sortModel } = dataPassesPerSimulationPassOverviewModel;
5351

54-
const { items, simulationPass, pagination } = dataPassesPerSimulationPassOverviewModel;
52+
pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(TABLEROW_HEIGHT, PAGE_USED_HEIGHT));
5553

5654
const commonTitle = h('h2#breadcrumb-header', 'Data Passes per MC');
5755

5856
return h('', {
5957
onremove: () => dataPassesPerSimulationPassOverviewModel.reset(),
6058
}, [
6159
h('.flex-row.items-center.g2', [
62-
filtersPanelPopover(dataPassesPerSimulationPassOverviewModel.filteringModel, dataPassesActiveColumns),
60+
filtersPanelPopover(filteringModel, dataPassesActiveColumns),
6361
h(
6462
'.flex-row.g1.items-center',
6563
simulationPass.match({
@@ -69,15 +67,10 @@ export const DataPassesPerSimulationPassOverviewPage = ({ dataPasses: {
6967
NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')],
7068
}),
7169
),
70+
warningComponent(warnings),
7271
]),
7372
h('.w-100.flex-column', [
74-
table(
75-
items,
76-
dataPassesActiveColumns,
77-
{ classes: getRowClasses },
78-
null,
79-
{ sort: dataPassesPerSimulationPassOverviewModel.sortModel },
80-
),
73+
table(items, dataPassesActiveColumns, { classes: getRowClasses }, null, { sort: sortModel }),
8174
paginationComponent(pagination),
8275
]),
8376
]);

lib/public/views/Environments/Overview/environmentOverviewComponent.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { environmentsActiveColumns } from '../ActiveColumns/environmentsActiveCo
1717
import { estimateDisplayableRowsCount } from '../../../utilities/estimateDisplayableRowsCount.js';
1818
import { paginationComponent } from '../../../components/Pagination/paginationComponent.js';
1919
import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js';
20+
import { warningComponent } from '../../../components/common/messages/warningComponent.js';
2021

2122
const TABLEROW_HEIGHT = 58;
2223
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -28,7 +29,7 @@ const PAGE_USED_HEIGHT = 181;
2829
* @returns {Object} Html page
2930
*/
3031
export const environmentOverviewComponent = (envsOverviewModel) => {
31-
const { pagination, environments } = envsOverviewModel;
32+
const { pagination, environments, warnings } = envsOverviewModel;
3233

3334
pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(
3435
TABLEROW_HEIGHT,
@@ -39,6 +40,7 @@ export const environmentOverviewComponent = (envsOverviewModel) => {
3940
h(
4041
'.flex-row.header-container.g2.pv2',
4142
filtersPanelPopover(envsOverviewModel, environmentsActiveColumns),
43+
warningComponent(warnings),
4244
),
4345
h('.w-100.flex-column', [
4446
h('.header-container.pv2'),

lib/public/views/LhcFills/Overview/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { estimateDisplayableRowsCount } from '../../../utilities/estimateDisplay
1919
import { paginationComponent } from '../../../components/Pagination/paginationComponent.js';
2020
import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js';
2121
import { toggleFilter } from '../../../components/Filters/common/filters/toggleFilter.js';
22+
import { warningComponent } from '../../../components/common/messages/warningComponent.js';
2223

2324
const TABLEROW_HEIGHT = 53.3;
2425
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -41,7 +42,9 @@ export const Index = (model) => h('', {
4142
* @returns {Object} Html page
4243
*/
4344
const showLhcFillsTable = (lhcFillsOverviewModel) => {
44-
lhcFillsOverviewModel.pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(
45+
const { items, pagination, filteringModel, warnings } = lhcFillsOverviewModel;
46+
47+
pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(
4548
TABLEROW_HEIGHT,
4649
PAGE_USED_HEIGHT,
4750
1,
@@ -50,11 +53,12 @@ const showLhcFillsTable = (lhcFillsOverviewModel) => {
5053
return [
5154
h('.flex-row.header-container.g2.pv2', [
5255
filtersPanelPopover(lhcFillsOverviewModel, lhcFillsActiveColumns),
53-
toggleFilter(lhcFillsOverviewModel.filteringModel.get('hasStableBeams'), 'STABLE BEAM ONLY'),
56+
toggleFilter(filteringModel.get('hasStableBeams'), 'STABLE BEAM ONLY'),
57+
warningComponent(warnings),
5458
]),
5559
h('.w-100.flex-column', [
56-
table(lhcFillsOverviewModel.items, lhcFillsActiveColumns, null, { tableClasses: '.table-sm' }),
57-
paginationComponent(lhcFillsOverviewModel.pagination),
60+
table(items, lhcFillsActiveColumns, null, { tableClasses: '.table-sm' }),
61+
paginationComponent(pagination),
5862
]),
5963
];
6064
};

lib/public/views/Logs/Overview/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { paginationComponent } from '../../../components/Pagination/paginationCo
1919
import { frontLink } from '../../../components/common/navigation/frontLink.js';
2020
import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js';
2121
import { excludeAnonymousLogAuthorToggle } from '../../../components/Filters/LogsFilter/author/authorFilter.js';
22+
import { warningComponent } from '../../../components/common/messages/warningComponent.js';
2223

2324
const TABLEROW_HEIGHT = 69;
2425
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -30,22 +31,22 @@ const PAGE_USED_HEIGHT = 215;
3031
* @return {Component} Returns a vnode with the table containing the logs
3132
*/
3233
const logOverviewScreen = ({ logs: { overviewModel: logsOverviewModel } }) => {
33-
logsOverviewModel.pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(
34-
TABLEROW_HEIGHT,
35-
PAGE_USED_HEIGHT,
36-
));
34+
const { pagination, filteringModel, logs, overviewSortModel, warnings } = logsOverviewModel;
35+
36+
pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(TABLEROW_HEIGHT, PAGE_USED_HEIGHT));
3737

3838
return h('', [
3939
h('#main-action-bar.flex-row.justify-between.header-container.pv2', [
4040
h('.flex-row.g3', [
4141
filtersPanelPopover(logsOverviewModel, logsActiveColumns),
42-
excludeAnonymousLogAuthorToggle(logsOverviewModel.filteringModel.get('author')),
42+
excludeAnonymousLogAuthorToggle(filteringModel.get('author')),
43+
warningComponent(warnings),
4344
]),
4445
actionButtons(),
4546
]),
4647
h('.w-100.flex-column', [
47-
table(logsOverviewModel.logs, logsActiveColumns, null, null, { sort: logsOverviewModel.overviewSortModel }),
48-
paginationComponent(logsOverviewModel.pagination),
48+
table(logs, logsActiveColumns, null, null, { sort: overviewSortModel }),
49+
paginationComponent(pagination),
4950
]),
5051
]);
5152
};

lib/public/views/QcFlagTypes/Overview/QcFlagTypesOverviewPage.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { qcFlagTypesActiveColumns } from '../ActiveColumns/qcFlagTypesActiveColu
1919
import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js';
2020
import { frontLink } from '../../../components/common/navigation/frontLink.js';
2121
import { BkpRoles } from '../../../domain/enums/BkpRoles.js';
22+
import { warningComponent } from '../../../components/common/messages/warningComponent.js';
2223

2324
const TABLEROW_HEIGHT = 30;
2425
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -30,18 +31,16 @@ const PAGE_USED_HEIGHT = 215;
3031
* @return {Component} The overview page
3132
*/
3233
export const QcFlagTypesOverviewPage = ({ qcFlagTypes: { overviewModel } }) => {
33-
overviewModel.pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(
34-
TABLEROW_HEIGHT,
35-
PAGE_USED_HEIGHT,
36-
));
34+
const { items: qcFlagTypes, pagination, warnings, sortModel } = overviewModel;
3735

38-
const { items: qcFlagTypes } = overviewModel;
36+
pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(TABLEROW_HEIGHT, PAGE_USED_HEIGHT));
3937

4038
return h('', [
4139
h('.flex-row.justify-between.items-center.g2', [
4240
h('.flex-row.items-center.g2', [
4341
filtersPanelPopover(overviewModel, qcFlagTypesActiveColumns),
4442
h('h2', 'QC Flag Types'),
43+
warningComponent(warnings),
4544
]),
4645
sessionService.hasAccess([BkpRoles.ADMIN]) && [
4746
frontLink(h('.flex-row.items-center.g1', [h('small', iconPlus()), 'QC Flag Type']), 'qc-flag-type-creation', {}, {
@@ -51,14 +50,8 @@ export const QcFlagTypesOverviewPage = ({ qcFlagTypes: { overviewModel } }) => {
5150
],
5251
]),
5352
h('.flex-column.w-100', [
54-
table(
55-
qcFlagTypes,
56-
qcFlagTypesActiveColumns,
57-
{ classes: '.table-sm' },
58-
null,
59-
{ sort: overviewModel.sortModel },
60-
),
61-
paginationComponent(overviewModel.pagination),
53+
table(qcFlagTypes, qcFlagTypesActiveColumns, { classes: '.table-sm' }, null, { sort: sortModel }),
54+
paginationComponent(pagination),
6255
]),
6356
]);
6457
};

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { table } from '../../../components/common/table/table.js';
2020
import { switchInput } from '../../../components/common/form/switchInput.js';
2121
import { exportTriggerAndModal } from '../../../components/common/dataExport/exportTriggerAndModal.js';
2222
import { textInputFilter } from '../../../components/Filters/common/filters/textInputFilter.js';
23+
import { warningComponent } from '../../../components/common/messages/warningComponent.js';
2324

2425
const TABLEROW_HEIGHT = 59;
2526
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -46,21 +47,20 @@ export const togglePhysicsOnlyFilter = (runDefinitionFilterModel) => {
4647
* @return {Component} Returns a vnode with the table containing the runs
4748
*/
4849
export const RunsOverviewPage = ({ runs: { overviewModel: runsOverviewModel }, modalModel }) => {
49-
runsOverviewModel.pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(
50-
TABLEROW_HEIGHT,
51-
PAGE_USED_HEIGHT,
52-
));
50+
const { pagination, items, exportModel, filteringModel, warnings } = runsOverviewModel;
51+
pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount(TABLEROW_HEIGHT, PAGE_USED_HEIGHT));
5352

5453
return h('', [
5554
h('.flex-row.header-container.g2.pv2', [
5655
filtersPanelPopover(runsOverviewModel, runsActiveColumns),
5756
h('.pl2#runOverviewFilter', textInputFilter(runsOverviewModel.filteringModel, 'runNumbers', 'e.g. 534454, 534455...')),
58-
togglePhysicsOnlyFilter(runsOverviewModel.filteringModel.get('definitions')),
59-
exportTriggerAndModal(runsOverviewModel.exportModel, modalModel),
57+
togglePhysicsOnlyFilter(filteringModel.get('definitions')),
58+
warningComponent(warnings),
59+
exportTriggerAndModal(exportModel, modalModel),
6060
]),
6161
h('.flex-column.w-100', [
62-
table(runsOverviewModel.items, runsActiveColumns),
63-
paginationComponent(runsOverviewModel.pagination),
62+
table(items, runsActiveColumns),
63+
paginationComponent(pagination),
6464
]),
6565
]);
6666
};

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { getInelasticInteractionRateColumns } from '../ActiveColumns/getInelasti
3939
import { exportTriggerAndModal } from '../../../components/common/dataExport/exportTriggerAndModal.js';
4040
import { textInputFilter } from '../../../components/Filters/common/filters/textInputFilter.js';
4141
import { toggleFilter } from '../../../components/Filters/common/filters/toggleFilter.js';
42+
import { warningComponent } from '../../../components/common/messages/warningComponent.js';
4243

4344
const TABLEROW_HEIGHT = 59;
4445
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -242,6 +243,7 @@ export const RunsPerDataPassOverviewPage = ({
242243
]),
243244
),
244245
toggleFilter(mcReproducibleAsNotBad, h('em', 'MC.R as not-bad'), 'mcReproducibleAsNotBadToggle'),
246+
warningComponent(perDataPassOverviewModel.warnings),
245247
h('.mlauto', qcSummaryLegendTooltip()),
246248
h('#actions-dropdown-button', DropdownComponent(
247249
h('button.btn.btn-primary', h('.flex-row.g2', ['Actions', iconCaretBottom()])),

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { filtersPanelPopover } from '../../../components/Filters/common/filtersP
2929
import { exportTriggerAndModal } from '../../../components/common/dataExport/exportTriggerAndModal.js';
3030
import { textInputFilter } from '../../../components/Filters/common/filters/textInputFilter.js';
3131
import { toggleFilter } from '../../../components/Filters/common/filters/toggleFilter.js';
32+
import { warningComponent } from '../../../components/common/messages/warningComponent.js';
3233

3334
const TABLEROW_HEIGHT = 62;
3435
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -66,6 +67,7 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
6667
mcReproducibleAsNotBad,
6768
qcSummary: remoteQcSummary,
6869
pdpBeamTypes,
70+
warnings,
6971
} = perLhcPeriodOverviewModel;
7072

7173
/**
@@ -110,6 +112,7 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
110112
filtersPanelPopover(perLhcPeriodOverviewModel, activeColumns, { profile: 'runsPerLhcPeriod' }),
111113
h('.pl2#runOverviewFilter', textInputFilter(perLhcPeriodOverviewModel.filteringModel, 'runNumbers', 'e.g. 534454, 534455...')),
112114
h('h2.flex-row', ['Good, physics runs of ', lhcPeriodName]),
115+
warningComponent(warnings),
113116
toggleFilter(mcReproducibleAsNotBad, h('em', 'MC.R as not-bad'), 'mcReproducibleAsNotBadToggle'),
114117
exportTriggerAndModal(perLhcPeriodOverviewModel.exportModel, modalModel),
115118
]),

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { exportTriggerAndModal } from '../../../components/common/dataExport/exp
2929
import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js';
3030
import { toggleFilter } from '../../../components/Filters/common/filters/toggleFilter.js';
3131
import { textInputFilter } from '../../../components/Filters/common/filters/textInputFilter.js';
32+
import { warningComponent } from '../../../components/common/messages/warningComponent.js';
3233

3334
const TABLEROW_HEIGHT = 59;
3435
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
@@ -67,6 +68,7 @@ export const RunsPerSimulationPassOverviewPage = ({
6768
sortModel,
6869
pdpBeamTypes,
6970
mcReproducibleAsNotBad,
71+
warnings,
7072
} = perSimulationPassOverviewModel;
7173

7274
const commonTitle = h('h2', 'Runs per MC');
@@ -103,6 +105,7 @@ export const RunsPerSimulationPassOverviewPage = ({
103105
]),
104106
),
105107
toggleFilter(mcReproducibleAsNotBad, h('em', 'MC.R as not-bad'), 'mcReproducibleAsNotBadToggle'),
108+
warningComponent(warnings),
106109
h('.mlauto', qcSummaryLegendTooltip()),
107110
exportTriggerAndModal(perSimulationPassOverviewModel.exportModel, modalModel, { autoMarginLeft: false }),
108111
frontLink(

0 commit comments

Comments
 (0)