CSR-543 Allow for number validation in textbox-questions for initialValues
This commit is contained in:
parent
36a8904535
commit
a3476b7098
3 changed files with 19 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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, () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue