Skip to content

Commit

Permalink
Prepare CTRL for C24_WMDE_Desktop_DE_23
Browse files Browse the repository at this point in the history
Based on the CTRL of C24_WMDE_Desktop_DE_21

Ticket: https://phabricator.wikimedia.org/T382307
  • Loading branch information
Abban authored and moiikana committed Dec 20, 2024
1 parent 55a787e commit 7231156
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 348 deletions.
4 changes: 2 additions & 2 deletions banners/desktop/C24_WMDE_Desktop_DE_23/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/FallbackBannerConductor.vue';
import Banner from './components/BannerVar.vue';
Expand All @@ -16,7 +16,7 @@ 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_var';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';
import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker';
import messages from './messages';
Expand Down
41 changes: 3 additions & 38 deletions banners/desktop/C24_WMDE_Desktop_DE_23/components/BannerVar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:bannerState="bannerState"
>
<template #close-button>
<ButtonClose @close="onCloseMain( 'MainBanner', CloseChoices.Close )"/>
<ButtonClose @close="onCloseMain"/>
</template>

<template #banner-title>
Expand Down Expand Up @@ -58,20 +58,6 @@

</MainBanner>

<MinimisedBanner
v-if="contentState === ContentStates.Minimised"
@maximise="() => onMaximiseBanner( 'maximise' )"
@maximise-cta="() => onMaximiseBanner( 'cta' )"
@close="() => onCloseMain( 'MinimisedBanner', CloseChoices.Close )"
>
<template #footer>
<FooterAlreadyDonated
@showFundsModal="isFundsModalVisible = true"
@clickedAlreadyDonatedLink="onClose( 'AlreadyDonated', CloseChoices.AlreadyDonated )"
/>
</template>
</MinimisedBanner>

<SoftClose
v-if="contentState === ContentStates.SoftClosing"
:show-close-icon="true"
Expand Down Expand Up @@ -125,14 +111,9 @@ import { BannerSubmitOnReturnEvent } from '@src/tracking/events/BannerSubmitOnRe
import { Tracker } from '@src/tracking/Tracker';
import { useBannerHider } from '@src/components/composables/useBannerHider';
import BannerTitle from '@banners/desktop/C24_WMDE_Desktop_DE_15/content/BannerTitle.vue';
import MinimisedBanner from '@banners/desktop/C24_WMDE_Desktop_DE_21/components/MinimisedBanner.vue';
import { useScrollMinimiser } from '@banners/desktop/C24_WMDE_Desktop_DE_21/useScrollMinimiser';
import { BannerMinimisedEvent } from '@banners/desktop/C24_WMDE_Desktop_DE_00/events/BannerMinimisedEvent';
import { BannerMaximisedEvent } from '@banners/desktop/C24_WMDE_Desktop_DE_00/events/BannerMaximisedEvent';
enum ContentStates {
Main = 'wmde-banner-wrapper--main',
Minimised = 'wmde-banner-wrapper--minimised',
SoftClosing = 'wmde-banner-wrapper--soft-closing',
}
Expand Down Expand Up @@ -161,20 +142,11 @@ const stepControllers = [
createSubmittableMainDonationForm( formModel, FormStepNames.UpgradeToYearlyFormStep ),
createSubmittableUpgradeToYearly( formModel, FormStepNames.MainDonationFormStep, FormStepNames.MainDonationFormStep )
];
const wasMinimised = ref<boolean>( false );
watch( contentState, async () => {
emit( 'bannerContentChanged' );
} );
useScrollMinimiser( 500, wasMinimised, () => {
if ( props.bannerState === BannerStates.Visible && contentState.value === ContentStates.Main ) {
contentState.value = ContentStates.Minimised;
wasMinimised.value = true;
tracker.trackEvent( new BannerMinimisedEvent() );
}
} );
const onSubmit = (): void => {
// special callback function: asking for previous close choices
const closeChoice = props.localCloseTracker.getItem();
Expand All @@ -183,25 +155,18 @@ const onSubmit = (): void => {
}
};
function onCloseMain( feature: TrackingFeatureName, userChoice: CloseChoices ): void {
function onCloseMain(): void {
if ( props.remainingImpressions > 0 ) {
contentState.value = ContentStates.SoftClosing;
emit( 'bannerContentChanged' );
} else {
onClose( feature, userChoice );
onClose( 'MainBanner', CloseChoices.Close );
}
}
function onClose( feature: TrackingFeatureName, userChoice: CloseChoices ): void {
emit( 'bannerClosed', new CloseEvent( feature, userChoice ) );
}
function onMaximiseBanner( userChoice: string ): void {
contentState.value = ContentStates.Main;
tracker.trackEvent( new BannerMaximisedEvent( userChoice ) );
emit( 'bannerContentChanged' );
}
function onHideFundsModal(): void {
isFundsModalVisible.value = false;
emit( 'modalClosed' );
Expand Down

This file was deleted.

26 changes: 0 additions & 26 deletions banners/desktop/C24_WMDE_Desktop_DE_23/content/MinimisedText.vue

This file was deleted.

57 changes: 0 additions & 57 deletions banners/desktop/C24_WMDE_Desktop_DE_23/event_map_var.ts

This file was deleted.

102 changes: 0 additions & 102 deletions banners/desktop/C24_WMDE_Desktop_DE_23/styles/MinimisedBanner.scss

This file was deleted.

60 changes: 0 additions & 60 deletions banners/desktop/C24_WMDE_Desktop_DE_23/styles/styles_var.scss

This file was deleted.

Loading

0 comments on commit 7231156

Please sign in to comment.