Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace window timer with injected timer #601

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';

// Channel specific form setup
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { currentCampaignTimePercentage } from './currentCampaignTimePercentage';
import { WindowTimer } from '@src/utils/Timer';
gbirke marked this conversation as resolved.
Show resolved Hide resolved

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';

// Channel specific form setup
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { currentCampaignTimePercentage } from './currentCampaignTimePercentage';
import { WindowTimer } from '@src/utils/Timer';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_01/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';

// Channel specific form setup
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { currentCampaignTimePercentage } from './currentCampaignTimePercentage';
import { WindowTimer } from '@src/utils/Timer';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_01/banner_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';

// Channel specific form setup
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { currentCampaignTimePercentage } from './currentCampaignTimePercentage';
import { WindowTimer } from '@src/utils/Timer';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_02/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';

// Channel specific form setup
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { currentCampaignTimePercentage } from './currentCampaignTimePercentage';
import { WindowTimer } from '@src/utils/Timer';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_02/banner_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';

// Channel specific form setup
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { currentCampaignTimePercentage } from './currentCampaignTimePercentage';
import { WindowTimer } from '@src/utils/Timer';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_03/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
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';

const date = new Date();
const localeFactory = new LocaleFactoryDe();
Expand Down Expand Up @@ -70,5 +67,6 @@ app.provide( 'currencyFormatter', currencyFormatter );
app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) );
app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) );
app.provide( 'tracker', tracker );
app.provide( 'timer', new WindowTimer() );

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_03/banner_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
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';

const date = new Date();
const localeFactory = new LocaleFactoryDe();
Expand Down Expand Up @@ -70,5 +67,6 @@ app.provide( 'currencyFormatter', currencyFormatter );
app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) );
app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) );
app.provide( 'tracker', tracker );
app.provide( 'timer', new WindowTimer() );

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_04/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
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';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_04/banner_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
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';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_05/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
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';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_05/banner_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
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';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_06/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
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';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_06/banner_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';

// Channel specific form setup
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { createFAQPageURL } from '@src/createFAQPageURL';
import { WindowTimer } from '@src/utils/Timer';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_07/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
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';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_07/banner_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';

// Locale-specific imports
import messages from './messages';
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';

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

app.mount( page.getBannerContainer() );
6 changes: 2 additions & 4 deletions banners/desktop/C24_WMDE_Desktop_DE_08/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';
import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker';

// Locale-specific imports
import messages from './messages';
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';

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

app.mount( page.getBannerContainer() );
Loading
Loading