Skip to content

Commit

Permalink
Prepare CTRL for C24_WMDE_Desktop_DE_21
Browse files Browse the repository at this point in the history
- based on desktop DE 20 ctrl
 (single progress bar)

https://phabricator.wikimedia.org/T381952
  • Loading branch information
moiikana committed Dec 16, 2024
1 parent 5390a70 commit eccd360
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 161 deletions.
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_21/banner_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ import { Translator } from '@src/Translator';
import DynamicTextPlugin from '@src/DynamicTextPlugin';
import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import eventMappings from './event_map_var';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';
import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker';
import messages from './messages_var';
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { WindowTimer } from '@src/utils/Timer';
import { currentCampaignTimePercentage } from '@src/components/ProgressBar/currentCampaignTimePercentage';

const date = new Date();
const localeFactory = new LocaleFactoryDe();
Expand Down Expand Up @@ -70,6 +69,5 @@ app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmo
app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) );
app.provide( 'tracker', tracker );
app.provide( 'timer', new WindowTimer() );
app.provide( 'currentCampaignTimePercentage', currentCampaignTimePercentage( new Date(), page.getCampaignParameters() ) );

app.mount( page.getBannerContainer() );
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</template>

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

<template #donation-form="{ formInteraction }: any">
Expand Down Expand Up @@ -83,7 +83,7 @@
import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates';
import { inject, ref, watch } from 'vue';
import { UseOfFundsContent as useOfFundsContentInterface } from '@src/domain/UseOfFunds/UseOfFundsContent';
import MainBanner from './MainBannerVar.vue';
import MainBanner from './MainBanner_var.vue';
import FundsModal from '@src/components/UseOfFunds/FundsModal.vue';
import BannerText from '../content/BannerText.vue';
import BannerSlides from '../content/BannerSlides.vue';
Expand All @@ -104,7 +104,7 @@ import { TrackingFeatureName } from '@src/tracking/TrackingEvent';
import ButtonClose from '@src/components/ButtonClose/ButtonClose.vue';
import FooterAlreadyDonated from '@src/components/Footer/FooterAlreadyDonated.vue';
import WMDEFundsForwardingDE from '@src/components/UseOfFunds/Infographics/WMDEFundsForwardingDE.vue';
import DoubleProgressBar from '@src/components/ProgressBar/DoubleProgressBar.vue';
import ProgressBar from '@src/components/ProgressBar/ProgressBarAlternative.vue';
import SoftClose from '@src/components/SoftClose/SoftClose.vue';
import { LocalCloseTracker } from '@src/utils/LocalCloseTracker';
import { BannerSubmitOnReturnEvent } from '@src/tracking/events/BannerSubmitOnReturnEvent';
Expand Down
47 changes: 47 additions & 0 deletions banners/desktop/C24_WMDE_Desktop_DE_21/event_map_var.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { TrackingEventConverterFactory } from '@src/tracking/LegacyTrackerWPORG';
import { WMDELegacyBannerEvent } from '@src/tracking/WPORG/WMDELegacyBannerEvent';
import { WMDESizeIssueEvent } from '@src/tracking/WPORG/WMDEBannerSizeIssue';
import { BannerSubmitEvent } from '@src/tracking/events/BannerSubmitEvent';
import { FormStepShownEvent } from '@src/tracking/events/FormStepShownEvent';
import { mapFormStepShownEvent } from '@src/tracking/LegacyEventTracking/mapFormStepShownEvent';
import { CustomAmountChangedEvent } from '@src/tracking/events/CustomAmountChangedEvent';
import { CloseEvent } from '@src/tracking/events/CloseEvent';
import { mapCloseEvent } from '@src/tracking/LegacyEventTracking/mapCloseEvent';
import { NotShownEvent } from '@src/tracking/events/NotShownEvent';
import { mapNotShownEvent } from '@src/tracking/LegacyEventTracking/mapNotShownEvent';
import { createViewportInfo } from '@src/tracking/LegacyEventTracking/createViewportInfo';
import { AlreadyDonatedShownEvent } from '@src/tracking/events/AlreadyDonatedShownEvent';
import { FallbackBannerSubmitEvent } from '@src/tracking/events/FallbackBannerSubmitEvent';
import { ShownEvent } from '@src/tracking/events/ShownEvent';
import { mapShownEvent } from '@src/tracking/LegacyEventTracking/mapShownEvent';
import { BannerSubmitOnReturnEvent } from '@src/tracking/events/BannerSubmitOnReturnEvent';

