Fixed a couple of issues that were causing failures.

This commit is contained in:
DavidAtSafelite 2023-04-20 11:42:40 -04:00
parent 080b9b4b1c
commit e757496dda
3 changed files with 64 additions and 67 deletions

View file

@ -1,55 +1,55 @@
const endpoints = {
GetRouteInfo: {
url: (applicationAbbreviation) => `/content/api/v1/content/${applicationAbbreviation}/RouteInfo`,
method: "POST",
method: 'POST'
},
GetHomepageInfo: {
url: (applicationAbbreviation) => `/content/api/v1/content/${applicationAbbreviation}/HomepageInfo`,
method: "GET",
method: 'GET'
},
GetPageData: {
url: (applicationAbbreviation, pageName) => `/content/api/v1/content/${applicationAbbreviation}/${pageName}`,
method: "GET",
method: 'GET'
},
GetVehicleYears: {
url: "/vehicle/api/v1/vehicle/years",
method: "GET",
url: '/vehicle/api/v1/vehicle/years',
method: 'GET'
},
GetVehicleMakes: {
url: "/vehicle/api/v1/vehicle/makes/",
method: "GET",
url: '/vehicle/api/v1/vehicle/makes/',
method: 'GET'
},
GetVehicleModels: {
url: "/vehicle/api/v1/vehicle/models",
method: "GET",
url: '/vehicle/api/v1/vehicle/models',
method: 'GET'
},
GetVehicleStyles: {
url: "/vehicle/api/v1/vehicle/styles",
method: "GET",
url: '/vehicle/api/v1/vehicle/styles',
method: 'GET'
},
GetDamageOptions: {
url: "/parts/api/v1/parts/damage-options",
method: "GET",
url: '/parts/api/v1/parts/damage-options',
method: 'GET'
},
GetPartsOrQuestions: {
url: "/parts/api/v1/parts/parts-or-questions",
method: "POST",
url: '/parts/api/v1/parts/parts-or-questions',
method: 'POST'
},
GetParts: {
url: "/parts/api/v1/parts/parts",
method: "POST",
url: '/parts/api/v1/parts/parts',
method: 'POST'
},
GetPriceOrderItems: {
url: '/price/api/v1/price/order-items',
method: 'GET'
},
GetCapabilityQuestions: {
url: "/parts/api/v1/parts/capability-questions",
method: "GET",
url: '/parts/api/v1/parts/capability-questions',
method: 'GET'
},
GetPartFromCapabilityAnswer: {
url: "/parts/api/v1/parts/part-from-capability-answer",
method: "POST",
url: '/parts/api/v1/parts/part-from-capability-answer',
method: 'POST'
},
GetWipers: {
url: '/parts/api/v1/parts/wipers',
@ -64,59 +64,59 @@ const endpoints = {
method: 'POST'
},
GetVehicle: {
url: "/vehicle/api/v1/vehicle/lookup",
method: "GET",
url: '/vehicle/api/v1/vehicle/lookup',
method: 'GET'
},
LogExperimentExposureIfAssigned: {
url: "/experiments/api/v1/experiments/log-exposure",
method: "POST",
url: '/experiments/api/v1/experiments/log-exposure',
method: 'POST'
},
LogPageView: {
url: "/analytics/api/v1/analytics/log-page-view",
method: "POST",
url: '/analytics/api/v1/analytics/log-page-view',
method: 'POST'
},
LogCustomEvent: {
url: "/analytics/api/v1/analytics/log-custom-event",
method: "POST",
url: '/analytics/api/v1/analytics/log-custom-event',
method: 'POST'
},
LookupVehicleByVin: {
url: "/vehicle/api/v1/vehicle/lookup",
method: "POST",
url: '/vehicle/api/v1/vehicle/lookup',
method: 'POST'
},
LookupVinByAddress: {
url: "/vehicle/api/v1/vehicle/lookup-vin-by-address",
method: "POST",
url: '/vehicle/api/v1/vehicle/lookup-vin-by-address',
method: 'POST'
},
LookupVinByPlate: {
url: "/vehicle/api/v1/vehicle/lookup-vin-by-plate",
method: "POST",
url: '/vehicle/api/v1/vehicle/lookup-vin-by-plate',
method: 'POST'
},
InitializeSession: {
url: "/analytics/api/v1/analytics/initialize",
method: "POST",
url: '/analytics/api/v1/analytics/initialize',
method: 'POST'
},
GetExperimentsByUser: {
url: "/analytics/api/v1/analytics/get-experiments",
method: "GET",
url: '/analytics/api/v1/analytics/get-experiments',
method: 'GET'
},
RunExperimentsForTrigger: {
url: "/experiments/api/v1/experiments/run",
method: "POST",
url: '/experiments/api/v1/experiments/run',
method: 'POST'
},
ValidateZip: {
url: "/location/api/v1/location/zip",
method: "GET",
url: '/location/api/v1/location/zip',
method: 'GET'
},
GooglePlaces: {
url: "https://maps.googleapis.com/maps/api/js?key={apiKey}&libraries=places"
url: 'https://maps.googleapis.com/maps/api/js?key={apiKey}&libraries=places'
},
ValidateClientTag: {
url: "/clientauth/api/v1/clientauth/validate-client-tag",
method: "GET",
url: '/clientauth/api/v1/clientauth/validate-client-tag',
method: 'GET'
},
IsVinbyAddressPermissible:{
url:"/vehicle/api/v1/vehicle/is-vin-by-address-permissible",
method:"Get",
url:'/vehicle/api/v1/vehicle/is-vin-by-address-permissible',
method:'Get'
}
};

View file

@ -2,7 +2,7 @@ import { dynamicStrings } from '@/constants/dynamic-strings';
import { useMainStore } from '@/store';
export function fetchCmsContentForPage(issPage) {
const store = useMainStore()
const store = useMainStore();
const clientName = store.issConfig.clientName;
const accountNumber = store.issConfig.accountNumber;
const clientOverride = (clientName.length > 0 && accountNumber > 0);
@ -59,7 +59,7 @@ function processPageData(baseResponse, clientResponse) {
let found = false;
clientResponse.data.Result.forEach((clientWidget) => {
if ( clientWidget.Name == baseWidget.Name )
if ( clientWidget.Name === baseWidget.Name )
{
widgets.push(clientWidget);
found = true;
@ -78,7 +78,7 @@ function processPageData(baseResponse, clientResponse) {
let found = false;
widgets.forEach((currentWidget) => {
if ( clientWidget.Name == currentWidget.Name )
if ( clientWidget.Name === currentWidget.Name )
{
found = true;
}
@ -178,10 +178,10 @@ function processWidgetItemForReplacement(widgetModel, key) {
function mapStringToModal(str) {
const startIndex = str.indexOf('{' + dynamicStrings.MODAL_LINK);
const linkToReplace = str.substring(startIndex, str.length);
let linkToReplace = str.substring(startIndex, str.length);
linkToReplace = linkToReplace.substring(0, linkToReplace.indexOf('}') + 1);
const params = linkToReplace.substring((dynamicStrings.MODAL_LINK).length + 2, linkToReplace.length -1)
const params = linkToReplace.substring((dynamicStrings.MODAL_LINK).length + 2, linkToReplace.length - 1);
const splitParams = params.split(',');
const bodyText = '<a modalTarget="' + splitParams[0] + '" class="modal-text" aria-label="Modal window">' + splitParams[1] + '</a>';
@ -189,9 +189,9 @@ function mapStringToModal(str) {
let returnVal = str.replace(linkToReplace, bodyText);
if (returnVal.includes(dynamicStrings.MODAL_LINK)) {
returnVal = mapStringToModal(returnVal)
returnVal = mapStringToModal(returnVal);
}
return returnVal
return returnVal;
}
// Function to convert a string, into a matching global state item.
@ -232,7 +232,7 @@ function getStoreValueFromString(str) {
let storeOrStateObject = useMainStore();
for (const s of str.split('.')) {
if (s === 'getters') continue; //For backward compatability
if (s === 'getters') continue; //For backward compatibility
if (storeOrStateObject[s] != undefined) {
storeOrStateObject = storeOrStateObject[s];
} else {
@ -259,10 +259,7 @@ export function processIfStatements(str, ifConditionKeyword, replacePlaceholderC
);
const hasEmbeddedCrLf = /\r?\n|\r/g.test(str);
if (hasEmbeddedCrLf) {
console.warning('Processing of conditional string was skipped. String has embedded carriage return/linefeed.');
}
if (!containsRelevantIfStatement || hasEmbeddedCrLf) {
if (!containsRelevantIfStatement) {
return str;
} else {
const ifStatementRegexExpression = getIfStatementRegexExpression();
@ -422,7 +419,7 @@ export function doesCopyContainTextLink(copy) {
export function setupModalLinks(context) {
context.$nextTick(() => {
const elements = document.getElementsByClassName("modal-text")
const elements = document.getElementsByClassName("modal-text");
for(let element of elements){
const target = element.getAttribute("modalTarget");
if(target)

View file

@ -21,11 +21,11 @@ module.exports = {
@import "./node_modules/bootstrap/scss/variables";
@import "./node_modules/bootstrap/scss/mixins";
@import "@/styles/mixins/customMixins";
`,
},
},
`
}
}
},
configureWebpack: {
devtool: 'source-map',
},
devtool: 'source-map'
}
};