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>
<html lang="">
<html lang="en-US">
<head>
<script>
window.dataLayer = [{}];

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,7 @@
import { useMainStore } from "@/store";
import { mapActions, mapStores } from "pinia";
import { useMainStore } from "@/store";
import { storeActions } from "@/constants/store-actions.js";
import { storeMutations } from "@/constants/store-mutations.js";
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
@ -36,12 +38,12 @@ export default {
},
savePageDataToStore(page, data) {
// 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: {
// store will be accessible globally as its id + 'Store'
...mapStores(useMainStore),
// store will be accessible globally as its id + 'Store'
//...mapStores(useMainStore),
storeActions() {
return storeActions;

View file

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

View file

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