From 26ae297269ce9dd0203e4d93ab9ee5d2a52c42aa Mon Sep 17 00:00:00 2001 From: James Mockett <1166188+jamesmockett@users.noreply.github.com> Date: Tue, 1 Oct 2024 10:16:57 +0100 Subject: [PATCH 1/2] Update Ophan to 2.2.5 --- dotcom-rendering/package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dotcom-rendering/package.json b/dotcom-rendering/package.json index c0fbcfe6c03..5a4f34b3854 100644 --- a/dotcom-rendering/package.json +++ b/dotcom-rendering/package.json @@ -48,7 +48,7 @@ "@guardian/identity-auth": "2.1.0", "@guardian/identity-auth-frontend": "4.0.0", "@guardian/libs": "18.0.0", - "@guardian/ophan-tracker-js": "2.2.2", + "@guardian/ophan-tracker-js": "2.2.5", "@guardian/shimport": "1.0.2", "@guardian/source": "8.0.0", "@guardian/source-development-kitchen": "8.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 18b4cf42f60..ce1a891649f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -362,8 +362,8 @@ importers: specifier: 18.0.0 version: 18.0.0(tslib@2.6.2)(typescript@5.5.3) '@guardian/ophan-tracker-js': - specifier: 2.2.2 - version: 2.2.2 + specifier: 2.2.5 + version: 2.2.5 '@guardian/shimport': specifier: 1.0.2 version: 1.0.2 @@ -4464,8 +4464,8 @@ packages: typescript: 5.5.3 dev: false - /@guardian/ophan-tracker-js@2.2.2: - resolution: {integrity: sha512-g+Xouc0bU1fC+8qltuLexBxK67V534ZFDQ/bGWQtYDFSJJJtyPIq6ytPcn4KULNOQc+zRsUcRIfO0uRnjJScbw==} + /@guardian/ophan-tracker-js@2.2.5: + resolution: {integrity: sha512-chfaV3hkFEVy7YYKRpGFmryH7ngWhgeMIu8vnC4UH7kkQCTGcF1pgLgbREdYArdgQezCnSO3o9/15nRX0VDolA==} engines: {node: '>=16'} dependencies: '@guardian/tsconfig': 1.0.0 From 0c1ae0d70c3dc683be6802e837b461cf1480d348 Mon Sep 17 00:00:00 2001 From: James Mockett <1166188+jamesmockett@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:30:19 +0100 Subject: [PATCH 2/2] Move Ophan attributes up to parent link element --- .../src/components/Card/components/CardBranding.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dotcom-rendering/src/components/Card/components/CardBranding.tsx b/dotcom-rendering/src/components/Card/components/CardBranding.tsx index 826a4fa786f..2b54ada6de0 100644 --- a/dotcom-rendering/src/components/Card/components/CardBranding.tsx +++ b/dotcom-rendering/src/components/Card/components/CardBranding.tsx @@ -83,6 +83,8 @@ export const CardBranding = ({ rel="nofollow" aria-label={`Visit the ${branding.sponsorName} website`} data-testid="card-branding-logo" + data-component={dataAttributes?.ophanComponentName} + data-link-name={dataAttributes?.ophanComponentLink} > {darkModeAvailable && branding.logoForDarkBackground && ( @@ -105,8 +107,6 @@ export const CardBranding = ({ alt={branding.sponsorName} width={logo.dimensions.width} height={logo.dimensions.height} - data-component={dataAttributes?.ophanComponentName} - data-link-name={dataAttributes?.ophanComponentLink} />