Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[O2B-1162] Display all PHYSICS runs on Data Pass view #1413

Merged
merged 22 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 16 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
22 changes: 22 additions & 0 deletions lib/public/components/common/navigation/breadcrumbs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @license
* Copyright 2019-2020 CERN and copyright holders of ALICE O2.
* See http://alice-o2.web.cern.ch/copyright for details of the copyright holders.
* All rights not expressly granted are reserved.
*
* This software is distributed under the terms of the GNU General Public
* License v3 (GPL Version 3), copied verbatim in the file "COPYING".
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

import { h, iconChevronRight } from '/js/src/index.js';

/**
* Create Breadcrumbs out of provided items which are separated with rightChevron Icon
* @param {Component[]} items items in breadcrumbs
* @return {Component} breadcrumbs
*/
export const breadcrumbs = (items) => h('.flex-row.g1.items-center', items.flatMap((item) => [iconChevronRight(), item]).slice(1));
martinboulais marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export class RunsPerDataPassOverviewModel extends RunsOverviewModel {
const endpint = super.getRootEndpoint();
return buildUrl(endpint, { filter: {
dataPassIds: [this._dataPassId],
runQualities: 'good',
definitions: 'PHYSICS',
} });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
* or submit itself to any jurisdiction.
*/

import { h } from '/js/src/index.js';
import { h, iconWarning } from '/js/src/index.js';
import { table } from '../../../components/common/table/table.js';
import { createRunDetectorsActiveColumns } from '../ActiveColumns/runDetectorsActiveColumns.js';
import { paginationComponent } from '../../../components/Pagination/paginationComponent.js';
import { estimateDisplayableRowsCount } from '../../../utilities/estimateDisplayableRowsCount.js';
import { exportRunsTriggerAndModal } from '../Overview/exportRunsTriggerAndModal.js';
import { runsActiveColumns } from '../ActiveColumns/runsActiveColumns.js';
import spinner from '../../../components/common/spinner.js';
import { tooltip } from '../../../components/common/popover/tooltip.js';
import { breadcrumbs } from '../../../components/common/navigation/breadcrumbs.js';

const TABLEROW_HEIGHT = 59;
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;
Expand Down Expand Up @@ -46,14 +48,19 @@ export const RunsPerDataPassOverviewPage = ({ runs: { perDataPassOverviewModel }
}), { profiles: 'runsPerDataPass' }),
};

const commonTitle = h('h2', { style: 'white-space: nowrap;' }, 'Physics Runs');

return h('', [
h('.flex-row.justify-between.items-center', [
dataPass.match({
Success: (payload) => h('h2', `Good, physics runs of ${payload.name}`),
Failure: () => h('h2.danger', 'Failed to fetch Data Pass information'),
Loading: () => h('.p1', spinner({ size: 2, absolute: false })),
NotAsked: () => h('h2', 'Good, physics runs'),
}),
h('.flex-row.justify-between.items-center.g2', [
h(
'.flex-row.g1.items-center',
dataPass.match({
Success: (payload) => breadcrumbs([commonTitle, h('h2', payload.name)]),
Failure: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'Not able to fetch data pass info')],
Loading: () => [commonTitle, spinner({ size: 2, absolute: false })],
NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')],
}),
),
exportRunsTriggerAndModal(perDataPassOverviewModel, modalModel),
]),
h('.flex-column.w-100', [
Expand Down
4 changes: 2 additions & 2 deletions test/public/runs/runsPerDataPass.overview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ module.exports = () => {
expect(title).to.equal('AliceO2 Bookkeeping');

await page.waitForSelector('h2');
const viewTitle = await page.$eval('h2', (element) => element.innerText);
expect(viewTitle).to.be.eql('Good, physics runs of LHC22a_apass1');
const viewTitleElements = await Promise.all((await page.$$('h2')).map((element) => element.evaluate(({ innerText }) => innerText)));
expect(viewTitleElements).to.have.all.ordered.members(['Physics Runs', 'LHC22a_apass1']);
});

it('shows correct datatypes in respective columns', async () => {
Expand Down