diff --git a/lib/public/components/Log/logDisplayComponent.js b/lib/public/components/Log/logDisplayComponent.js index d5646c55bb..4b306fe046 100644 --- a/lib/public/components/Log/logDisplayComponent.js +++ b/lib/public/components/Log/logDisplayComponent.js @@ -67,9 +67,9 @@ const logFields = () => ({ name: 'Attachments', visible: true, format: (attachments) => h('span.flex-row.flex-wrap.gc1', attachments.flatMap((attachment) => [ - attachmentPreviewComponent(attachment), h('span.mr2', ','), - ]).slice(0, -1)), + attachmentPreviewComponent(attachment), + ]).slice(1)), }, }); diff --git a/lib/public/components/environments/environmentStatusHistoryComponent.js b/lib/public/components/environments/environmentStatusHistoryComponent.js index d2746413d3..bad63078fe 100644 --- a/lib/public/components/environments/environmentStatusHistoryComponent.js +++ b/lib/public/components/environments/environmentStatusHistoryComponent.js @@ -37,6 +37,6 @@ export const environmentStatusHistoryLegendComponent = () => * @return {Component} the resulting environment status history component */ export const environmentStatusHistoryComponent = (statusHistory) => statusHistory.flatMap((value) => [ - coloredEnvironmentStatusComponent(value.status, value.acronym), '-', -]).slice(0, -1); + coloredEnvironmentStatusComponent(value.status, value.acronym), +]).slice(1); diff --git a/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js b/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js index b52e860714..293c76c6e9 100644 --- a/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js +++ b/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js @@ -83,9 +83,9 @@ export const environmentsActiveColumns = { size: 'w-20', format: (historyItems) => historyItems .flatMap(({ status }) => [ - coloredEnvironmentStatusComponent(status, STATUS_ACRONYMS[status]), '-', - ]).slice(0, -1), + coloredEnvironmentStatusComponent(status, STATUS_ACRONYMS[status]), + ]).slice(1), balloon: true, }, }; diff --git a/lib/public/views/Logs/Create/logCreationComponent.js b/lib/public/views/Logs/Create/logCreationComponent.js index d853e5ed05..85b0a141d3 100644 --- a/lib/public/views/Logs/Create/logCreationComponent.js +++ b/lib/public/views/Logs/Create/logCreationComponent.js @@ -188,6 +188,7 @@ const attachmentsPanel = (logCreationModel) => { h('#attachments-list.flex-row.flex-wrap.p2', attachments.flatMap((attachment) => { const preview = filePreviewComponent(attachment, attachment.type, attachment.name); return [ + h('span.mr2', ','), preview ? popover( filePreviewPopoverLink(attachment.name), @@ -203,9 +204,8 @@ const attachmentsPanel = (logCreationModel) => { }, ) : h('', attachment.name), - h('span.mr2', ','), ]; - }).slice(0, -1)), + }).slice(1)), ]); }; diff --git a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js index 04eba11f83..b2d95261a3 100644 --- a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js +++ b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js @@ -84,8 +84,6 @@ export class RunsPerDataPassOverviewModel extends RunsOverviewModel { const endpint = super.getRootEndpoint(); return buildUrl(endpint, { filter: { dataPassIds: [this._dataPassId], - runQualities: 'good', - definitions: 'PHYSICS', } }); } diff --git a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js index 561551f779..758f349e51 100644 --- a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js +++ b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js @@ -11,7 +11,7 @@ * 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'; @@ -19,6 +19,8 @@ import { estimateDisplayableRowsCount } from '../../../utilities/estimateDisplay 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; @@ -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', [ diff --git a/lib/public/views/Runs/format/displayRunEorReasonOverview.js b/lib/public/views/Runs/format/displayRunEorReasonOverview.js index 5bfed378a3..744f73f18d 100644 --- a/lib/public/views/Runs/format/displayRunEorReasonOverview.js +++ b/lib/public/views/Runs/format/displayRunEorReasonOverview.js @@ -20,7 +20,6 @@ import { formatEorReason } from './formatEorReason.js'; * @return {Component} the display component */ export const displayRunEorReasonsOverview = (eorReasons) => eorReasons.length - ? eorReasons.map((eorReason) => [formatEorReason(eorReason), h('br')]) - .flat() - .slice(0, -1) + ? eorReasons.flatMap((eorReason) => [h('br'), formatEorReason(eorReason)]) + .slice(1) : '-'; diff --git a/test/public/runs/runsPerDataPass.overview.test.js b/test/public/runs/runsPerDataPass.overview.test.js index 5934a59001..3aab4ccfe3 100644 --- a/test/public/runs/runsPerDataPass.overview.test.js +++ b/test/public/runs/runsPerDataPass.overview.test.js @@ -78,8 +78,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 () => { @@ -126,8 +126,8 @@ module.exports = () => { await reloadPage(page); expect(await page.$eval('#firstRowIndex', (element) => parseInt(element.innerText, 10))).to.equal(1); - expect(await page.$eval('#lastRowIndex', (element) => parseInt(element.innerText, 10))).to.equal(3); - expect(await page.$eval('#totalRowsCount', (element) => parseInt(element.innerText, 10))).to.equal(3); + expect(await page.$eval('#lastRowIndex', (element) => parseInt(element.innerText, 10))).to.equal(4); + expect(await page.$eval('#totalRowsCount', (element) => parseInt(element.innerText, 10))).to.equal(4); }); it('successfully switch to raw timestamp display', async () => { @@ -158,7 +158,7 @@ module.exports = () => { // Expect the amount of visible runs to reduce when the first option (5) is selected const tableRows = await page.$$('table tr'); - expect(tableRows.length - 1).to.equal(3); + expect(tableRows.length - 1).to.equal(4); // Expect the custom per page input to have red border and text color if wrong value typed const customPerPageInput = await page.$(`${amountSelectorId} input[type=number]`); @@ -242,8 +242,9 @@ module.exports = () => { expect(downloadFilesNames.filter((name) => name == targetFileName)).to.be.lengthOf(1); const runs = JSON.parse(fs.readFileSync(path.resolve(downloadPath, targetFileName))); - expect(runs).to.be.lengthOf(3); + expect(runs).to.be.lengthOf(4); expect(runs).to.have.deep.all.members([ + { runNumber: 105, runQuality: 'test' }, { runNumber: 56, runQuality: 'good' }, { runNumber: 54, runQuality: 'good' }, { runNumber: 49, runQuality: 'good' },