From 57a73b5289d1d6e0363326b0419005c2675da6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Tue, 8 Sep 2020 02:59:01 +0200 Subject: [PATCH] overall user experience --- ui/src/components/Admin.vue | 32 +++++++++++++++++++++++------ ui/src/components/admin/Input.vue | 24 +++++++++++++++++----- ui/src/components/admin/Login.vue | 24 ++++++++++++++++------ ui/src/components/admin/Preview.vue | 16 ++++++++------- 4 files changed, 72 insertions(+), 24 deletions(-) diff --git a/ui/src/components/Admin.vue b/ui/src/components/Admin.vue index 0d3922c..cd117cb 100644 --- a/ui/src/components/Admin.vue +++ b/ui/src/components/Admin.vue @@ -2,16 +2,16 @@

Geburtstags-Tool

- - - + + +
@@ -71,4 +87,8 @@ div.admin button.back { div.admin button:hover { opacity: 0.8; } + +div.admin button:disabled { + background-color: #888; +} \ No newline at end of file diff --git a/ui/src/components/admin/Input.vue b/ui/src/components/admin/Input.vue index 3ff3034..67539c8 100644 --- a/ui/src/components/admin/Input.vue +++ b/ui/src/components/admin/Input.vue @@ -4,7 +4,7 @@

Empfänger

- @@ -50,11 +50,25 @@ Deine Lenaisten`, }, }), + props: { + default: Object, + }, + + mounted() { + this.$refs.first.focus(); + + if (!!this.default.recipient && !!this.default.mail) { + this.recipient = this.default.recipient; + this.mail = this.default.mail; + } + }, + methods: { check(event) { - this.$emit('success', this.recipient, this.mail); event.preventDefault(); - } - } -} + event.submitter.disabled = true; + this.$emit("next", this.recipient, this.mail); + }, + }, +}; diff --git a/ui/src/components/admin/Login.vue b/ui/src/components/admin/Login.vue index f8c2f2b..432dc39 100644 --- a/ui/src/components/admin/Login.vue +++ b/ui/src/components/admin/Login.vue @@ -1,7 +1,7 @@ @@ -13,12 +13,14 @@ export default { methods: { check(event) { - if (event.submitter.value === "good") { - this.$emit("success"); - } else { - this.$emit("failure"); - } event.preventDefault(); + event.submitter.disabled = true; + + if (event.submitter.value === "next") { + // success + } else { + this.$emit("back"); + } }, }, };