Skip to content

Commit 72071d2

Browse files
committed
feat: move analytics and ATI analytics data to topics fixtures
1 parent f2ea051 commit 72071d2

File tree

4 files changed

+29
-12
lines changed

4 files changed

+29
-12
lines changed

src/app/lib/config/fixtures/afrique.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ import { TopicsFixtureData } from './types';
22

33
const topics: TopicsFixtureData = {
44
headline: 'Sujets',
5+
analytics: {
6+
name: 'afrique.topics.page',
7+
producer: 'AFRIQUE',
8+
},
9+
atiAnalytics: {
10+
contentId: 'urn:bbc:tipo:topic:afrique-topics-index',
11+
contentType: 'index-category',
12+
pageIdentifier: 'afrique.topics.index.page',
13+
pageTitle: 'Sujets',
14+
},
515
topics: [
616
{
717
id: 'cqywjv1rwgxt',

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ import { TopicsFixtureData } from './types';
22

33
const topics: TopicsFixtureData = {
44
headline: 'Batutuwa',
5+
analytics: {
6+
name: 'hausa.topics.page',
7+
producer: 'HAUSA',
8+
},
9+
atiAnalytics: {
10+
contentId: 'urn:bbc:tipo:topic:hausa-topics-index',
11+
contentType: 'index-category',
12+
pageIdentifier: 'hausa.topics.index.page',
13+
pageTitle: 'Batutuwa',
14+
},
515
topics: [
616
{
717
topicName: "'Yan awaren Biafra",

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ export type Topic = {
88
id: string;
99
};
1010

11+
export type TopicsAnalyticsData = {
12+
name: string;
13+
producer: string;
14+
};
15+
1116
export type TopicsFixtureData = {
1217
headline: string;
18+
analytics: TopicsAnalyticsData;
19+
atiAnalytics: ATIData;
1320
topics?: Topic[];
1421
};
1522

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,8 @@ 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-
},
76+
analytics: topicsData.analytics,
77+
atiAnalytics: topicsData.atiAnalytics,
8878
},
8979
},
9080
},

0 commit comments

Comments
 (0)