Skip to content

Commit d927011

Browse files
[O2B-1326] Add GAQ explanation (#1863)
* [O2B-1326] Add GAQ explanation * Attempt at fixing test
1 parent b0be7a0 commit d927011

3 files changed

Lines changed: 35 additions & 15 deletions

File tree

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

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
* or submit itself to any jurisdiction.
1212
*/
1313

14-
import { h } from '/js/src/index.js';
14+
import { h, info } from '/js/src/index.js';
1515
import { iconCaretTop, iconCaretBottom, iconX } from '/js/src/icons.js';
16+
import { tooltip } from '../popover/tooltip.js';
1617

1718
/**
1819
* @typedef TableModels the list of models that handle an eventual table state
@@ -36,11 +37,13 @@ export const headers = (columns, models) => {
3637
const classes = [size || null, column.classes || null];
3738

3839
// Name needs to be empty for a popover, otherwise the name when hovering will be blocking the popover.
39-
const attributes = {
40-
scope: 'col',
41-
title: information || undefined,
42-
};
40+
const attributes = { scope: 'col' };
4341
let content = [name];
42+
43+
if (information) {
44+
content.push(tooltip(info(), information));
45+
}
46+
4447
if (sortModel && sortable) {
4548
attributes.onmouseenter = () => {
4649
sortModel.previewOn = key;
@@ -67,31 +70,37 @@ export const headers = (columns, models) => {
6770
classes.push('clickable');
6871

6972
const sortIndicator = h(
70-
`.ml2${preview ? '.gray-dark' : ''}`,
73+
preview ? '.gray-dark' : '',
7174
{ id: `${key}-sort${preview ? '-preview' : ''}` },
7275
icon,
7376
);
7477
content.push(sortIndicator);
78+
}
7579

80+
if (content.length > 1) {
7681
// Wrap content in a row container
77-
content = h('.flex-row.items-center', content);
78-
} else if (inlineFilter) {
82+
content = h('.flex-row.items-center.g1', content);
83+
}
84+
85+
if (inlineFilter) {
7986
const {
8087
getValue = null,
8188
onChange = () => {
8289
// Simple default which does nothing
8390
},
8491
placeholder = '',
8592
} = inlineFilter;
86-
content.push(h('input.form-control', {
87-
type: 'text',
88-
placeholder,
89-
oninput: (e) => onChange(e.target.value, filterModel),
90-
...getValue ? { value: getValue(filterModel) } : {},
91-
}));
9293

9394
// Wrap content in a column container
94-
content = h('.flex-column.justify-between.gr2', content);
95+
content = h('.flex-column.justify-between.gr2', [
96+
content,
97+
h('input.form-control', {
98+
type: 'text',
99+
placeholder,
100+
oninput: (e) => onChange(e.target.value, filterModel),
101+
...getValue ? { value: getValue(filterModel) } : {},
102+
}),
103+
]);
95104
}
96105

97106
return h(`th#${key}.${classes.filter((item) => Boolean(item)).join(' ')}`, attributes, content);

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ export const RunsPerDataPassOverviewPage = ({
167167
Success: (gaqSummary) => ({
168168
globalAggregatedQuality: {
169169
name: 'GAQ',
170+
information: h(
171+
'',
172+
h('', 'Global aggregated flag based on critical detectors.'),
173+
h('', 'Default detectors: FT0, ITS, TPC (and ZDC for heavy-ion runs)'),
174+
),
170175
visible: true,
171176
format: (_, { runNumber }) => {
172177
const runGaqSummary = gaqSummary[runNumber];

test/public/runs/runsPerDataPass.overview.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ module.exports = () => {
171171
.to.be.equal('Missing 3 verifications');
172172
});
173173

174+
it('should successfully display tooltip information on GAQ column', async () => {
175+
const popoverContent = await getPopoverContent(await page.waitForSelector('#globalAggregatedQuality .popover-trigger'));
176+
expect(popoverContent).to.equal('Global aggregated flag based on critical detectors.' +
177+
'Default detectors: FT0, ITS, TPC (and ZDC for heavy-ion runs)');
178+
});
179+
174180
it('should switch mcReproducibleAsNotBad', async () => {
175181
await pressElement(page, '#mcReproducibleAsNotBadToggle input', true);
176182
await waitForTableLength(page, 3);

0 commit comments

Comments
 (0)