From 2d5fede6dd8376588abeda8308883fedcd0f01a1 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Wed, 1 Apr 2020 10:55:13 +0200 Subject: [PATCH] Share Dialog: Add setup button #225 Signed-off-by: Michael Mayer --- frontend/src/dialog/p-photo-share-dialog.vue | 29 +++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/frontend/src/dialog/p-photo-share-dialog.vue b/frontend/src/dialog/p-photo-share-dialog.vue index 9b5af8be3..31e6381a3 100644 --- a/frontend/src/dialog/p-photo-share-dialog.vue +++ b/frontend/src/dialog/p-photo-share-dialog.vue @@ -10,12 +10,13 @@ @@ -30,7 +31,7 @@ :search-input.sync="search" :items="pathItems" :loading="loading" - :disabled="loading" + :disabled="loading || noAccounts" item-text="text" item-value="value" :label="labels.path" @@ -38,11 +39,15 @@ - + Cancel + + {{ labels.setup }} + + class="action-upload" v-else> {{ labels.upload }} @@ -61,6 +66,7 @@ }, data() { return { + noAccounts: false, loading: true, search: null, account: {}, @@ -75,6 +81,7 @@ account: this.$gettext("Account"), path: this.$gettext("Location"), upload: this.$gettext("Upload"), + setup: this.$gettext("Setup"), } } }, @@ -82,6 +89,9 @@ cancel() { this.$emit('cancel'); }, + setup() { + this.$router.push({name: "settings_accounts"}); + }, confirm() { if (this.loading) { this.$notify.wait(); @@ -114,9 +124,14 @@ }; Account.search(params).then(response => { - this.account = response.models[0]; - this.accounts = response.models; - this.onChange(); + if (!response.models.length) { + this.noAccounts = true; + this.loading = false; + } else { + this.account = response.models[0]; + this.accounts = response.models; + this.onChange(); + } }).catch(() => this.loading = false) }, },