Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GN-146 Data tracking attributes #153

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Footer/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { footerClickEventAction } from "../tracker";
export class Footer extends Component {
render() {
return (
<footer className={styles.footer}>
<footer className={styles.footer} data-tracking="Global footer">
<div className={styles.container}>
<TrackedLink
eventAction={footerClickEventAction}
Expand Down
3 changes: 2 additions & 1 deletion src/Header/Account/Account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function Account(props) {
}

return props.isLoggedIn ? (
<div className={styles.account}>
<div className={styles.account} data-tracking="Account panel">
<button
className={classnames(styles.button, styles.myAccount)}
id="my-account-button"
Expand Down Expand Up @@ -184,6 +184,7 @@ function Account(props) {
</div>
) : (
<a
data-tracking="Sign in"
href={signInLink.url}
className={styles.button}
onClick={handleMenuItemClick}
Expand Down
3 changes: 2 additions & 1 deletion src/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class Header extends Component {
aria-hidden="true"
/>

<div className={styles.header}>
<div className={styles.header} data-tracking="Global nav">
<header aria-label="Site header">
<ul className={styles.a11yLinks} aria-label="Accessibility links">
<li>
Expand All @@ -112,6 +112,7 @@ export class Header extends Component {
aria-label="Home"
className={styles.home}
onClick={this.handleLogoClick}
data-tracking="Logo"
>
<LogoIcon
className={styles.icon}
Expand Down
8 changes: 4 additions & 4 deletions src/Header/Nav/Dropdown/Components/AboutUs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function AboutUs() {
Explore about us
</Button>
<Grid gutter="loose">
<GridItem cols={12} md={3}>
<GridItem cols={12} md={3} data-tracking="Who we are">
<h3 className="mt--d">Who we are</h3>
<ul className={classnames(styles.listUnstyled, "mt--d")}>
<li>
Expand Down Expand Up @@ -59,7 +59,7 @@ export function AboutUs() {
</li>
</ul>
</GridItem>
<GridItem cols={12} md={3}>
<GridItem cols={12} md={3} data-tracking="What we do">
<h3 className="mt--d">What we do</h3>
<ul className={classnames(styles.listUnstyled, "mt--d")}>
<li>
Expand Down Expand Up @@ -94,7 +94,7 @@ export function AboutUs() {
</li>
</ul>
</GridItem>
<GridItem cols={12} md={3}>
<GridItem cols={12} md={3} data-tracking="Our programmes">
<h3 className="mt--d">Our programmes</h3>
<ul className={classnames(styles.listUnstyled, "mt--d")}>
<li>
Expand Down Expand Up @@ -131,7 +131,7 @@ export function AboutUs() {
</li>
</ul>
</GridItem>
<GridItem cols={12} md={3}>
<GridItem cols={12} md={3} data-tracking="Get involved">
<h3 className="mt--d">Get involved</h3>
<ul className={classnames(styles.listUnstyled, "mt--d")}>
<li>
Expand Down
44 changes: 24 additions & 20 deletions src/Header/Nav/Dropdown/Components/BNF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,30 @@ export function BNF() {
View BNF
</Button>

<h3 className="mt--d">Drugs A to Z</h3>
<ol className={styles.alphabet}>
{drugsAtoZ.map(({ letter, link }) => {
return (
<li
key={letter}
className={`${styles.letter} ${link ? "" : styles.chunkyLetter}`}
>
{link ? (
<a href={`${drugsAtoZurl}${letter}`}>{letter}</a>
) : (
<span>{letter}</span>
)}
</li>
);
})}
</ol>
<div data-tracking="Drugs A to Z">
<h3 className="mt--d">Drugs A to Z</h3>
<ol className={styles.alphabet}>
{drugsAtoZ.map(({ letter, link }) => {
return (
<li
key={letter}
className={`${styles.letter} ${
link ? "" : styles.chunkyLetter
}`}
>
{link ? (
<a href={`${drugsAtoZurl}${letter}`}>{letter}</a>
) : (
<span>{letter}</span>
)}
</li>
);
})}
</ol>
</div>

<Grid gutter="loose">
<GridItem cols={12} md={3}>
<GridItem cols={12} md={3} data-tracking="Browse A to Z by">
<h3>Browse A to Z by</h3>
<ul className={styles.listUnstyled}>
<li>
Expand All @@ -82,7 +86,7 @@ export function BNF() {
</li>
</ul>
</GridItem>
<GridItem cols={12} md={6}>
<GridItem cols={12} md={6} data-tracking="Browse by type">
<h3>Browse by type</h3>
<ul className={styles.listUnstyled} style={{ columnCount: 2 }}>
<li>
Expand Down Expand Up @@ -111,7 +115,7 @@ export function BNF() {
</li>
</ul>
</GridItem>
<GridItem cols={12} md={3}>
<GridItem cols={12} md={3} data-tracking="What's new">
<h3>What’s new</h3>
<ul className={styles.listUnstyled}>
<li>
Expand Down
45 changes: 24 additions & 21 deletions src/Header/Nav/Dropdown/Components/BNFc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,29 @@ export function BNFc() {
View BNFC
</Button>

<h3 className="mt--d">Drugs A to Z</h3>
<ol className={styles.alphabet}>
{drugsAtoZ.map(({ letter, link }) => {
return (
<li
key={letter}
className={`${styles.letter} ${link ? "" : styles.chunkyLetter}`}
>
{link ? (
<a href={`${drugsAtoZurl}${letter}`}>{letter}</a>
) : (
<span>{letter}</span>
)}
</li>
);
})}
</ol>

<div data-tracking="Drugs A to Z">
<h3 className="mt--d">Drugs A to Z</h3>
<ol className={styles.alphabet}>
{drugsAtoZ.map(({ letter, link }) => {
return (
<li
key={letter}
className={`${styles.letter} ${
link ? "" : styles.chunkyLetter
}`}
>
{link ? (
<a href={`${drugsAtoZurl}${letter}`}>{letter}</a>
) : (
<span>{letter}</span>
)}
</li>
);
})}
</ol>
</div>
<Grid gutter="loose">
<GridItem cols={12} md={3}>
<GridItem cols={12} md={3} data-tracking="Browse A to Z by">
<h3>Browse A to Z by</h3>
<ul className={styles.listUnstyled}>
<li>
Expand All @@ -83,7 +86,7 @@ export function BNFc() {
</li>
</ul>
</GridItem>
<GridItem cols={12} md={6}>
<GridItem cols={12} md={6} data-tracking="Browse by type">
<h3>Browse by type</h3>
<ul className={styles.listUnstyled} style={{ columnCount: 2 }}>
<li>
Expand All @@ -109,7 +112,7 @@ export function BNFc() {
</li>
</ul>
</GridItem>
<GridItem cols={12} md={3}>
<GridItem cols={12} md={3} data-tracking="What's new">
<h3>What’s new</h3>
<ul className={styles.listUnstyled}>
<li>
Expand Down
49 changes: 28 additions & 21 deletions src/Header/Nav/Dropdown/Components/CKS.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,33 @@ export function CKS() {
View CKS
</Button>

<h3 className="mt--d">Health topics A to Z</h3>
<ol className={styles.alphabet}>
{topicsAtoZ.map(({ letter, link }) => {
return (
<li
key={letter}
className={`${styles.letter} ${link ? "" : styles.chunkyLetter}`}
>
{link ? (
<a href={`${topicsAtoZurl}${letter}`}>{letter}</a>
) : (
<span>{letter}</span>
)}
</li>
);
})}
</ol>

<div data-tracking="Health topics A to Z">
<h3 className="mt--d">Health topics A to Z</h3>
<ol className={styles.alphabet}>
{topicsAtoZ.map(({ letter, link }) => {
return (
<li
key={letter}
className={`${styles.letter} ${
link ? "" : styles.chunkyLetter
}`}
>
{link ? (
<a href={`${topicsAtoZurl}${letter}`}>{letter}</a>
) : (
<span>{letter}</span>
)}
</li>
);
})}
</ol>
</div>
<Grid gutter="loose">
<GridItem cols={12} md={6}>
<GridItem
cols={12}
md={6}
data-tracking="Topics most frequently visited"
>
<h3>Topics most frequently visited</h3>
<ul className={styles.listUnstyled} style={{ columnCount: 2 }}>
<li>
Expand All @@ -96,15 +103,15 @@ export function CKS() {
</li>
</ul>
</GridItem>
<GridItem cols={12} md={3}>
<GridItem cols={12} md={3} data-tracking="Browse by">
<h3>Browse by</h3>
<ul className={styles.listUnstyled}>
<li>
<a href={`${baseUrl}/specialities/`}>Specialities</a>
</li>
</ul>
</GridItem>
<GridItem cols={12} md={3}>
<GridItem cols={12} md={3} data-tracking="What's new">
<h3>What’s new</h3>
<ul className={styles.listUnstyled}>
<li>
Expand Down
Loading