Skip to content

Commit

Permalink
Remove _2022 from ticker names
Browse files Browse the repository at this point in the history
Rather than create a new ticker for each year, it seems sensible to
reuse them each year (if necessary). Therefore, let’s remove the year
from the name.

Co-ordinated with:

- [support-admin-console PR 446](guardian/support-admin-console#446)
- [contributions-ticker-calculator PR 886](https://github.com/guardian/support-dotcom-components/pull/886/files)
  • Loading branch information
emdash-ie authored and Emily Bourke committed Oct 13, 2023
1 parent 94c461e commit e0f063f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/modules/src/modules/banners/utils/storybook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const tickerSettings: TickerSettings = {
total: 120_000,
goal: 150_000,
},
name: 'US_2022',
name: 'US',
};

export const props: BannerProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ WithTicker.args = {
total: 10000,
goal: 100000,
},
name: 'US_2022',
name: 'US',
},
},
};
Expand Down
10 changes: 5 additions & 5 deletions packages/server/src/lib/fetchTickerData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ export class TickerDataProvider {

export const buildTickerDataReloader = async (): Promise<TickerDataProvider> => {
const reloaders: TickerDataProviders = await Promise.all([
buildReloader(getTickerDataForTickerTypeFetcher('US_2022'), 60),
buildReloader(getTickerDataForTickerTypeFetcher('AU_2022'), 60),
]).then(([US_2022, AU_2022]) => ({
US_2022,
AU_2022,
buildReloader(getTickerDataForTickerTypeFetcher('US'), 60),
buildReloader(getTickerDataForTickerTypeFetcher('AU'), 60),
]).then(([US, AU]) => ({
US,
AU,
}));
return new TickerDataProvider(reloaders);
};
6 changes: 3 additions & 3 deletions packages/server/src/tests/amp/ampEpicSelection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const tickerSettings: TickerSettings = {
goalReachedPrimary: "We've hit our goal!",
goalReachedSecondary: 'but you can still support us',
},
name: 'US_2022',
name: 'US',
};

const epicTest: AmpEpicTest = {
Expand Down Expand Up @@ -78,8 +78,8 @@ const expectedAmpEpic: AMPEpic = {
};

const tickerDataReloader = new TickerDataProvider({
US_2022: { get: () => ({ total: 999, goal: 1000 }) },
AU_2022: { get: () => ({ total: 999, goal: 1000 }) },
US: { get: () => ({ total: 999, goal: 1000 }) },
AU: { get: () => ({ total: 999, goal: 1000 }) },
});

describe('ampEpicTests', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/types/props/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const tickerDataSchema = z.object({
});

// Corresponds to .json file names in S3
export type TickerName = 'US_2022' | 'AU_2022';
export type TickerName = 'US' | 'AU';

export interface TickerSettings {
endType: TickerEndType;
Expand Down

0 comments on commit e0f063f

Please sign in to comment.