Skip to content

Commit 23ef84c

Browse files
committed
feat: link topics page; topics index page ATI analytics
1 parent f341131 commit 23ef84c

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

src/app/lib/config/fixtures/types/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Summary } from '#app/models/types/curationData';
22
import { Services } from '#app/models/types/global';
3+
import { ATIData } from '#app/components/ATIAnalytics/types';
34

45
export type Topic = {
56
topicName: string;
@@ -18,6 +19,7 @@ export type PageData = {
1819
totalItems: number;
1920
metadata: {
2021
type: string;
22+
atiAnalytics: ATIData;
2123
};
2224
};
2325

src/app/lib/config/services/hausa.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,10 @@ export const service: DefaultServiceConfig = {
469469
title: 'Shirye-shiryen rediyo',
470470
url: '/hausa/topics/c4nx34q5724t',
471471
},
472+
{
473+
title: 'Batutuwa',
474+
url: '/hausa/topics',
475+
},
472476
],
473477
},
474478
};

ws-nextjs-app/pages/[service]/topics/TopicsIndexPage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Pagination from '#app/components/Pagination';
33
import { ServiceContext } from '#app/contexts/ServiceContext';
44
import { useContext } from 'react';
55
import MetadataContainer from '#app/components/Metadata';
6+
import ATIAnalytics from '#app/components/ATIAnalytics';
67
import { TopicsPageProps } from '#app/lib/config/fixtures/types';
78
import styles from './index.styles';
89

@@ -14,7 +15,8 @@ const TopicsPage = ({
1415
safeActivePage,
1516
}: TopicsPageProps) => {
1617
const { translations, lang } = useContext(ServiceContext);
17-
const { summaries, headline } = pageData || {};
18+
const { summaries, headline, metadata } = pageData || {};
19+
const { atiAnalytics } = metadata;
1820

1921
const {
2022
pageXOfY,
@@ -38,6 +40,7 @@ const TopicsPage = ({
3840

3941
return (
4042
<main css={styles.container}>
43+
<ATIAnalytics atiData={atiAnalytics} />
4144
<MetadataContainer
4245
title={metadataTitle}
4346
openGraphType="website"

ws-nextjs-app/pages/[service]/topics/index.page.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ export const getServerSideProps: GetServerSideProps = async context => {
7373
totalItems,
7474
metadata: {
7575
type: TOPIC_PAGE,
76+
analytics: {
77+
name: 'hausa.topics.page',
78+
producer: 'HAUSA',
79+
},
80+
atiAnalytics: {
81+
name: 'hausa-topics-index',
82+
type: 'index-category',
83+
contentId: 'urn:bbc:tipo:topic:hausa-topics-index',
84+
contentType: 'index-category',
85+
pageIdentifier: 'hausa.topics.index.page',
86+
pageTitle: 'Batutuwa',
87+
},
7688
},
7789
},
7890
},

0 commit comments

Comments
 (0)