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

feat(TMRS-488): retrieve categoryPath - read more slice #3977

Merged
merged 5 commits into from
Nov 5, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const expectedArticles = [
summary:
'How is your bank balance? Even if the cost of living crisis doesn’t constitute a crisis for you, you’ll have noticed that you’re suddenly paying more for and what felt reasonable may now...',
url:
'https://www.thetimes.co.uk/article/save-or-splurge-what-experts-spend-their-own-money-on-tdd65qlj6'
'l1/l2/article/save-or-splurge-what-experts-spend-their-own-money-on-tdd65qlj6'
},
{
byline: '',
Expand All @@ -42,8 +42,7 @@ const expectedArticles = [
label: 'Obituary',
summary:
'On August 1, 1981, Major Ian Crooke, the operations officer of 22 Special Air Service in Hereford, received a telephone call from London. A Marxist coup d’état was taking place in the former British...',
url:
'https://www.thetimes.co.uk/article/lieutenant-colonel-ian-crooke-obituary-t0b890wgp'
url: 'l1/l2/article/lieutenant-colonel-ian-crooke-obituary-t0b890wgp'
},
{
byline: 'Patrick Maguire',
Expand All @@ -62,8 +61,7 @@ const expectedArticles = [
label: 'RED BOX | PATRICK MAGUIRE',
summary:
'Worse than May. Worse than Major. As bad as Thatcher. of his own MPs, far more than even the most pessimistic whip predicted this time yesterday. Can Boris...',
url:
'https://www.thetimes.co.uk/article/is-the-party-over-for-boris-johnson-k8s0jxv6r'
url: 'l1/l2/article/is-the-party-over-for-boris-johnson-k8s0jxv6r'
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Article = {
bylines?: Byline[];
summary?: Summary;
media?: Media;
categoryPath: string;
};

// HELPERS
Expand Down Expand Up @@ -66,7 +67,7 @@ const getImage = (media?: Media) => {

const formatArticle = (article: Article): SliceArticle => {
return {
url: article.url,
url: article.categoryPath,
label: article.label,
byline: getBylines(article.bylines),
headline: article.headline,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export default {
{
url:
'https://www.thetimes.co.uk/article/save-or-splurge-what-experts-spend-their-own-money-on-tdd65qlj6',
categoryPath:
'l1/l2/article/save-or-splurge-what-experts-spend-their-own-money-on-tdd65qlj6',
slug: 'save-or-splurge-what-experts-spend-their-own-money-on',
label: null,
headline: 'Save or splurge: what experts spend their own money on',
Expand Down Expand Up @@ -51,6 +53,8 @@ export default {
{
url:
'https://www.thetimes.co.uk/article/lieutenant-colonel-ian-crooke-obituary-t0b890wgp',
categoryPath:
'l1/l2/article/lieutenant-colonel-ian-crooke-obituary-t0b890wgp',
slug: 'lieutenant-colonel-ian-crooke-obituary',
label: 'Obituary',
headline: 'Lieutenant Colonel Ian Crooke',
Expand Down Expand Up @@ -78,6 +82,8 @@ export default {
{
url:
'https://www.thetimes.co.uk/article/is-the-party-over-for-boris-johnson-k8s0jxv6r',
categoryPath:
'l1/l2/article/is-the-party-over-for-boris-johnson-k8s0jxv6r',
slug: 'is-the-party-over-for-boris-johnson',
label: 'RED BOX | PATRICK MAGUIRE',
headline: 'Is the party over for Johnson?',
Expand Down Expand Up @@ -118,6 +124,8 @@ export default {
{
url:
'https://www.thetimes.co.uk/article/quentin-letts-a-pm-his-party-and-the-country-left-firmly-in-limp-on-territory-klvfgrj8g',
categoryPath:
'l1/l2/article/quentin-letts-a-pm-his-party-and-the-country-left-firmly-in-limp-on-territory-klvfgrj8g',
slug:
'quentin-letts-a-pm-his-party-and-the-country-left-firmly-in-limp-on-territory',
label: 'Political Sketch',
Expand Down Expand Up @@ -152,6 +160,8 @@ export default {
{
url:
'https://www.thetimes.co.uk/article/boris-johnson-should-look-for-an-honourable-exit-7fkgkl2rq',
categoryPath:
'l1/l2/article/boris-johnson-should-look-for-an-honourable-exit-7fkgkl2rq',
slug: 'boris-johnson-should-look-for-an-honourable-exit',
label: 'WILLIAM HAGUE | COMMENT',
headline: 'Hague: Johnson should look for an honourable exit',
Expand Down Expand Up @@ -184,6 +194,8 @@ export default {
{
url:
'https://www.thetimes.co.uk/article/carrie-johnson-and-hard-times-at-no-10-hfmkr8ssn',
categoryPath:
'l1/l2/article/carrie-johnson-and-hard-times-at-no-10-hfmkr8ssn',
slug: 'carrie-johnson-and-hard-times-at-no-10',
label: 'POLITICS',
headline: 'Carrie Johnson and hard times at No 10',
Expand Down Expand Up @@ -216,6 +228,8 @@ export default {
{
url:
'https://www.thetimes.co.uk/article/dead-man-walking-times-commentators-give-their-verdicts-boris-johnson-confidence-vote-0f59md3bt',
categoryPath:
'l1/l2/article/dead-man-walking-times-commentators-give-their-verdicts-boris-johnson-confidence-vote-0f59md3bt',
slug:
'dead-man-walking-times-commentators-give-their-verdicts-boris-johnson-confidence-vote',
label: 'Politics',
Expand Down Expand Up @@ -269,6 +283,7 @@ export default {
{
url:
'https://www.thetimes.co.uk/article/margot-heuman-obituary-9fdm8h3hr',
categoryPath: 'l1/l2/article/margot-heuman-obituary-9fdm8h3hr',
slug: 'margot-heuman-obituary',
label: 'Obituary',
headline: 'Margot Heuman',
Expand Down Expand Up @@ -296,6 +311,8 @@ export default {
{
url:
'https://www.thetimes.co.uk/article/the-times-view-on-tory-confidence-in-boris-johnson-pyrrhic-victory-wl5fl2jb2',
categoryPath:
'l1/l2/article/the-times-view-on-tory-confidence-in-boris-johnson-pyrrhic-victory-wl5fl2jb2',
slug:
'the-times-view-on-tory-confidence-in-boris-johnson-pyrrhic-victory',
label: 'LEADING ARTICLE',
Expand Down Expand Up @@ -329,6 +346,8 @@ export default {
{
url:
'https://www.thetimes.co.uk/article/boris-johnson-allies-took-time-saving-big-dog-leadership-contest-rn5dzbw8h',
categoryPath:
'l1/l2/article/boris-johnson-allies-took-time-saving-big-dog-leadership-contest-rn5dzbw8h',
slug:
'boris-johnson-allies-took-time-saving-big-dog-leadership-contest',
label: 'Politics',
Expand Down
1 change: 1 addition & 0 deletions packages/ts-components/src/types/externs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ declare module '@times-components/ts-slices' {
export type SliceArticle = {
id?: string;
url?: string;
categoryPath?: string;
label?: string;
byline?: string;
headline: string;
Expand Down