CSR-543 Allow for number validation in textbox-questions for initialValues

This commit is contained in:
Katie 2022-05-11 13:22:13 -04:00
parent 36a8904535
commit a3476b7098
3 changed files with 19 additions and 7 deletions

View file

@ -51,13 +51,26 @@ export default {
default: '',
},
validationRules: String,
cmsWidgetName: String,
cmsWidgetName: String
},
setup(props) {
const propsClone = Object.assign({}, props);
const modelValue = propsClone.modelValue;
let initialValue;
switch (typeof modelValue) {
case "number":
initialValue = modelValue;
break;
default:
initialValue = (modelValue && modelValue.length > 0) ? modelValue : "";
break;
}
const fieldOptions = {
type: "text",
value: props.modelValue,
initialValue: (props.modelValue && props.modelValue.length > 0) ? props.modelValue : "",
value: modelValue,
initialValue: initialValue
};
const {

View file

@ -26,7 +26,6 @@ export function getDamageString() {
export function getIsWindshieldOnly () {
const damageLocations = store.getters.damage.glassToReplace;
const returnString = damageLocations.length === 1 && damageLocations[0]?.location === "Windshield" ? "windshield" : "glass";
console.log(damageLocations);
return returnString;
}

View file

@ -262,13 +262,13 @@ export default {
store.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
},
getEmailFromStore(){
return store.getters.order.customer.emailAddress
return store.getters.order.customer.emailAddress;
},
getVinFromStore(){
return store.getters.vehicle.vin
return store.getters.vehicle.vin;
},
getZipFromStore(){
return store.getters.vehicle.registration.zipCode
return store.getters.order.serviceLocation.zipCode;
},
attachCustomEvents() {
this.prependActionToMethod(this, this.forwardButtonAction, () => {