Skip to content

Commit

Permalink
Merge pull request #1784 from thebiggive/BG2-2775-sort-cc-highlight-t…
Browse files Browse the repository at this point in the history
…o-top

BG2-2775: Don't adjust CC URL after start of Feb 2025
  • Loading branch information
bdsl authored Nov 28, 2024
2 parents 306556d + 10ccb76 commit 5b1a796
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 5b1a796

Please sign in to comment.