Merge pull request #990 from Safelite/rlsmerge/2023.03.09-to-develop-v3

Rlsmerge/2023.03.09 to develop v3
This commit is contained in:
CarlNation 2023-03-02 10:13:19 -05:00 committed by GitHub
commit 3e3cee48e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 9 deletions

View file

@ -1,7 +1,7 @@
const queryStrings = {
FMG_PAGE: "fmgPage",
START_TYPE: "start_type",
ZIP_CODE: "zipCode",
ZIP_CODE: "zipcode",
};
export { queryStrings };

View file

@ -134,7 +134,7 @@ export default {
data() {
return {
selectedVinLookupMethod: null,
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipCode,
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode,
emailAddress: this.getEmailFromStore(),
displayInvalidZipAlert: false,
displayNonServiceableZipAlert: false,
@ -147,9 +147,13 @@ export default {
//Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
const zip = Object.hasOwn(to.query, queryStrings.ZIP_CODE) ? to.query.zipCode : null;
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const hasZip = urlParams.has(queryStrings.ZIP_CODE);
const zip = urlParams.get(queryStrings.ZIP_CODE);
var vinByAddressPromise;
if (zip) {
if (hasZip) {
vinByAddressPromise = baseMixin.methods.dispatchStoreAction(
storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE,
zip,
@ -189,7 +193,7 @@ export default {
}
}
if (zip) {
if (zip && resultMap.vinByAddress === false) {
var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
(answer) => answer.Name === "HomeAddress"
);

View file

@ -152,7 +152,7 @@ export default {
data() {
return {
licensePlate: this.getLicensePlateFromStore(),
registrationZipCode: this.getRegistrationZipFromStore() ?? this.$route.query.zipCode,
registrationZipCode: this.getRegistrationZipFromStore() ?? this.$route.query.zipcode,
email: this.getEmailFromStore(),
serviceZipCode: this.getServiceZipFromStore(),
displayNonServiceableZipAlert: false,

View file

@ -176,7 +176,7 @@ export default {
data() {
return {
vin: this.getVinFromStore(),
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipCode,
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode,
emailAddress: this.getEmailFromStore(),
isCarIdDifferent: false,
customAlertData: {},

View file

@ -265,14 +265,23 @@ async function navigate(
fmgPage: destinationFmgPageValue,
};
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const lowerCaseParams = new URLSearchParams();
for (const [name, value] of urlParams) {
lowerCaseParams.append(name.toLowerCase(), value);
}
const hasZip = lowerCaseParams.has(queryStrings.ZIP_CODE);
const zip = lowerCaseParams.get(queryStrings.ZIP_CODE);
if (
Object.hasOwn(currentRoute.query, queryStrings.ZIP_CODE) &&
hasZip &&
(store.getters.order.serviceLocation.zipCode === undefined ||
store.getters.order.serviceLocation.zipCode == null) &&
(store.getters.order.vehicle.registration.zipCode === undefined ||
store.getters.order.vehicle.registration.zipCode == null)
) {
queryStringsObject[queryStrings.ZIP_CODE] = currentRoute.query.zipCode;
queryStringsObject[queryStrings.ZIP_CODE] = zip;
}
router.push({