Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
required,
integer
},
coolFactor: {
required,
decimal
},
flatA: { required },
flatB: { required },
forGroup: {
nested: { required }
},
validationGroup: ['age', 'coolFactor', 'flatA', 'flatB', 'forGroup.nested'],
people: {
required,
minLength: minLength(3),
$each: {
name: {
required,
minLength: minLength(2)
}
}
},
username: {
required,
isUnique(value: string) {
// standalone validator ideally should not assume a field is required
if (value === '') return true
// simulate async call, fail for all logins with even length
return new Promise((resolve, reject) => {
setTimeout(() => {
},
submit () {
this.$v.$touch()
if (this.$v.$invalid) return
this.onSubmit(this.account)
}
},
validations: {
account: {
email: {
required,
email
},
password: {
required,
minLength: minLength(6)
}
}
}
}
showLoading: false,
message: '',
},
agentTypeList: this.$t('CANNED_MGMT.AGENT_TYPES'),
show: true,
};
},
computed: {
headerImage() {
return cannedImg;
},
},
validations: {
shortCode: {
required,
minLength: minLength(2),
},
content: {
required,
},
agentType: {
required,
},
},
methods: {
setPageName({ name }) {
this.$v.agentType.$touch();
this.agentType = name;
},
showAlert() {
bus.$emit('newToastMessage', this.addCanned.message);
agentTypeList: this.$t('AGENT_MGMT.AGENT_TYPES'),
show: true,
};
},
computed: {
headerImage() {
return agentImg;
},
...mapGetters({
uiFlags: 'agents/getUIFlags',
}),
},
validations: {
agentName: {
required,
minLength: minLength(4),
},
agentEmail: {
required,
email,
},
agentType: {
required,
},
},
methods: {
setPageName({ name }) {
this.$v.agentType.$touch();
this.agentType = name;
},
showAlert(message) {
validations: () => ({
fields: {
deletionPassword: { required, minLength: minLength(10) },
deletionWarning: { required }
}
})
}
serviceId: { type: String, default: null },
initialAttributes: { type: Object, default: () => ({}) }
},
validations: {
attributes: {
clusterId: { required },
alias: {},
namespace: { required },
workloadType: {
required,
oneOf: (value) => Object.values(resourceKinds).includes(value)
},
workloadName: { required },
forwards: {
required,
minLength: minLength(1),
$each: {
localPort: { required, integer, between: between(0, 65535) },
remotePort: { required, integer, between: between(0, 65535) }
}
}
}
},
data() {
return {
error: null,
attributes: {
...this.getEmptyAttributes(),
clusterId: this.$route.params.clusterId,
...cloneDeep(this.initialAttributes)
},
namespaces: {
import { required, minLength } from 'vuelidate/lib/validators'
export default {
data() {
return {
form: {
userName: '',
password: ''
}
}
},
validations: {
form: {
userName: {
required,
minLength: minLength(5)
},
password: {
required,
minLength: minLength(8)
}
}
}
}
{ name: 'lb', value: 'lb' },
{ name: 'mg', value: 'mg' }
],
formData: {
name: null,
price: null,
description: null,
unit: null
}
}
},
validations: {
formData: {
name: {
required,
minLength: minLength(3)
},
price: {
required,
numeric,
minValue: minValue(0.1),
maxLength: maxLength(10)
},
description: {
maxLength: maxLength(255)
}
}
},
computed: {
...mapGetters('currency', [
'defaultCurrencyForInput'
]),
validators () {
const validators = {
accessKeyId: {
required,
minLength: minLength(16),
maxLength: maxLength(128)
},
accessKeySecret: {
required,
minLength: minLength(30)
}
}
return validators
},
isCreateMode () {
name: 'John'
},
{
name: ''
}
]
}
},
validations: {
people: {
required,
minLength: minLength(3),
$each: {
name: {
required,
minLength: minLength(2)
}
}
}
}
}