web/satellite/vuetify-poc: fix vuetify form reloads

This change fixes an issue where the vuetify app will reload when
"enter" is pressed in a form. It also adds a success notification on
successfully enabling 2FA.

Change-Id: I23a66122dce4f1bd2ff21a5cd6ae0f1b22be9395
This commit is contained in:
Wilfred Asomani 2023-08-16 08:32:11 +00:00 committed by Storj Robot
parent 957d8d6ca0
commit ea38b9f78e
8 changed files with 14 additions and 9 deletions

View File

@ -29,7 +29,7 @@
<v-divider />
<v-card-item class="px-7 py-5">
<v-form v-model="formValid">
<v-form v-model="formValid" @submit.prevent="onChangeName">
<v-col cols="12" class="px-0">
<v-text-field
v-model="name"

View File

@ -32,7 +32,7 @@
</v-card-item>
<v-divider />
<v-card-item class="px-7 py-5">
<v-form v-model="formValid">
<v-form v-model="formValid" @submit.prevent="onChangePassword">
<v-col cols="12" class="px-0">
<v-text-field
v-model="oldPassword"

View File

@ -33,7 +33,7 @@
<v-divider />
<v-form v-model="formValid" class="pa-8 pb-3">
<v-form v-model="formValid" class="pa-8 pb-3" @submit.prevent="onCreate">
<v-row>
<v-col>
<p>Buckets are used to store and organize your files.</p>

View File

@ -32,7 +32,7 @@
</v-card-item>
<v-divider class="mx-8" />
<v-card-item class="px-8 pt-4 pb-0">
<v-form v-model="formValid" class="pt-2">
<v-form v-model="formValid" class="pt-2" @submit.prevent="disable">
<v-text-field
v-model="confirmCode"
variant="outlined"

View File

@ -56,7 +56,7 @@
</v-card-item>
<v-divider class="mx-8" />
<v-card-item class="px-8 pt-4 pb-0">
<v-form v-model="formValid" class="pt-2">
<v-form v-model="formValid" class="pt-2" @submit.prevent>
<v-text-field
v-model="confirmPasscode"
variant="outlined"
@ -277,6 +277,10 @@ watch(confirmPasscode, () => {
watch(innerContent, newContent => {
if (newContent) return;
// dialog has been closed
if (step.value === 2) {
// recovery codes/success step
notify.success('2FA successfully enabled');
}
step.value = 0;
confirmPasscode.value = '';
isError.value = false;

View File

@ -2,7 +2,7 @@
// See LICENSE for copying information.
<template>
<v-form ref="form" class="pa-8">
<v-form ref="form" class="pa-8" @submit.prevent>
<v-row>
<v-col cols="12">
<v-text-field

View File

@ -2,7 +2,7 @@
// See LICENSE for copying information.
<template>
<v-form ref="form" class="pa-8">
<v-form ref="form" class="pa-8" @submit.prevent>
<v-row>
<v-col cols="12">
<p v-if="passphraseType === CreateAccessStep.EnterMyPassphrase">

View File

@ -56,7 +56,7 @@
<v-divider />
<v-form v-model="valid" class="pa-7 pb-4">
<v-form v-model="valid" class="pa-7 pb-4" @submit.prevent="onAddUsersClick">
<v-row>
<v-col>
<p>Invite team members to join you in this project.</p>
@ -163,13 +163,14 @@ const selectedProjectID = computed((): string => projectsStore.state.selectedPro
* Tries to add users related to entered emails list to current project.
*/
async function onAddUsersClick(): Promise<void> {
if (isLoading.value) return;
if (isLoading.value || !valid.value) return;
isLoading.value = true;
try {
await pmStore.inviteMembers([email.value], selectedProjectID.value);
notify.notify('Invites sent!');
email.value = '';
} catch (error) {
error.message = `Error adding project members. ${error.message}`;
notify.notifyError(error, AnalyticsErrorEventSource.ADD_PROJECT_MEMBER_MODAL);