Browse Source

fix: disable validation error(share dialog) unless inviting user

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/765/head
Pranav C 3 years ago
parent
commit
5e88184029
  1. 19
      packages/nc-gui/components/auth/userManagement.vue

19
packages/nc-gui/components/auth/userManagement.vue

@ -365,10 +365,17 @@
</p> </p>
<div class="text-right"> <div class="text-right">
<x-btn tooltip="Invite more users" small outlined btn.class="grey--text" @click="invite_token = null, selectedUser = {}"> <x-btn
tooltip="Invite more users"
small
outlined
btn.class="grey--text"
@click="invite_token = null, selectedUser = {}"
>
<v-icon small color="grey" class="mr-1"> <v-icon small color="grey" class="mr-1">
mdi-account-multiple-plus-outline mdi-account-multiple-plus-outline
</v-icon> Invite more </v-icon>
Invite more
</x-btn> </x-btn>
</div> </div>
@ -385,7 +392,7 @@
dense dense
validate-on-blur validate-on-blur
outlined outlined
:rules="emailRules" :rules="validate && emailRules"
class="caption" class="caption"
hint="You can add multiple comma(,) separated emails" hint="You can add multiple comma(,) separated emails"
label="Email" label="Email"
@ -460,6 +467,7 @@ export default {
name: 'UserManagement', name: 'UserManagement',
components: { XBtn, ShareBase, FeedbackForm, DlgLabelSubmitCancel, SetListCheckboxCell }, components: { XBtn, ShareBase, FeedbackForm, DlgLabelSubmitCancel, SetListCheckboxCell },
data: () => ({ data: () => ({
validate: false,
deleteItem: null, deleteItem: null,
invite_token: null, invite_token: null,
userEditDialog: false, userEditDialog: false,
@ -516,6 +524,9 @@ export default {
} }
}, },
watch: { watch: {
userEditDialog(v) {
if (!v) { this.validate = false }
},
options: { options: {
async handler() { async handler() {
await this.loadUsers() await this.loadUsers()
@ -696,6 +707,8 @@ export default {
} }
}, },
async saveUser() { async saveUser() {
this.validate = true
await this.$nextTick()
if (this.loading || !this.$refs.form.validate() || !this.selectedUser) { if (this.loading || !this.$refs.form.validate() || !this.selectedUser) {
return return
} }

Loading…
Cancel
Save