Merge pull request #763 from Safelite/bug/brydon/SSR-1382
Fixing available vaps reactivity
This commit is contained in:
commit
b7094c0487
2 changed files with 8 additions and 157 deletions
|
|
@ -2,163 +2,11 @@
|
||||||
|
|
||||||
exports[`cart-dropdown component initial data rendered as expected 1`] = `
|
exports[`cart-dropdown component initial data rendered as expected 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"availableVaps": Array [],
|
|
||||||
"cartItemType": Object {
|
"cartItemType": Object {
|
||||||
"MOBILE_FEE": "MOBILE FEE",
|
"MOBILE_FEE": "MOBILE FEE",
|
||||||
"RECYCLE_FEE": "RECYCLE FEE",
|
"RECYCLE_FEE": "RECYCLE FEE",
|
||||||
"VAP": "VAP",
|
"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,
|
"isExpanded": false,
|
||||||
"widget": Object {
|
"widget": Object {
|
||||||
"amountDue": "AmountDueTextWidget",
|
"amountDue": "AmountDueTextWidget",
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,6 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isExpanded: this.isInitiallyExpanded,
|
isExpanded: this.isInitiallyExpanded,
|
||||||
availableVaps: this.submittedOrder ? this.submittedOrder.lineItems.vaps : useMainStore().order.availableVaps,
|
|
||||||
widget: {
|
widget: {
|
||||||
amountDue: 'AmountDueTextWidget',
|
amountDue: 'AmountDueTextWidget',
|
||||||
amountPaid: 'AmountPaidTextWidget',
|
amountPaid: 'AmountPaidTextWidget',
|
||||||
|
|
@ -209,11 +208,16 @@ export default {
|
||||||
servicePackage: 'ServicePackageTitle',
|
servicePackage: 'ServicePackageTitle',
|
||||||
vapsItemDescriptions: 'VapsItemDescriptions'
|
vapsItemDescriptions: 'VapsItemDescriptions'
|
||||||
},
|
},
|
||||||
cartItemType,
|
cartItemType
|
||||||
cartOrder: this.submittedOrder ?? useMainStore().order
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
cartOrder() {
|
||||||
|
return this.submittedOrder ?? useMainStore().order;
|
||||||
|
},
|
||||||
|
availableVaps() {
|
||||||
|
return this.cartOrder.availableVaps;
|
||||||
|
},
|
||||||
deductible() {
|
deductible() {
|
||||||
return getDeductible(this.cartOrder);
|
return getDeductible(this.cartOrder);
|
||||||
},
|
},
|
||||||
|
|
@ -255,13 +259,12 @@ export default {
|
||||||
return !this.showAsPaid ? 0 : this.total;
|
return !this.showAsPaid ? 0 : this.total;
|
||||||
},
|
},
|
||||||
availableLineItems() {
|
availableLineItems() {
|
||||||
const vapsToUse = this.availableVaps ?? this.lineItems.vaps;
|
|
||||||
const { supportingItems, glassParts, otherParts, feeItems } = this.lineItems;
|
const { supportingItems, glassParts, otherParts, feeItems } = this.lineItems;
|
||||||
const result = [
|
const result = [
|
||||||
...(supportingItems ?? []),
|
...(supportingItems ?? []),
|
||||||
...(glassParts ?? []),
|
...(glassParts ?? []),
|
||||||
...(otherParts ?? []),
|
...(otherParts ?? []),
|
||||||
...(vapsToUse ?? []),
|
...(this.availableVaps ?? []),
|
||||||
...(feeItems ?? [])
|
...(feeItems ?? [])
|
||||||
];
|
];
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue