Skip to content

Commit d865e2a

Browse files
committed
[O2B-1479] Remove redundant ?? in table.js, Processed @isaachilly 's feedback
1 parent 88643ea commit d865e2a

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const table = (
153153

154154
const scrollEnabled = horizontalScrollEnabled || verticalScrollEnabled;
155155
let optionalTableClassesExpression = freezeFirstColumn && horizontalScrollEnabled ? '.freeze-first-column' : '';
156-
optionalTableClassesExpression += tableClasses ?? '';
156+
optionalTableClassesExpression += tableClasses;
157157

158158
const firstLevelWrapperClasses =
159159
(verticalScrollEnabled ? '.sticky-table-wrapper' : '') +

lib/public/utilities/formatting/formatBeamType.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ export const formatBeamType = (beamType = '') => {
2323
if (beamOneType !== '' && beamTwoType !== '') {
2424
return h('', [beamOneType.trim(), h('br'), beamTwoType.trim()]);
2525
} else {
26-
return '-';
26+
return h('', '-');
2727
}
2828
};

lib/public/views/LhcFills/ActiveColumns/lhcFillsActiveColumns.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { formatTimestamp } from '../../../utilities/formatting/formatTimestamp.j
1616
import { formatDuration } from '../../../utilities/formatting/formatDuration.mjs';
1717
import { formatPercentage } from '../../../utilities/formatting/formatPercentage.js';
1818
import { CopyToClipboardComponent, h } from '/js/src/index.js';
19+
import { iconPlus } from '/js/src/icons.js';
1920
import { formatRunsList } from '../../Runs/format/formatRunsList.js';
2021
import { formatLhcFillsTimeLoss } from '../format/formatLhcFillsTimeLoss.js';
2122
import { buttonLinkWithDropdown } from '../../../components/common/selection/infoLoggerButtonGroup/buttonLinkWithDropdown.js';
@@ -39,13 +40,13 @@ export const lhcFillsActiveColumns = {
3940
{ fillNumber },
4041
[
4142
h(CopyToClipboardComponent, { value: fillNumber, id: fillNumber }, 'Copy Fill Number'),
43+
...infologgerLinksComponents({ runNumbers: runs.map(({ runNumber }) => runNumber) }),
4244
frontLink(
43-
'Add log to this fill',
45+
[iconPlus(), ' Add log to this fill'],
4446
'log-create',
4547
{ lhcFillNumbers: [fillNumber] },
4648
{ id: 'create-log', class: 'btn btn-primary h2' },
4749
),
48-
...infologgerLinksComponents({ runNumbers: runs.map(({ runNumber }) => runNumber) }),
4950
],
5051
),
5152
profiles: {

test/public/lhcFills/overview.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ const { expect } = chai;
3131
const percentageRegex = new RegExp(/\d{1,2}.\d{2}%/);
3232
const durationRegex = new RegExp(/\d{2}:\d{2}:\d{2}/);
3333

34-
const beamTypeExpect = { selector:'tbody tr:nth-child(1) td:nth-child(8)', value: 'PROTON\nPROTON'};
35-
const beforeFirststRunExpect = { selector:'tbody tr:nth-child(1) td:nth-child(5)', value: '03:00:00\n(25.00%)'};
36-
const collidingBunchesExpect = { selector:'tbody tr:nth-child(1) td:nth-child(9)', value: '1024'};
37-
const meanRunDurationExpect = { selector:'tbody tr:nth-child(1) td:nth-child(6)', value: '01:40:00'};
38-
const totalRunsDurationExpect = { selector:'tbody tr:nth-child(1) td:nth-child(7)', value: '05:00:00\n(41.67%)'};
39-
4034
module.exports = () => {
4135
let page;
4236
let browser;
@@ -133,8 +127,8 @@ module.exports = () => {
133127
await page.waitForSelector(`body > div:nth-child(3) > div:nth-child(1)`);
134128
await expectInnerText(page, `#copy-6 > div:nth-child(1)`, 'Copy Fill Number')
135129

136-
await expectLink(page, 'body > div:nth-child(3) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > a:nth-child(2)', {
137-
href: `http://localhost:4000/?page=log-create&lhcFillNumbers=6`, innerText: 'Add log to this fill'
130+
await expectLink(page, 'body > div:nth-child(3) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > a:nth-child(3)', {
131+
href: `http://localhost:4000/?page=log-create&lhcFillNumbers=6`, innerText: ' Add log to this fill'
138132
})
139133
// disable the popover
140134
await pressElement(page, `#row6-fillNumber-text > div:nth-child(1) > div:nth-child(2)`)
@@ -217,6 +211,12 @@ module.exports = () => {
217211
});
218212

219213
it('should successfully display some statistics', async () => {
214+
const beamTypeExpect = { selector: 'tbody tr:nth-child(1) td:nth-child(8)', value: 'PROTON\nPROTON' };
215+
const beforeFirststRunExpect = { selector: 'tbody tr:nth-child(1) td:nth-child(5)', value: '03:00:00\n(25.00%)' };
216+
const collidingBunchesExpect = { selector: 'tbody tr:nth-child(1) td:nth-child(9)', value: '1024' };
217+
const meanRunDurationExpect = { selector: 'tbody tr:nth-child(1) td:nth-child(6)', value: '01:40:00' };
218+
const totalRunsDurationExpect = { selector: 'tbody tr:nth-child(1) td:nth-child(7)', value: '05:00:00\n(41.67%)' };
219+
220220
await goToPage(page, 'lhc-fill-overview');
221221

222222
await expectInnerText(page, beamTypeExpect.selector, beamTypeExpect.value);

0 commit comments

Comments
 (0)