This commit is contained in:
Jeremy Zimmerman 2022-11-07 13:49:26 -05:00
parent accf724428
commit f33810a43d
13 changed files with 64 additions and 14 deletions

View file

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang=""> <html lang="en-US">
<head> <head>
<script> <script>
window.dataLayer = [{}]; window.dataLayer = [{}];

View file

@ -13,4 +13,4 @@
@import "@/styles/common-typography-styles.scss"; @import "@/styles/common-typography-styles.scss";
@import "@/styles/common-error-styles.scss"; @import "@/styles/common-error-styles.scss";
@import "@/styles/common-animations.scss"; @import "@/styles/common-animations.scss";
</style> </style>

View file

@ -1,10 +1,10 @@
import axios from "axios"; import axios from "axios";
//import analyticsMixIn from "@/mixins/analytics-mixin.js"; import analyticsMixIn from "@/mixins/analytics-mixin.js";
import { useMainStore } from "@/store";
import { applicationConfig } from "@/constants/application-config.js"; import { applicationConfig } from "@/constants/application-config.js";
import { GaCategories, GaActions, GaLabels } from "@/constants/analytics"; import { GaCategories, GaActions, GaLabels } from "@/constants/analytics";
import { headerKeys } from "@/constants/header-keys"; import { headerKeys } from "@/constants/header-keys";
import { useMainStore } from "@/store";
export default { export default {
callHttpClient({ method, endpoint, payload, logApiCall = true}) { callHttpClient({ method, endpoint, payload, logApiCall = true}) {
@ -25,14 +25,12 @@ export default {
}) })
.then((response) => { .then((response) => {
if (logApiCall) { if (logApiCall) {
/*
analyticsMixIn.methods.pushEventToGA( analyticsMixIn.methods.pushEventToGA(
GaCategories.API_RESPONSE, GaCategories.API_RESPONSE,
GaActions.RESULT, GaActions.RESULT,
`${GaLabels.SUCCESS}_${endpoint}`, `${GaLabels.SUCCESS}_${endpoint}`,
true true
); );
*/
} }
return resolve(response); return resolve(response);

View file

@ -33,9 +33,18 @@
// Supporting files // Supporting files
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper"; import { settleAllPromises } from "@/helpers/layout-helper";
import { useMainStore } from "@/store";
export default { export default {
name: 'vehicle-make', name: 'vehicle-make',
setup()
{
const mainStore = useMainStore()
return {
mainStore,
}
},
data() { data() {
return { return {
selectedMake: null, selectedMake: null,

View file

@ -28,9 +28,18 @@
// Supporting files // Supporting files
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper"; import { settleAllPromises } from "@/helpers/layout-helper";
import { useMainStore } from "@/store";
export default { export default {
name: "vehicle-model", name: "vehicle-model",
setup()
{
const mainStore = useMainStore()
return {
mainStore,
}
},
data() { data() {
return { return {
selectedModel: null, selectedModel: null,

View file

@ -29,10 +29,19 @@ import vehicleBanner from "@/common-components/vehicle-banner/vehicle-banner";
// Supporting files // Supporting files
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper"; import { settleAllPromises } from "@/helpers/layout-helper";
import { useMainStore } from "@/store";
export default { export default {
name: "vehicle-style", name: "vehicle-style",
setup()
{
const mainStore = useMainStore()
return {
mainStore,
}
},
data() { data() {
return { return {
selectedStyle: null, selectedStyle: null,

View file

@ -28,9 +28,18 @@
// Supporting files // Supporting files
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper"; import { settleAllPromises } from "@/helpers/layout-helper";
import { useMainStore } from "@/store";
export default { export default {
name: "vehicle-year", name: "vehicle-year",
setup()
{
const mainStore = useMainStore()
return {
mainStore,
}
},
data() { data() {
return { return {
selectedYear: null, selectedYear: null,

View file

@ -18,6 +18,14 @@
export default { export default {
name: "year-question", name: "year-question",
setup()
{
const mainStore = useMainStore()
return {
mainStore,
}
},
data() { data() {
return { return {
years: Array, years: Array,

View file

@ -18,13 +18,14 @@ const vueApp = createApp(App);
const pinia = createPinia(); const pinia = createPinia();
vueApp.use(pinia); vueApp.use(pinia);
pinia.use(piniaPluginPersistedstate); pinia.use(piniaPluginPersistedstate);
useMainStore().populateInitialState(); useMainStore().populateInitialState()
// Additional Vue items to setup // Additional Vue items to setup
vueApp.use(router); vueApp.use(router);
vueApp.use(Maska);
vueApp.mixin(baseMixin); vueApp.mixin(baseMixin);
vueApp.mixin(analyticsMixin); vueApp.mixin(analyticsMixin);
vueApp.mixin(experimentMixin); vueApp.mixin(experimentMixin);
vueApp.use(Maska);
vueApp.mount("#app"); vueApp.mount("#app");

View file

@ -17,9 +17,10 @@ import {
} from "@/constants/analytics"; } from "@/constants/analytics";
import { cookieNames } from "@/constants/cookie-names"; import { cookieNames } from "@/constants/cookie-names";
import { useMainStore } from "@/store"; import { useMainStore } from "@/store";
import { mapStores } from "pinia";
import baseMixin from "@/mixins/base-mixin"; import baseMixin from "@/mixins/base-mixin";
import { mapStores } from "pinia";
export default { export default {
methods: { methods: {
@ -73,6 +74,8 @@ export default {
pushToDataLayerIfDefined(eventToBePushed); pushToDataLayerIfDefined(eventToBePushed);
console.log("GA REPLY -" + eventToBePushed);
if (pushToLogApp) { if (pushToLogApp) {
this.logCustomEvent(category, action, labelToLog, undefined); this.logCustomEvent(category, action, labelToLog, undefined);
} }
@ -171,7 +174,7 @@ export default {
}, },
}, },
computed: { computed: {
...mapStores(useMainStore), //...mapStores(useMainStore),
analyticsPageEvents() { analyticsPageEvents() {
return analyticsPageEvents; return analyticsPageEvents;

View file

@ -1,5 +1,7 @@
import { useMainStore } from "@/store";
import { mapActions, mapStores } from "pinia"; import { mapActions, mapStores } from "pinia";
import { useMainStore } from "@/store";
import { storeActions } from "@/constants/store-actions.js"; import { storeActions } from "@/constants/store-actions.js";
import { storeMutations } from "@/constants/store-mutations.js"; import { storeMutations } from "@/constants/store-mutations.js";
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios"; import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
@ -36,12 +38,12 @@ export default {
}, },
savePageDataToStore(page, data) { savePageDataToStore(page, data) {
// TODO: Fix this! // TODO: Fix this!
//this.mainStore.commit(storeMutations.UPDATE_PAGE_DATA, { page: page, data: data }); //this.useMainStore.commit(storeMutations.UPDATE_PAGE_DATA, { page: page, data: data });
}, },
}, },
computed: { computed: {
// store will be accessible globally as its id + 'Store' // store will be accessible globally as its id + 'Store'
...mapStores(useMainStore), //...mapStores(useMainStore),
storeActions() { storeActions() {
return storeActions; return storeActions;

View file

@ -149,6 +149,7 @@ function navigateToUrl(url, optionalQuery = {}) {
function getNavigationMap (scenario, currentRoute) { function getNavigationMap (scenario, currentRoute) {
const issPageValue = currentRoute.query.issPage; const issPageValue = currentRoute.query.issPage;
try { try {
const matchedQueryValue = routingTable(useMainStore()) const matchedQueryValue = routingTable(useMainStore())
.filter( .filter(
(item) => (item) =>

View file

@ -256,6 +256,7 @@ export const useMainStore = defineStore({
shouldUseSessionId: shouldUseSessionId, shouldUseSessionId: shouldUseSessionId,
experimentsForUser: experimentsForUser, experimentsForUser: experimentsForUser,
} }
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.LogPageView.method, method: endpoints.LogPageView.method,
endpoint: endpoints.LogPageView.url, endpoint: endpoints.LogPageView.url,