From 38fe97f602bc1ca348826737ac8e5465a1723bca Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Sat, 14 Jul 2018 20:28:18 +0530 Subject: [PATCH] Add next action links for doctype meta --- ui/components/Form/Form.vue | 33 ++++++++++++++++++++++++------ ui/components/Form/FormActions.vue | 15 ++++++++++---- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/ui/components/Form/Form.vue b/ui/components/Form/Form.vue index 210dd862..180201a8 100644 --- a/ui/components/Form/Form.vue +++ b/ui/components/Form/Form.vue @@ -3,6 +3,7 @@ { + link.action(this); + }; + links.push(link); + } + } + this.links = links; + } + }, + async submit() { this.doc.set('submitted', 1); await this.save(); @@ -105,7 +124,9 @@ export default { if (!isValid && !this.invalidFields.includes(fieldname)) { this.invalidFields.push(fieldname); } else if (isValid) { - this.invalidFields = this.invalidFields.filter(invalidField => invalidField !== fieldname) + this.invalidFields = this.invalidFields.filter( + invalidField => invalidField !== fieldname + ); } }, @@ -113,7 +134,7 @@ export default { const form = this.$el.querySelector('form'); let validity = form.checkValidity(); this.invalid = !validity; - }, + } } }; diff --git a/ui/components/Form/FormActions.vue b/ui/components/Form/FormActions.vue index 4cab83d3..9d1fe420 100644 --- a/ui/components/Form/FormActions.vue +++ b/ui/components/Form/FormActions.vue @@ -1,16 +1,23 @@