diff --git a/lib/public/components/common/externalLinks/aliEcsEnvironmentLinkComponent.js b/lib/public/components/common/externalLinks/aliEcsEnvironmentLinkComponent.js index d9ceaf7aaf..2302cddfda 100644 --- a/lib/public/components/common/externalLinks/aliEcsEnvironmentLinkComponent.js +++ b/lib/public/components/common/externalLinks/aliEcsEnvironmentLinkComponent.js @@ -23,7 +23,7 @@ export const aliEcsEnvironmentLinkComponent = (environmentId) => { const aliEcsEnvironmentUrl = getAliEcsUrl(environmentId); return aliEcsEnvironmentUrl ? h( - 'a', + 'a.external-link', { target: '_blank', href: aliEcsEnvironmentUrl }, 'ECS', ) diff --git a/lib/public/components/common/externalLinks/infologgerLinksComponents.js b/lib/public/components/common/externalLinks/infologgerLinksComponents.js index 191823cb56..18d2d0ff00 100644 --- a/lib/public/components/common/externalLinks/infologgerLinksComponents.js +++ b/lib/public/components/common/externalLinks/infologgerLinksComponents.js @@ -21,7 +21,7 @@ import { h } from '/js/src/index.js'; * @param {string} label The label for the link. * @return {Component} The infologger link component */ -const infoLoggerLink = (url, label) => h('a', { href: url, target: '_blank' }, label); +const infoLoggerLink = (url, label) => h('a.external-link', { href: url, target: '_blank' }, label); /** * Returns an FLP infologger link component for the given infologger filter and label. diff --git a/lib/public/components/common/externalLinks/qcGuiLinkComponent.js b/lib/public/components/common/externalLinks/qcGuiLinkComponent.js index 3cd0428015..9f3218fe8f 100644 --- a/lib/public/components/common/externalLinks/qcGuiLinkComponent.js +++ b/lib/public/components/common/externalLinks/qcGuiLinkComponent.js @@ -27,5 +27,5 @@ export const qcGuiLinkComponent = (run) => { return null; } - return h('a', { href: qcGuiLinkUrl, target: '_blank' }, 'QCG'); + return h('a.external-link', { href: qcGuiLinkUrl, target: '_blank' }, 'QCG'); }; diff --git a/lib/public/views/Runs/Details/runDetailsComponent.js b/lib/public/views/Runs/Details/runDetailsComponent.js index f298fc90e3..81d1e5d95c 100644 --- a/lib/public/views/Runs/Details/runDetailsComponent.js +++ b/lib/public/views/Runs/Details/runDetailsComponent.js @@ -140,16 +140,18 @@ export const runDetailsComponent = (runDetailsModel, router) => runDetailsModel. ]), ), ]), - h('h3.flex-row.w-100.g2.items-baseline.mb3', [ - environmentLink && [h('', 'Environment: '), environmentLink], - (flpInfologgerLink || epnInfologgerLink) && [ - h('', 'Infologger: '), - flpInfologgerLink && h('.external-links', flpInfologgerLink), - epnInfologgerLink && h('.external-links', epnInfologgerLink), - ], - [h('.external-links', qcGuiLinkComponent(run))], - isRunConsideredRunning(run) && aliEcsEnvironmentLink && [h('.external-links', aliEcsEnvironmentLink)], - ].filter((elements) => elements).flatMap((elements) => ['-', ...elements]).slice(1)), + h( + 'h3.flex-row.w-100.g2.items-baseline.mb3', + [ + environmentLink && [h('', 'Environment: '), environmentLink], + (flpInfologgerLink || epnInfologgerLink) && [h('', 'Infologger: '), flpInfologgerLink, epnInfologgerLink], + [qcGuiLinkComponent(run)], + isRunConsideredRunning(run) && aliEcsEnvironmentLink && [aliEcsEnvironmentLink], + ] + .filter((elements) => elements && elements.filter((item) => item).length) + .flatMap((elements) => ['-', ...elements]) + .slice(1), + ), errorAlert(runDetailsModel.updateErrors), h('.flex-column.g2', [ h(PanelComponent, [ diff --git a/test/public/runs/detail.test.js b/test/public/runs/detail.test.js index 4f10364fdc..96df771d8d 100644 --- a/test/public/runs/detail.test.js +++ b/test/public/runs/detail.test.js @@ -478,12 +478,11 @@ module.exports = () => { await waitForNavigation(page, () => pressElement(page, 'a#run-overview')); await waitForNavigation(page, () => pressElement(page, '#row108 a')); - await page.waitForSelector('.external-links'); - await expectLink(page, '.external-links a', { + await expectLink(page, 'a.external-link', { innerText: 'FLP', href: 'http://localhost:8081/?q={%22run%22:{%22match%22:%22108%22},%22severity%22:{%22in%22:%22W%20E%20F%22}}', }); - await expectLink(page, '.external-links:nth-of-type(3) a', { + await expectLink(page, 'a.external-link:nth-of-type(2)', { innerText: 'QCG', href: 'http://localhost:8082/?page=layoutShow&runNumber=108&definition=PHYSICS&pdpBeamType=pp&runType=PHYSICS', }); @@ -492,7 +491,7 @@ module.exports = () => { it('should display links to environment in ECS if run is running', async () => { await goToRunDetails(page, 104); - await page.waitForSelector('.external-links:nth-of-type(3) a', { hidden: true, timeout: 250 }); + await page.waitForSelector('a.external-link:nth-of-type(3)', { hidden: true, timeout: 250 }); // Create running run await goToRunDetails(page, '1010'); @@ -501,7 +500,7 @@ module.exports = () => { await page.waitForSelector('.alert.alert-danger', { hidden: true, timeout: 300 }); await expectInnerText(page, '#runDurationValue', 'RUNNING'); - await expectLink(page, '.external-links:nth-of-type(5) a', { + await expectLink(page, 'a.external-link:nth-of-type(4)', { href: 'http://localhost:8080/?page=environment&id=CmCvjNbg', innerText: 'ECS', });