Skip to content

Commit b3ddba4

Browse files
Merge pull request #326 from AppQuality/dashboard-tracking
feat(tracking): add classNames and ids to elements for tracking purpose
2 parents 73a7fa6 + 820289a commit b3ddba4

File tree

15 files changed

+28
-7
lines changed

15 files changed

+28
-7
lines changed

src/common/components/BugsReportCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const BugsReportCard = ({
6464

6565
<SpecialCard.Footer direction="column" justifyContent="center">
6666
<Button
67-
className="report-btn report-btn-link report-btn-link"
67+
className="report-btn report-btn-download report-btn-bugs-report"
6868
isPill
6969
isStretched
7070
onClick={getReport}

src/common/components/Pill.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,21 @@ const PillContainer = styled.div`
2424
`;
2525

2626
export const Pill = ({
27+
id,
2728
background,
2829
color,
2930
icon,
3031
title,
3132
children,
3233
}: {
34+
id?: string;
3335
title: string;
3436
background?: string;
3537
color?: string;
3638
icon?: ReactNode;
3739
children?: ReactNode;
3840
}) => (
39-
<PillContainer>
41+
<PillContainer {...(id && { id })}>
4042
<StyledTag isPill hue={background ?? 'white'} size="large">
4143
{icon && <StyledAvatar>{icon}</StyledAvatar>}
4244
<Span isBold style={{ color: color ?? globalTheme.palette.grey[700] }}>

src/pages/Campaign/navigation/bugs/ExternalLink.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const BugsNavigationLink = ({ campaignId }: { campaignId: number }) => {
1414

1515
return (
1616
<StyledAnchor
17+
id="anchor-bugs-list-navigation"
1718
isExternal
1819
onClick={() => {
1920
// eslint-disable-next-line security/detect-non-literal-fs-filename

src/pages/Campaign/navigation/bugs/Navigation.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const BugsNavigation = ({ containerId }: { containerId?: string }) => {
1010
return (
1111
<>
1212
<StickyNavItem
13+
id="anchor-campaign-overview-navigation"
1314
to="campaign-overview"
1415
containerId={containerId ?? 'main'}
1516
spy
@@ -23,6 +24,7 @@ export const BugsNavigation = ({ containerId }: { containerId?: string }) => {
2324
{t('__CAMPAIGN_PAGE_NAVIGATION_BUG_GROUP_DETAILS_LABEL')}
2425
</StickyNavItemLabel>
2526
<StickyNavItem
27+
id="anchor-unique-bug-distribution-navigation"
2628
to="unique-bug-distribution"
2729
containerId={containerId ?? 'main'}
2830
spy
@@ -33,6 +35,7 @@ export const BugsNavigation = ({ containerId }: { containerId?: string }) => {
3335
{t('__CAMPAIGN_PAGE_NAVIGATION_BUG_ITEM_DETAILS_UNIQUE_BUGS_LABEL')}
3436
</StickyNavItem>
3537
<StickyNavItem
38+
id="anchor-devices-and-types-navigation"
3639
to="devices-and-types"
3740
containerId={containerId ?? 'main'}
3841
spy

src/pages/Campaign/navigation/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const Navigation = ({
3333
{t('__CAMPAIGN_PAGE_NAVIGATION_BUG_GROUP_OTHER_LABEL')}
3434
</StickyNavItemLabel>
3535
<StickyNavItem
36+
id="anchor-reports-navigation"
3637
to="reports"
3738
containerId="main"
3839
spy

src/pages/Campaign/navigation/media/ExternalLink.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const MediaNavigationLink = ({ campaignId }: { campaignId: number }) => {
1414

1515
return (
1616
<StyledAnchor
17+
id="anchor-media-list-navigation"
1718
isExternal
1819
onClick={() => {
1920
// eslint-disable-next-line security/detect-non-literal-fs-filename

src/pages/Campaign/pageHeader/Pills.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,23 @@ export const Pills = ({ campaign }: { campaign: CampaignWithOutput }) => {
154154
<Pipe style={{ marginRight: globalTheme.space.md }} />
155155
{meta.allowed_devices.includes('desktop') && (
156156
<Pill
157+
id="pill-desktop-header"
157158
icon={<DesktopIcon />}
158159
title={t('__CAMPAIGN_PAGE_INFO_HEADER_DESKTOP')}
159160
color={globalTheme.palette.azure[600]}
160161
/>
161162
)}
162163
{meta.allowed_devices.includes('smartphone') && (
163164
<Pill
165+
id="pill-smartphone-header"
164166
icon={<SmartphoneIcon />}
165167
title={t('__CAMPAIGN_PAGE_INFO_HEADER_PLATFORM_SMARTPHONE')}
166168
color={globalTheme.palette.azure[600]}
167169
/>
168170
)}
169171
{meta.allowed_devices.includes('tablet') && (
170172
<Pill
173+
id="pill-tablet-header"
171174
icon={<TabletIcon />}
172175
title={t('__CAMPAIGN_PAGE_INFO_HEADER_PLATFORM_TABLET')}
173176
color={globalTheme.palette.azure[600]}
@@ -179,6 +182,7 @@ export const Pills = ({ campaign }: { campaign: CampaignWithOutput }) => {
179182
<ButtonWrapper>
180183
{outputs?.includes('bugs') && (
181184
<Button
185+
id="button-bugs-list-header"
182186
isPrimary
183187
isPill
184188
themeColor={globalTheme.palette.water[600]}
@@ -195,6 +199,7 @@ export const Pills = ({ campaign }: { campaign: CampaignWithOutput }) => {
195199
)}
196200
{outputs?.includes('media') && (
197201
<Button
202+
id="button-media-list-header"
198203
isPrimary
199204
isPill
200205
themeColor={globalTheme.palette.water[600]}

src/pages/Campaign/pageHeader/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ const CampaignPageHeader = ({ campaignId }: { campaignId: number }) => {
115115
isProjectError ? null : (
116116
<PageHeader>
117117
<PageHeader.Breadcrumb>
118-
<Anchor onClick={() => navigate(projectRoute)}>{project.name}</Anchor>
118+
<Anchor id="breadcrumb-parent" onClick={() => navigate(projectRoute)}>
119+
{project.name}
120+
</Anchor>
119121
<Span>{campaign.customer_title}</Span>
120122
</PageHeader.Breadcrumb>
121123
<PageHeader.Main infoTitle={campaign.customer_title}>

src/pages/Campaign/widgets/BugCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const BugCardTitle = ({
8282
children: React.ReactNode;
8383
url: string;
8484
}) => (
85-
<Anchor href={url} target="_blank">
85+
<Anchor className="anchor-bug-card-title" href={url} target="_blank">
8686
<MD isBold>{children}</MD>
8787
</Anchor>
8888
);

src/pages/Campaign/widgets/BugDistributionCard/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ const BugDistributionCard = ({ campaignId }: { campaignId: number }) => {
113113

114114
<BasicWidget.Footer>
115115
<Anchor
116+
id="anchor-bugs-list-bugs-distribution-widget"
116117
isExternal
117118
onClick={() =>
118119
// eslint-disable-next-line security/detect-non-literal-fs-filename

0 commit comments

Comments
 (0)