From 18239993f184e33c9eab0420f131ae17222909dc Mon Sep 17 00:00:00 2001 From: Gabriel Birke Date: Fri, 6 Dec 2024 16:47:15 +0100 Subject: [PATCH] Prepare VAR for C24_WMDE_Desktop_EN_06 Add double progress bar to VAR - add comment to `currentCampaignTimePercentage` - add English translations for `DoubleProgressBar` component - switch back to "million" formatting (instead of whole number formatting) for the "amount remaining" in the late progress content. This was switched before in 2023 Desktop DE 24 Ticket: https://phabricator.wikimedia.org/T381396 --- .../C24_WMDE_Desktop_EN_06/banner_var.ts | 4 +- .../components/BannerVar.vue | 4 +- .../C24_WMDE_Desktop_EN_06/messages_var.ts | 29 +++++++++++ .../styles/FallbackBanner.scss | 1 + .../styles/MainBannerVar.scss | 50 +++++++++++++++++++ .../styles/styles_var.scss | 8 ++- .../currentCampaignTimePercentage.ts | 3 ++ .../messages/DoubleProgressBar.en.ts | 7 +++ .../dev/CampaignParameterOverride.ts | 2 +- .../generators/ProgressBarContent.ts | 2 +- 10 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 banners/english/C24_WMDE_Desktop_EN_06/messages_var.ts create mode 100644 banners/english/C24_WMDE_Desktop_EN_06/styles/MainBannerVar.scss create mode 100644 src/components/ProgressBar/messages/DoubleProgressBar.en.ts diff --git a/banners/english/C24_WMDE_Desktop_EN_06/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_06/banner_var.ts index a43bf7aaa..6e9590ac4 100644 --- a/banners/english/C24_WMDE_Desktop_EN_06/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_06/banner_var.ts @@ -17,13 +17,14 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; -import messages from './messages'; +import messages from './messages_var'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; import { WindowTimer } from '@src/utils/Timer'; +import { currentCampaignTimePercentage } from '@src/components/ProgressBar/currentCampaignTimePercentage'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -67,5 +68,6 @@ app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmo app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN } ) ); app.provide( 'tracker', tracker ); app.provide( 'timer', new WindowTimer() ); +app.provide( 'currentCampaignTimePercentage', currentCampaignTimePercentage( new Date(), page.getCampaignParameters() ) ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_06/components/BannerVar.vue b/banners/english/C24_WMDE_Desktop_EN_06/components/BannerVar.vue index 32ae64f83..af094f8e7 100644 --- a/banners/english/C24_WMDE_Desktop_EN_06/components/BannerVar.vue +++ b/banners/english/C24_WMDE_Desktop_EN_06/components/BannerVar.vue @@ -21,7 +21,7 @@