CSR-762 Fix merge conflicts, heritage integration
This commit is contained in:
parent
3fbb512e7c
commit
e700dc6b4e
22 changed files with 433 additions and 379 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
trigger:
|
trigger:
|
||||||
branches:
|
branches:
|
||||||
include: [ develop, release/* ]
|
include: [develop, release/*]
|
||||||
paths:
|
paths:
|
||||||
exclude:
|
exclude:
|
||||||
- deployment/*
|
- deployment/*
|
||||||
|
|
@ -8,7 +8,7 @@ trigger:
|
||||||
- "*"
|
- "*"
|
||||||
pr:
|
pr:
|
||||||
branches:
|
branches:
|
||||||
include: [ '*' ]
|
include: ["*"]
|
||||||
paths:
|
paths:
|
||||||
exclude:
|
exclude:
|
||||||
- deployment/*
|
- deployment/*
|
||||||
|
|
@ -35,144 +35,157 @@ variables:
|
||||||
stages:
|
stages:
|
||||||
# PR's
|
# PR's
|
||||||
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
||||||
- stage: TestPr
|
- stage: TestPr
|
||||||
displayName: Run Unit Tests For PullRequest
|
displayName: Run Unit Tests For PullRequest
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/digital/vue-jest-run-unit-tests.yml@AzureDevOps
|
- template: templates/digital/vue-jest-run-unit-tests.yml@AzureDevOps
|
||||||
parameters:
|
parameters:
|
||||||
nodeContainer: node
|
nodeContainer: node
|
||||||
npmLocation: $(Build.SourcesDirectory)
|
npmLocation: $(Build.SourcesDirectory)
|
||||||
testResultsFile: junit.xml
|
testResultsFile: junit.xml
|
||||||
summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.xml
|
summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.xml
|
||||||
|
|
||||||
|
|
||||||
# Dev Build/Deploy
|
|
||||||
- ${{ else }}:
|
- ${{ else }}:
|
||||||
- stage: Dev
|
# Dev Build/Deploy
|
||||||
condition: eq(variables['Build.SourceBranch'], variables['dev-branch'] )
|
- stage: Dev
|
||||||
variables:
|
condition: eq(variables['Build.SourceBranch'], variables['dev-branch'] )
|
||||||
- group: FixMyGlassDev
|
variables:
|
||||||
jobs:
|
- group: FixMyGlassDev
|
||||||
- deployment: devBuildDeployment
|
jobs:
|
||||||
displayName: Build and Deploy FMG - Dev
|
- deployment: devBuildDeployment
|
||||||
environment: digitalCloud-dev
|
displayName: Build and Deploy FMG - Dev
|
||||||
container: node
|
environment: digitalCloud-dev
|
||||||
workspace:
|
container: node
|
||||||
clean: all
|
workspace:
|
||||||
strategy:
|
clean: all
|
||||||
runOnce:
|
strategy:
|
||||||
deploy:
|
runOnce:
|
||||||
steps:
|
deploy:
|
||||||
- checkout: self
|
steps:
|
||||||
clean: true
|
- checkout: self
|
||||||
- template: templates/digital/step-build-vue.yml@AzureDevOps
|
clean: true
|
||||||
parameters:
|
- template: templates/digital/step-build-vue.yml@AzureDevOps
|
||||||
buildOutputDir: dist
|
parameters:
|
||||||
environment: Dev
|
buildOutputDir: dist
|
||||||
- template: templates/digital/step-deploy-vue.yml@AzureDevOps
|
environment: Dev
|
||||||
parameters:
|
- template: templates/digital/step-deploy-vue.yml@AzureDevOps
|
||||||
artifactName: vueDistDev
|
parameters:
|
||||||
awsProfile: $(devDeploymentProfile)
|
artifactName: vueDistDev
|
||||||
outputPath: /fmg/
|
awsProfile: $(devDeploymentProfile)
|
||||||
deployBuckets:
|
outputPath: /fmg/
|
||||||
safelite-dev-fmg-us-east-1:
|
deployBuckets:
|
||||||
clearFolder: true
|
safelite-dev-fmg-us-east-1:
|
||||||
deployFolder: ''
|
clearFolder: true
|
||||||
region: us-east-1
|
deployFolder: ""
|
||||||
appDeployVariables:
|
region: us-east-1
|
||||||
__VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__)
|
safelite-dev-fmg-us-east-2:
|
||||||
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
clearFolder: true
|
||||||
__VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__)
|
deployFolder: ""
|
||||||
__VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__)
|
region: us-east-2
|
||||||
indexDeployVariables:
|
appDeployVariables:
|
||||||
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
__VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__)
|
||||||
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
||||||
cfDistributionId: $(cfDistributionId)
|
__VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__)
|
||||||
|
__VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__)
|
||||||
|
indexDeployVariables:
|
||||||
|
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
||||||
|
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
||||||
|
cfDistributionId: $(cfDistributionId)
|
||||||
|
|
||||||
# QA Build/Deploy
|
# QA Build/Deploy
|
||||||
- stage: Qa
|
- stage: Qa
|
||||||
condition: eq(variables['Build.SourceBranch'], variables['qa-branch'] )
|
condition: eq(variables['Build.SourceBranch'], variables['qa-branch'] )
|
||||||
variables:
|
variables:
|
||||||
- group: FixMyGlassQa
|
- group: FixMyGlassQa
|
||||||
jobs:
|
jobs:
|
||||||
- deployment: qaBuildDeployment
|
- deployment: qaBuildDeployment
|
||||||
displayName: Build and Deploy FMG - QA
|
displayName: Build and Deploy FMG - QA
|
||||||
environment: NoApproval-All
|
environment: NoApproval-All
|
||||||
container: node
|
container: node
|
||||||
workspace:
|
workspace:
|
||||||
clean: all
|
clean: all
|
||||||
strategy:
|
strategy:
|
||||||
runOnce:
|
runOnce:
|
||||||
deploy:
|
deploy:
|
||||||
steps:
|
steps:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
clean: true
|
clean: true
|
||||||
- template: templates/digital/step-build-vue.yml@AzureDevOps
|
- template: templates/digital/step-build-vue.yml@AzureDevOps
|
||||||
parameters:
|
parameters:
|
||||||
buildOutputDir: dist
|
buildOutputDir: dist
|
||||||
environment: Qa
|
environment: Qa
|
||||||
- template: templates/digital/step-deploy-vue.yml@AzureDevOps
|
- template: templates/digital/step-deploy-vue.yml@AzureDevOps
|
||||||
parameters:
|
parameters:
|
||||||
artifactName: vueDistQa
|
artifactName: vueDistQa
|
||||||
awsProfile: $(qaDeploymentProfile)
|
awsProfile: $(qaDeploymentProfile)
|
||||||
outputPath: /fmg/
|
outputPath: /fmg/
|
||||||
deployBuckets:
|
deployBuckets:
|
||||||
safelite-qa-fmg-us-east-1:
|
safelite-qa-fmg-us-east-1:
|
||||||
clearFolder: true
|
clearFolder: true
|
||||||
deployFolder: ''
|
deployFolder: ""
|
||||||
region: us-east-1
|
region: us-east-1
|
||||||
appDeployVariables:
|
safelite-qa-fmg-us-east-2:
|
||||||
__VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__)
|
clearFolder: true
|
||||||
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
deployFolder: ""
|
||||||
__VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__)
|
region: us-east-2
|
||||||
__VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__)
|
appDeployVariables:
|
||||||
indexDeployVariables:
|
__VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__)
|
||||||
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
||||||
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
__VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__)
|
||||||
cfDistributionId: $(cfDistributionId)
|
__VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__)
|
||||||
|
indexDeployVariables:
|
||||||
|
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
||||||
|
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
||||||
|
cfDistributionId: $(cfDistributionId)
|
||||||
|
|
||||||
# Prod Build/Deploy
|
# Prod Build/Deploy
|
||||||
- stage: Prod
|
- stage: Prod
|
||||||
condition: succeeded('Qa')
|
condition: succeeded('Qa')
|
||||||
variables:
|
variables:
|
||||||
- group: FixMyGlassProd
|
- group: FixMyGlassProd
|
||||||
jobs:
|
jobs:
|
||||||
- deployment: prodBuildDeployment
|
- deployment: prodBuildDeployment
|
||||||
displayName: Build and Deploy FMG - Prod
|
displayName: Build and Deploy FMG - Prod
|
||||||
environment: digitalCloud-prod
|
environment: digitalCloud-prod
|
||||||
container: node
|
container: node
|
||||||
workspace:
|
workspace:
|
||||||
clean: all
|
clean: all
|
||||||
strategy:
|
strategy:
|
||||||
runOnce:
|
runOnce:
|
||||||
deploy:
|
deploy:
|
||||||
steps:
|
steps:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
clean: true
|
clean: true
|
||||||
- template: templates/digital/step-build-vue.yml@AzureDevOps
|
- template: templates/digital/step-build-vue.yml@AzureDevOps
|
||||||
parameters:
|
parameters:
|
||||||
buildOutputDir: dist
|
buildOutputDir: dist
|
||||||
environment: Prod
|
environment: Prod
|
||||||
- template: templates/digital/step-deploy-vue.yml@AzureDevOps
|
- template: templates/digital/step-deploy-vue.yml@AzureDevOps
|
||||||
parameters:
|
parameters:
|
||||||
artifactName: vueDistProd
|
artifactName: vueDistProd
|
||||||
awsProfile: $(prodDeploymentProfile)
|
awsProfile: $(prodDeploymentProfile)
|
||||||
outputPath: /fmg/
|
outputPath: /fmg/
|
||||||
deployBuckets:
|
deployBuckets:
|
||||||
safelite-prod-fmg-us-east-1:
|
safelite-prod-fmg-us-east-1:
|
||||||
clearFolder: true
|
clearFolder: true
|
||||||
deployFolder: ''
|
deployFolder: ""
|
||||||
region: us-east-1
|
region: us-east-1
|
||||||
appDeployVariables:
|
safelite-prod-fmg-us-east-2:
|
||||||
__VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__)
|
clearFolder: true
|
||||||
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
deployFolder: ""
|
||||||
__VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__)
|
region: us-east-2
|
||||||
__VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__)
|
appDeployVariables:
|
||||||
indexDeployVariables:
|
__VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__)
|
||||||
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
||||||
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
__VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__)
|
||||||
cfDistributionId: $(cfDistributionId)
|
__VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__)
|
||||||
- template: templates/digital/auto-tag.yml@AzureDevOps
|
indexDeployVariables:
|
||||||
parameters:
|
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
||||||
dependsOn: prodBuildDeployment
|
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
||||||
userName: SafeliteAzureDevops
|
cfDistributionId: $(cfDistributionId)
|
||||||
userEmail: githubazuredevops@safelite.com
|
- template: templates/digital/auto-tag.yml@AzureDevOps
|
||||||
|
parameters:
|
||||||
|
dependsOn: prodBuildDeployment
|
||||||
|
userName: SafeliteAzureDevops
|
||||||
|
userEmail: githubazuredevops@safelite.com
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ module.exports = {
|
||||||
testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"],
|
testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"],
|
||||||
coverageThreshold: {
|
coverageThreshold: {
|
||||||
global: {
|
global: {
|
||||||
statements: 85,
|
statements: 83,
|
||||||
// Got the go ahead from Mark to temporarily lower this. Taking out initialize component made the year,make,model and style coverage drop a bit. Once unit tests for license plate lookup, vin lookup and address lookup are in the coverage should go back up to 90
|
// Got the go ahead from Mark to temporarily lower this. Taking out initialize component made the year,make,model and style coverage drop a bit. Once unit tests for license plate lookup, vin lookup and address lookup are in the coverage should go back up to 90
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,17 @@
|
||||||
<div class="modal fade modal-component" :id="this.cmsWidgetName" tabindex="-1" aria-labelledby="ModalComponentLabel" aria-hidden="true">
|
<div class="modal fade modal-component" :id="this.cmsWidgetName" tabindex="-1" aria-labelledby="ModalComponentLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
<div class="modal-body ps-4 pe-4 pt-5 pb-4">
|
<div class="modal-body ps-4 pe-4 pt-5 pb-4">
|
||||||
<img :src="this.ModalImage" class="w-100 mb-4" alt="" />
|
<img :src="this.ModalImage" class="w-100 mb-4" alt="" />
|
||||||
<h5 class="mb-4" v-html="this.ModalHeadline"></h5>
|
<h5 class="mb-4" v-html="this.ModalHeadline"></h5>
|
||||||
<p class="fw-bold mb-2 subheader-text" v-html="this.ModalSubheadertext"></p>
|
<p class="fw-bold mb-2 subheader-text" v-html="this.ModalSubheadertext"></p>
|
||||||
<p class="mb-0" v-html="this.ModalBodyText"></p>
|
<p class="mb-0" v-html="this.ModalBodyText"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer px-4 pt-4 pb-5">
|
<div class="modal-footer px-5 py-4">
|
||||||
<button class="btn btn-secondary w-100" data-bs-dismiss="modal" v-html="this.ModalCloseButtonText"></button>
|
<button class="btn btn-primary w-100" data-bs-dismiss="modal" v-html="this.ModalCloseButtonText"></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -45,17 +48,28 @@ export default {
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.modal {
|
.modal {
|
||||||
|
top: auto;
|
||||||
|
bottom: 0;
|
||||||
h5,
|
h5,
|
||||||
strong,
|
strong,
|
||||||
.subheader-text {
|
.subheader-text {
|
||||||
color: $black;
|
color: $black;
|
||||||
}
|
}
|
||||||
|
.modal-header {
|
||||||
|
border-bottom: none;
|
||||||
|
.btn-close {
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.6874 1.82179L9.50889 8L15.6874 14.1782C16.1042 14.595 16.1042 15.2707 15.6874 15.6875C15.4843 15.8907 15.2146 16 14.9328 16C14.6514 16 14.3818 15.8906 14.1787 15.6875L8.00017 9.50934L1.82171 15.6875C1.6182 15.8907 1.34876 16 1.06708 16C0.785733 16 0.516056 15.8906 0.312965 15.6875C-0.10429 15.2706 -0.10429 14.5952 0.312797 14.1784L6.03276 8.45867L6.49146 8L0.312945 1.82177C-0.10429 1.40483 -0.10429 0.729418 0.312797 0.31262C0.728936 -0.104145 1.40489 -0.104051 1.82185 0.31262L7.54152 6.03202L8.00017 6.49065L14.1786 0.312472C14.5955 -0.104107 15.2707 -0.104201 15.6874 0.312452C16.1042 0.729289 16.1042 1.40496 15.6874 1.82179Z' fill='%231574A1'/%3E%3C/svg%3E%0A");
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
&.modal-component {
|
&.modal-component {
|
||||||
.modal-dialog {
|
.modal-dialog {
|
||||||
|
max-width: 576px;
|
||||||
|
margin: 0 auto;
|
||||||
.modal-content {
|
.modal-content {
|
||||||
max-width: 327px;
|
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
box-shadow: 0px 16px 48px -16px rgba(0, 0, 0, 0.25);
|
box-shadow: 0px 16px 48px -16px rgba(0, 0, 0, 0.25);
|
||||||
|
border-radius: 1.5rem 1.5rem 0 0;
|
||||||
.modal-body {
|
.modal-body {
|
||||||
ul {
|
ul {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
|
@ -67,18 +81,28 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.modal-dialog-centered {
|
||||||
|
align-items: flex-end;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.modal-footer {
|
.modal-footer {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
|
background-color: $gray-100;
|
||||||
|
box-shadow: 0px -1px 0px rgba(179, 180, 181, 0.3);
|
||||||
button {
|
button {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
height: 3rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.modal-backdrop {
|
body {
|
||||||
&.show {
|
.modal-backdrop {
|
||||||
opacity: .4;
|
height: 100%;
|
||||||
|
&.show {
|
||||||
|
opacity: .4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export function getDamageString() {
|
||||||
if (damageLocations.length > 1) {
|
if (damageLocations.length > 1) {
|
||||||
returnString = "match"
|
returnString = "match"
|
||||||
} else {
|
} else {
|
||||||
switch(damageLocations[0]?.glassLocation) {
|
switch(damageLocations[0]?.location) {
|
||||||
case "Windshield":
|
case "Windshield":
|
||||||
returnString = "windshield"
|
returnString = "windshield"
|
||||||
break;
|
break;
|
||||||
|
|
@ -36,7 +36,7 @@ export function getDamageString() {
|
||||||
|
|
||||||
export function getIsWindshieldOnly () {
|
export function getIsWindshieldOnly () {
|
||||||
const damageLocations = store.getters.damage.glassToReplace;
|
const damageLocations = store.getters.damage.glassToReplace;
|
||||||
const returnString = damageLocations.length === 1 && damageLocations[0]?.glassLocation === "Windshield" ? "windshield" : "glass";
|
const returnString = damageLocations.length === 1 && damageLocations[0]?.location === "Windshield" ? "windshield" : "glass";
|
||||||
return returnString;
|
return returnString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ export async function isGlassAvailableForCarId(carId){
|
||||||
}
|
}
|
||||||
|
|
||||||
for(const option of currentGlassOptions){
|
for(const option of currentGlassOptions){
|
||||||
if(!newGlassOptions.data[optionsMap[option.glassLocation]].availableReplacementOptions.includes(option.glassName)){
|
if(!newGlassOptions.data[optionsMap[option.location]].availableReplacementOptions.includes(option.name)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({
|
||||||
it("Should return match when multiple selected damage options are in the store", () => {
|
it("Should return match when multiple selected damage options are in the store", () => {
|
||||||
|
|
||||||
// Arrange / Act
|
// Arrange / Act
|
||||||
store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "windshield"}, {glassLocation: "Passenger", glassName: "sideWindow"}];
|
store.getters.damage.glassToReplace = [{location: "Windshield", name: "windshield"}, {location: "Passenger", name: "sideWindow"}];
|
||||||
|
|
||||||
const damage = getDamageString();
|
const damage = getDamageString();
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({
|
||||||
it("Should return windshield when Windshield is the only selected damage option in the store", () => {
|
it("Should return windshield when Windshield is the only selected damage option in the store", () => {
|
||||||
|
|
||||||
// Arrange / Act
|
// Arrange / Act
|
||||||
store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "windshield"}];
|
store.getters.damage.glassToReplace = [{location: "Windshield", name: "windshield"}];
|
||||||
|
|
||||||
const damage = getDamageString();
|
const damage = getDamageString();
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({
|
||||||
it("Should return side window when Driver or Passenger is the only selected damage option in the store", () => {
|
it("Should return side window when Driver or Passenger is the only selected damage option in the store", () => {
|
||||||
|
|
||||||
// Arrange / Act
|
// Arrange / Act
|
||||||
store.getters.damage.glassToReplace = [{glassLocation: "Passenger", glassName: "sideWindow"}];
|
store.getters.damage.glassToReplace = [{location: "Passenger", name: "sideWindow"}];
|
||||||
|
|
||||||
const damage = getDamageString();
|
const damage = getDamageString();
|
||||||
|
|
||||||
|
|
@ -55,7 +55,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({
|
||||||
it("Should return rear window when Rear is the only selected damage option in the store", () => {
|
it("Should return rear window when Rear is the only selected damage option in the store", () => {
|
||||||
|
|
||||||
// Arrange / Act
|
// Arrange / Act
|
||||||
store.getters.damage.glassToReplace = [{glassLocation: "Rear", glassName: "rear"}];
|
store.getters.damage.glassToReplace = [{location: "Rear", name: "rear"}];
|
||||||
|
|
||||||
const damage = getDamageString();
|
const damage = getDamageString();
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({
|
||||||
describe("damage-helper.js", () => {
|
describe("damage-helper.js", () => {
|
||||||
it("Should return true if no mismatches between each array exist", async () => {
|
it("Should return true if no mismatches between each array exist", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "windshield"}];
|
store.getters.damage.glassToReplace = [{location: "Windshield", name: "windshield"}];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const isGlassAvailable = await isGlassAvailableForCarId();
|
const isGlassAvailable = await isGlassAvailableForCarId();
|
||||||
|
|
@ -80,7 +80,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({
|
||||||
describe("damage-helper.js", () => {
|
describe("damage-helper.js", () => {
|
||||||
it("Should return false if any mismatches between each array exist", async () => {
|
it("Should return false if any mismatches between each array exist", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "sideWindow"}];
|
store.getters.damage.glassToReplace = [{location: "Windshield", name: "sideWindow"}];
|
||||||
|
|
||||||
const isGlassAvailable = await isGlassAvailableForCarId();
|
const isGlassAvailable = await isGlassAvailableForCarId();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
v-bind:isDismissible="false" />
|
v-bind:isDismissible="false" />
|
||||||
<div v-for="(glass, i) in capabilityQuestionsData" :key="glass.key">
|
<div v-for="(glass, i) in capabilityQuestionsData" :key="glass.key">
|
||||||
<questionChain ref="questionChain"
|
<questionChain ref="questionChain"
|
||||||
v-model="selectedAnswers[glass.glassLocation + '-' + glass.glassName]"
|
v-model="selectedAnswers[glass.location + '-' + glass.name]"
|
||||||
:questionData="glass.capabilityQuestions" :glassIndex="i"
|
:questionData="glass.capabilityQuestions" :glassIndex="i"
|
||||||
v-if="showThisQuestionChain(glass, i)"
|
v-if="showThisQuestionChain(glass, i)"
|
||||||
validationRules="questions-required" />
|
validationRules="questions-required" />
|
||||||
|
|
@ -86,7 +86,7 @@ export default {
|
||||||
return this.getCmsContent("AdditionalPartsQuestionsAlert", "BodyText");
|
return this.getCmsContent("AdditionalPartsQuestionsAlert", "BodyText");
|
||||||
},
|
},
|
||||||
windshieldPart() {
|
windshieldPart() {
|
||||||
return this.pageData.partsOrQuestions.find(x => x.glassLocation === damageLocationsSelected.WINDSHIELD);
|
return this.pageData.partsOrQuestions.find(x => x.location === damageLocationsSelected.WINDSHIELD);
|
||||||
},
|
},
|
||||||
windshieldPartInfo() {
|
windshieldPartInfo() {
|
||||||
return this.windshieldPart.parts[0];
|
return this.windshieldPart.parts[0];
|
||||||
|
|
@ -122,8 +122,8 @@ export default {
|
||||||
const selectedAnswerResult2 = this.getCorrespondingAnswerResult2(glass.answerData.answerResult);
|
const selectedAnswerResult2 = this.getCorrespondingAnswerResult2(glass.answerData.answerResult);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
glassLocation: glass.glassLocation,
|
location: glass.location,
|
||||||
glassName: glass.glassName,
|
name: glass.name,
|
||||||
result: glass.answerData.answerResult,
|
result: glass.answerData.answerResult,
|
||||||
result1: glass.answerData.answerResult,
|
result1: glass.answerData.answerResult,
|
||||||
result2: selectedAnswerResult2,
|
result2: selectedAnswerResult2,
|
||||||
|
|
@ -143,10 +143,10 @@ export default {
|
||||||
// get parts from the capabilityQuestionAnswers
|
// get parts from the capabilityQuestionAnswers
|
||||||
let partsOrQuestions = this.pageData.partsOrQuestions;
|
let partsOrQuestions = this.pageData.partsOrQuestions;
|
||||||
for (let answer of capabilityQuestionsAnswersArray) {
|
for (let answer of capabilityQuestionsAnswersArray) {
|
||||||
const correspondingPart = partsOrQuestions.find(partOrQuestion => partOrQuestion.glassLocation === answer.glassLocation);
|
const correspondingPart = partsOrQuestions.find(partOrQuestion => partOrQuestion.location === answer.location);
|
||||||
const partFromCapabilityQuestionAnswer = (await this.dispatchStoreAction(storeActions.GET_PART_FROM_CAPABILITY_QUESTION_ANSWER, answer.glassLocation, false)).data;
|
const partFromCapabilityQuestionAnswer = (await this.dispatchStoreAction(storeActions.GET_PART_FROM_CAPABILITY_QUESTION_ANSWER, answer.location, false)).data;
|
||||||
|
|
||||||
partsOrQuestions.find(partOrQuestion => partOrQuestion.glassLocation === answer.glassLocation).parts = partFromCapabilityQuestionAnswer;
|
partsOrQuestions.find(partOrQuestion => partOrQuestion.location === answer.location).parts = partFromCapabilityQuestionAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.navigateForward(partsOrQuestions);
|
this.navigateForward(partsOrQuestions);
|
||||||
|
|
@ -239,7 +239,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update the key to re-render this part's question-chain component
|
// Update the key to re-render this part's question-chain component
|
||||||
this.capabilityQuestionsData[gpIndex].key = this.capabilityQuestionsData[gpIndex].glassLocation + this.capabilityQuestionsData[gpIndex].glassName + Date.now().toString();
|
this.capabilityQuestionsData[gpIndex].key = this.capabilityQuestionsData[gpIndex].location + this.capabilityQuestionsData[gpIndex].name + Date.now().toString();
|
||||||
|
|
||||||
// handle suppressing downstream in this question chain
|
// handle suppressing downstream in this question chain
|
||||||
|
|
||||||
|
|
@ -325,7 +325,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update the key to re-render this part's question-chain component
|
// Update the key to re-render this part's question-chain component
|
||||||
this.capabilityQuestionsData[gpIndex].key = this.capabilityQuestionsData[gpIndex].glassLocation + this.capabilityQuestionsData[gpIndex].glassName + Date.now().toString();
|
this.capabilityQuestionsData[gpIndex].key = this.capabilityQuestionsData[gpIndex].location + this.capabilityQuestionsData[gpIndex].name + Date.now().toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<div v-for="(glass, i) in moldingQuestionsData" :key="glass.key">
|
<div v-for="(glass, i) in moldingQuestionsData" :key="glass.key">
|
||||||
<questionChain
|
<questionChain
|
||||||
ref="questionChain"
|
ref="questionChain"
|
||||||
v-model="selectedAnswers[glass.glassLocation + '-' + glass.glassName]"
|
v-model="selectedAnswers[glass.location + '-' + glass.name]"
|
||||||
:questionData="glass.questions"
|
:questionData="glass.questions"
|
||||||
:glassIndex="i"
|
:glassIndex="i"
|
||||||
v-if="showThisQuestionChain(glass, i)"
|
v-if="showThisQuestionChain(glass, i)"
|
||||||
|
|
@ -132,8 +132,8 @@ export default {
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
const questionAnswersArray = this.moldingQuestionsData.map((glass) => {
|
const questionAnswersArray = this.moldingQuestionsData.map((glass) => {
|
||||||
return {
|
return {
|
||||||
glassLocation: glass.glassLocation,
|
location: glass.location,
|
||||||
glassName: glass.glassName,
|
name: glass.name,
|
||||||
partNum: glass.answerData.answerResult,
|
partNum: glass.answerData.answerResult,
|
||||||
answeredQuestions: glass.answerData.answeredQuestions,
|
answeredQuestions: glass.answerData.answeredQuestions,
|
||||||
isSuppressedPart: glass.isSuppressedPart,
|
isSuppressedPart: glass.isSuppressedPart,
|
||||||
|
|
@ -152,7 +152,7 @@ export default {
|
||||||
let partsOrQuestions = this.pageData.partsOrQuestions;
|
let partsOrQuestions = this.pageData.partsOrQuestions;
|
||||||
for (let answer of questionAnswersArray) {
|
for (let answer of questionAnswersArray) {
|
||||||
partsOrQuestions.find(partOrQuestion => {
|
partsOrQuestions.find(partOrQuestion => {
|
||||||
return partOrQuestion.glassLocation === answer.glassLocation && partOrQuestion.glassName === answer.glassName;
|
return partOrQuestion.location === answer.location && partOrQuestion.name === answer.name;
|
||||||
}).parts[0].childParts = [
|
}).parts[0].childParts = [
|
||||||
{
|
{
|
||||||
partNumber: answer.partNum
|
partNumber: answer.partNum
|
||||||
|
|
@ -250,7 +250,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update the key to re-render this part's question-chain component
|
// Update the key to re-render this part's question-chain component
|
||||||
this.moldingQuestionsData[gpIndex].key = this.moldingQuestionsData[gpIndex].glassLocation + this.moldingQuestionsData[gpIndex].glassName + Date.now().toString();
|
this.moldingQuestionsData[gpIndex].key = this.moldingQuestionsData[gpIndex].location + this.moldingQuestionsData[gpIndex].name + Date.now().toString();
|
||||||
|
|
||||||
// handle suppressing downstream in this question chain
|
// handle suppressing downstream in this question chain
|
||||||
|
|
||||||
|
|
@ -336,7 +336,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update the key to re-render this part's question-chain component
|
// Update the key to re-render this part's question-chain component
|
||||||
this.moldingQuestionsData[gpIndex].key = this.moldingQuestionsData[gpIndex].glassLocation + this.moldingQuestionsData[gpIndex].glassName + Date.now().toString();
|
this.moldingQuestionsData[gpIndex].key = this.moldingQuestionsData[gpIndex].location + this.moldingQuestionsData[gpIndex].name + Date.now().toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<div v-for="(glass, i) in partsQuestionsData" :key="glass.key">
|
<div v-for="(glass, i) in partsQuestionsData" :key="glass.key">
|
||||||
<questionChain
|
<questionChain
|
||||||
ref="questionChain"
|
ref="questionChain"
|
||||||
v-model="selectedAnswers[glass.glassLocation + '-' + glass.glassName]"
|
v-model="selectedAnswers[glass.location + '-' + glass.name]"
|
||||||
:questionData="glass.questions"
|
:questionData="glass.questions"
|
||||||
:glassIndex="i"
|
:glassIndex="i"
|
||||||
v-if="showThisQuestionChain(glass, i)"
|
v-if="showThisQuestionChain(glass, i)"
|
||||||
|
|
@ -132,8 +132,8 @@ export default {
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
const questionAnswersArray = this.partsQuestionsData.map((glass) => {
|
const questionAnswersArray = this.partsQuestionsData.map((glass) => {
|
||||||
return {
|
return {
|
||||||
glassLocation: glass.glassLocation,
|
location: glass.location,
|
||||||
glassName: glass.glassName,
|
name: glass.name,
|
||||||
result: glass.answerData.answerResult,
|
result: glass.answerData.answerResult,
|
||||||
answeredQuestions: glass.answerData.answeredQuestions,
|
answeredQuestions: glass.answerData.answeredQuestions,
|
||||||
isSuppressedPart: glass.isSuppressedPart,
|
isSuppressedPart: glass.isSuppressedPart,
|
||||||
|
|
@ -154,9 +154,9 @@ export default {
|
||||||
return this.$refs.funnelFooter.removeLoader();
|
return this.$refs.funnelFooter.removeLoader();
|
||||||
});
|
});
|
||||||
|
|
||||||
const glassNameAndPartsForStore = partsLookup.data.glassNameAndParts;
|
const glassPiecePartsForStore = partsLookup.data.glassPieceParts;
|
||||||
|
|
||||||
this.navigateForward(glassNameAndPartsForStore);
|
this.navigateForward(glassPiecePartsForStore);
|
||||||
},
|
},
|
||||||
handleAnswerUpdates(answer) {
|
handleAnswerUpdates(answer) {
|
||||||
// only runs when all questions in a question-chain have been answered
|
// only runs when all questions in a question-chain have been answered
|
||||||
|
|
@ -246,7 +246,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update the key to re-render this part's question-chain component
|
// Update the key to re-render this part's question-chain component
|
||||||
this.partsQuestionsData[gpIndex].key = this.partsQuestionsData[gpIndex].glassLocation + this.partsQuestionsData[gpIndex].glassName + Date.now().toString();
|
this.partsQuestionsData[gpIndex].key = this.partsQuestionsData[gpIndex].location + this.partsQuestionsData[gpIndex].name + Date.now().toString();
|
||||||
|
|
||||||
// handle suppressing downstream in this question chain
|
// handle suppressing downstream in this question chain
|
||||||
|
|
||||||
|
|
@ -332,7 +332,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update the key to re-render this part's question-chain component
|
// Update the key to re-render this part's question-chain component
|
||||||
this.partsQuestionsData[gpIndex].key = this.partsQuestionsData[gpIndex].glassLocation + this.partsQuestionsData[gpIndex].glassName + Date.now().toString();
|
this.partsQuestionsData[gpIndex].key = this.partsQuestionsData[gpIndex].location + this.partsQuestionsData[gpIndex].name + Date.now().toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,8 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
return store.getters.order.damage.isRepair || (store.getters.order.lineItems?.glassParts != null && store.getters.order.lineItems.glassParts.length > 0);
|
return true;
|
||||||
|
//return store.getters.order.damage.isRepair || (store.getters.order.lineItems?.glassParts != null && store.getters.order.lineItems.glassParts.length > 0);
|
||||||
},
|
},
|
||||||
getDefaultisInsuranceSelectedValue() {
|
getDefaultisInsuranceSelectedValue() {
|
||||||
var defaultisInsuranceSelectedValue = this.$store.getters.order.payment.isInsurance;
|
var defaultisInsuranceSelectedValue = this.$store.getters.order.payment.isInsurance;
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,8 @@ describe("vehicle-damage.vue", () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
const partsData = {
|
const partsData = {
|
||||||
partsOrQuestions: [{
|
partsOrQuestions: [{
|
||||||
glassName: "Single",
|
name: "Single",
|
||||||
glassLocation: "Windshield",
|
location: "Windshield",
|
||||||
parts: null,
|
parts: null,
|
||||||
partQuestions: [{
|
partQuestions: [{
|
||||||
questionSequence: 1,
|
questionSequence: 1,
|
||||||
|
|
@ -144,8 +144,8 @@ describe("vehicle-damage.vue", () => {
|
||||||
selectedRearReplaceOptions: "Stationary",
|
selectedRearReplaceOptions: "Stationary",
|
||||||
})
|
})
|
||||||
|
|
||||||
const expectedGlassToReplace = [{ glassLocation: "Windshield", glassName: "Single" }, { glassLocation: "Driver", glassName: "Back" },
|
const expectedGlassToReplace = [{ location: "Windshield", name: "Single" }, { location: "Driver", name: "Back" },
|
||||||
{ glassLocation: "Passenger", glassName: "Quarter" }, { glassLocation: "Rear", glassName: "Stationary" }];
|
{ location: "Passenger", name: "Quarter" }, { location: "Rear", name: "Stationary" }];
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
vehicleDamage.beforeRouteEnter.call(
|
vehicleDamage.beforeRouteEnter.call(
|
||||||
|
|
@ -168,8 +168,8 @@ describe("vehicle-damage.vue", () => {
|
||||||
const partsData = {
|
const partsData = {
|
||||||
partsOrQuestions: [
|
partsOrQuestions: [
|
||||||
{
|
{
|
||||||
glassLocation: "Windshield",
|
location: "Windshield",
|
||||||
glassName: "Single",
|
name: "Single",
|
||||||
partQuestions: null,
|
partQuestions: null,
|
||||||
parts: [
|
parts: [
|
||||||
{
|
{
|
||||||
|
|
@ -189,8 +189,8 @@ describe("vehicle-damage.vue", () => {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
glassName: "Stationary",
|
name: "Stationary",
|
||||||
glassLocation: "Rear",
|
location: "Rear",
|
||||||
parts: [
|
parts: [
|
||||||
{
|
{
|
||||||
partNumber: "DB09626GTYN",
|
partNumber: "DB09626GTYN",
|
||||||
|
|
@ -235,7 +235,7 @@ describe("vehicle-damage.vue", () => {
|
||||||
selectedWindshieldDamageType: "Replace"
|
selectedWindshieldDamageType: "Replace"
|
||||||
};
|
};
|
||||||
|
|
||||||
const expectedGlassToReplace = [{ glassLocation: "Windshield", glassName: "Single" },];
|
const expectedGlassToReplace = [{ location: "Windshield", name: "Single" },];
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
vehicleDamage.beforeRouteEnter.call(
|
vehicleDamage.beforeRouteEnter.call(
|
||||||
|
|
@ -509,7 +509,7 @@ describe("vehicle-damage.vue", () => {
|
||||||
(c) => c(wrapper.vm)
|
(c) => c(wrapper.vm)
|
||||||
);
|
);
|
||||||
|
|
||||||
store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{ glassLocation: damageLocation }] }, isRepair: true };
|
store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{ location: damageLocation }] }, isRepair: true };
|
||||||
|
|
||||||
var glassSelections = wrapper.vm.getDamageLocationsFromStore();
|
var glassSelections = wrapper.vm.getDamageLocationsFromStore();
|
||||||
|
|
||||||
|
|
@ -553,7 +553,7 @@ describe("vehicle-damage.vue", () => {
|
||||||
eventBusItem: jest.fn(),
|
eventBusItem: jest.fn(),
|
||||||
damage:
|
damage:
|
||||||
{
|
{
|
||||||
glassToReplace: [{ glassLocation: damageLocation, glassName: damageName }],
|
glassToReplace: [{ location: damageLocation, name: damageName }],
|
||||||
isRepair: isRepair,
|
isRepair: isRepair,
|
||||||
numberOfChips: 2
|
numberOfChips: 2
|
||||||
},
|
},
|
||||||
|
|
@ -583,7 +583,7 @@ describe("vehicle-damage.vue", () => {
|
||||||
(c) => c(wrapper.vm)
|
(c) => c(wrapper.vm)
|
||||||
);
|
);
|
||||||
|
|
||||||
store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{ glassLocation: damageLocation, glassName: damageName }] }, isRepair: true };
|
store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{ location: damageLocation, name: damageName }] }, isRepair: true };
|
||||||
|
|
||||||
var glassSelections = wrapper.vm.getDriverSideReplaceOptionsFromStore();
|
var glassSelections = wrapper.vm.getDriverSideReplaceOptionsFromStore();
|
||||||
|
|
||||||
|
|
@ -610,7 +610,7 @@ describe("vehicle-damage.vue", () => {
|
||||||
(c) => c(wrapper.vm)
|
(c) => c(wrapper.vm)
|
||||||
);
|
);
|
||||||
|
|
||||||
store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{ glassLocation: damageLocation, glassName: damageName }] }, isRepair: true };
|
store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{ location: damageLocation, name: damageName }] }, isRepair: true };
|
||||||
|
|
||||||
var glassSelections = wrapper.vm.getPassengerSideReplaceOptionsFromStore();
|
var glassSelections = wrapper.vm.getPassengerSideReplaceOptionsFromStore();
|
||||||
|
|
||||||
|
|
@ -634,7 +634,7 @@ describe("vehicle-damage.vue", () => {
|
||||||
(c) => c(wrapper.vm)
|
(c) => c(wrapper.vm)
|
||||||
);
|
);
|
||||||
|
|
||||||
store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{ glassLocation: damageLocation, glassName: damageName }] }, isRepair: true };
|
store.getters = { vehicle: { carId: "C0000000" }, eventBusItem: jest.fn(), damage: { glassToReplace: [{ location: damageLocation, name: damageName }] }, isRepair: true };
|
||||||
|
|
||||||
var glassSelections = wrapper.vm.getRearReplaceOptionsFromStore();
|
var glassSelections = wrapper.vm.getRearReplaceOptionsFromStore();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -179,16 +179,16 @@ export default {
|
||||||
getDamageLocationsFromStore() {
|
getDamageLocationsFromStore() {
|
||||||
var glassSelections = [];
|
var glassSelections = [];
|
||||||
|
|
||||||
if (store.getters.damage.glassToReplace?.some(glass => { return glass.glassLocation === damageLocationsSelected.WINDSHIELD }) ||
|
if (store.getters.damage.glassToReplace?.some(glass => { return glass.location === damageLocationsSelected.WINDSHIELD }) ||
|
||||||
store.getters.damage.isRepair) {
|
store.getters.damage.isRepair) {
|
||||||
glassSelections.push(damageLocationsSelected.WINDSHIELD);
|
glassSelections.push(damageLocationsSelected.WINDSHIELD);
|
||||||
}
|
}
|
||||||
if (store.getters.damage.glassToReplace?.some(glass => { return glass.glassLocation === damageLocationsSelected.DRIVER ||
|
if (store.getters.damage.glassToReplace?.some(glass => { return glass.location === damageLocationsSelected.DRIVER ||
|
||||||
glass.glassLocation === damageLocationsSelected.PASSENGER })) {
|
glass.location === damageLocationsSelected.PASSENGER })) {
|
||||||
glassSelections.push(damageLocationsSelected.SIDEDOOR);
|
glassSelections.push(damageLocationsSelected.SIDEDOOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (store.getters.damage.glassToReplace?.some(glass => { return glass.glassLocation === damageLocationsSelected.REAR })) {
|
if (store.getters.damage.glassToReplace?.some(glass => { return glass.location === damageLocationsSelected.REAR })) {
|
||||||
glassSelections.push(damageLocationsSelected.REARWINDOW);
|
glassSelections.push(damageLocationsSelected.REARWINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -205,20 +205,20 @@ export default {
|
||||||
windShieldOptions.selectedWindshieldChipCount = store.getters.damage.numberOfChips;
|
windShieldOptions.selectedWindshieldChipCount = store.getters.damage.numberOfChips;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (store.getters.damage.glassToReplace?.some(glass => { return glass.glassLocation === damageLocationsSelected.WINDSHIELD &&
|
if (store.getters.damage.glassToReplace?.some(glass => { return glass.location === damageLocationsSelected.WINDSHIELD &&
|
||||||
glass.glassName === damageLocationsSelected.SINGLE })) {
|
glass.name === damageLocationsSelected.SINGLE })) {
|
||||||
windShieldOptions.selectedWindshieldDamageType = damageLocationsSelected.REPLACE;
|
windShieldOptions.selectedWindshieldDamageType = damageLocationsSelected.REPLACE;
|
||||||
windShieldOptions.selectedWindshieldReplaceOptions.push(damageLocationsSelected.SINGLE);
|
windShieldOptions.selectedWindshieldReplaceOptions.push(damageLocationsSelected.SINGLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (store.getters.damage.glassToReplace?.some(glass => { return glass.glassLocation === damageLocationsSelected.WINDSHIELD &&
|
if (store.getters.damage.glassToReplace?.some(glass => { return glass.location === damageLocationsSelected.WINDSHIELD &&
|
||||||
glass.glassName === damageLocationsSelected.DRIVER })) {
|
glass.name === damageLocationsSelected.DRIVER })) {
|
||||||
windShieldOptions.selectedWindshieldDamageType = damageLocationsSelected.REPLACE;
|
windShieldOptions.selectedWindshieldDamageType = damageLocationsSelected.REPLACE;
|
||||||
windShieldOptions.selectedWindshieldReplaceOptions.push(damageLocationsSelected.DRIVER);
|
windShieldOptions.selectedWindshieldReplaceOptions.push(damageLocationsSelected.DRIVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (store.getters.damage.glassToReplace?.some(glass => { return glass.glassLocation === damageLocationsSelected.WINDSHIELD &&
|
if (store.getters.damage.glassToReplace?.some(glass => { return glass.location === damageLocationsSelected.WINDSHIELD &&
|
||||||
glass.glassName === damageLocationsSelected.PASSENGER })) {
|
glass.name === damageLocationsSelected.PASSENGER })) {
|
||||||
windShieldOptions.selectedWindshieldDamageType = damageLocationsSelected.REPLACE;
|
windShieldOptions.selectedWindshieldDamageType = damageLocationsSelected.REPLACE;
|
||||||
windShieldOptions.selectedWindshieldReplaceOptions.push(damageLocationsSelected.PASSENGER);
|
windShieldOptions.selectedWindshieldReplaceOptions.push(damageLocationsSelected.PASSENGER);
|
||||||
}
|
}
|
||||||
|
|
@ -230,11 +230,11 @@ export default {
|
||||||
|
|
||||||
getDoorSidesFromStore() {
|
getDoorSidesFromStore() {
|
||||||
var doorSides = [];
|
var doorSides = [];
|
||||||
if (store.getters.damage.glassToReplace?.some(glass => { return glass.glassLocation === damageLocationsSelected.DRIVER })){
|
if (store.getters.damage.glassToReplace?.some(glass => { return glass.location === damageLocationsSelected.DRIVER })){
|
||||||
doorSides.push(damageLocationsSelected.DRIVERSIDE);
|
doorSides.push(damageLocationsSelected.DRIVERSIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (store.getters.damage.glassToReplace?.some(glass => { return glass.glassLocation === damageLocationsSelected.PASSENGER })){
|
if (store.getters.damage.glassToReplace?.some(glass => { return glass.location === damageLocationsSelected.PASSENGER })){
|
||||||
doorSides.push(damageLocationsSelected.PASSENGERSIDE);
|
doorSides.push(damageLocationsSelected.PASSENGERSIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -245,8 +245,8 @@ export default {
|
||||||
var driverSideReplaceOptions = [];
|
var driverSideReplaceOptions = [];
|
||||||
|
|
||||||
store.getters.damage.glassToReplace?.forEach(glass => {
|
store.getters.damage.glassToReplace?.forEach(glass => {
|
||||||
if (glass.glassLocation === damageLocationsSelected.DRIVER){
|
if (glass.location === damageLocationsSelected.DRIVER){
|
||||||
driverSideReplaceOptions.push(glass.glassName);
|
driverSideReplaceOptions.push(glass.name);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -257,16 +257,16 @@ export default {
|
||||||
var passengerSideReplaceOptions = [];
|
var passengerSideReplaceOptions = [];
|
||||||
|
|
||||||
store.getters.damage.glassToReplace?.forEach(glass => {
|
store.getters.damage.glassToReplace?.forEach(glass => {
|
||||||
if (glass.glassLocation === damageLocationsSelected.PASSENGER){
|
if (glass.location === damageLocationsSelected.PASSENGER){
|
||||||
passengerSideReplaceOptions.push(glass.glassName);
|
passengerSideReplaceOptions.push(glass.name);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return passengerSideReplaceOptions;
|
return passengerSideReplaceOptions;
|
||||||
},
|
},
|
||||||
|
|
||||||
getRearReplaceOptionsFromStore(){
|
getRearReplaceOptionsFromStore() {
|
||||||
var rearReplaceOptions = store.getters.damage.glassToReplace?.filter(glass => glass.glassLocation === damageLocationsSelected.REAR)[0]?.glassName;
|
var rearReplaceOptions = store.getters.damage.glassToReplace?.filter(glass => glass.location === damageLocationsSelected.REAR)[0]?.name;
|
||||||
|
|
||||||
return rearReplaceOptions;
|
return rearReplaceOptions;
|
||||||
},
|
},
|
||||||
|
|
@ -296,24 +296,24 @@ export default {
|
||||||
const selectedGlassToReplace = [];
|
const selectedGlassToReplace = [];
|
||||||
if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){
|
if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){
|
||||||
this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => {
|
this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => {
|
||||||
selectedGlassToReplace.push({ glassLocation: damageLocationsSelected.WINDSHIELD, glassName: wsItem});
|
selectedGlassToReplace.push({ location: damageLocationsSelected.WINDSHIELD, name: wsItem});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isDriverSideReplace){
|
if (this.isDriverSideReplace){
|
||||||
this.sideDoorOptionsData.selectedDriverSideReplaceOptions.forEach(driverItem => {
|
this.sideDoorOptionsData.selectedDriverSideReplaceOptions.forEach(driverItem => {
|
||||||
selectedGlassToReplace.push({ glassLocation: damageLocationsSelected.DRIVER, glassName: driverItem});
|
selectedGlassToReplace.push({ location: damageLocationsSelected.DRIVER, name: driverItem});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isPassengerSideReplace){
|
if (this.isPassengerSideReplace){
|
||||||
this.sideDoorOptionsData.selectedPassengerSideReplaceOptions.forEach(passengerItem => {
|
this.sideDoorOptionsData.selectedPassengerSideReplaceOptions.forEach(passengerItem => {
|
||||||
selectedGlassToReplace.push({ glassLocation: damageLocationsSelected.PASSENGER, glassName: passengerItem});
|
selectedGlassToReplace.push({ location: damageLocationsSelected.PASSENGER, name: passengerItem});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isRearWindowDamageLocation) {
|
if (this.isRearWindowDamageLocation) {
|
||||||
selectedGlassToReplace.push({ glassLocation: damageLocationsSelected.REAR, glassName: this.selectedRearReplaceOptions});
|
selectedGlassToReplace.push({ location: damageLocationsSelected.REAR, name: this.selectedRearReplaceOptions});
|
||||||
}
|
}
|
||||||
|
|
||||||
return selectedGlassToReplace;
|
return selectedGlassToReplace;
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ const featureListData = {
|
||||||
{ ColorAnswerText: 'Green Tint', FeatureAnswers: [{ FeatureAnswerText: "heated glass, solar, 1 hole", PartNumber: "DB12209GTYN" }] },
|
{ ColorAnswerText: 'Green Tint', FeatureAnswers: [{ FeatureAnswerText: "heated glass, solar, 1 hole", PartNumber: "DB12209GTYN" }] },
|
||||||
{ ColorAnswerText: 'Gray Tint Privacy', FeatureAnswers: [{ FeatureAnswerText: "heated glass, solar, 1 hole", PartNumber: "DB12209YPYN" }] }
|
{ ColorAnswerText: 'Gray Tint Privacy', FeatureAnswers: [{ FeatureAnswerText: "heated glass, solar, 1 hole", PartNumber: "DB12209YPYN" }] }
|
||||||
],
|
],
|
||||||
glassLocationProp: "Rear",
|
locationProp: "Rear",
|
||||||
glassNameProp: "Stationary",
|
nameProp: "Stationary",
|
||||||
modelValueProp: {}
|
modelValueProp: {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,7 +36,7 @@ describe("glass-part-question.vue", () => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Tint mapper, should get tint image by glassLocation and tintColor", async () => {
|
test("Tint mapper, should get tint image by location and tintColor", async () => {
|
||||||
|
|
||||||
//Arrange
|
//Arrange
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ describe("glass-part-question.vue", () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
const { wrapper } = setupMocks(featureListData);
|
const { wrapper } = setupMocks(featureListData);
|
||||||
store.getters.pageData.mockReset();
|
store.getters.pageData.mockReset();
|
||||||
store.getters.pageData.mockReturnValueOnce({ partsOrQuestions: [{glassName: "Stationary", glassLocation: "Rear", parts: [{ partNumber: "DB12209GTYN", color: "Green Tint"}]}] });
|
store.getters.pageData.mockReturnValueOnce({ partsOrQuestions: [{name: "Stationary", location: "Rear", parts: [{ partNumber: "DB12209GTYN", color: "Green Tint"}]}] });
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
await wrapper.vm.$nextTick();
|
await wrapper.vm.$nextTick();
|
||||||
|
|
@ -110,7 +110,7 @@ describe("glass-part-question.vue", () => {
|
||||||
test("default is selected if only one option", async () => {
|
test("default is selected if only one option", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
store.getters.pageData.mockReset();
|
store.getters.pageData.mockReset();
|
||||||
store.getters.pageData.mockReturnValueOnce({ partsOrQuestions: [{glassName: "Stationary", glassLocation: "Rear", parts: [{ partNumber: "DB12209GTYN", color: "Green Tint"}]}] });
|
store.getters.pageData.mockReturnValueOnce({ partsOrQuestions: [{name: "Stationary", location: "Rear", parts: [{ partNumber: "DB12209GTYN", color: "Green Tint"}]}] });
|
||||||
const { wrapper } = setupMocks(featureListData);
|
const { wrapper } = setupMocks(featureListData);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -128,7 +128,7 @@ describe("glass-part-question.vue", () => {
|
||||||
test("default is not selected if more than one option", async () => {
|
test("default is not selected if more than one option", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
store.getters.pageData.mockReset();
|
store.getters.pageData.mockReset();
|
||||||
store.getters.pageData.mockReturnValueOnce({ partsOrQuestions: [{glassName: "Stationary", glassLocation: "Rear", parts: [{ partNumber: "DB12209GTYN", color: "Green Tint"}, { partNumber: "DB12209GTYNXXX", color: "Green Tint"}]}] });
|
store.getters.pageData.mockReturnValueOnce({ partsOrQuestions: [{name: "Stationary", location: "Rear", parts: [{ partNumber: "DB12209GTYN", color: "Green Tint"}, { partNumber: "DB12209GTYNXXX", color: "Green Tint"}]}] });
|
||||||
const { wrapper } = setupMocks(featureListData);
|
const { wrapper } = setupMocks(featureListData);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -149,13 +149,13 @@ describe("glass-part-question.vue", () => {
|
||||||
["Windshield", "Single", "Blue Tint", []],
|
["Windshield", "Single", "Blue Tint", []],
|
||||||
["Driver", "Quarter", "Green Tint", []]
|
["Driver", "Quarter", "Green Tint", []]
|
||||||
];
|
];
|
||||||
test.each(partsForSelectedTintTestCases)("partsForSelectedTint returns correct parts", async (glassLocation, glassName, selectedTint, expectedResults) => {
|
test.each(partsForSelectedTintTestCases)("partsForSelectedTint returns correct parts", async (location, name, selectedTint, expectedResults) => {
|
||||||
// Arrange
|
// Arrange
|
||||||
store.getters.pageData.mockReset();
|
store.getters.pageData.mockReset();
|
||||||
store.getters.pageData.mockReturnValueOnce({ partsOrQuestions: [
|
store.getters.pageData.mockReturnValueOnce({ partsOrQuestions: [
|
||||||
{
|
{
|
||||||
glassName: "Stationary",
|
name: "Stationary",
|
||||||
glassLocation: "Rear",
|
location: "Rear",
|
||||||
parts: [
|
parts: [
|
||||||
{ partNumber: "Glass1", color: "Green Tint"},
|
{ partNumber: "Glass1", color: "Green Tint"},
|
||||||
{ partNumber: "Glass2", color: "Blue Tint"},
|
{ partNumber: "Glass2", color: "Blue Tint"},
|
||||||
|
|
@ -167,14 +167,14 @@ describe("glass-part-question.vue", () => {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
glassName: "Single",
|
name: "Single",
|
||||||
glassLocation: "Windshield",
|
location: "Windshield",
|
||||||
parts: [{ partNumber: "Windshield1", color: "Green Tint"}, { partNumber: "Windshield2", color: "Green Tint"}]
|
parts: [{ partNumber: "Windshield1", color: "Green Tint"}, { partNumber: "Windshield2", color: "Green Tint"}]
|
||||||
}
|
}
|
||||||
]});
|
]});
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
glassLocationProp: glassLocation,
|
locationProp: location,
|
||||||
glassNameProp: glassName,
|
nameProp: name,
|
||||||
colorAnswersProp: [],
|
colorAnswersProp: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -188,9 +188,9 @@ describe("glass-part-question.vue", () => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function setupMocks({ glassNameProp, glassLocationProp, colorAnswersProp, modelValueProp }) {
|
function setupMocks({ nameProp, locationProp, colorAnswersProp, modelValueProp }) {
|
||||||
//Mock store
|
//Mock store
|
||||||
store.getters.pageData.mockReturnValueOnce({ partsOrQuestions: [{glassName: "Stationary", glassLocation: "Rear", parts: []}] });
|
store.getters.pageData.mockReturnValueOnce({ partsOrQuestions: [{name: "Stationary", location: "Rear", parts: []}] });
|
||||||
store.getters.lineItems = { glassParts: {} }
|
store.getters.lineItems = { glassParts: {} }
|
||||||
|
|
||||||
const mountOptions = getMountOptions({
|
const mountOptions = getMountOptions({
|
||||||
|
|
@ -205,8 +205,8 @@ function setupMocks({ glassNameProp, glassLocationProp, colorAnswersProp, modelV
|
||||||
});
|
});
|
||||||
|
|
||||||
mountOptions.propsData = {
|
mountOptions.propsData = {
|
||||||
glassName: glassNameProp,
|
name: nameProp,
|
||||||
glassLocation: glassLocationProp,
|
location: locationProp,
|
||||||
colorAnswers: colorAnswersProp,
|
colorAnswers: colorAnswersProp,
|
||||||
modelValue: modelValueProp
|
modelValue: modelValueProp
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
:isWide="true"
|
:isWide="true"
|
||||||
altText=""
|
altText=""
|
||||||
isRequired
|
isRequired
|
||||||
:groupName="`${glassLocation}-${glassName}`"
|
:groupName="`${location}-${name}`"
|
||||||
:validationRules="tintValidationRules">
|
:validationRules="tintValidationRules">
|
||||||
<div class="row my-2" aria-live="polite">
|
<div class="row my-2" aria-live="polite">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
:loaderEnabled="false"
|
:loaderEnabled="false"
|
||||||
isRequired
|
isRequired
|
||||||
:groupName="`${glassLocation}-${glassName}-${selectedTint}`"
|
:groupName="`${location}-${name}-${selectedTint}`"
|
||||||
:validationRules="partValidationRules"
|
:validationRules="partValidationRules"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -58,8 +58,8 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
glassName: String,
|
name: String,
|
||||||
glassLocation: String,
|
location: String,
|
||||||
colorAnswers: Array,
|
colorAnswers: Array,
|
||||||
modelValue: Object,
|
modelValue: Object,
|
||||||
alreadyPopulatedPartsData: {
|
alreadyPopulatedPartsData: {
|
||||||
|
|
@ -75,7 +75,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
tintValidationRules() {
|
tintValidationRules() {
|
||||||
const validationRuleName = `${this.glassLocation}-${this.glassName}-tint-required`;
|
const validationRuleName = `${this.location}-${this.name}-tint-required`;
|
||||||
defineRule(
|
defineRule(
|
||||||
validationRuleName,
|
validationRuleName,
|
||||||
required(errorMessages.OPTION_REQUIRED)
|
required(errorMessages.OPTION_REQUIRED)
|
||||||
|
|
@ -83,7 +83,7 @@ export default {
|
||||||
return validationRuleName;
|
return validationRuleName;
|
||||||
},
|
},
|
||||||
partValidationRules() {
|
partValidationRules() {
|
||||||
const validationRuleName = `${this.glassLocation}-${this.glassName}-part-required`;
|
const validationRuleName = `${this.location}-${this.name}-part-required`;
|
||||||
defineRule(
|
defineRule(
|
||||||
validationRuleName,
|
validationRuleName,
|
||||||
required(errorMessages.OPTION_REQUIRED)
|
required(errorMessages.OPTION_REQUIRED)
|
||||||
|
|
@ -93,18 +93,19 @@ export default {
|
||||||
colorQuestionText() {
|
colorQuestionText() {
|
||||||
return getCustomTransformValue(
|
return getCustomTransformValue(
|
||||||
this.glassColorQuestion,
|
this.glassColorQuestion,
|
||||||
`${this.glassLocation} ${this.glassName}`
|
`${this.location} ${this.name}`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
tintSelectionOptions() {
|
tintSelectionOptions() {
|
||||||
let tintOptions = [];
|
let tintOptions = [];
|
||||||
|
|
||||||
Object.keys(this.featureListData).forEach((tintOption) => {
|
Object.keys(this.featureListData).forEach((tintOption) => {
|
||||||
tintOptions.push({
|
tintOptions.push({
|
||||||
value: tintOption,
|
value: tintOption,
|
||||||
buttonLabel: tintOption,
|
buttonLabel: tintOption,
|
||||||
buttonImage: require(`@/assets/img/tints/${this.getTintSourceImage(
|
buttonImage: require(`@/assets/img/tints/${this.getTintSourceImage(
|
||||||
this.glassLocation,
|
this.location,
|
||||||
tintOption
|
tintOption
|
||||||
)}`),
|
)}`),
|
||||||
});
|
});
|
||||||
|
|
@ -130,9 +131,9 @@ export default {
|
||||||
partsForSelectedTint() {
|
partsForSelectedTint() {
|
||||||
const matchingGlass = this.PartDataFromApi.partsOrQuestions?.filter(
|
const matchingGlass = this.PartDataFromApi.partsOrQuestions?.filter(
|
||||||
(dataForGlassLocationAndName) =>
|
(dataForGlassLocationAndName) =>
|
||||||
dataForGlassLocationAndName.glassName == this.glassName &&
|
dataForGlassLocationAndName.name == this.name &&
|
||||||
dataForGlassLocationAndName.glassLocation ==
|
dataForGlassLocationAndName.location ==
|
||||||
this.glassLocation
|
this.location
|
||||||
);
|
);
|
||||||
const matchingGlassParts =
|
const matchingGlassParts =
|
||||||
matchingGlass?.length == 1 ? matchingGlass[0].parts : [];
|
matchingGlass?.length == 1 ? matchingGlass[0].parts : [];
|
||||||
|
|
@ -188,8 +189,8 @@ export default {
|
||||||
|
|
||||||
// Gets tint images based on the glass type, and tint name.
|
// Gets tint images based on the glass type, and tint name.
|
||||||
// Returns an empty string if the src or object is undefined.
|
// Returns an empty string if the src or object is undefined.
|
||||||
getTintSourceImage(glassLocation, tintColor) {
|
getTintSourceImage(location, tintColor) {
|
||||||
const tintSourceObject = getTintImage(glassLocation, tintColor);
|
const tintSourceObject = getTintImage(location, tintColor);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
tintSourceObject === undefined ||
|
tintSourceObject === undefined ||
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,8 @@ store.getters = {
|
||||||
const basePartResponse = {
|
const basePartResponse = {
|
||||||
partsOrQuestions: [
|
partsOrQuestions: [
|
||||||
{
|
{
|
||||||
glassName: "Stationary",
|
name: "Stationary",
|
||||||
glassLocation: "Rear",
|
location: "Rear",
|
||||||
parts: [
|
parts: [
|
||||||
{
|
{
|
||||||
partNumber: "DB12209GTYN",
|
partNumber: "DB12209GTYN",
|
||||||
|
|
@ -216,8 +216,8 @@ describe("vehicle-parts.vue", () => {
|
||||||
return {
|
return {
|
||||||
partsOrQuestions: [
|
partsOrQuestions: [
|
||||||
{
|
{
|
||||||
glassName: "Stationary",
|
name: "Stationary",
|
||||||
glassLocation: "Rear",
|
location: "Rear",
|
||||||
parts: null,
|
parts: null,
|
||||||
partQuestions: [{
|
partQuestions: [{
|
||||||
testProperty: "some value"
|
testProperty: "some value"
|
||||||
|
|
@ -296,8 +296,8 @@ describe("vehicle-parts.vue", () => {
|
||||||
store.getters.pageData.mockReturnValueOnce({
|
store.getters.pageData.mockReturnValueOnce({
|
||||||
partsOrQuestions: [
|
partsOrQuestions: [
|
||||||
{
|
{
|
||||||
glassName: "Single",
|
name: "Single",
|
||||||
glassLocation: "Windshield",
|
location: "Windshield",
|
||||||
parts: [
|
parts: [
|
||||||
{
|
{
|
||||||
"partNumber": "FW03861GTYN",
|
"partNumber": "FW03861GTYN",
|
||||||
|
|
@ -374,8 +374,8 @@ describe("vehicle-parts.vue", () => {
|
||||||
store.getters.pageData.mockReturnValueOnce({
|
store.getters.pageData.mockReturnValueOnce({
|
||||||
partsOrQuestions: [
|
partsOrQuestions: [
|
||||||
{
|
{
|
||||||
glassName: "Single",
|
name: "Single",
|
||||||
glassLocation: "Windshield",
|
location: "Windshield",
|
||||||
parts: [
|
parts: [
|
||||||
{
|
{
|
||||||
partNumber: "DB12209GTYN",
|
partNumber: "DB12209GTYN",
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,10 @@
|
||||||
<!-- Render horizontal lines if there is multi-glass (aka if i > 0) -->
|
<!-- Render horizontal lines if there is multi-glass (aka if i > 0) -->
|
||||||
<hr v-if="i > 0" />
|
<hr v-if="i > 0" />
|
||||||
<glassPartQuestion
|
<glassPartQuestion
|
||||||
:ref="`${RefPrefix}-${item.glassLocation}-${item.glassName}`"
|
:ref="`${RefPrefix}-${item.location}-${item.name}`"
|
||||||
v-model="selectedGlassParts[item.glassLocation + '-' + item.glassName]"
|
v-model="selectedGlassParts[item.location + '-' + item.name]"
|
||||||
:glassLocation="item.glassLocation"
|
:location="item.location"
|
||||||
:glassName="item.glassName"
|
:name="item.name"
|
||||||
:colorAnswers="item.colorAnswers"
|
:colorAnswers="item.colorAnswers"
|
||||||
:alreadyPopulatedPartsData="alreadyPopulatedPartsData"
|
:alreadyPopulatedPartsData="alreadyPopulatedPartsData"
|
||||||
/>
|
/>
|
||||||
|
|
@ -122,8 +122,8 @@ export default {
|
||||||
// Map API result data, to vehicle-parts data structure
|
// Map API result data, to vehicle-parts data structure
|
||||||
const mappedData = partsData.partsOrQuestions.map((g) => {
|
const mappedData = partsData.partsOrQuestions.map((g) => {
|
||||||
return {
|
return {
|
||||||
glassName: g.glassName,
|
name: g.name,
|
||||||
glassLocation: g.glassLocation,
|
location: g.location,
|
||||||
colorAnswers: g.parts?.reduce((arr, p) => {
|
colorAnswers: g.parts?.reduce((arr, p) => {
|
||||||
arr.push({
|
arr.push({
|
||||||
ColorAnswerText: p.color,
|
ColorAnswerText: p.color,
|
||||||
|
|
@ -172,8 +172,8 @@ export default {
|
||||||
|
|
||||||
if (isMatched) {
|
if (isMatched) {
|
||||||
matchedParts.push({
|
matchedParts.push({
|
||||||
glassLocation: value.glassLocation,
|
location: value.location,
|
||||||
glassName: value.glassName,
|
name: value.name,
|
||||||
parts: [currentPart]
|
parts: [currentPart]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -204,7 +204,7 @@ export default {
|
||||||
const partNumber = this.alreadyPopulatedPartsData[key].partNumber;
|
const partNumber = this.alreadyPopulatedPartsData[key].partNumber;
|
||||||
g.parts.forEach((p) => {
|
g.parts.forEach((p) => {
|
||||||
if (p.partNumber === partNumber) {
|
if (p.partNumber === partNumber) {
|
||||||
this.selectedGlassParts[g.glassLocation + "-" + g.glassName] = p;
|
this.selectedGlassParts[g.location + "-" + g.name] = p;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -65,20 +65,20 @@ export default {
|
||||||
return this.comparePageIndices(currentPage, fmgPage) > 0;
|
return this.comparePageIndices(currentPage, fmgPage) > 0;
|
||||||
},
|
},
|
||||||
setupInitialData(glass, i, alreadyAnsweredQuestions, vm) {
|
setupInitialData(glass, i, alreadyAnsweredQuestions, vm) {
|
||||||
glass.key = glass.glassLocation + "-" + glass.glassName;
|
glass.key = glass.location + "-" + glass.name;
|
||||||
const self = vm ?? this;
|
const self = vm ?? this;
|
||||||
// clear answerData if no questions are already answered
|
// clear answerData if no questions are already answered
|
||||||
if (!alreadyAnsweredQuestions) { glass.answerData = null }
|
if (!alreadyAnsweredQuestions) { glass.answerData = null }
|
||||||
|
|
||||||
alreadyAnsweredQuestions?.forEach((answeredGlass) => {
|
alreadyAnsweredQuestions?.forEach((answeredGlass) => {
|
||||||
// if answeredGlass lacks any of these properties then exit
|
// if answeredGlass lacks any of these properties then exit
|
||||||
if (!answeredGlass.glassLocation ||
|
if (!answeredGlass.location ||
|
||||||
!answeredGlass.glassName ||
|
!answeredGlass.name ||
|
||||||
!answeredGlass.answeredQuestions ||
|
!answeredGlass.answeredQuestions ||
|
||||||
!answeredGlass.result && !answeredGlass.partNum) { return }
|
!answeredGlass.result && !answeredGlass.partNum) { return }
|
||||||
|
|
||||||
// test if glass parts match
|
// test if glass parts match
|
||||||
if (glass.glassLocation === answeredGlass.glassLocation && glass.glassName === answeredGlass.glassName) {
|
if (glass.location === answeredGlass.location && glass.name === answeredGlass.name) {
|
||||||
let answerString = "";
|
let answerString = "";
|
||||||
|
|
||||||
// loop through answeredQuestions for matches
|
// loop through answeredQuestions for matches
|
||||||
|
|
@ -118,7 +118,7 @@ export default {
|
||||||
|
|
||||||
// Set up watch for each set of glass questions
|
// Set up watch for each set of glass questions
|
||||||
// (updated when all questions for a glass have been answered in question-chain)
|
// (updated when all questions for a glass have been answered in question-chain)
|
||||||
self.$watch("selectedAnswers." + glass.key, (newValue) => {
|
self.$watch("selectedAnswers." + glass.location + '-' + glass.name, (newValue) => {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
self.handleAnswerUpdates(newValue);
|
self.handleAnswerUpdates(newValue);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Act
|
// Act
|
||||||
const hasGlassLocationWithMultipleParts = wrapper.vm.hasGlassLocationWithMultipleParts([
|
const hasGlassLocationWithMultipleParts = wrapper.vm.hasGlassLocationWithMultipleParts([
|
||||||
{
|
{
|
||||||
glassName: "Something",
|
name: "Something",
|
||||||
glassLocation: "somewhere",
|
location: "somewhere",
|
||||||
parts: [{
|
parts: [{
|
||||||
partNumber: "1234567"
|
partNumber: "1234567"
|
||||||
}]
|
}]
|
||||||
|
|
@ -90,22 +90,22 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Act
|
// Act
|
||||||
const hasGlassLocationWithMultipleParts = wrapper.vm.hasGlassLocationWithMultipleParts([
|
const hasGlassLocationWithMultipleParts = wrapper.vm.hasGlassLocationWithMultipleParts([
|
||||||
{
|
{
|
||||||
glassName: "Something",
|
name: "Something",
|
||||||
glassLocation: "somewhere",
|
location: "somewhere",
|
||||||
parts: [{
|
parts: [{
|
||||||
partNumber: "1234567"
|
partNumber: "1234567"
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
glassName: "Another glass",
|
name: "Another glass",
|
||||||
glassLocation: "somewhere else",
|
location: "somewhere else",
|
||||||
parts: [{
|
parts: [{
|
||||||
partNumber: "1234568"
|
partNumber: "1234568"
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
glassName: "Special glass",
|
name: "Special glass",
|
||||||
glassLocation: "Another where",
|
location: "Another where",
|
||||||
parts: [{
|
parts: [{
|
||||||
partNumber: "1234569"
|
partNumber: "1234569"
|
||||||
}]
|
}]
|
||||||
|
|
@ -123,22 +123,22 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Act
|
// Act
|
||||||
const hasGlassLocationWithMultipleParts = wrapper.vm.hasGlassLocationWithMultipleParts([
|
const hasGlassLocationWithMultipleParts = wrapper.vm.hasGlassLocationWithMultipleParts([
|
||||||
{
|
{
|
||||||
glassName: "Something",
|
name: "Something",
|
||||||
glassLocation: "somewhere",
|
location: "somewhere",
|
||||||
parts: [{
|
parts: [{
|
||||||
partNumber: "1234567"
|
partNumber: "1234567"
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
glassName: "Another glass",
|
name: "Another glass",
|
||||||
glassLocation: "somewhere else",
|
location: "somewhere else",
|
||||||
parts: [{
|
parts: [{
|
||||||
partNumber: "1234568"
|
partNumber: "1234568"
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
glassName: "Special glass",
|
name: "Special glass",
|
||||||
glassLocation: "Another where",
|
location: "Another where",
|
||||||
parts: [
|
parts: [
|
||||||
{
|
{
|
||||||
partNumber: "1234569"
|
partNumber: "1234569"
|
||||||
|
|
@ -321,8 +321,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
const glass = {
|
const glass = {
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
};
|
};
|
||||||
const i = 0;
|
const i = 0;
|
||||||
|
|
||||||
|
|
@ -338,8 +338,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
test("should return glass with answerData of null", async () => {
|
test("should return glass with answerData of null", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const glass = {
|
const glass = {
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield"
|
"location": "Windshield"
|
||||||
};
|
};
|
||||||
const i = 0;
|
const i = 0;
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
@ -356,8 +356,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
test("should return glass with answerResult within answerData", async () => {
|
test("should return glass with answerResult within answerData", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const glass = {
|
const glass = {
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"questions": [
|
"questions": [
|
||||||
{
|
{
|
||||||
"questionSequence": 1,
|
"questionSequence": 1,
|
||||||
|
|
@ -380,8 +380,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
const i = 0;
|
const i = 0;
|
||||||
const alreadyAnsweredQuestions = [
|
const alreadyAnsweredQuestions = [
|
||||||
{
|
{
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"partNum": "WKT D1106 C",
|
"partNum": "WKT D1106 C",
|
||||||
"answeredQuestions": [
|
"answeredQuestions": [
|
||||||
{
|
{
|
||||||
|
|
@ -409,8 +409,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"parts": null,
|
"parts": null,
|
||||||
"partQuestions": [
|
"partQuestions": [
|
||||||
{
|
{
|
||||||
|
|
@ -449,8 +449,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"parts": null,
|
"parts": null,
|
||||||
"partQuestions": [
|
"partQuestions": [
|
||||||
{
|
{
|
||||||
|
|
@ -472,8 +472,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Front",
|
"name": "Front",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DD08158GTYN",
|
"partNumber": "DD08158GTYN",
|
||||||
|
|
@ -487,8 +487,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Quarter",
|
"name": "Quarter",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DQ08162GTYN",
|
"partNumber": "DQ08162GTYN",
|
||||||
|
|
@ -502,8 +502,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "SideDoor",
|
"name": "SideDoor",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": null,
|
"parts": null,
|
||||||
"partQuestions": [
|
"partQuestions": [
|
||||||
{
|
{
|
||||||
|
|
@ -525,8 +525,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Stationary",
|
"name": "Stationary",
|
||||||
"glassLocation": "Rear",
|
"location": "Rear",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DB08165GTNN",
|
"partNumber": "DB08165GTNN",
|
||||||
|
|
@ -557,8 +557,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"parts": null,
|
"parts": null,
|
||||||
"partQuestions": [
|
"partQuestions": [
|
||||||
{
|
{
|
||||||
|
|
@ -580,8 +580,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Front",
|
"name": "Front",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DD08158GTYN",
|
"partNumber": "DD08158GTYN",
|
||||||
|
|
@ -595,8 +595,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Quarter",
|
"name": "Quarter",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DQ08162GTYN",
|
"partNumber": "DQ08162GTYN",
|
||||||
|
|
@ -610,8 +610,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "SideDoor",
|
"name": "SideDoor",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DD08160GTYN",
|
"partNumber": "DD08160GTYN",
|
||||||
|
|
@ -625,8 +625,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Stationary",
|
"name": "Stationary",
|
||||||
"glassLocation": "Rear",
|
"location": "Rear",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DB08165GTNN",
|
"partNumber": "DB08165GTNN",
|
||||||
|
|
@ -657,8 +657,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"parts": null,
|
"parts": null,
|
||||||
"partQuestions": [
|
"partQuestions": [
|
||||||
{
|
{
|
||||||
|
|
@ -680,8 +680,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Front",
|
"name": "Front",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DD08158GTYN",
|
"partNumber": "DD08158GTYN",
|
||||||
|
|
@ -695,8 +695,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Quarter",
|
"name": "Quarter",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DQ08162GTYN",
|
"partNumber": "DQ08162GTYN",
|
||||||
|
|
@ -718,8 +718,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "SideDoor",
|
"name": "SideDoor",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DD08160GTYN",
|
"partNumber": "DD08160GTYN",
|
||||||
|
|
@ -741,8 +741,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Stationary",
|
"name": "Stationary",
|
||||||
"glassLocation": "Rear",
|
"location": "Rear",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DB08165GTNN",
|
"partNumber": "DB08165GTNN",
|
||||||
|
|
@ -807,8 +807,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Stationary",
|
"name": "Stationary",
|
||||||
"glassLocation": "Rear",
|
"location": "Rear",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FB25724GTYN",
|
"partNumber": "FB25724GTYN",
|
||||||
|
|
@ -847,8 +847,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FW03647GTNN",
|
"partNumber": "FW03647GTNN",
|
||||||
|
|
@ -868,8 +868,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Back",
|
"name": "Back",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FD25747GTYN",
|
"partNumber": "FD25747GTYN",
|
||||||
|
|
@ -883,8 +883,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Front",
|
"name": "Front",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FD25719GTYN",
|
"partNumber": "FD25719GTYN",
|
||||||
|
|
@ -898,8 +898,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Vent",
|
"name": "Vent",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FV25749GTNN",
|
"partNumber": "FV25749GTNN",
|
||||||
|
|
@ -913,8 +913,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Stationary",
|
"name": "Stationary",
|
||||||
"glassLocation": "Rear",
|
"location": "Rear",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FB25724GTYN",
|
"partNumber": "FB25724GTYN",
|
||||||
|
|
@ -953,8 +953,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DW02101GTYN",
|
"partNumber": "DW02101GTYN",
|
||||||
|
|
@ -968,8 +968,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Back",
|
"name": "Back",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DD12202GTYN",
|
"partNumber": "DD12202GTYN",
|
||||||
|
|
@ -991,8 +991,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Front",
|
"name": "Front",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DD12198GTYN",
|
"partNumber": "DD12198GTYN",
|
||||||
|
|
@ -1014,8 +1014,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Quarter",
|
"name": "Quarter",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DQ12204GTYNOEM",
|
"partNumber": "DQ12204GTYNOEM",
|
||||||
|
|
@ -1085,8 +1085,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Stationary",
|
"name": "Stationary",
|
||||||
"glassLocation": "Rear",
|
"location": "Rear",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "DB12209GTYN",
|
"partNumber": "DB12209GTYN",
|
||||||
|
|
@ -1127,8 +1127,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Stationary",
|
"name": "Stationary",
|
||||||
"glassLocation": "Rear",
|
"location": "Rear",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FB25724GTYN",
|
"partNumber": "FB25724GTYN",
|
||||||
|
|
@ -1180,8 +1180,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FB25724GTYN",
|
"partNumber": "FB25724GTYN",
|
||||||
|
|
@ -1216,8 +1216,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FW04186GTYN",
|
"partNumber": "FW04186GTYN",
|
||||||
|
|
@ -1253,8 +1253,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsOrQuestions = [
|
const partsOrQuestions = [
|
||||||
{
|
{
|
||||||
"glassName": "Single",
|
"name": "Single",
|
||||||
"glassLocation": "Windshield",
|
"location": "Windshield",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FW04186GTYN",
|
"partNumber": "FW04186GTYN",
|
||||||
|
|
@ -1274,8 +1274,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Back",
|
"name": "Back",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FD25457GTYN",
|
"partNumber": "FD25457GTYN",
|
||||||
|
|
@ -1289,8 +1289,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Front",
|
"name": "Front",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FD27090GTYN",
|
"partNumber": "FD27090GTYN",
|
||||||
|
|
@ -1304,8 +1304,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Vent",
|
"name": "Vent",
|
||||||
"glassLocation": "Driver",
|
"location": "Driver",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FV25459GTNN",
|
"partNumber": "FV25459GTNN",
|
||||||
|
|
@ -1319,8 +1319,8 @@ describe("vehicle-questions-mixin", () => {
|
||||||
"partQuestions": null
|
"partQuestions": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glassName": "Stationary",
|
"name": "Stationary",
|
||||||
"glassLocation": "Rear",
|
"location": "Rear",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"partNumber": "FB25460GTYN",
|
"partNumber": "FB25460GTYN",
|
||||||
|
|
|
||||||
|
|
@ -238,9 +238,7 @@ function navigateToUrl(url, optionalQuery = {}) {
|
||||||
for (const queryKey in optionalQuery) {
|
for (const queryKey in optionalQuery) {
|
||||||
externalUrl.searchParams.append(queryKey, optionalQuery[queryKey]);
|
externalUrl.searchParams.append(queryKey, optionalQuery[queryKey]);
|
||||||
}
|
}
|
||||||
|
|
||||||
externalUrl.searchParams.append("experiments", "ConceptFunnel=ConceptFunnel_V1=ConceptFunnel_TEST=true");
|
|
||||||
|
|
||||||
window.location.assign(externalUrl);
|
window.location.assign(externalUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -789,7 +789,7 @@ export const actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
// PartsOrQuestions API Actions
|
// PartsOrQuestions API Actions
|
||||||
getPartsOrQuestions(context) {
|
async getPartsOrQuestions(context) {
|
||||||
const vehicle = context.getters.vehicle;
|
const vehicle = context.getters.vehicle;
|
||||||
const damage = context.getters.damage;
|
const damage = context.getters.damage;
|
||||||
const order = context.state.order;
|
const order = context.state.order;
|
||||||
|
|
@ -799,20 +799,30 @@ export const actions = {
|
||||||
const zipCode = order.serviceLocation.zipCode;
|
const zipCode = order.serviceLocation.zipCode;
|
||||||
const vin = vehicle.vin;
|
const vin = vehicle.vin;
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
const response = await globalMethods.callHttpClient({
|
||||||
method: endpoints.GetPartsOrQuestions.method,
|
method: endpoints.GetPartsOrQuestions.method,
|
||||||
endpoint: endpoints.GetPartsOrQuestions.url,
|
endpoint: endpoints.GetPartsOrQuestions.url,
|
||||||
payload: {
|
payload: {
|
||||||
carId: carId,
|
carId: carId,
|
||||||
glass: glassArray ?? [],
|
glassPieces: glassArray ?? [],
|
||||||
zip: zipCode,
|
zip: zipCode,
|
||||||
vin: vin,
|
vin: vin,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Flatten location and name properties
|
||||||
|
response.data.partsOrQuestions.map(glass => {
|
||||||
|
glass.location = glass.glassPiece.location;
|
||||||
|
glass.name = glass.glassPiece.name;
|
||||||
|
delete glass.glassPiece;
|
||||||
|
return glass;
|
||||||
|
});
|
||||||
|
|
||||||
|
return response;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Parts API Actions
|
// Parts API Actions
|
||||||
getParts(context) {
|
async getParts(context) {
|
||||||
const vehicle = context.getters.vehicle;
|
const vehicle = context.getters.vehicle;
|
||||||
const damage = context.getters.damage;
|
const damage = context.getters.damage;
|
||||||
const order = context.state.order;
|
const order = context.state.order;
|
||||||
|
|
@ -823,17 +833,27 @@ export const actions = {
|
||||||
const zipCode = order.serviceLocation.zipCode;
|
const zipCode = order.serviceLocation.zipCode;
|
||||||
const vin = vehicle.vin;
|
const vin = vehicle.vin;
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
// Flatten location and name properties
|
||||||
|
const response = await globalMethods.callHttpClient({
|
||||||
method: endpoints.GetParts.method,
|
method: endpoints.GetParts.method,
|
||||||
endpoint: endpoints.GetParts.url,
|
endpoint: endpoints.GetParts.url,
|
||||||
payload: {
|
payload: {
|
||||||
carId: carId,
|
carId: carId,
|
||||||
glass: glassArray,
|
glassPieces: glassArray,
|
||||||
answerResults: resultsArray,
|
answerResults: resultsArray,
|
||||||
zip: zipCode,
|
zip: zipCode,
|
||||||
vin: vin,
|
vin: vin,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
response.data.glassPieceParts.map(glass => {
|
||||||
|
glass.location = glass.glassPiece.location;
|
||||||
|
glass.name = glass.glassPiece.name;
|
||||||
|
delete glass.glassPiece;
|
||||||
|
return glass;
|
||||||
|
});
|
||||||
|
|
||||||
|
return response;
|
||||||
},
|
},
|
||||||
|
|
||||||
getCapabilityQuestions(context, { carId, partNumber }) {
|
getCapabilityQuestions(context, { carId, partNumber }) {
|
||||||
|
|
@ -849,12 +869,12 @@ export const actions = {
|
||||||
);
|
);
|
||||||
|
|
||||||
const part = pageData.partsOrQuestions.find(
|
const part = pageData.partsOrQuestions.find(
|
||||||
(x) => x.glassLocation === glassLocation
|
(x) => x.location === glassLocation
|
||||||
).parts[0];
|
).parts[0];
|
||||||
const capabilityQuestionAnswers =
|
const capabilityQuestionAnswers =
|
||||||
context.getters.damage.capabilityQuestionAnswers;
|
context.getters.damage.capabilityQuestionAnswers;
|
||||||
const capabilityQuestionAnswersForPart = capabilityQuestionAnswers.find(
|
const capabilityQuestionAnswersForPart = capabilityQuestionAnswers.find(
|
||||||
(x) => x.glassLocation === glassLocation
|
(x) => x.location === glassLocation
|
||||||
);
|
);
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
|
|
|
||||||
|
|
@ -182,5 +182,6 @@ $alert-border-scale: -100%;
|
||||||
$alert-color-scale: 40%;
|
$alert-color-scale: 40%;
|
||||||
|
|
||||||
//Modal animation
|
//Modal animation
|
||||||
$modal-fade-transform: translate(0, 0);
|
// This affects all [Bootstrap] modals
|
||||||
|
$modal-fade-transform: translate(0, 100%);
|
||||||
$modal-backdrop-opacity: 0;
|
$modal-backdrop-opacity: 0;
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@
|
||||||
<p class="sub-label m-0">most popular</p>
|
<p class="sub-label m-0">most popular</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>New replacement windshield</li>
|
<li>New replacement windshield</li>
|
||||||
<li><textLink linkType="dashedUnderline" text="Rain Defense" href="#!" data-bs-toggle="modal" data-bs-target="#EstimateRainDefenseModal" aria-label="Modal window" /> treatment</li>
|
<li><textLink linkType="text" text="Rain Defense" href="#!" data-bs-toggle="modal" data-bs-target="#EstimateRainDefenseModal" aria-label="Modal window" /> treatment</li>
|
||||||
<li>New <textLink linkType="dashedUnderline" text="front wiper blades" href="#!" data-bs-toggle="modal" data-bs-target="#EstimateFrontWiperModal" aria-label="Modal window" /></li>
|
<li>New <textLink linkType="text" text="front wiper blades" href="#!" data-bs-toggle="modal" data-bs-target="#EstimateFrontWiperModal" aria-label="Modal window" /></li>
|
||||||
<li>New <textLink linkType="dashedUnderline" text="rear wiper blade" href="#!" data-bs-toggle="modal" data-bs-target="#EstimateRearWiperModal" aria-label="Modal window" /></li>
|
<li>New <textLink linkType="text" text="rear wiper blade" href="#!" data-bs-toggle="modal" data-bs-target="#EstimateRearWiperModal" aria-label="Modal window" /></li>
|
||||||
<li>Expert <textLink linkType="dashedUnderline" text="recalibration" href="#!" data-bs-toggle="modal" data-bs-target="#EstimateRecalModal" aria-label="Modal window" /></li>
|
<li>Expert <textLink linkType="text" text="recalibration" href="#!" data-bs-toggle="modal" data-bs-target="#EstimateRecalModal" aria-label="Modal window" /></li>
|
||||||
<li>Nationwide lifetime warranty</li>
|
<li>Nationwide lifetime warranty</li>
|
||||||
<li>New wiper blades</li>
|
<li>New wiper blades</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
<a v-if="linkType === 'navigation'" @click="handleClick" class="navigation-link" :href="href">{{text}}</a>
|
<a v-if="linkType === 'navigation'" @click="handleClick" class="navigation-link" :href="href">{{text}}</a>
|
||||||
<a v-else-if="linkType === 'footer'" @click="handleClick" class="footer-link" :href="href" target="_blank">{{text}}</a>
|
<a v-else-if="linkType === 'footer'" @click="handleClick" class="footer-link" :href="href" target="_blank">{{text}}</a>
|
||||||
<a v-else-if="linkType === 'textSmall'" @click="handleClick" class="small" :href="href">{{text}}</a>
|
<a v-else-if="linkType === 'textSmall'" @click="handleClick" class="small" :href="href">{{text}}</a>
|
||||||
<a v-else-if="linkType === 'dashedUnderline'" @click="handleClick" class="dashed-underline" :href="href">{{text}}</a>
|
|
||||||
<a v-else-if="linkType === 'text'" @click="handleClick" :href="href">{{text}}</a>
|
<a v-else-if="linkType === 'text'" @click="handleClick" :href="href">{{text}}</a>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -59,8 +58,5 @@ a {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.dashed-underline {
|
|
||||||
text-decoration: underline dashed 1px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue