Merge pull request #355 from Safelite/feature/digital/SSR-468.2

Feature/digital/ssr 468.2
This commit is contained in:
michaela-brydon-safelite 2023-07-05 13:41:46 -04:00 committed by GitHub
commit d3fa094f72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 64 deletions

View file

@ -121,9 +121,7 @@ export default {
return this.isMultiSelect ? "checkbox" : "radio"; return this.isMultiSelect ? "checkbox" : "radio";
}, },
buttonId() { buttonId() {
return `${this.groupName?.replace(" ", "-")}-${this.value return `${this.groupName}-${this.value}`.replaceAll(" ", "-");
?.toString()
?.replace(" ", "-")}`;
}, },
isValueSelectedOnClick() { isValueSelectedOnClick() {
return this.isMultiSelect || this.selectingInitiatesLoad; return this.isMultiSelect || this.selectingInitiatesLoad;

View file

@ -31,7 +31,7 @@
<div <div
:class="getComponentWrapperClasses" :class="getComponentWrapperClasses"
v-for="answer in buttonsInfo" v-for="answer in buttonsInfo"
:key="answer.value ? answer.value : answer"> :key="answer.value ?? answer">
<component <component
:is="buttonTypeString" :is="buttonTypeString"
:buttonLabel="answer.buttonLabel" :buttonLabel="answer.buttonLabel"

View file

@ -12,7 +12,7 @@
:isWide="true" :isWide="true"
altText="" altText=""
isRequired isRequired
:groupName="`${glassLocation}-${glassName}`" :groupName="replaceAllSpaceWithDash(`${glassLocation}-${glassName}`)"
: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">
@ -27,7 +27,7 @@
:loaderEnabled="false" :loaderEnabled="false"
isRequired isRequired
isSmallQuestionText isSmallQuestionText
:groupName="`${glassLocation}-${glassName}-${selectedTint}`" :groupName="replaceAllSpaceWithDash(`${glassLocation}-${glassName}-${selectedTint}`)"
:validationRules="partValidationRules" /> :validationRules="partValidationRules" />
</div> </div>
</div> </div>
@ -210,6 +210,10 @@ export default {
} }
}); });
}, },
replaceAllSpaceWithDash(str) {
return String(str).replaceAll(" ", "-");
},
}, },
watch: { watch: {
selectedTint() { selectedTint() {

View file

@ -76,21 +76,27 @@ export default {
value: inputValue, value: inputValue,
handleChange, handleChange,
errors, errors,
resetField
} = useField(props.groupName, props.validationRules, } = useField(props.groupName, props.validationRules,
{ {
type: inputType, type: inputType
checkedValue: props.value,
}); });
return { return {
handleChange, handleChange,
errors, errors,
resetField
}; };
}, },
}; unmounted(){
</script> this.resetField();
}
};
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
.form-check {
.form-check {
position: relative; position: relative;
label { label {
@ -140,5 +146,5 @@ export default {
font-size: .875rem; font-size: .875rem;
color: $gray-600; color: $gray-600;
} }
} }
</style> </style>