Skip to content

Commit

Permalink
web/satellite: submit passphrase inputs on enter press
Browse files Browse the repository at this point in the history
This change submits passphrase inputs and access name inputs on enter
press, progressing to their next steps in the flow. As a result, an
issue where pressing enter in the access passphrase step will close the
access creation dialog.

Issue: #6918

Change-Id: I7748f59ac01954cf489959245a1fb7983982d484
  • Loading branch information
wilfred-asomanii authored and Storj Robot committed Apr 23, 2024
1 parent 6213389 commit 45169cb
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions web/satellite/src/components/dialogs/AccessSetupDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
:ref="stepInfos[SetupStep.ChooseAccessStep].ref"
@name-changed="newName => name = newName"
@typeChanged="newType => accessType = newType"
@submit="nextStep"
/>
</v-window-item>

Expand All @@ -61,6 +62,7 @@
:ref="stepInfos[SetupStep.AccessEncryption].ref"
@selectOption="val => passphraseOption = val"
@passphraseChanged="val => passphrase = val"
@submit="nextStep"
/>
</v-window-item>

Expand Down
2 changes: 2 additions & 0 deletions web/satellite/src/components/dialogs/CreateAccessDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
:ref="stepInfos[CreateAccessStep.CreateNewAccess].ref"
@name-changed="newName => name = newName"
@types-changed="newTypes => accessTypes = newTypes"
@submit="nextStep"
/>
</v-window-item>

Expand All @@ -67,6 +68,7 @@
:ref="stepInfos[CreateAccessStep.AccessEncryption].ref"
@select-option="newOpt => passphraseOption = newOpt"
@passphrase-changed="newPass => passphrase = newPass"
@submit="nextStep"
/>
</v-window-item>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
:ref="stepInfo[ManageProjectPassphraseStep.EnterPassphrase].ref"
ack-required
@passphrase-changed="newPass => passphrase = newPass"
@submit="onNextClick"
>
Please note that Storj does not know or store your encryption passphrase.
If you lose it, you will not be able to recover your files.
Expand Down Expand Up @@ -74,6 +75,7 @@
:ref="stepInfo[ManageProjectPassphraseStep.Switch].ref"
title="Switch Passphrase"
set-on-next
@submit="onNextClick"
>
Switch passphrase to view existing data that is uploaded with a different passphrase, or upload new data.
Please note that you won't see the previous data once you switch passphrases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See LICENSE for copying information.

<template>
<v-form ref="form" class="pa-7" @submit.prevent>
<v-form ref="form" class="pa-7" @submit.prevent="emit('submit')">
<v-row>
<v-col cols="12">
<p class="text-subtitle-2 font-weight-bold mb-5">Enter Access Name</p>
Expand Down Expand Up @@ -91,6 +91,7 @@ const agStore = useAccessGrantsStore();
const emit = defineEmits<{
'nameChanged': [name: string];
'typeChanged': [type: AccessType];
'submit': [];
}>();
const form = ref<VForm | null>(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See LICENSE for copying information.

<template>
<v-form ref="form" class="pa-8" @submit.prevent>
<v-form ref="form" class="pa-8" @submit.prevent="emit('submit')">
<v-row>
<v-col v-if="$slots.default" cols="12">
<slot />
Expand Down Expand Up @@ -74,6 +74,7 @@ const props = withDefaults(defineProps<{
const emit = defineEmits<{
'passphraseChanged': [passphrase: string];
'submit': [];
}>();
watch(passphrase, value => emit('passphraseChanged', value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See LICENSE for copying information.

<template>
<v-form ref="form" class="pa-7 pb-4">
<v-form ref="form" class="pa-7 pb-4" @submit.prevent="emit('submit')">
<v-row>
<v-col cols="12">
<!-- <p class="text-subtitle-2 font-weight-bold mb-2">Encryption Passphrase</p> -->
Expand Down Expand Up @@ -116,6 +116,7 @@ import PasswordInputEyeIcons from '@/components/PasswordInputEyeIcons.vue';
const emit = defineEmits<{
'selectOption': [option: PassphraseOption];
'passphraseChanged': [passphrase: string];
'submit': [];
}>();
const form = ref<VForm | null>(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See LICENSE for copying information.

<template>
<v-form ref="form" class="pa-7 pb-4" @submit.prevent>
<v-form ref="form" class="pa-7 pb-4" @submit.prevent="emit('submit')">
<v-row>
<v-col cols="12">
<p class="text-subtitle-2 font-weight-bold mb-5">Enter Access Name</p>
Expand Down Expand Up @@ -117,6 +117,7 @@ watch(types, value => emit('typesChanged', value.slice()), { deep: true });
const emit = defineEmits<{
'nameChanged': [name: string];
'typesChanged': [types: AccessType[]];
'submit': [];
}>();
const agStore = useAccessGrantsStore();
Expand Down

0 comments on commit 45169cb

Please sign in to comment.