Skip to content

Commit

Permalink
Prepare CTRL for C24_WMDE_Mobile_DE_13
Browse files Browse the repository at this point in the history
Based on the VAR of test 12

Ticket: https://phabricator.wikimedia.org/T381954
  • Loading branch information
Abban committed Dec 18, 2024
1 parent f784aad commit fa6e20c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 116 deletions.
6 changes: 4 additions & 2 deletions banners/mobile/C24_WMDE_Mobile_DE_13/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker';
import { WindowTimer } from '@src/utils/Timer';
import { currentCampaignTimePercentage } from '@src/components/ProgressBar/currentCampaignTimePercentage';

const localeFactory = new LocaleFactoryDe();
const translator = new Translator( messages );
Expand All @@ -31,7 +32,7 @@ const page = new PageWPORG( mediaWiki, ( new SkinFactory( mediaWiki ) ).getSkin(
const runtimeEnvironment = new UrlRuntimeEnvironment( window.location );
const impressionCount = new LocalImpressionCount( page.getTracking().keyword, runtimeEnvironment );
const tracker = new LegacyTrackerWPORG( mediaWiki, page.getTracking().keyword, eventMappings, runtimeEnvironment );

const date = new Date();
const currencyFormatter = localeFactory.getCurrencyFormatter();

const app = createVueApp( BannerConductor, {
Expand All @@ -54,7 +55,7 @@ const app = createVueApp( BannerConductor, {
app.use( TranslationPlugin, translator );
app.use( DynamicTextPlugin, {
campaignParameters: page.getCampaignParameters(),
date: new Date(),
date,
formatters: localeFactory.getFormatters(),
impressionCount,
translator,
Expand All @@ -66,5 +67,6 @@ app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmo
app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) );
app.provide( 'tracker', tracker );
app.provide( 'timer', new WindowTimer() );
app.provide( 'currentCampaignTimePercentage', currentCampaignTimePercentage( date, page.getCampaignParameters() ) );

app.mount( page.getBannerContainer() );
2 changes: 1 addition & 1 deletion banners/mobile/C24_WMDE_Mobile_DE_13/banner_var.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createVueApp } from '@src/createVueApp';

import './styles/styles_var.scss';
import './styles/styles.scss';

import BannerConductor from '@src/components/BannerConductor/BannerConductor.vue';
import Banner from './components/BannerVar.vue';
Expand Down
10 changes: 5 additions & 5 deletions banners/mobile/C24_WMDE_Mobile_DE_13/components/BannerCtrl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<KeenSlider :with-navigation="false" :play="slideshowShouldPlay" :interval="5000">

<template #slides="{ currentSlide }: any">
<BannerSlides :currentSlide="currentSlide" :play-live-text="contentState === ContentStates.Mini"/>
<BannerSlides :currentSlide="currentSlide" :play-live-text="contentState === ContentStates.Mini">
<template #progress><ProgressBar/></template>
</BannerSlides>
</template>

</KeenSlider>
Expand All @@ -24,9 +26,7 @@
<BannerText :play-live-text="contentState === ContentStates.FullPage"/>
</template>

<template #progress>
<ProgressBar amount-to-show-on-right="TARGET"/>
</template>
<template #progress><ProgressBar/></template>

<template #donation-form="{ formInteraction }: any">
<MultiStepDonation
Expand Down Expand Up @@ -143,7 +143,7 @@ import {
} from '@src/components/DonationForm/StepControllers/SubmittableUpgradeToYearly';
import MainDonationFormButton from '@src/components/DonationForm/Forms/MainDonationFormButton.vue';
import WMDEFundsForwardingDE from '@src/components/UseOfFunds/Infographics/WMDEFundsForwardingDE.vue';
import ProgressBar from '@src/components/ProgressBar/ProgressBar.vue';
import ProgressBar from '../content/ProgressBar.vue';
import { LocalCloseTracker } from '@src/utils/LocalCloseTracker';
import { BannerSubmitOnReturnEvent } from '@src/tracking/events/BannerSubmitOnReturnEvent';
import SoftClose from '@src/components/SoftClose/SoftClose.vue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ import { PageScroller } from '@src/utils/PageScroller/PageScroller';
import MainDonationFormAdaptiveAmounts from '@src/components/DonationForm/Forms/MainDonationFormAdaptiveAmounts.vue';
import MultiStepDonation from '@src/components/DonationForm/MultiStepDonation.vue';
import BannerText from '../content/BannerText.vue';
import BannerSlides from '../content/BannerSlidesVar.vue';
import BannerSlides from '../content/BannerSlides.vue';
import BannerFooter from '@src/components/Footer/BannerFooter.vue';
import KeenSlider from '@src/components/Slider/KeenSlider.vue';
import { Tracker } from '@src/tracking/Tracker';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<KeenSliderSlide :is-current="currentSlide === 0" class="wmde-banner-slide-content-with-progress-bar">
<p>Unser Spendenziel: {{ goalDonationSum }} Millionen €</p>
<ProgressBar amount-to-show-on-right="TARGET"/>
<slot name="progress"/>
</KeenSliderSlide>

<KeenSliderSlide :is-current="currentSlide === 1">
Expand Down Expand Up @@ -44,7 +44,6 @@ import { inject, onMounted, onUnmounted, watch } from 'vue';
import KeenSliderSlide from '@src/components/Slider/KeenSliderSlide.vue';
import AnimatedText from '@src/components/AnimatedText/AnimatedText.vue';
import { useLiveDateAndTime } from '@src/components/composables/useLiveDateAndTime';
import ProgressBar from '@src/components/ProgressBar/ProgressBar.vue';
interface Props {
playLiveText: boolean;
Expand Down
74 changes: 0 additions & 74 deletions banners/mobile/C24_WMDE_Mobile_DE_13/content/BannerSlidesVar.vue

This file was deleted.

4 changes: 2 additions & 2 deletions banners/mobile/C24_WMDE_Mobile_DE_13/styles/styles.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use 'src/themes/Modo/swatches/skin_default' with (
$upgrade-to-yearly-button-form: true,
$progress-bar: true,
$double-progress-bar: true,
$soft-close: true,
$thank-you-box: true
);
Expand All @@ -24,5 +24,5 @@
@use 'src/themes/Modo/DonationForm/SubComponents/SmsBox';
@use 'src/themes/Modo/Slider/Slider';
@use 'src/themes/Modo/SoftClose/SoftClose';
@use 'src/themes/Modo/ProgressBar/ProgressBar';
@use 'src/themes/Modo/ProgressBar/DoubleProgressBar';
@use 'src/themes/Modo/Message/Message';
28 changes: 0 additions & 28 deletions banners/mobile/C24_WMDE_Mobile_DE_13/styles/styles_var.scss

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ describe( 'BannerCtrl.vue', () => {
currencyFormatter: new CurrencyDe(),
formItems,
tracker,
timer: timer ?? new TimerStub()
timer: timer ?? new TimerStub(),
currentCampaignTimePercentage: 42
}
}
} );
Expand Down

0 comments on commit fa6e20c

Please sign in to comment.