Unser Spendenziel: {{ goalDonationSum }} Millionen €
+
+
+
+
+
Hi,
+
+ vielleicht kommen wir gerade ungelegen, aber dennoch: Klicken Sie jetzt bitte nicht weg! Am
+ heutigen {{ currentDayName }}, den {{ liveDateAndTime.currentDate }}, um {{ liveDateAndTime.currentTime }} bitten wir Sie,
+ die Unabhängigkeit von Wikipedia zu unterstützen.
+
+
+
+
+
+ {{ campaignDaySentence }}
+
+ Die meisten Menschen spenden, weil sie Wikipedia nützlich finden.
+
+
+
+
+
+ Die durchschnittliche Spende beträgt {{ averageDonation }}, doch bereits 10 € helfen uns weiter. Hat Wikipedia
+ Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt?
+
+
+
+
+
+ Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück.
+ Vielen Dank!
+
+ vielleicht kommen wir gerade ungelegen, aber dennoch: Klicken Sie jetzt bitte nicht weg! Am heutigen
+ {{ currentDayName }}, den {{ liveDateAndTime.currentDate }}, um {{ liveDateAndTime.currentTime }}
+ bitten wir Sie, die Unabhängigkeit von Wikipedia zu unterstützen. {{ campaignDaySentence }}
+ Die meisten Menschen spenden, weil sie Wikipedia
+ nützlich finden. Die durchschnittliche Spende beträgt {{ averageDonation }}, doch bereits 10 € helfen uns
+ weiter. Hat Wikipedia Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt? Dann entscheiden
+ Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück. Vielen Dank!
+
+
+
+
+
+
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/event_map.ts b/banners/mobile/C24_WMDE_Mobile_DE_09/event_map.ts
new file mode 100644
index 000000000..d7a00a5dd
--- /dev/null
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/event_map.ts
@@ -0,0 +1,33 @@
+import { TrackingEventConverterFactory } from '@src/tracking/LegacyTrackerWPORG';
+import { WMDELegacyBannerEvent } from '@src/tracking/WPORG/WMDELegacyBannerEvent';
+import { MobileMiniBannerExpandedEvent } from '@src/tracking/events/MobileMiniBannerExpandedEvent';
+import { FormStepShownEvent } from '@src/tracking/events/FormStepShownEvent';
+import { mapFormStepShownEvent } from '@src/tracking/LegacyEventTracking/mapFormStepShownEvent';
+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 { BannerSubmitEvent } from '@src/tracking/events/BannerSubmitEvent';
+import { WMDESizeIssueEvent } from '@src/tracking/WPORG/WMDEBannerSizeIssue';
+import { createViewportInfo } from '@src/tracking/LegacyEventTracking/createViewportInfo';
+import { BannerSubmitOnReturnEvent } from '@src/tracking/events/BannerSubmitOnReturnEvent';
+
+export default new Map( [
+ [ CloseEvent.EVENT_NAME, mapCloseEvent ],
+ [ MobileMiniBannerExpandedEvent.EVENT_NAME,
+ ( e: MobileMiniBannerExpandedEvent ): WMDELegacyBannerEvent => new WMDELegacyBannerEvent( e.eventName + ( e.userChoice !== '' ? `-${e.userChoice}` : '' ), 1 ) ],
+ [ FormStepShownEvent.EVENT_NAME, mapFormStepShownEvent ],
+ [ NotShownEvent.EVENT_NAME, mapNotShownEvent ],
+
+ [ BannerSubmitEvent.EVENT_NAME, ( e: BannerSubmitEvent ): WMDESizeIssueEvent => {
+ switch ( e.feature ) {
+ case 'MiniBanner':
+ case 'UpgradeToYearlyForm':
+ return new WMDESizeIssueEvent( `submit-${e.userChoice}`, createViewportInfo(), 1 );
+ default:
+ return new WMDESizeIssueEvent( `submit`, createViewportInfo(), 1 );
+ }
+ } ],
+ [ BannerSubmitOnReturnEvent.EVENT_NAME,
+ ( e: BannerSubmitOnReturnEvent ): WMDELegacyBannerEvent => new WMDELegacyBannerEvent( e.eventName + ( e.userChoice !== '' ? `-${e.userChoice}` : '' ), 1 ) ]
+] );
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/form_items.ts b/banners/mobile/C24_WMDE_Mobile_DE_09/form_items.ts
new file mode 100644
index 000000000..53c204d06
--- /dev/null
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/form_items.ts
@@ -0,0 +1,23 @@
+import FormItemsBuilder from '@src/utils/FormItemsBuilder/FormItemsBuilder';
+import { Translator } from '@src/Translator';
+import { DonationFormItems } from '@src/utils/FormItemsBuilder/DonationFormItems';
+import { Intervals } from '@src/utils/FormItemsBuilder/fields/Intervals';
+import { PaymentMethods } from '@src/utils/FormItemsBuilder/fields/PaymentMethods';
+import { NumberFormatter } from '@src/utils/DynamicContent/formatters/NumberFormatter';
+
+export function createFormItems( translations: Translator, amountFormatter: NumberFormatter ): DonationFormItems {
+ return new FormItemsBuilder( translations, amountFormatter )
+ .setIntervals(
+ Intervals.ONCE,
+ Intervals.MONTHLY,
+ Intervals.YEARLY
+ )
+ .setAmounts( 10, 15, 25, 50, 100 )
+ .setPaymentMethods(
+ PaymentMethods.PAYPAL,
+ PaymentMethods.DIRECT_DEBIT,
+ PaymentMethods.BANK_TRANSFER,
+ PaymentMethods.CREDIT_CARD,
+ PaymentMethods.SOFORT
+ ).getItems();
+}
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/messages.ts b/banners/mobile/C24_WMDE_Mobile_DE_09/messages.ts
new file mode 100644
index 000000000..930f9b38f
--- /dev/null
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/messages.ts
@@ -0,0 +1,30 @@
+import DynamicCampaignTextDe from '@src/utils/DynamicContent/messages/DynamicCampaignText.de';
+import { TranslationMessages } from '@src/Translator';
+import UpgradeToYearlyDe from '@src/components/DonationForm/Forms/messages/UpgradeToYearly.de';
+import FooterDe from '@src/components/Footer/messages/Footer.de';
+import MainDonationFormDe from '@src/components/DonationForm/Forms/messages/MainDonationForm.de';
+import SoftCloseDe from '@src/components/SoftClose/messages/SoftClose.de';
+
+const messages: TranslationMessages = {
+ ...DynamicCampaignTextDe,
+ ...FooterDe,
+ ...MainDonationFormDe,
+ ...UpgradeToYearlyDe,
+ ...SoftCloseDe,
+
+ // custom messages here
+ 'use-of-funds-link': 'Was Ihre Spende bewirkt',
+ 'payment-bank-transfer': 'Überweisung',
+ 'payment-sofort': 'Sofort',
+ 'upgrade-to-yearly-copy': '
Jedes Jahr sind wir auf Menschen wie Sie angewiesen. Jährliche Spenden helfen uns' +
+ ' besonders und ermöglichen langfristige Weiterentwicklungen.
' +
+ '
Sie gehen kein Risiko ein: Jederzeit formlos zu sofort kündbar.
- Ist Ihnen Wikipedia 10 € wert?
+ Wikipedia ist unverkäuflich
From ce203d0e76fc9f4cf86c730f15fb8b47ba0e6198 Mon Sep 17 00:00:00 2001
From: Corinna Hillebrand
Date: Fri, 15 Nov 2024 15:08:29 +0100
Subject: [PATCH 3/9] Prepare VAR for C24_WMDE_Mobile_DE_09
- copy ctrl files
---
.../C24_WMDE_Mobile_DE_09/banner_var.ts | 4 +-
.../components/BannerVar.vue | 2 +-
.../content/BannerSlides_var.vue | 75 +++++++++++++++++++
.../C24_WMDE_Mobile_DE_09/event_map_var.ts | 33 ++++++++
.../styles/styles_var.scss | 29 +++++++
5 files changed, 140 insertions(+), 3 deletions(-)
create mode 100644 banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerSlides_var.vue
create mode 100644 banners/mobile/C24_WMDE_Mobile_DE_09/event_map_var.ts
create mode 100644 banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles_var.scss
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_09/banner_var.ts
index 30a5573d2..257e96848 100644
--- a/banners/mobile/C24_WMDE_Mobile_DE_09/banner_var.ts
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/banner_var.ts
@@ -1,6 +1,6 @@
import { createVueApp } from '@src/createVueApp';
-import './styles/styles.scss';
+import './styles/styles_var.scss';
import BannerConductor from '@src/components/BannerConductor/BannerConductor.vue';
import Banner from './components/BannerVar.vue';
@@ -16,7 +16,7 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin';
import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
-import eventMappings from './event_map';
+import eventMappings from './event_map_var';
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';
import { createFormItems } from './form_items';
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.vue b/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.vue
index 4814078c1..d81bcffb1 100644
--- a/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.vue
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.vue
@@ -113,7 +113,7 @@ import { PageScroller } from '@src/utils/PageScroller/PageScroller';
import MainDonationForm from '@src/components/DonationForm/Forms/MainDonationForm.vue';
import MultiStepDonation from '@src/components/DonationForm/MultiStepDonation.vue';
import BannerText from '../content/BannerText.vue';
-import BannerSlides from '../content/BannerSlides.vue';
+import BannerSlides from '../content/BannerSlides_var.vue';
import BannerFooter from '@src/components/Footer/BannerFooter.vue';
import KeenSlider from '@src/components/Slider/KeenSlider.vue';
import { Tracker } from '@src/tracking/Tracker';
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerSlides_var.vue b/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerSlides_var.vue
new file mode 100644
index 000000000..48524e525
--- /dev/null
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerSlides_var.vue
@@ -0,0 +1,75 @@
+
+
+
+
Unser Spendenziel: {{ goalDonationSum }} Millionen €
+
+
+
+
+
Hi,
+
+ vielleicht kommen wir gerade ungelegen, aber dennoch: Klicken Sie jetzt bitte nicht weg! Am
+ heutigen {{ currentDayName }}, den {{ liveDateAndTime.currentDate }}, um {{ liveDateAndTime.currentTime }} bitten wir Sie,
+ die Unabhängigkeit von Wikipedia zu unterstützen.
+
+
+
+
+
+ {{ campaignDaySentence }}
+
+ Die meisten Menschen spenden, weil sie Wikipedia nützlich finden.
+
+
+
+
+
+ Die durchschnittliche Spende beträgt {{ averageDonation }}, doch bereits 10 € helfen uns weiter. Hat Wikipedia
+ Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt?
+
+
+
+
+
+ Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück.
+ Vielen Dank!
+
+
+
+
+
+
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/event_map_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_09/event_map_var.ts
new file mode 100644
index 000000000..d7a00a5dd
--- /dev/null
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/event_map_var.ts
@@ -0,0 +1,33 @@
+import { TrackingEventConverterFactory } from '@src/tracking/LegacyTrackerWPORG';
+import { WMDELegacyBannerEvent } from '@src/tracking/WPORG/WMDELegacyBannerEvent';
+import { MobileMiniBannerExpandedEvent } from '@src/tracking/events/MobileMiniBannerExpandedEvent';
+import { FormStepShownEvent } from '@src/tracking/events/FormStepShownEvent';
+import { mapFormStepShownEvent } from '@src/tracking/LegacyEventTracking/mapFormStepShownEvent';
+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 { BannerSubmitEvent } from '@src/tracking/events/BannerSubmitEvent';
+import { WMDESizeIssueEvent } from '@src/tracking/WPORG/WMDEBannerSizeIssue';
+import { createViewportInfo } from '@src/tracking/LegacyEventTracking/createViewportInfo';
+import { BannerSubmitOnReturnEvent } from '@src/tracking/events/BannerSubmitOnReturnEvent';
+
+export default new Map( [
+ [ CloseEvent.EVENT_NAME, mapCloseEvent ],
+ [ MobileMiniBannerExpandedEvent.EVENT_NAME,
+ ( e: MobileMiniBannerExpandedEvent ): WMDELegacyBannerEvent => new WMDELegacyBannerEvent( e.eventName + ( e.userChoice !== '' ? `-${e.userChoice}` : '' ), 1 ) ],
+ [ FormStepShownEvent.EVENT_NAME, mapFormStepShownEvent ],
+ [ NotShownEvent.EVENT_NAME, mapNotShownEvent ],
+
+ [ BannerSubmitEvent.EVENT_NAME, ( e: BannerSubmitEvent ): WMDESizeIssueEvent => {
+ switch ( e.feature ) {
+ case 'MiniBanner':
+ case 'UpgradeToYearlyForm':
+ return new WMDESizeIssueEvent( `submit-${e.userChoice}`, createViewportInfo(), 1 );
+ default:
+ return new WMDESizeIssueEvent( `submit`, createViewportInfo(), 1 );
+ }
+ } ],
+ [ BannerSubmitOnReturnEvent.EVENT_NAME,
+ ( e: BannerSubmitOnReturnEvent ): WMDELegacyBannerEvent => new WMDELegacyBannerEvent( e.eventName + ( e.userChoice !== '' ? `-${e.userChoice}` : '' ), 1 ) ]
+] );
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles_var.scss b/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles_var.scss
new file mode 100644
index 000000000..cb6632a99
--- /dev/null
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles_var.scss
@@ -0,0 +1,29 @@
+@use 'src/themes/Mikings/swatches/skin_default' with (
+ $upgrade-to-yearly-button-form: true,
+ $progress-bar: true,
+ $soft-close: true,
+ $thank-you-box: true
+);
+@use 'src/components/BannerConductor/banner-transition';
+@use 'src/themes/UseOfFunds/swatches/skin_default' as uof-default;
+@use 'src/themes/UseOfFunds/UseOfFunds';
+@use 'src/themes/Mikings/defaults';
+@use './Banner';
+@use './MiniBanner' with (
+ $height: 288px
+);
+@use './FullPageBanner';
+@use 'src/themes/Mikings/Footer/Footer';
+@use 'src/themes/Mikings/ThankYouBox/ThankYouBox';
+@use 'src/themes/Mikings/Footer/SelectionInput';
+@use 'src/themes/Mikings/DonationForm/MultiStepDonation';
+@use 'src/themes/Mikings/DonationForm/Forms/UpgradeToYearlyButtonForm';
+@use 'src/themes/Mikings/DonationForm/SubComponents/SelectGroup';
+@use 'src/themes/Mikings/DonationForm/SubComponents/SelectCustomAmount';
+@use 'src/themes/Mikings/DonationForm/SubComponents/SmsBox';
+@use 'src/themes/Mikings/Slider/Slider' with (
+ $pagination-padding: 10px,
+ $pagination-height: 40px
+);
+@use 'src/themes/Mikings/SoftClose/SoftClose';
+@use 'src/themes/Mikings/ProgressBar/ProgressBar';
From bdb72450f6a5b36be60c27ee5c20fea1dd9b4d62 Mon Sep 17 00:00:00 2001
From: Corinna Hillebrand
Date: Fri, 15 Nov 2024 15:34:04 +0100
Subject: [PATCH 4/9] Implement VAR for C24_WMDE_Mobile_DE_09
- var uses 10 reasons popup
- tracks shown, cta-click and accordion item clicks
- make minibanners the same size
- remove old MinimisedTracker (leftover)
- add tests for tracking
https://phabricator.wikimedia.org/T379953
---
.../C24_WMDE_Mobile_DE_09/MinimisedTracker.ts | 27 ---
.../C24_WMDE_Mobile_DE_09/banner_var.ts | 2 +-
.../components/BannerVar.vue | 51 +++++-
.../components/MiniBannerVar.vue | 37 ----
.../content/BannerSlides_var.vue | 21 +++
.../content/BannerText_var.vue | 61 +++++++
.../C24_WMDE_Mobile_DE_09/event_map_var.ts | 11 +-
.../C24_WMDE_Mobile_DE_09/messages_var.ts | 32 ++++
.../styles/MiniBanner_var.scss | 161 ++++++++++++++++++
.../C24_WMDE_Mobile_DE_09/styles/styles.scss | 2 +-
.../styles/styles_var.scss | 6 +-
.../ReasonsToDonate/ReasonsToDonate.vue | 8 +-
.../messages/ReasonsToDonate.de.ts | 20 +--
.../styles/ReasonsToDonate.scss | 2 +-
.../events/ReasonsToDonateCTAClickedEvent.ts | 4 -
.../events/ReasonsToDonateItemClickedEvent.ts | 3 +-
.../events/ReasonsToDonateShownEvent.ts | 4 -
.../components/BannerVar.spec.ts | 30 +++-
.../ReasonsToDonate/ReasonsToDonate.spec.ts | 4 +-
test/features/ReasonsToDonate.ts | 58 +++++++
20 files changed, 439 insertions(+), 105 deletions(-)
delete mode 100644 banners/mobile/C24_WMDE_Mobile_DE_09/MinimisedTracker.ts
delete mode 100644 banners/mobile/C24_WMDE_Mobile_DE_09/components/MiniBannerVar.vue
create mode 100644 banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerText_var.vue
create mode 100644 banners/mobile/C24_WMDE_Mobile_DE_09/messages_var.ts
create mode 100644 banners/mobile/C24_WMDE_Mobile_DE_09/styles/MiniBanner_var.scss
create mode 100644 test/features/ReasonsToDonate.ts
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/MinimisedTracker.ts b/banners/mobile/C24_WMDE_Mobile_DE_09/MinimisedTracker.ts
deleted file mode 100644
index 2e207100e..000000000
--- a/banners/mobile/C24_WMDE_Mobile_DE_09/MinimisedTracker.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import hasLocalStorage from '@src/utils/hasLocalStorage';
-
-/**
- * This feature is to track the minimised state and load the banner
- * minimised on page change. It was removed from the ticket, but
- * I'm leaving it here in case it gets re-added while I'm away.
- */
-export interface MinimisedTracker {
- setMinimised( minimised: boolean ): void;
- isMinimised(): boolean;
-}
-
-export class LocalStorageMinimisedTracker implements MinimisedTracker {
- public setMinimised( minimised: boolean ): void {
- if ( !hasLocalStorage() ) {
- return;
- }
- window.localStorage.setItem( 'fundraising.minimised', minimised ? 'true' : 'false' );
- }
-
- public isMinimised(): boolean {
- if ( !hasLocalStorage() ) {
- return false;
- }
- return window.localStorage.getItem( 'fundraising.minimised' ) === 'true';
- }
-}
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_09/banner_var.ts
index 257e96848..37b018974 100644
--- a/banners/mobile/C24_WMDE_Mobile_DE_09/banner_var.ts
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/banner_var.ts
@@ -17,7 +17,7 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map_var';
-import messages from './messages';
+import messages from './messages_var';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.vue b/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.vue
index d81bcffb1..a93181a2a 100644
--- a/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.vue
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.vue
@@ -9,7 +9,11 @@
-
+
@@ -21,7 +25,10 @@
@close="() => onClose( 'FullPageBanner', CloseChoices.Hide )"
>
-
+
@@ -98,6 +105,13 @@
+
+
@@ -105,14 +119,14 @@
import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates';
import { computed, inject, ref, watch } from 'vue';
import FullPageBanner from './FullPageBanner.vue';
-import MiniBanner from './MiniBannerVar.vue';
+import MiniBanner from './MiniBanner.vue';
import FundsModal from '@src/components/UseOfFunds/FundsModal.vue';
import { UseOfFundsContent as useOfFundsContentInterface } from '@src/domain/UseOfFunds/UseOfFundsContent';
import { UseOfFundsCloseSources } from '@src/components/UseOfFunds/UseOfFundsCloseSources';
import { PageScroller } from '@src/utils/PageScroller/PageScroller';
import MainDonationForm from '@src/components/DonationForm/Forms/MainDonationForm.vue';
import MultiStepDonation from '@src/components/DonationForm/MultiStepDonation.vue';
-import BannerText from '../content/BannerText.vue';
+import BannerText from '../content/BannerText_var.vue';
import BannerSlides from '../content/BannerSlides_var.vue';
import BannerFooter from '@src/components/Footer/BannerFooter.vue';
import KeenSlider from '@src/components/Slider/KeenSlider.vue';
@@ -136,6 +150,10 @@ import ProgressBar from '@src/components/ProgressBar/ProgressBar.vue';
import { LocalCloseTracker } from '@src/utils/LocalCloseTracker';
import { BannerSubmitOnReturnEvent } from '@src/tracking/events/BannerSubmitOnReturnEvent';
import SoftClose from '@src/components/SoftClose/SoftClose.vue';
+import ReasonsToDonate from '@src/components/ReasonsToDonate/ReasonsToDonate.vue';
+import { ReasonsToDonateCTAClickedEvent } from '@src/tracking/events/ReasonsToDonateCTAClickedEvent';
+import { ReasonsToDonateShownEvent } from '@src/tracking/events/ReasonsToDonateShownEvent';
+import { ReasonsToDonateItemClickedEvent } from '@src/tracking/events/ReasonsToDonateItemClickedEvent';
enum ContentStates {
Mini = 'wmde-banner-wrapper--mini',
@@ -157,11 +175,12 @@ interface Props {
}
const props = defineProps();
-const emit = defineEmits( [ 'bannerClosed', 'bannerContentChanged' ] );
+const emit = defineEmits( [ 'bannerClosed', 'bannerContentChanged', 'reasonsToDonate' ] );
const tracker = inject( 'tracker' );
const isFundsModalVisible = ref( false );
+const isReasonsToDonateVisible = ref( false );
const slideShowStopped = ref( false );
const slideshowShouldPlay = computed( () => props.bannerState === BannerStates.Visible && !slideShowStopped.value );
const contentState = ref( ContentStates.Mini );
@@ -221,4 +240,26 @@ const onHideFundsModal = ( payload: { source: UseOfFundsCloseSources } ): void =
isFundsModalVisible.value = false;
};
+const onShowReasonsToDonate = (): void => {
+ isReasonsToDonateVisible.value = true;
+ tracker.trackEvent( new ReasonsToDonateShownEvent() );
+};
+
+const onReasonsToDonateAccordionItemClicked = ( payload: { itemNumber: string } ): void => {
+ tracker.trackEvent( new ReasonsToDonateItemClickedEvent( payload.itemNumber ) );
+};
+
+const onReasonsToDonateCallToActionClicked = (): void => {
+ tracker.trackEvent( new ReasonsToDonateCTAClickedEvent() );
+
+ slideShowStopped.value = true;
+ contentState.value = ContentStates.FullPage;
+
+ props.pageScroller.scrollIntoView( '.wmde-banner-form' );
+ isReasonsToDonateVisible.value = false;
+};
+const onHideReasonsToDonate = (): void => {
+ isReasonsToDonateVisible.value = false;
+};
+
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/components/MiniBannerVar.vue b/banners/mobile/C24_WMDE_Mobile_DE_09/components/MiniBannerVar.vue
deleted file mode 100644
index 7ab1e5afd..000000000
--- a/banners/mobile/C24_WMDE_Mobile_DE_09/components/MiniBannerVar.vue
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück.
+ Falls Sie zögern,
+
+ hier sind 10 gute Gründe
+
+ für eine Spende.
Vielen Dank!
+ vielleicht kommen wir gerade ungelegen, aber dennoch: Klicken Sie jetzt bitte nicht weg! Am heutigen
+ {{ currentDayName }}, den {{ liveDateAndTime.currentDate }}, um {{ liveDateAndTime.currentTime }}
+ bitten wir Sie, die Unabhängigkeit von Wikipedia zu unterstützen. {{ campaignDaySentence }}
+ Die meisten Menschen spenden, weil sie Wikipedia
+ nützlich finden. Die durchschnittliche Spende beträgt {{ averageDonation }}, doch bereits 10 € helfen uns
+ weiter. Hat Wikipedia Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt? Dann entscheiden
+ Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück.
+ Falls Sie zögern,
+
+ hier sind 10 gute Gründe
+
+ für eine Spende.
+ Vielen Dank!
+
Jedes Jahr sind wir auf Menschen wie Sie angewiesen. Jährliche Spenden helfen uns' +
+ ' besonders und ermöglichen langfristige Weiterentwicklungen.
' +
+ '
Sie gehen kein Risiko ein: Jederzeit formlos zu sofort kündbar.
',
+ 'upgrade-to-yearly-no': 'Nein, ich spende einmalig {{amount}}',
+ 'upgrade-to-yearly-yes': 'Ja, ich spende {{amount}} jährlich',
+ 'campaign-day-only-n-days': 'Heute sind es nur noch {{days}} Tage bis zum Ende unserer Spendenkampagne.',
+ 'soft-close-prompt': 'Wikipedia später unterstützen?',
+ 'soft-close-button-already-donated': 'Habe schon gespendet',
+ 'amount-total': ''
+};
+
+export default messages;
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/styles/MiniBanner_var.scss b/banners/mobile/C24_WMDE_Mobile_DE_09/styles/MiniBanner_var.scss
new file mode 100644
index 000000000..aafadbf3c
--- /dev/null
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/styles/MiniBanner_var.scss
@@ -0,0 +1,161 @@
+@use '@src/themes/Mikings/variables/globals';
+
+$height: 288px !default;
+
+.wmde-banner {
+ &-mini {
+ display: flex;
+ flex-direction: column;
+ min-height: $height;
+ padding: 16px 0;
+ position: relative;
+ border: 2px solid var( --mini-border );
+ background: var( --mini-background );
+
+ &-close {
+ position: absolute;
+ height: 36px;
+ width: 36px;
+ top: 11px;
+ right: 16px;
+ text-align: center;
+ background: var( --mini-close-background );
+ padding: 10px;
+ z-index: 2;
+
+ &-button {
+ border: none;
+ margin-top: auto;
+ float: right;
+ height: 16px;
+ line-height: 16px;
+ width: 16px;
+ background: var( --mini-close-background );
+ z-index: 2;
+
+ svg {
+ height: 16px;
+ width: 16px;
+ }
+
+ &:hover {
+ cursor: pointer;
+ }
+ }
+ }
+
+ &-headline {
+ height: 25px;
+ text-align: center;
+ margin: 0 16px 16px;
+
+ &-background {
+ position: relative;
+ text-align: left;
+
+ @media ( min-width: 400px ) {
+ text-align: center;
+ }
+
+ /* single line above container */
+ &::before {
+ content: '';
+ display: block;
+ background: var( --mini-headline-line );
+ width: 100%;
+ height: 1px;
+ position: absolute;
+ top: 50%;
+ z-index: 1;
+ }
+ }
+
+ &-content {
+ position: relative;
+ display: inline-block;
+ font-weight: bold;
+ font-size: 14px;
+ line-height: 25px;
+ color: var( --mini-headline-color );
+ background: var( --mini-headline-background );
+ padding: 0 5px;
+ z-index: 2;
+ white-space: nowrap;
+
+ @media ( min-width: 330px ) {
+ font-size: 16px;
+ }
+
+ @media ( min-width: 360px ) {
+ font-size: 18px;
+ }
+ }
+ }
+
+ &-slideshow {
+ display: flex;
+ flex-direction: column;
+ flex: 1 1 auto;
+ }
+
+ &-button-group {
+ display: flex;
+ justify-content: center;
+ }
+
+ &-button,
+ &-button-preselect {
+ width: 50%;
+ height: 40px;
+ border: none;
+ border-radius: 20px;
+ font-weight: bold;
+ color: var( --mini-button-color );
+ margin: 0 16px;
+ font-size: 14px;
+ white-space: nowrap;
+
+ @media ( min-width: 370px ) {
+ font-size: 16px;
+ }
+ }
+
+ &-button {
+ background: var( --mini-button-background );
+
+ &:hover,
+ &:focus {
+ background: var( --mini-button-background-hover );
+ }
+ }
+
+ &-button-preselect {
+ background: var( --mini-button-alt-background );
+
+ &:hover,
+ &:focus {
+ background: var( --mini-button-alt-background-hover );
+ }
+ }
+
+ .smallprint-mini {
+ text-align: center;
+ font-size: 11px;
+ margin-top: 12px;
+ margin-bottom: -5px;
+
+ a {
+ color: var( --mini-smallprint-color );
+
+ &:hover,
+ &:focus {
+ text-decoration: underline;
+ }
+ }
+ }
+
+ .wmde-banner-slide-reasons-to-donate-sentence {
+ margin-bottom: 0;
+ }
+ }
+}
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles.scss b/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles.scss
index cb6632a99..f6b7092a4 100644
--- a/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles.scss
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles.scss
@@ -10,7 +10,7 @@
@use 'src/themes/Mikings/defaults';
@use './Banner';
@use './MiniBanner' with (
- $height: 288px
+ $height: 306px
);
@use './FullPageBanner';
@use 'src/themes/Mikings/Footer/Footer';
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles_var.scss b/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles_var.scss
index cb6632a99..d68714006 100644
--- a/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles_var.scss
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/styles/styles_var.scss
@@ -9,8 +9,8 @@
@use 'src/themes/UseOfFunds/UseOfFunds';
@use 'src/themes/Mikings/defaults';
@use './Banner';
-@use './MiniBanner' with (
- $height: 288px
+@use './MiniBanner_var' with (
+ $height: 306px
);
@use './FullPageBanner';
@use 'src/themes/Mikings/Footer/Footer';
@@ -27,3 +27,5 @@
);
@use 'src/themes/Mikings/SoftClose/SoftClose';
@use 'src/themes/Mikings/ProgressBar/ProgressBar';
+@use 'src/components/ReasonsToDonate/styles/swatches/skin_default' as reasons-default;
+@use 'src/components/ReasonsToDonate/styles/ReasonsToDonate';
diff --git a/src/components/ReasonsToDonate/ReasonsToDonate.vue b/src/components/ReasonsToDonate/ReasonsToDonate.vue
index 37827dbc7..9994eb9fb 100644
--- a/src/components/ReasonsToDonate/ReasonsToDonate.vue
+++ b/src/components/ReasonsToDonate/ReasonsToDonate.vue
@@ -14,7 +14,7 @@
class="wmde-banner-10-reasons-accordion-title"
tabindex="0"
:class="$translate( `reasons-${index}-class` )"
- @click="$emit( 'accordionItemClicked', index.toString() )"
+ @click="$emit( 'accordionItemClicked', { itemNumber: index.toString() } )"
>
{{ index }}.{{ $translate( `reasons-${index}-title` ) }}
@@ -41,7 +41,7 @@
diff --git a/src/components/ReasonsToDonate/messages/ReasonsToDonate.de.ts b/src/components/ReasonsToDonate/messages/ReasonsToDonate.de.ts
index 174211cda..fa85511dd 100644
--- a/src/components/ReasonsToDonate/messages/ReasonsToDonate.de.ts
+++ b/src/components/ReasonsToDonate/messages/ReasonsToDonate.de.ts
@@ -3,7 +3,7 @@ import { TranslationMessages } from '@src/Translator';
const translations: TranslationMessages = {
'reasons-title': '10 Gründe, warum Sie für Wikipedia spenden sollten:',
- 'reasons-1-title': 'Etwas zurückgeben.',
+ 'reasons-1-title': 'Etwas zurückgeben',
'reasons-1-content': 'Das kostenlose Wissen in Wikipedia hilft Ihnen regelmäßig weiter? Mit einer Spende geben Sie' +
' etwas zurück – und helfen uns damit sehr wirkungsvoll. Denn wir haben Kosten wie jede andere Top-Website der Welt.',
'reasons-1-class': 'reasons-giving-back',
@@ -13,49 +13,49 @@ const translations: TranslationMessages = {
' Denn dieses gigantische Wissensprojekt entsteht nur dank dieser unermüdlichen, ehrenamtlichen Arbeit.',
'reasons-2-class': 'reasons-giving-back',
- 'reasons-3-title': 'In (Ihr) Wissen investieren.',
+ 'reasons-3-title': 'In (Ihr) Wissen investieren',
'reasons-3-content': 'Ihre Spende stellt sicher, dass Wikipedia auch in Zukunft wachsen und gedeihen kann. Und Sie damit' +
' weiterhin 24/7 auf kostenloses und fundiertes Wissen zugreifen können.',
'reasons-3-class': 'reasons-giving-back',
- 'reasons-4-title': 'Unabhängigkeit sichern.',
+ 'reasons-4-title': 'Unabhängigkeit sichern',
'reasons-4-content': 'Wikipedia ist und bleibt unverkäuflich! Sie wird niemals Konzernen, Milliardären oder Regierungen' +
' gehören. Ihre Spende sichert die finanzielle Unabhängigkeit der Wikipedia. So bleiben ihre Inhalte neutral und vertrauenswürdig. ',
'reasons-4-class': 'reasons-knowledge',
- 'reasons-5-title': 'Freien Zugang zu Wissen ermöglichen.',
+ 'reasons-5-title': 'Freien Zugang zu Wissen ermöglichen',
'reasons-5-content': 'Ihre Spende ermöglicht allen Menschen weltweit kostenfreien Zugang zu zuverlässigem, vertrauenswürdigem' +
' Wissen – unabhängig von Geld, Status und Herkunft.',
'reasons-5-class': 'reasons-knowledge',
- 'reasons-6-title': 'Den Fels in der Brandung stärken.',
+ 'reasons-6-title': 'Den Fels in der Brandung stärken',
'reasons-6-content': 'Fake News, Manipulation, Desinformation und Zensur verbreiten sich rasant. Ihre Spende ermöglicht unsere' +
' Arbeit an technischen Lösungen zur Verbesserung der “Abwehrkräfte”, damit Wikipedia auch in Zukunft mit neutralem und gesichertem Wissen Orientierung gibt.',
'reasons-6-class': 'reasons-knowledge',
- 'reasons-7-title': 'Wissen bewahren.',
+ 'reasons-7-title': 'Wissen bewahren',
'reasons-7-content': 'Wikipedia & Co. sichern Wissen in Form von Text, Bildern, Filmen und Daten im digitalen Raum. Ihre Spende' +
' trägt dazu bei, dass dieses kulturelle Erbe auch in Zukunft erhalten und für alle zugänglich ist.',
'reasons-7-class': 'reasons-knowledge',
- 'reasons-8-title': 'Die Freiwilligen unterstützen.',
+ 'reasons-8-title': 'Die Freiwilligen unterstützen',
'reasons-8-content': 'Wir fördern die unermüdliche Arbeit der Freiwilligen für Wikipedia mit vielen Projekten und Aktivitäten. Ihre' +
' Spende hilft uns, diese Arbeit bestmöglich zu unterstützen, damit sich Wikipedia weiterentwickelt.',
'reasons-8-class': 'reasons-technical',
- 'reasons-9-title': 'Das technische Fundament finanzieren.',
+ 'reasons-9-title': 'Das technische Fundament finanzieren',
'reasons-9-content': 'Der technische Betrieb der Wikimedia-Projekte verursacht hohe laufende Kosten. Ihre Spende hilft' +
' sicherzustellen, dass Wikipedia überall, jederzeit und schnell erreichbar ist sowie die höchsten Sicherheitsstandards erfüllt.',
'reasons-9-class': 'reasons-technical',
- 'reasons-10-title': 'Technische Innovationen ermöglichen.',
+ 'reasons-10-title': 'Technische Innovationen ermöglichen',
'reasons-10-content': 'Ihre Spende ermöglicht technische Verbesserungen, damit die Nutzung von Wikipedia noch einfacher und' +
' vielfältiger wird. Zudem erleichtern wir durch ständige Optimierung der Software, dass die Freiwilligen die besten Bedingungen für ihre Arbeit vorfinden.',
'reasons-10-class': 'reasons-technical',
'reasons-final-content': 'Überzeugt? Ganz gleich, ob Sie „Ihre“ Wikipedia unterstützen, die wichtige Rolle der' +
' Wikipedia für die ganze Gesellschaft stärken oder einfach nur Danke sagen wollen –',
- 'reasons-final-content-highlighted': 'Ihre Spende, ganz gleich, ob 5 € oder 50 €, ist immer ein wichtiger Beitrag.',
+ 'reasons-final-content-highlighted': 'Jede Spende, ob 5 € oder 50 €, ist immer ein wichtiger Beitrag.',
'reasons-cta': 'Jetzt spenden'
};
diff --git a/src/components/ReasonsToDonate/styles/ReasonsToDonate.scss b/src/components/ReasonsToDonate/styles/ReasonsToDonate.scss
index 3666a269f..3311d6834 100644
--- a/src/components/ReasonsToDonate/styles/ReasonsToDonate.scss
+++ b/src/components/ReasonsToDonate/styles/ReasonsToDonate.scss
@@ -169,7 +169,7 @@
}
&-accordion-content {
- font-size: 14px;
+ font-size: 16px;
padding: 0 20px 14px 60px;
}
diff --git a/src/tracking/events/ReasonsToDonateCTAClickedEvent.ts b/src/tracking/events/ReasonsToDonateCTAClickedEvent.ts
index e8f904855..5f41421e1 100644
--- a/src/tracking/events/ReasonsToDonateCTAClickedEvent.ts
+++ b/src/tracking/events/ReasonsToDonateCTAClickedEvent.ts
@@ -7,8 +7,4 @@ export class ReasonsToDonateCTAClickedEvent implements TrackingEvent {
public readonly customData: void;
public readonly feature: TrackingFeatureName;
public readonly userChoice: string = '';
-
- public constructor( feature: TrackingFeatureName ) {
- this.feature = feature;
- }
}
diff --git a/src/tracking/events/ReasonsToDonateItemClickedEvent.ts b/src/tracking/events/ReasonsToDonateItemClickedEvent.ts
index efcbcc65d..cd50d8af2 100644
--- a/src/tracking/events/ReasonsToDonateItemClickedEvent.ts
+++ b/src/tracking/events/ReasonsToDonateItemClickedEvent.ts
@@ -8,8 +8,7 @@ export class ReasonsToDonateItemClickedEvent implements TrackingEvent {
public readonly feature: TrackingFeatureName;
public readonly userChoice: string;
- public constructor( feature: TrackingFeatureName, userChoice: string ) {
- this.feature = feature;
+ public constructor( userChoice: string ) {
this.userChoice = userChoice;
}
}
diff --git a/src/tracking/events/ReasonsToDonateShownEvent.ts b/src/tracking/events/ReasonsToDonateShownEvent.ts
index 0e571f519..71e66a662 100644
--- a/src/tracking/events/ReasonsToDonateShownEvent.ts
+++ b/src/tracking/events/ReasonsToDonateShownEvent.ts
@@ -7,8 +7,4 @@ export class ReasonsToDonateShownEvent implements TrackingEvent {
public readonly customData: void;
public readonly feature: TrackingFeatureName;
public readonly userChoice: string = '';
-
- public constructor( feature: TrackingFeatureName ) {
- this.feature = feature;
- }
}
diff --git a/test/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.spec.ts b/test/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.spec.ts
index 756e6bbda..ec83a0e5a 100644
--- a/test/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.spec.ts
+++ b/test/banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.spec.ts
@@ -1,4 +1,4 @@
-import { afterEach, beforeEach, describe, test, vi } from 'vitest';
+import { afterEach, beforeEach, describe, Mock, test, vi } from 'vitest';
import { mount, VueWrapper } from '@vue/test-utils';
import Banner from '@banners/mobile/C24_WMDE_Mobile_DE_09/components/BannerVar.vue';
import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates';
@@ -21,12 +21,15 @@ import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures } f
import { softCloseSubmitTrackingFeatures } from '@test/features/SoftCloseSubmitTracking';
import { Timer } from '@src/utils/Timer';
import { TimerStub } from '@test/fixtures/TimerStub';
+import { useReasonsToDonateFeatures, useReasonsToDonateScrollFeatures } from '@test/features/ReasonsToDonate';
let pageScroller: PageScroller;
let tracker: Tracker;
const formModel = useFormModel();
const translator = ( key: string ): string => key;
describe( 'BannerVar.vue', () => {
+ let showCallback: Mock;
+ let closeCallback: Mock;
let wrapper: VueWrapper;
beforeEach( () => {
@@ -40,6 +43,12 @@ describe( 'BannerVar.vue', () => {
tracker = {
trackEvent: vi.fn()
};
+
+ // for the reasonsToDonate feature
+ showCallback = vi.fn();
+ closeCallback = vi.fn();
+ HTMLDialogElement.prototype.showModal = showCallback;
+ HTMLDialogElement.prototype.close = closeCallback;
} );
afterEach( () => {
@@ -71,7 +80,7 @@ describe( 'BannerVar.vue', () => {
formActions: { donateWithAddressAction: 'https://example.com/with-address', donateAnonymouslyAction: 'https://example.com/without-address' },
currencyFormatter: new CurrencyEn(),
formItems,
- tracker,
+ tracker: tracker,
timer: timer ?? new TimerStub()
}
}
@@ -160,6 +169,23 @@ describe( 'BannerVar.vue', () => {
} );
} );
+ describe( 'Reasons to Donate', () => {
+ test.each( [
+ [ 'expectContainsReasonsToDonateDialogue' ],
+ [ 'expectTracksReasonsToDonateShownEvent' ],
+ [ 'expectTracksReasonsToDonateCTAClickedEvent' ],
+ [ 'expectTracksReasonsToDonateItemClickedEvent' ]
+ ] )( '%s', async ( testName: string ) => {
+ await useReasonsToDonateFeatures[ testName ]( getWrapper(), tracker );
+ } );
+
+ test.each( [
+ [ 'expectScrollsToFormWhenCallToActionIsClicked' ]
+ ] )( '%s', async ( testName: string ) => {
+ await useReasonsToDonateScrollFeatures[ testName ]( getWrapper(), pageScroller );
+ } );
+ } );
+
describe( 'Mini Banner', () => {
test.each( [
[ 'expectSlideShowPlaysWhenMiniBannerBecomesVisible' ],
diff --git a/test/components/ReasonsToDonate/ReasonsToDonate.spec.ts b/test/components/ReasonsToDonate/ReasonsToDonate.spec.ts
index eb5df1a92..bc16e841c 100644
--- a/test/components/ReasonsToDonate/ReasonsToDonate.spec.ts
+++ b/test/components/ReasonsToDonate/ReasonsToDonate.spec.ts
@@ -59,8 +59,8 @@ describe( 'ReasonsToDonate.vue', () => {
await wrapper.find( '.wmde-banner-10-reasons-accordion-item:nth-child(8) .wmde-banner-10-reasons-accordion-title' ).trigger( 'click' );
expect( wrapper.emitted( 'accordionItemClicked' ).length ).toStrictEqual( 2 );
- expect( wrapper.emitted( 'accordionItemClicked' )[ 0 ][ 0 ] ).toStrictEqual( '1' );
- expect( wrapper.emitted( 'accordionItemClicked' )[ 1 ][ 0 ] ).toStrictEqual( '8' );
+ expect( wrapper.emitted( 'accordionItemClicked' )[ 0 ][ 0 ] ).toStrictEqual( { itemNumber: '1' } );
+ expect( wrapper.emitted( 'accordionItemClicked' )[ 1 ][ 0 ] ).toStrictEqual( { itemNumber: '8' } );
await wrapper.find( '.wmde-banner-10-reasons-cta button' ).trigger( 'click' );
expect( wrapper.emitted( 'callToActionClicked' ).length ).toStrictEqual( 1 );
diff --git a/test/features/ReasonsToDonate.ts b/test/features/ReasonsToDonate.ts
new file mode 100644
index 000000000..ca9593977
--- /dev/null
+++ b/test/features/ReasonsToDonate.ts
@@ -0,0 +1,58 @@
+import { VueWrapper } from '@vue/test-utils';
+import { expect } from 'vitest';
+import { PageScroller } from '@src/utils/PageScroller/PageScroller';
+import { Tracker } from '@src/tracking/Tracker';
+import { ReasonsToDonateShownEvent } from '@src/tracking/events/ReasonsToDonateShownEvent';
+import { ReasonsToDonateCTAClickedEvent } from '@src/tracking/events/ReasonsToDonateCTAClickedEvent';
+import { ReasonsToDonateItemClickedEvent } from '@src/tracking/events/ReasonsToDonateItemClickedEvent';
+import ReasonsToDonate from '@src/components/ReasonsToDonate/ReasonsToDonate.vue';
+
+const expectContainsReasonsToDonateDialogue = async ( wrapper: VueWrapper ): Promise => {
+ expect( wrapper.findComponent( ReasonsToDonate ).exists() ).toBeTruthy();
+};
+
+const expectScrollsToFormWhenCallToActionIsClicked = async ( wrapper: VueWrapper, pageScroller: PageScroller ): Promise => {
+ await wrapper.find( '.wmde-banner-reasons-to-donate-link' ).trigger( 'click' );
+ await wrapper.find( '.wmde-banner-10-reasons-cta button' ).trigger( 'click' );
+
+ expect( pageScroller.scrollIntoView ).toHaveBeenCalledOnce();
+ expect( pageScroller.scrollIntoView ).toHaveBeenCalledWith( '.wmde-banner-form' );
+};
+
+const expectTracksReasonsToDonateShownEvent = async ( wrapper: VueWrapper, tracker: Tracker ): Promise => {
+
+ await wrapper.find( '.wmde-banner-reasons-to-donate-link' ).trigger( 'click' );
+
+ expect( tracker.trackEvent ).toHaveBeenCalledOnce();
+ expect( tracker.trackEvent ).toHaveBeenCalledWith( new ReasonsToDonateShownEvent() );
+};
+
+const expectTracksReasonsToDonateCTAClickedEvent = async ( wrapper: VueWrapper, tracker: Tracker ): Promise => {
+ await wrapper.find( '.wmde-banner-reasons-to-donate-link' ).trigger( 'click' );
+
+ await wrapper.find( '.wmde-banner-10-reasons-cta button' ).trigger( 'click' );
+
+ expect( tracker.trackEvent ).toHaveBeenCalledTimes( 2 );
+ expect( tracker.trackEvent ).toBeCalledWith( new ReasonsToDonateCTAClickedEvent() );
+};
+
+const expectTracksReasonsToDonateItemClickedEvent = async ( wrapper: VueWrapper, tracker: Tracker ): Promise => {
+ await wrapper.find( '.wmde-banner-reasons-to-donate-link' ).trigger( 'click' );
+
+ const itemNumber = '5';
+ await wrapper.find( `.wmde-banner-10-reasons-accordion-item:nth-child(${itemNumber}) .wmde-banner-10-reasons-accordion-title` ).trigger( 'click' );
+
+ expect( tracker.trackEvent ).toHaveBeenCalledWith( new ReasonsToDonateItemClickedEvent( itemNumber ) );
+};
+
+export const useReasonsToDonateFeatures: Record, tracker: Tracker ) => Promise> = {
+ expectContainsReasonsToDonateDialogue,
+ expectTracksReasonsToDonateShownEvent,
+ expectTracksReasonsToDonateCTAClickedEvent,
+ expectTracksReasonsToDonateItemClickedEvent
+
+};
+
+export const useReasonsToDonateScrollFeatures: Record, pageScroller: PageScroller ) => Promise> = {
+ expectScrollsToFormWhenCallToActionIsClicked
+};
From fc9d9cdce8c4f323f628b02cb6e736b10b23bb29 Mon Sep 17 00:00:00 2001
From: Abban Dunne
Date: Tue, 19 Nov 2024 15:30:50 +0100
Subject: [PATCH 5/9] Add content button styling to Mikings theme (#626)
This adds some styles so we can use buttons in the
slider and full page content in the mobile de
banners.
Ticket: https://phabricator.wikimedia.org/T379953
---
.../content/BannerSlides_var.vue | 9 ++-------
.../content/BannerText_var.vue | 9 +--------
.../styles/styles_var.scss | 1 +
src/themes/Mikings/Message/Message.scss | 18 ++++++++++++++++++
src/themes/Mikings/Slider/Slider.scss | 15 +++++++++++++++
src/themes/Mikings/swatches/color_light.scss | 2 ++
6 files changed, 39 insertions(+), 15 deletions(-)
create mode 100644 src/themes/Mikings/Message/Message.scss
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerSlides_var.vue b/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerSlides_var.vue
index 6d8f1a4e2..32d01c23f 100644
--- a/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerSlides_var.vue
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerSlides_var.vue
@@ -43,14 +43,9 @@
Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück.
Falls Sie zögern,
-
+
+
für eine Spende.
Vielen Dank!
diff --git a/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerText_var.vue b/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerText_var.vue
index a5956142e..13679edf3 100644
--- a/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerText_var.vue
+++ b/banners/mobile/C24_WMDE_Mobile_DE_09/content/BannerText_var.vue
@@ -13,14 +13,7 @@
weiter. Hat Wikipedia Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt? Dann entscheiden
Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück.
Falls Sie zögern,
-
- hier sind 10 gute Gründe
-
+
für eine Spende.
Vielen Dank!
+ {{ liveDateAndTime.currentDate }}, {{ liveDateAndTime.currentTime }} - An alle, die Wikipedia in
+ Deutschland nutzen
+
+
+ Vielleicht kommen wir gerade ungelegen, aber dennoch: Klicken Sie jetzt bitte nicht weg! Am heutigen
+ {{ currentDayName }}, den {{ currentDate }}, bitten wir Sie, die Unabhängigkeit von Wikipedia zu unterstützen.
+
+
+
+
+ {{campaignDaySentence}}
+
+ Die meisten Menschen spenden, weil sie Wikipedia nützlich finden.
+
+
+
+
+ Die durchschnittliche Spende beträgt {{ averageDonation }}, doch bereits 5 € helfen uns weiter. Hat Wikipedia
+ Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt?
+
+
+
+
+ Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück. Vielen Dank!
+
+ {{ liveDateAndTime.currentDate }}, {{ liveDateAndTime.currentTime }} - An alle, die Wikipedia
+ in Deutschland nutzen
+
+
+ Vielleicht kommen wir gerade ungelegen, aber dennoch: Klicken Sie jetzt bitte nicht weg! Am heutigen
+ {{ currentDayName }}, den {{ currentDate }}, bitten wir Sie, die Unabhängigkeit von Wikipedia zu unterstützen.
+ {{campaignDaySentence}}
+
+ Die meisten Menschen spenden, weil sie Wikipedia nützlich finden.
+ Die durchschnittliche Spende beträgt {{ averageDonation }}, doch bereits 5 € helfen uns weiter.
+ Hat Wikipedia Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt?
+ Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück.
+ Vielen Dank!
+
+ {{ campaignDaySentence }} Millionen Menschen nutzen Wikipedia, aber 99 % spenden nicht – sie
+ übergehen diesen Aufruf. Wenn Wikipedia Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee
+ geschenkt hat, dann geben Sie etwas zurück. Danke!
+
+
+
+
+
+
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/event_map.ts b/banners/desktop/C24_WMDE_Desktop_DE_14/event_map.ts
new file mode 100644
index 000000000..88eb4714e
--- /dev/null
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/event_map.ts
@@ -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( [
+ [ 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 )
+ ]
+] );
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/event_map_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_14/event_map_var.ts
new file mode 100644
index 000000000..c7eb259e7
--- /dev/null
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/event_map_var.ts
@@ -0,0 +1,49 @@
+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';
+import { CoverTransactionFeesEvent } from '@src/tracking/events/CoverTransactionFeesEvent';
+
+export default new Map( [
+ [ 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 )
+ ],
+ [ CoverTransactionFeesEvent.EVENT_NAME, ( e: CoverTransactionFeesEvent ): WMDELegacyBannerEvent => new WMDELegacyBannerEvent( e.userChoice + 'cover-transaction-fee', 1 ) ]
+] );
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/form_items.ts b/banners/desktop/C24_WMDE_Desktop_DE_14/form_items.ts
new file mode 100644
index 000000000..b70650d19
--- /dev/null
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/form_items.ts
@@ -0,0 +1,23 @@
+import FormItemsBuilder from '@src/utils/FormItemsBuilder/FormItemsBuilder';
+import { Translator } from '@src/Translator';
+import { DonationFormItems } from '@src/utils/FormItemsBuilder/DonationFormItems';
+import { Intervals } from '@src/utils/FormItemsBuilder/fields/Intervals';
+import { PaymentMethods } from '@src/utils/FormItemsBuilder/fields/PaymentMethods';
+import { NumberFormatter } from '@src/utils/DynamicContent/formatters/NumberFormatter';
+
+export function createFormItems( translations: Translator, amountFormatter: NumberFormatter ): DonationFormItems {
+ return new FormItemsBuilder( translations, amountFormatter )
+ .setIntervals(
+ Intervals.ONCE,
+ Intervals.MONTHLY,
+ Intervals.QUARTERLY,
+ Intervals.YEARLY
+ )
+ .setAmounts( 5, 10, 20, 25, 50, 100 )
+ .setPaymentMethods(
+ PaymentMethods.PAYPAL,
+ PaymentMethods.BANK_TRANSFER,
+ PaymentMethods.CREDIT_CARD,
+ PaymentMethods.DIRECT_DEBIT
+ ).getItems();
+}
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/messages.ts b/banners/desktop/C24_WMDE_Desktop_DE_14/messages.ts
new file mode 100644
index 000000000..8bb2ea2d4
--- /dev/null
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/messages.ts
@@ -0,0 +1,32 @@
+import CustomAmountFormDe from '@src/components/DonationForm/Forms/messages/CustomAmountForm.de';
+import DynamicCampaignTextDe from '@src/utils/DynamicContent/messages/DynamicCampaignText.de';
+import { TranslationMessages } from '@src/Translator';
+import UpgradeToYearlyDe from '@src/components/DonationForm/Forms/messages/UpgradeToYearly.de';
+import AddressFormDe from '@src/components/DonationForm/Forms/messages/AddressForm.de';
+import FooterDe from '@src/components/Footer/messages/Footer.de';
+import MainDonationFormDe from '@src/components/DonationForm/Forms/messages/MainDonationForm.de';
+import FallbackBanner from '@src/components/FallbackBanner/messages/FallbackBanner.de';
+import AlreadyDonatedModal from '@src/components/AlreadyDonatedModal/translations/AlreadyDonatedModal.de';
+import SoftCloseDe from '@src/components/SoftClose/messages/SoftClose.de';
+
+const messages: TranslationMessages = {
+ ...CustomAmountFormDe,
+ ...DynamicCampaignTextDe,
+ ...UpgradeToYearlyDe,
+ ...AddressFormDe,
+ ...FooterDe,
+ ...MainDonationFormDe,
+ ...AlreadyDonatedModal,
+ ...FallbackBanner,
+ ...SoftCloseDe,
+ 'already-donated-go-away-button': 'Im Moment nicht',
+ 'soft-close-prompt': 'Dürfen wir später nochmal fragen?',
+ 'upgrade-to-yearly-copy': `
Jedes Jahr sind wir auf Menschen wie Sie angewiesen. Jährliche Spenden helfen uns besonders und ermöglichen langfristige Weiterentwicklungen.
+
Sie gehen kein Risiko ein: Jederzeit formlos zu sofort kündbar.
`,
+ 'upgrade-to-yearly-no': 'Nein, ich spende einmalig {{amount}}',
+ 'upgrade-to-yearly-yes': 'Ja, ich spende {{amount}} jährlich',
+ 'campaign-day-only-n-days': 'Heute sind es nur noch {{days}} Tage bis zum Ende unserer Spendenkampagne.',
+ 'custom-amount-placeholder': 'Wahlbetrag'
+};
+
+export default messages;
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/messages_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_14/messages_var.ts
new file mode 100644
index 000000000..b7c246a89
--- /dev/null
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/messages_var.ts
@@ -0,0 +1,33 @@
+import CustomAmountFormDe from '@src/components/DonationForm/Forms/messages/CustomAmountForm.de';
+import DynamicCampaignTextDe from '@src/utils/DynamicContent/messages/DynamicCampaignText.de';
+import { TranslationMessages } from '@src/Translator';
+import UpgradeToYearlyDe from '@src/components/DonationForm/Forms/messages/UpgradeToYearly.de';
+import AddressFormDe from '@src/components/DonationForm/Forms/messages/AddressForm.de';
+import FooterDe from '@src/components/Footer/messages/Footer.de';
+import MainDonationFormDe from '@src/components/DonationForm/Forms/messages/MainDonationForm.de';
+import FallbackBanner from '@src/components/FallbackBanner/messages/FallbackBanner.de';
+import AlreadyDonatedModal from '@src/components/AlreadyDonatedModal/translations/AlreadyDonatedModal.de';
+import SoftCloseDe from '@src/components/SoftClose/messages/SoftClose.de';
+
+const messages: TranslationMessages = {
+ ...CustomAmountFormDe,
+ ...DynamicCampaignTextDe,
+ ...UpgradeToYearlyDe,
+ ...AddressFormDe,
+ ...FooterDe,
+ ...MainDonationFormDe,
+ ...AlreadyDonatedModal,
+ ...FallbackBanner,
+ ...SoftCloseDe,
+ 'already-donated-go-away-button': 'Im Moment nicht',
+ 'soft-close-prompt': 'Dürfen wir später nochmal fragen?',
+ 'upgrade-to-yearly-copy': `
Jedes Jahr sind wir auf Menschen wie Sie angewiesen. Jährliche Spenden helfen uns besonders und ermöglichen langfristige Weiterentwicklungen.
+
Sie gehen kein Risiko ein: Jederzeit formlos zu sofort kündbar.
+ {{ liveDateAndTime.currentDate }}, {{ liveDateAndTime.currentTime }} - An alle, die Wikipedia in
+ Deutschland nutzen
+
+
+ Vielleicht kommen wir gerade ungelegen, aber dennoch: Klicken Sie jetzt bitte nicht weg! Am heutigen
+ {{ currentDayName }}, den {{ currentDate }}, bitten wir Sie, die Unabhängigkeit von Wikipedia zu unterstützen.
+
+
+
+
+ {{campaignDaySentence}}
+
+ Die meisten Menschen spenden, weil sie Wikipedia nützlich finden.
+
+
+
+
+ Die durchschnittliche Spende beträgt {{ averageDonation }}, doch bereits 5 € helfen uns weiter. Hat Wikipedia
+ Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt?
+
+
+
+
+ Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück. Vielen Dank!
+
+ {{ liveDateAndTime.currentDate }}, {{ liveDateAndTime.currentTime }} - An alle, die Wikipedia
+ in Deutschland nutzen
+
+
+ Vielleicht kommen wir gerade ungelegen, aber dennoch: Klicken Sie jetzt bitte nicht weg! Am heutigen
+ {{ currentDayName }}, den {{ currentDate }}, bitten wir Sie, die Unabhängigkeit von Wikipedia zu unterstützen.
+ {{campaignDaySentence}}
+
+ Die meisten Menschen spenden, weil sie Wikipedia nützlich finden.
+ Die durchschnittliche Spende beträgt {{ averageDonation }}, doch bereits 5 € helfen uns weiter.
+ Hat Wikipedia Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt?
+ Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück.
+ Vielen Dank!
+
+
+
+
+
+
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/event_map_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_14/event_map_var.ts
new file mode 100644
index 000000000..88eb4714e
--- /dev/null
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/event_map_var.ts
@@ -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( [
+ [ 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 )
+ ]
+] );
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/messages_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_14/messages_var.ts
new file mode 100644
index 000000000..8bb2ea2d4
--- /dev/null
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/messages_var.ts
@@ -0,0 +1,32 @@
+import CustomAmountFormDe from '@src/components/DonationForm/Forms/messages/CustomAmountForm.de';
+import DynamicCampaignTextDe from '@src/utils/DynamicContent/messages/DynamicCampaignText.de';
+import { TranslationMessages } from '@src/Translator';
+import UpgradeToYearlyDe from '@src/components/DonationForm/Forms/messages/UpgradeToYearly.de';
+import AddressFormDe from '@src/components/DonationForm/Forms/messages/AddressForm.de';
+import FooterDe from '@src/components/Footer/messages/Footer.de';
+import MainDonationFormDe from '@src/components/DonationForm/Forms/messages/MainDonationForm.de';
+import FallbackBanner from '@src/components/FallbackBanner/messages/FallbackBanner.de';
+import AlreadyDonatedModal from '@src/components/AlreadyDonatedModal/translations/AlreadyDonatedModal.de';
+import SoftCloseDe from '@src/components/SoftClose/messages/SoftClose.de';
+
+const messages: TranslationMessages = {
+ ...CustomAmountFormDe,
+ ...DynamicCampaignTextDe,
+ ...UpgradeToYearlyDe,
+ ...AddressFormDe,
+ ...FooterDe,
+ ...MainDonationFormDe,
+ ...AlreadyDonatedModal,
+ ...FallbackBanner,
+ ...SoftCloseDe,
+ 'already-donated-go-away-button': 'Im Moment nicht',
+ 'soft-close-prompt': 'Dürfen wir später nochmal fragen?',
+ 'upgrade-to-yearly-copy': `
Jedes Jahr sind wir auf Menschen wie Sie angewiesen. Jährliche Spenden helfen uns besonders und ermöglichen langfristige Weiterentwicklungen.
+
Sie gehen kein Risiko ein: Jederzeit formlos zu sofort kündbar.
`,
+ 'upgrade-to-yearly-no': 'Nein, ich spende einmalig {{amount}}',
+ 'upgrade-to-yearly-yes': 'Ja, ich spende {{amount}} jährlich',
+ 'campaign-day-only-n-days': 'Heute sind es nur noch {{days}} Tage bis zum Ende unserer Spendenkampagne.',
+ 'custom-amount-placeholder': 'Wahlbetrag'
+};
+
+export default messages;
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/styles/styles_var.scss b/banners/desktop/C24_WMDE_Desktop_DE_14/styles/styles_var.scss
new file mode 100644
index 000000000..ff644c870
--- /dev/null
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/styles/styles_var.scss
@@ -0,0 +1,54 @@
+// This is the file where we import the theme-specific component styles
+@use '../../../../src/themes/Svingle/swatches/skin_default' with (
+ $slider: true,
+ $select-group: true,
+ $upgrade-to-yearly: true,
+ $fallback-banner: 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 'MainBanner' with (
+ $banner-height: 357px,
+ $form-width: 300px
+);
+@use 'src/themes/Svingle/defaults';
+@use 'src/themes/Svingle/ButtonClose/ButtonClose';
+@use 'src/themes/Svingle/ProgressBar/ProgressBar';
+@use 'src/themes/Svingle/DonationForm/DonationForm';
+@use 'src/themes/Svingle/DonationForm/MultiStepDonation';
+@use 'src/themes/Svingle/DonationForm/SubComponents/SelectGroup';
+@use 'src/themes/Svingle/DonationForm/SubComponents/SelectGroupRadios' with (
+ $font-size: 14px
+);
+@use 'src/themes/Svingle/DonationForm/SubComponents/SelectCustomAmountRadio' with (
+ $font-size: 14px
+);
+@use 'src/themes/Svingle/DonationForm/SubComponents/SmsBox';
+@use 'src/themes/Svingle/DonationForm/Forms/MainDonationForm';
+@use 'src/themes/Svingle/DonationForm/Forms/UpgradeToYearlyButtonForm' with (
+ $font-size: 14px
+);
+@use 'src/themes/Svingle/DonationForm/Forms/CustomAmountForm';
+@use 'src/themes/Svingle/Footer/FooterAlreadyDonated';
+@use 'src/themes/Svingle/Footer/SelectionInput';
+@use 'src/themes/Svingle/Message/Message';
+@use 'src/themes/Svingle/SoftClose/SoftClose';
+@use 'src/themes/Svingle/Slider/KeenSlider';
+
+/**
+ * Fallback banner with "Fijitiv" theme
+ * All selectors in Fijitiv theme are prefixed with the ".wmde-banner-fallback" class selector,
+ so they override the "default" styles with the same selector
+ */
+@use 'FallbackBanner';
+@use 'src/themes/Fijitiv/FallbackBanner/FallbackButton';
+@use 'src/themes/Fijitiv/FallbackBanner/LargeFooter';
+@use 'src/themes/Fijitiv/FallbackBanner/SmallFooter';
+@use 'src/themes/Fijitiv/ProgressBar/ProgressBar' as FallbackProgressBar with (
+ $progress-bar-margin: 0 15px
+);
+@use 'src/themes/Fijitiv/Slider/KeenSlider' as FallbackSlider;
From 6a0a29cb29d95ed30450411109b182a6e1bf44b9 Mon Sep 17 00:00:00 2001
From: Sperling-0
Date: Mon, 18 Nov 2024 12:59:35 +0100
Subject: [PATCH 9/9] Implement VAR for C24_WMDE_Desktop_DE_14
- adds additional copy
- displays the "10 good reasons" overlay when the link in the added copy is clicked
- adds styles for the "10 good reasons" button link
Ticket: https://phabricator.wikimedia.org/T379953
---
.../C24_WMDE_Desktop_DE_14/banner_var.ts | 13 ++---
.../components/BannerVar.vue | 52 +++++++++++++++++--
.../content/BannerSlidesVar.vue | 21 ++++++--
.../content/BannerTextVar.vue | 37 +++++++++----
.../C24_WMDE_Desktop_DE_14/event_map_var.ts | 13 +++--
.../C24_WMDE_Desktop_DE_14/messages_var.ts | 2 +
.../styles/styles_var.scss | 2 +
src/themes/Svingle/Message/Message.scss | 16 ++++++
src/themes/Svingle/Slider/KeenSlider.scss | 16 ++++++
src/themes/Svingle/swatches/color_light.scss | 6 +++
.../components/BannerVar.spec.ts | 49 ++++++++++++-----
11 files changed, 187 insertions(+), 40 deletions(-)
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_14/banner_var.ts
index 2be3e1dd8..5e239316f 100644
--- a/banners/desktop/C24_WMDE_Desktop_DE_14/banner_var.ts
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/banner_var.ts
@@ -1,9 +1,9 @@
import { createVueApp } from '@src/createVueApp';
-import './styles/styles.scss';
+import './styles/styles_var.scss';
import BannerConductor from '@src/components/BannerConductor/FallbackBannerConductor.vue';
-import Banner from './components/BannerCtrl.vue';
+import Banner from './components/BannerVar.vue';
import FallbackBanner from './components/FallbackBanner.vue';
import { UrlRuntimeEnvironment } from '@src/utils/RuntimeEnvironment';
import { WindowResizeHandler } from '@src/utils/ResizeHandler';
@@ -16,18 +16,19 @@ 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';
// Locale-specific imports
-import messages from './messages';
+import messages from './messages_var';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';
// Channel specific form setup
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { WindowTimer } from '@src/utils/Timer';
+import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller';
const date = new Date();
const localeFactory = new LocaleFactoryDe();
@@ -46,6 +47,7 @@ const app = createVueApp( BannerConductor, {
},
bannerProps: {
useOfFundsContent: localeFactory.getUseOfFundsLoader().getContent(),
+ pageScroller: new WindowPageScroller(),
remainingImpressions: impressionCount.getRemainingImpressions( page.getMaxBannerImpressions( 'desktop' ) ),
localCloseTracker: new LocalStorageCloseTracker(),
donationLink: createFallbackDonationURL( page.getTracking(), impressionCount )
@@ -63,8 +65,7 @@ app.use( DynamicTextPlugin, {
date,
formatters: localeFactory.getFormatters(),
impressionCount,
- translator,
- urgencyMessageDaysLeft: 45
+ translator
} );
const currencyFormatter = localeFactory.getCurrencyFormatter();
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/components/BannerVar.vue b/banners/desktop/C24_WMDE_Desktop_DE_14/components/BannerVar.vue
index 54ea355f0..3e7c152ad 100644
--- a/banners/desktop/C24_WMDE_Desktop_DE_14/components/BannerVar.vue
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/components/BannerVar.vue
@@ -10,14 +10,21 @@
-
+
-
+
@@ -72,6 +79,13 @@
+
+
@@ -81,8 +95,8 @@ import { inject, ref, watch } from 'vue';
import { UseOfFundsContent as useOfFundsContentInterface } from '@src/domain/UseOfFunds/UseOfFundsContent';
import MainBanner from './MainBanner.vue';
import FundsModal from '@src/components/UseOfFunds/FundsModal.vue';
-import BannerText from '../content/BannerText.vue';
-import BannerSlides from '../content/BannerSlides.vue';
+import BannerText from '../content/BannerTextVar.vue';
+import BannerSlides from '../content/BannerSlidesVar.vue';
import MultiStepDonation from '@src/components/DonationForm/MultiStepDonation.vue';
import MainDonationForm from '@src/components/DonationForm/Forms/MainDonationForm.vue';
import UpgradeToYearlyButtonForm from '@src/components/DonationForm/Forms/UpgradeToYearlyButtonForm.vue';
@@ -106,6 +120,11 @@ import { LocalCloseTracker } from '@src/utils/LocalCloseTracker';
import { BannerSubmitOnReturnEvent } from '@src/tracking/events/BannerSubmitOnReturnEvent';
import { Tracker } from '@src/tracking/Tracker';
import { useBannerHider } from '@src/components/composables/useBannerHider';
+import { ReasonsToDonateShownEvent } from '@src/tracking/events/ReasonsToDonateShownEvent';
+import ReasonsToDonate from '@src/components/ReasonsToDonate/ReasonsToDonate.vue';
+import { ReasonsToDonateItemClickedEvent } from '@src/tracking/events/ReasonsToDonateItemClickedEvent';
+import { PageScroller } from '@src/utils/PageScroller/PageScroller';
+import { ReasonsToDonateCTAClickedEvent } from '@src/tracking/events/ReasonsToDonateCTAClickedEvent';
enum ContentStates {
Main = 'wmde-banner-wrapper--main',
@@ -120,17 +139,19 @@ enum FormStepNames {
interface Props {
bannerState: BannerStates;
useOfFundsContent: useOfFundsContentInterface;
+ pageScroller: PageScroller;
remainingImpressions: number;
localCloseTracker: LocalCloseTracker;
}
const props = defineProps();
-const emit = defineEmits( [ 'bannerClosed', 'bannerContentChanged' ] );
+const emit = defineEmits( [ 'bannerClosed', 'bannerContentChanged', 'reasonsToDonate' ] );
useBannerHider( 800, emit );
const tracker = inject( 'tracker' );
const isFundsModalVisible = ref( false );
+const isReasonsToDonateVisible = ref( false );
const contentState = ref( ContentStates.Main );
const formModel = useFormModel();
const stepControllers = [
@@ -150,6 +171,27 @@ const onSubmit = (): void => {
}
};
+const onShowReasonsToDonate = (): void => {
+ isReasonsToDonateVisible.value = true;
+ tracker.trackEvent( new ReasonsToDonateShownEvent() );
+};
+const onReasonsToDonateAccordionItemClicked = ( payload: { itemNumber: string } ): void => {
+ tracker.trackEvent( new ReasonsToDonateItemClickedEvent( payload.itemNumber ) );
+};
+
+const onHideReasonsToDonate = (): void => {
+ isReasonsToDonateVisible.value = false;
+};
+
+const onReasonsToDonateCallToActionClicked = (): void => {
+ tracker.trackEvent( new ReasonsToDonateCTAClickedEvent() );
+
+ contentState.value = ContentStates.Main;
+
+ props.pageScroller.scrollIntoView( '.wmde-banner-form' );
+ isReasonsToDonateVisible.value = false;
+};
+
function onCloseMain(): void {
if ( props.remainingImpressions > 0 ) {
contentState.value = ContentStates.SoftClosing;
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_14/content/BannerSlidesVar.vue b/banners/desktop/C24_WMDE_Desktop_DE_14/content/BannerSlidesVar.vue
index 46790f372..a648e683b 100644
--- a/banners/desktop/C24_WMDE_Desktop_DE_14/content/BannerSlidesVar.vue
+++ b/banners/desktop/C24_WMDE_Desktop_DE_14/content/BannerSlidesVar.vue
@@ -28,24 +28,32 @@
- Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück. Vielen Dank!
+ Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück. Falls Sie zögern,
+
+ für eine Spende. Vielen Dank!