diff --git a/.eslintrc.js b/.eslintrc.js index e297ea07..00e008c2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,9 +25,8 @@ module.exports = { 'generator-star-spacing': 'off', // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'semi': 'on', - 'indent': 'off', - // 'indent': ["error", 4], + 'semi': 2, + 'indent': ["error", 2], 'space-before-function-paren': 'off' } } diff --git a/models/doctype/Contact/Contact.js b/models/doctype/Contact/Contact.js index 8fac5095..854dd182 100644 --- a/models/doctype/Contact/Contact.js +++ b/models/doctype/Contact/Contact.js @@ -10,7 +10,6 @@ module.exports = { "keywordFields": [ "fullName" ], - "titleField": "fullName", "fields": [ { "fieldname": "fullName", @@ -61,7 +60,7 @@ module.exports = { }, listSettings: { - getFields(list) { + getFields(list) { return ['fullName']; }, getRowHTML(list, data) { @@ -79,4 +78,4 @@ module.exports = { ] } ] -} \ No newline at end of file +} diff --git a/src/components/Form/Form.vue b/src/components/Form/Form.vue index 00feb927..e3b66a53 100644 --- a/src/components/Form/Form.vue +++ b/src/components/Form/Form.vue @@ -68,10 +68,8 @@ export default { await this.doc.update(); } - if (this.doc.name !== this.$route.params.name) { - this.$router.push(`/edit/${this.doctype}/${this.doc.name}`); - return; - } + this.$emit('save', this.doc); + } catch (e) { console.error(e); return; @@ -95,7 +93,4 @@ export default { }; diff --git a/src/components/ListAndForm.vue b/src/components/ListAndForm.vue index 1145f184..05621346 100644 --- a/src/components/ListAndForm.vue +++ b/src/components/ListAndForm.vue @@ -4,7 +4,7 @@
- +
@@ -17,6 +17,13 @@ export default { components: { FrappeList: List, FrappeForm: Form + }, + methods: { + onSave(doc) { + if (doc.name !== this.$route.params.name) { + this.$router.push(`/edit/${doc.doctype}/${doc.name}`); + } + } } } diff --git a/src/components/Modal.vue b/src/components/Modal.vue index 46c9a5cd..1b6f7b90 100644 --- a/src/components/Modal.vue +++ b/src/components/Modal.vue @@ -1,8 +1,7 @@