From 3580155e42eaec32f1fdbb449aad64a6f55ef647 Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Thu, 20 Jun 2024 13:45:18 -0400 Subject: [PATCH 1/2] Fixing available vaps reactivity --- src/iss-components/cart-dropdown/cart-dropdown.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/iss-components/cart-dropdown/cart-dropdown.vue b/src/iss-components/cart-dropdown/cart-dropdown.vue index 66d3cbf9..c7eb6a57 100644 --- a/src/iss-components/cart-dropdown/cart-dropdown.vue +++ b/src/iss-components/cart-dropdown/cart-dropdown.vue @@ -196,7 +196,6 @@ export default { data() { return { isExpanded: this.isInitiallyExpanded, - availableVaps: this.submittedOrder ? this.submittedOrder.lineItems.vaps : useMainStore().order.availableVaps, widget: { amountDue: 'AmountDueTextWidget', amountPaid: 'AmountPaidTextWidget', @@ -209,11 +208,16 @@ export default { servicePackage: 'ServicePackageTitle', vapsItemDescriptions: 'VapsItemDescriptions' }, - cartItemType, - cartOrder: this.submittedOrder ?? useMainStore().order + cartItemType }; }, computed: { + cartOrder() { + return this.submittedOrder ?? useMainStore().order; + }, + availableVaps() { + return this.cartOrder.availableVaps; + }, deductible() { return getDeductible(this.cartOrder); }, @@ -255,13 +259,12 @@ export default { return !this.showAsPaid ? 0 : this.total; }, availableLineItems() { - const vapsToUse = this.availableVaps ?? this.lineItems.vaps; const { supportingItems, glassParts, otherParts, feeItems } = this.lineItems; const result = [ ...(supportingItems ?? []), ...(glassParts ?? []), ...(otherParts ?? []), - ...(vapsToUse ?? []), + ...(this.availableVaps ?? []), ...(feeItems ?? []) ]; return result; From 0e108fc52e0ebc4ffecb02c1d20367192a6257c0 Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Thu, 20 Jun 2024 13:54:02 -0400 Subject: [PATCH 2/2] Updating snapshot --- .../__snapshots__/cart-dropdown.spec.js.snap | 152 ------------------ 1 file changed, 152 deletions(-) diff --git a/src/iss-components/cart-dropdown/__snapshots__/cart-dropdown.spec.js.snap b/src/iss-components/cart-dropdown/__snapshots__/cart-dropdown.spec.js.snap index 5c5b5676..dc913570 100644 --- a/src/iss-components/cart-dropdown/__snapshots__/cart-dropdown.spec.js.snap +++ b/src/iss-components/cart-dropdown/__snapshots__/cart-dropdown.spec.js.snap @@ -2,163 +2,11 @@ exports[`cart-dropdown component initial data rendered as expected 1`] = ` Object { - "availableVaps": Array [], "cartItemType": Object { "MOBILE_FEE": "MOBILE FEE", "RECYCLE_FEE": "RECYCLE FEE", "VAP": "VAP", }, - "cartOrder": Object { - "availableVaps": Array [], - "carrierPhoneNumber": null, - "contactInfo": Object { - "alternativePhone": null, - "emailAddress": null, - "firstName": null, - "homePhone": null, - "lastName": null, - "notesForTechnician": "", - "requestTextUpdates": false, - "servicePhone": null, - }, - "currentDeductible": null, - "customer": Object { - "address": Object { - "city": null, - "state": null, - "streetAddress": null, - "streetAddress2": null, - "zipCode": null, - }, - "emailAddress": null, - "firstName": null, - "lastName": null, - }, - "customerPortalLoginToken": null, - "damage": Object { - "capabilityQuestionAnswers": null, - "glassToReplace": null, - "isRepair": null, - "moldingQuestionAnswers": null, - "numberOfChips": null, - "partQuestionAnswers": null, - }, - "eon": null, - "insuranceCoverage": Object { - "claimNumber": null, - "coverageStatus": 0, - "coverageType": 0, - }, - "lineItems": Object { - "feeItems": Array [], - "glassParts": null, - "otherParts": null, - "serverData": null, - "supportingItems": null, - "vaps": null, - }, - "loadedFromDupeCheck": null, - "loadedSessionClearedPreviousData": null, - "originalDeductible": null, - "parentAccountNumber": null, - "payment": Object { - "creditCardToken": Object { - "authCode": null, - "billToFirstName": null, - "billToLastName": null, - "billToPostalCode": null, - "cardType": null, - "expMonth": null, - "expYear": null, - "lastFour": null, - "referenceNumber": null, - "subscriptionId": null, - "transReferenceNumber": null, - "transactionId": null, - }, - "isPayInAdvance": null, - "parentAccountNumber": 0, - "payInAdvanceType": null, - "paypalToken": null, - }, - "policy": Object { - "damageCause": null, - "damageCity": null, - "damageState": null, - "dateOfLoss": null, - "deductible": Object { - "repair": null, - "replace": null, - }, - "endorsementQuestionAnswers": Array [], - "endorsements": Array [], - "isDamageGlassOnly": null, - "policyData": null, - "policyNumber": null, - "policyZipCode": null, - "status": null, - "vehicles": Array [], - }, - "referralCorrelationId": "00000000-0000-0000-0000-000000000000", - "referralDate": null, - "referralNumber": null, - "referralSequenceNumber": null, - "schedule": Object { - "date": null, - "endTime": null, - "jobMaxMinutes": null, - "jobMinMinutes": null, - "routeCode": null, - "startTime": null, - }, - "serviceLocation": Object { - "IsSafeliteProvider": null, - "address": null, - "address2": null, - "appointmentType": null, - "city": null, - "isVehicleProtected": null, - "provider": Object { - "address": Object { - "city": null, - "state": null, - "streetAddress": null, - "zipCode": null, - "zipCodeCtu": null, - }, - "companyName": null, - "phoneNumber": null, - "providerNumber": null, - }, - "searchFilter": null, - "state": null, - "zipCode": null, - "zipCodeCtu": null, - }, - "vehicle": Object { - "carId": null, - "category": null, - "imageColor": null, - "imageUrl": null, - "imageVifNumber": null, - "make": null, - "model": null, - "policyVehicleId": null, - "registration": Object { - "address": null, - "city": null, - "firstName": null, - "lastName": null, - "licensePlate": null, - "state": null, - "zipCode": null, - }, - "style": null, - "vin": null, - "year": null, - }, - "workOrderNumber": null, - }, "isExpanded": false, "widget": Object { "amountDue": "AmountDueTextWidget",