diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 89b7895c..22519120 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -44,6 +44,14 @@ CURRENT ROADMAP CURRENT TODOs =-=-=-=-=-=-= +TODO: Form customization + - Init of form: synthesize a single working collection array of objects in the vue data() for the session to play with not live data + - customize form should work with a *copy* of all data and only access the store to update after successful save and on init to make copy + - When go to save then synthesize the record to send back + - Update the Store on success + - Do not add any custom fields not set to be displayed, their mere presence in teh template means they are to be displayed + + TODO: FORM CUSTOMIZATION FORM - Customize option on every form if user is logged in with BizAdminFull rights diff --git a/ayanova/src/views/customize.vue b/ayanova/src/views/customize.vue index 64f41210..bde796e8 100644 --- a/ayanova/src/views/customize.vue +++ b/ayanova/src/views/customize.vue @@ -43,11 +43,13 @@ {{ item.key }} + + {{ item }} @@ -158,6 +160,29 @@ export default { }, canDuplicate: function() { return this.formState.valid && !this.formState.dirty; + }, + getTemplateItemForField: function(customTemplateFieldKey) { + //first check template + var templateItem = window.$gz.formCustomTemplate.getFieldTemplateValue( + this.formCustomTemplateKey, + availableFieldItem.key + ); + if(templateItem==undefined){ + templateItem= + } + return templateItem; + }, + fullName: { + // getter + get: function() { + return this.firstName + " " + this.lastName; + }, + // setter + set: function(newValue) { + var names = newValue.split(" "); + this.firstName = names[0]; + this.lastName = names[names.length - 1]; + } } }, components: {},