This commit is contained in:
2019-12-10 16:42:46 +00:00
parent 09f7b46b56
commit bb33ccdaf2
3 changed files with 8 additions and 20 deletions

View File

@@ -45,7 +45,7 @@ CURRENT ROADMAP
CURRENT TODOs CURRENT TODOs
=-=-=-=-=-=-= =-=-=-=-=-=-=
TODO: Widget edit form start and end date are required by server but not set to required in the form template?!
TODO: Form customization TODO: Form customization

View File

@@ -218,7 +218,7 @@ export default {
}, },
/////////////////////////////// ///////////////////////////////
// DatePrecedence // DatePrecedence
// (start date must precede end date) // (start date must precede end date, however if both are empty then that's ok)
// //
datePrecedence(vm, refStart, refEnd) { datePrecedence(vm, refStart, refEnd) {
if (vm.formState.loading) { if (vm.formState.loading) {
@@ -338,7 +338,7 @@ export default {
/////////////////////////////// ///////////////////////////////
// USER REQUIRED FIELDS // USER REQUIRED FIELDS
// (Fields defined by AyaNova users as required on form that are not stock required already) // (Fields defined by AyaNova users as required on form that are not stock required already)
// // (was using this in testing on widget form notes field but not sure where else it's applicable)
userRequiredFields(vm, ref, formCustomTemplateFieldName) { userRequiredFields(vm, ref, formCustomTemplateFieldName) {
if (vm.formState.loading) { if (vm.formState.loading) {
return false; return false;

View File

@@ -68,10 +68,7 @@
:counter="10" :counter="10"
:label="lt('WidgetCount')" :label="lt('WidgetCount')"
ref="count" ref="count"
:rules="[ :rules="[form().integerValid(this, 'count')]"
form().integerValid(this, 'count'),
form().required(this, 'count')
]"
:error-messages="form().serverErrors(this, 'count')" :error-messages="form().serverErrors(this, 'count')"
required required
@change="onChange('count')" @change="onChange('count')"
@@ -93,10 +90,7 @@
:label="lt('WidgetDollarAmount')" :label="lt('WidgetDollarAmount')"
ref="dollarAmount" ref="dollarAmount"
required required
:rules="[ :rules="[form().decimalValid(this, 'dollarAmount')]"
form().decimalValid(this, 'dollarAmount'),
form().required(this, 'dollarAmount')
]"
:error-messages="form().serverErrors(this, 'dollarAmount')" :error-messages="form().serverErrors(this, 'dollarAmount')"
@change="onChange('dollarAmount')" @change="onChange('dollarAmount')"
type="number" type="number"
@@ -157,10 +151,7 @@
:readonly="this.formState.readOnly" :readonly="this.formState.readOnly"
:label="lt('WidgetRoles')" :label="lt('WidgetRoles')"
ref="roles" ref="roles"
:rules="[ :rules="[form().integerValid(this, 'roles')]"
form().integerValid(this, 'roles'),
form().required(this, 'roles')
]"
:error-messages="form().serverErrors(this, 'roles')" :error-messages="form().serverErrors(this, 'roles')"
required required
@change="onChange('roles')" @change="onChange('roles')"
@@ -175,9 +166,6 @@
:error-messages="form().serverErrors(this, 'notes')" :error-messages="form().serverErrors(this, 'notes')"
ref="notes" ref="notes"
@change="onChange('notes')" @change="onChange('notes')"
:rules="[
form().userRequiredFields(this, 'notes', 'WidgetNotes')
]"
auto-grow auto-grow
clearable clearable
></v-textarea> ></v-textarea>
@@ -354,14 +342,14 @@ export default {
}, },
obj: { obj: {
//IMPORTANT NOTE: Fields that are NON NULLABLE in the schema for the table but *are* hideable **MUST** have a default value set here or else there will be no way to save the record //IMPORTANT NOTE: Fields that are NON NULLABLE in the schema for the table but *are* hideable **MUST** have a default value set here or else there will be no way to save the record
//I.E. Serial field below //I.E. Serial, Roles fields
id: 0, id: 0,
concurrencyToken: 0, concurrencyToken: 0,
name: null, name: null,
serial: 0, serial: 0,
dollarAmount: null, dollarAmount: null,
active: null, active: null,
roles: null, roles: 0,
startDate: null, startDate: null,
endDate: null, endDate: null,
notes: null, notes: null,