export default new Map<string, TrackingEventConverterFactory>( [
[ ShownEvent.EVENT_NAME, mapShownEvent ],
[ CloseEvent.EVENT_NAME, mapCloseEvent ],
[ FormStepShownEvent.EVENT_NAME, mapFormStepShownEvent ],
[ CustomAmountChangedEvent.EVENT_NAME,
( e: CustomAmountChangedEvent ): WMDELegacyBannerEvent =>
new WMDELegacyBannerEvent( e.userChoice + '-amount', 1 )
],
[ AlreadyDonatedShownEvent.EVENT_NAME, ( e: AlreadyDonatedShownEvent ): WMDELegacyBannerEvent => new WMDELegacyBannerEvent( e.eventName, 1 ) ],
[ NotShownEvent.EVENT_NAME, mapNotShownEvent ],
[ BannerSubmitEvent.EVENT_NAME, ( e: BannerSubmitEvent ): WMDESizeIssueEvent => {
switch ( e.feature ) {
case 'UpgradeToYearlyForm':
return new WMDESizeIssueEvent( `submit-${e.userChoice}`, createViewportInfo(), 1 );
case 'UpgradeToMonthlyForm':
return new WMDESizeIssueEvent( `submit-${e.userChoice}`, createViewportInfo(), 1 );
default:
return new WMDESizeIssueEvent( `submit`, createViewportInfo(), 1 );
}
} ],
[ FallbackBannerSubmitEvent.EVENT_NAME,
( e: FallbackBannerSubmitEvent ): WMDESizeIssueEvent =>
new WMDESizeIssueEvent( e.eventName, createViewportInfo(), 1 )
],
[ BannerSubmitOnReturnEvent.EVENT_NAME,
( e: BannerSubmitOnReturnEvent ): WMDELegacyBannerEvent =>
new WMDELegacyBannerEvent( e.eventName + ( e.userChoice !== '' ? `-${e.userChoice}` : '' ), 1 )
]
] );
35 changes: 0 additions & 35 deletions banners/desktop/C24_WMDE_Desktop_DE_21/messages_var.ts

This file was deleted.

60 changes: 0 additions & 60 deletions banners/desktop/C24_WMDE_Desktop_DE_21/styles/MainBannerVar.scss

This file was deleted.

55 changes: 0 additions & 55 deletions banners/desktop/C24_WMDE_Desktop_DE_21/styles/MainBannerVar_1.scss

This file was deleted.

12 changes: 8 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_21/styles/styles_var.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
$select-group: true,
$upgrade-to-yearly: true,
$fallback-banner: true,
$double-progress-bar: true,
$progress-bar: true,
$soft-close: true,
);
@use 'src/components/BannerConductor/banner-transition';
@use 'src/themes/UseOfFunds/swatches/skin_default' as uof-default;
@use 'Banner';
@use 'src/themes/UseOfFunds/UseOfFunds';
@use 'MainBannerVar' with (
@use 'MainBanner' with (
$banner-height: 357px,
$form-width: 300px
);
@use 'src/themes/Treedip/defaults';
@use 'src/themes/Treedip/ButtonClose/ButtonClose';
@use 'src/themes/Treedip/ProgressBar/DoubleProgressBar';
@use 'src/themes/Treedip/ProgressBar/ProgressBarAlternative' with (
$progress-bar-margin: 0 15px
);
@use 'src/themes/Treedip/DonationForm/DonationForm';
@use 'src/themes/Treedip/DonationForm/MultiStepDonation';
@use 'src/themes/Treedip/DonationForm/SubComponents/SelectGroup';
Expand All @@ -34,7 +36,9 @@
@use 'src/themes/Treedip/Message/Message' with (
$slider-main-headline-font-size: 25px,
$message-header-padding-bottom: 8px,
$message-header-small-up-padding-bottom: 8px
$message-header-small-up-padding-bottom: 8px,
$message-header-padding-top: 20px,
$message-header-small-up-padding-top: 20px
);
@use 'src/themes/Treedip/SoftClose/SoftClose';
@use 'src/themes/Treedip/Slider/KeenSlider' with (
Expand Down

0 comments on commit eccd360

Please sign in to comment.