From 288a7cc3a668d363092cfbb775371a03470e08b1 Mon Sep 17 00:00:00 2001 From: Jacob Bare Date: Wed, 3 Mar 2021 15:32:40 -0600 Subject: [PATCH 1/4] Move P1 leaders tracking into leaders No longer need to use an emitter either --- .../browser/click-emitter.vue | 50 ------------------- packages/marko-web-leaders/browser/index.js | 8 ++- .../browser/p1events-tracker.vue} | 3 +- .../components/click-emitter.marko | 1 - .../marko-web-leaders/components/marko.json | 6 +-- .../components/p1events-tracker.marko | 1 + packages/marko-web-leaders/package.json | 1 - .../marko-web-leaders/utils/event-attrs.js | 8 --- .../utils/event-link-attrs.js | 16 ------ .../marko-web-p1-events/browser/.eslintrc.js | 21 -------- packages/marko-web-p1-events/browser/index.js | 6 --- .../marko-web-p1-events/components/marko.json | 5 -- .../components/track-leaders.marko | 11 ---- yarn.lock | 5 -- 14 files changed, 9 insertions(+), 133 deletions(-) delete mode 100644 packages/marko-web-leaders/browser/click-emitter.vue rename packages/{marko-web-p1-events/browser/track-leaders.vue => marko-web-leaders/browser/p1events-tracker.vue} (95%) delete mode 100644 packages/marko-web-leaders/components/click-emitter.marko create mode 100644 packages/marko-web-leaders/components/p1events-tracker.marko delete mode 100644 packages/marko-web-leaders/utils/event-attrs.js delete mode 100644 packages/marko-web-leaders/utils/event-link-attrs.js delete mode 100644 packages/marko-web-p1-events/browser/.eslintrc.js delete mode 100644 packages/marko-web-p1-events/browser/index.js delete mode 100644 packages/marko-web-p1-events/components/track-leaders.marko diff --git a/packages/marko-web-leaders/browser/click-emitter.vue b/packages/marko-web-leaders/browser/click-emitter.vue deleted file mode 100644 index 553c4b69b..000000000 --- a/packages/marko-web-leaders/browser/click-emitter.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/packages/marko-web-leaders/browser/index.js b/packages/marko-web-leaders/browser/index.js index 6df79cd27..70117ac1a 100644 --- a/packages/marko-web-leaders/browser/index.js +++ b/packages/marko-web-leaders/browser/index.js @@ -1,13 +1,14 @@ const LeadersProgram = () => import(/* webpackChunkName: "leaders-program" */ '@parameter1/base-cms-leaders-program'); -const LeadersClickEmitter = () => import(/* webpackChunkName: "leaders-click-emitter" */ './click-emitter.vue'); const LeadersCompanyWebsiteLink = () => import(/* webpackChunkName: "leaders-company-website-link" */ './company-website-link.vue'); const LeadersCompanySocialLink = () => import(/* webpackChunkName: "leaders-company-social-link" */ './company-social-link.vue'); const LeadersGTMTracker = () => import(/* webpackChunkName: "leaders-gtm-tracker" */ './gtm-tracker.vue'); +const LeadersP1EventsTracker = () => import(/* webpackChunkName: "leaders-p1-event-tracker" */ './p1events-tracker.vue'); -export default (Browser, { withGTM = true } = {}) => { +export default (Browser, { withGTM = true, withP1Events = true } = {}) => { const { EventBus } = Browser; if (withGTM) Browser.register('LeadersGTMTracker', LeadersGTMTracker, { provide: { EventBus } }); + if (withP1Events) Browser.register('LeadersP1EventsTracker', LeadersP1EventsTracker, { provide: { EventBus } }); Browser.register('LeadersProgram', LeadersProgram, { withApollo: true, on: { action: (...args) => EventBus.$emit('leaders-action', ...args) }, @@ -18,7 +19,4 @@ export default (Browser, { withGTM = true } = {}) => { Browser.register('LeadersCompanySocialLink', LeadersCompanySocialLink, { on: { action: (...args) => EventBus.$emit('leaders-action', ...args) }, }); - Browser.register('LeadersClickEmitter', LeadersClickEmitter, { - on: { action: (...args) => EventBus.$emit('leaders-action', ...args) }, - }); }; diff --git a/packages/marko-web-p1-events/browser/track-leaders.vue b/packages/marko-web-leaders/browser/p1events-tracker.vue similarity index 95% rename from packages/marko-web-p1-events/browser/track-leaders.vue rename to packages/marko-web-leaders/browser/p1events-tracker.vue index 60939bca8..6f564b4e0 100644 --- a/packages/marko-web-p1-events/browser/track-leaders.vue +++ b/packages/marko-web-leaders/browser/p1events-tracker.vue @@ -1,5 +1,5 @@