Skip to content

Commit

Permalink
BG2-2775: Don't adjust CC URL after start of Feb 2025
Browse files Browse the repository at this point in the history
The implementation we have of this at the moment is specific to 2024
  • Loading branch information
bdsl committed Nov 28, 2024
1 parent 309c8bb commit 10ccb76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app/highlight-cards/HighlightCard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ describe('highlightCard', () => {
});

it('should replace CC24 link with metacampaign page', () => {
if (new Date() > new Date('2025-02-01')) {
pending('Implementation was only made for 2024');
}

const cardFromApi = cardLinkingTo("https://example-blog.com/christmas-challenge/");

const highlightCardForHomepage = SFAPIHighlightCardToHighlightCard(
Expand Down
2 changes: 1 addition & 1 deletion src/app/highlight-cards/HighlightCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const SFAPIHighlightCardToHighlightCard = (experienceUriPrefix: string, b
let href = replaceURLOrigin(experienceUriPrefix, blogUriPrefix, donateUriPrefix, sfApiHighlightCard.button.href);

// temp fix for 2024. Will need to think of something better and probably move this logic to SF for next year.
if (href.pathname.includes('christmas-challenge')) {
if (href.pathname.includes('christmas-challenge') && (new Date() < new Date('2025-02-01'))) {
href = new URL(donateUriPrefix + '/christmas-challenge-2024');
}

Expand Down

0 comments on commit 10ccb76

Please sign in to comment.