Skip to content

Commit b74f0fa

Browse files
[O2B-1514] Move the statistics button on lhc fills to the navbar (#2076)
* Statistics button has been moved to navbar. In between RCT and Overview
1 parent 6577e9b commit b74f0fa

7 files changed

Lines changed: 72 additions & 5 deletions

File tree

lib/public/components/NavBar/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ function navBar(model) {
144144
pageTab('lhc-fill-overview', 'LHC Fills'),
145145
pageTab('run-overview', 'Runs'),
146146
pageTab('lhc-period-overview', 'RCT'),
147+
pageTab('statistics', 'Statistics'),
147148
dropdownSubMenu('Overview', model.isDropdownMenuOpened('overview'), () => model.toggleDropdownMenu('overview'), [
148149
pageMenuLink('Tag Overview', 'tag-overview'),
149150
pageMenuLink('QC Flag Types', 'qc-flag-types-overview'),

lib/public/views/LhcFills/Detail/lhcFillDetailsComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export const lhcFillDetailsComponent = (detailsModel) => detailsModel.lhcFillDet
167167
'-',
168168
) : null,
169169
h('h4', 'Runs'),
170-
runsCounter && h('#statistics.details-container', [
170+
runsCounter && h('#runStatistics.details-container', [
171171
h('.detail-section', [
172172
h('.flex-row.g3', [
173173
h('strong', 'Total:'),

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { table } from '../../../components/common/table/table.js';
1717
import { lhcFillsActiveColumns } from '../ActiveColumns/lhcFillsActiveColumns.js';
1818
import { estimateDisplayableRowsCount } from '../../../utilities/estimateDisplayableRowsCount.js';
1919
import { paginationComponent } from '../../../components/Pagination/paginationComponent.js';
20-
import { frontLink } from '../../../components/common/navigation/frontLink.js';
2120
import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js';
2221
import { toggleStableBeamOnlyFilter } from '../../../components/Filters/LhcFillsFilter/stableBeamFilter.js';
2322

@@ -50,7 +49,6 @@ const showLhcFillsTable = (lhcFillsOverviewModel) => {
5049

5150
return [
5251
h('.flex-row.header-container.g2.pv2', [
53-
frontLink(h('button.btn.btn-primary', 'Statistics'), 'statistics'),
5452
filtersPanelPopover(lhcFillsOverviewModel, lhcFillsActiveColumns),
5553
toggleStableBeamOnlyFilter(lhcFillsOverviewModel.filteringModel.get('hasStableBeams')),
5654
]),

test/public/components/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @license
3+
* Copyright CERN and copyright holders of ALICE O2. This software is
4+
* distributed under the terms of the GNU General Public License v3 (GPL
5+
* Version 3), copied verbatim in the file "COPYING".
6+
*
7+
* See http://alice-o2.web.cern.ch/license for full licensing information.
8+
*
9+
* In applying this license CERN does not waive the privileges and immunities
10+
* granted to it by virtue of its status as an Intergovernmental Organization
11+
* or submit itself to any jurisdiction.
12+
*/
13+
14+
const NavBarSuite = require('./navBar.test')
15+
16+
module.exports = () => {
17+
describe('Navbar component', NavBarSuite);
18+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* @license
3+
* Copyright CERN and copyright holders of ALICE O2. This software is
4+
* distributed under the terms of the GNU General Public License v3 (GPL
5+
* Version 3), copied verbatim in the file "COPYING".
6+
*
7+
* See http://alice-o2.web.cern.ch/license for full licensing information.
8+
*
9+
* In applying this license CERN does not waive the privileges and immunities
10+
* granted to it by virtue of its status as an Intergovernmental Organization
11+
* or submit itself to any jurisdiction.
12+
*/
13+
14+
const {
15+
defaultBefore,
16+
defaultAfter,
17+
goToPage,
18+
expectUrlParams,
19+
} = require('../defaults.js');
20+
21+
module.exports = () => {
22+
let page;
23+
let browser;
24+
const navTabSelector = 'a.btn-tab[id]'; // ALI FLP doesn't have an id, nor a functional href, hence why it is excluded like this
25+
26+
before(async () => {
27+
[page, browser] = await defaultBefore();
28+
});
29+
30+
it('NavBar Tabs should navigate to their respective pages', async () => {
31+
await goToPage(page, 'home');
32+
33+
await page.waitForSelector(navTabSelector);
34+
35+
const tabIds = await page.$$eval(navTabSelector, tabs => tabs.map(tab => tab.id));
36+
37+
for (const id of tabIds) {
38+
await page.click(`#${id}`);
39+
40+
expectUrlParams(page, { page: id }); // basePageTabs set their links and their ID to be the same.
41+
await goToPage(page, 'home'); // Additional check to see if the correct
42+
}
43+
});
44+
45+
after(async () => {
46+
await defaultAfter(page, browser);
47+
});
48+
};

test/public/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ const ErrorSuite = require('./error');
2323
const EosReportSuite = require('./eosReport');
2424
const LhcPeriodsSuite = require('./lhcPeriods');
2525
const DataPassesSuite = require('./dataPasses');
26+
const ComponentsSuite = require('./components');
2627
const SimulationPassesSuite = require('./simulationPasses');
2728
const QcFlagTypesSuite = require('./qcFlagTypes');
2829
const QcFlagsSuite = require('./qcFlags');
2930

3031
module.exports = () => {
32+
describe('Components', ComponentsSuite);
3133
describe('LhcPeriods', LhcPeriodsSuite);
3234
describe('LhcFills', LhcFillsSuite);
3335
describe('Logs', LogsSuite);

test/public/lhcFills/detail.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ module.exports = () => {
6969
it('should successfully display runs statistics', async () => {
7070
await goToPage(page, 'lhc-fill-details', { queryParameters: { fillNumber: 6 } });
7171

72-
await page.waitForSelector('#statistics');
73-
const statisticsContent = await page.$eval('#statistics', (element) => element.innerText);
72+
await page.waitForSelector('#runStatistics');
73+
const statisticsContent = await page.$eval('#runStatistics', (element) => element.innerText);
7474

7575
expect(statisticsContent).to.include('Over 2 minutes');
7676
expect(statisticsContent).to.include('Under 2 minutes');

0 commit comments

Comments
 (0)