From bb33ccdaf270b8fe2df6b876a45fb17d3d552d3b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 10 Dec 2019 16:42:46 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 2 +- ayanova/src/api/gzform.js | 4 ++-- ayanova/src/views/inventory-widget-edit.vue | 22 +++++---------------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 48d2b392..1f74cd4e 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -45,7 +45,7 @@ CURRENT ROADMAP 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 diff --git a/ayanova/src/api/gzform.js b/ayanova/src/api/gzform.js index 05d7553c..5aa8d9bd 100644 --- a/ayanova/src/api/gzform.js +++ b/ayanova/src/api/gzform.js @@ -218,7 +218,7 @@ export default { }, /////////////////////////////// // 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) { if (vm.formState.loading) { @@ -338,7 +338,7 @@ export default { /////////////////////////////// // USER REQUIRED FIELDS // (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) { if (vm.formState.loading) { return false; diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index 93340291..3ec5ab71 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -68,10 +68,7 @@ :counter="10" :label="lt('WidgetCount')" ref="count" - :rules="[ - form().integerValid(this, 'count'), - form().required(this, 'count') - ]" + :rules="[form().integerValid(this, 'count')]" :error-messages="form().serverErrors(this, 'count')" required @change="onChange('count')" @@ -93,10 +90,7 @@ :label="lt('WidgetDollarAmount')" ref="dollarAmount" required - :rules="[ - form().decimalValid(this, 'dollarAmount'), - form().required(this, 'dollarAmount') - ]" + :rules="[form().decimalValid(this, 'dollarAmount')]" :error-messages="form().serverErrors(this, 'dollarAmount')" @change="onChange('dollarAmount')" type="number" @@ -157,10 +151,7 @@ :readonly="this.formState.readOnly" :label="lt('WidgetRoles')" ref="roles" - :rules="[ - form().integerValid(this, 'roles'), - form().required(this, 'roles') - ]" + :rules="[form().integerValid(this, 'roles')]" :error-messages="form().serverErrors(this, 'roles')" required @change="onChange('roles')" @@ -175,9 +166,6 @@ :error-messages="form().serverErrors(this, 'notes')" ref="notes" @change="onChange('notes')" - :rules="[ - form().userRequiredFields(this, 'notes', 'WidgetNotes') - ]" auto-grow clearable > @@ -354,14 +342,14 @@ export default { }, 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 - //I.E. Serial field below + //I.E. Serial, Roles fields id: 0, concurrencyToken: 0, name: null, serial: 0, dollarAmount: null, active: null, - roles: null, + roles: 0, startDate: null, endDate: null, notes: null,