Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Enter key works as continue button click on Setup Wizard #11537

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
shouldValidate: {
type: Boolean,
},
shouldValidateOnEnter: {
type: Boolean,
default: true,
},
// Set to false if you just want one password field
showConfirmationInput: {
type: Boolean,
Expand Down Expand Up @@ -122,6 +126,9 @@
this.$refs.password.focus();
},
checkErrorsAndSubmit(e) {
if (!this.shouldValidateOnEnter) {
return;
}
if (this.valid) {
this.$emit('submitNewPassword');
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
class="radio-button"
:label="$tr('yesOptionLabel')"
:value="true"
:autofocus="setting"
/>
<KRadioButton
ref="noRadio"
v-model="setting"
class="radio-button"
:label="$tr('noOptionLabel')"
:value="false"
:autofocus="!setting"
/>
<p class="description">
{{ getCommonSyncString('changeLater') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
:label="$tr('fullDeviceLabel')"
:value="Options.FULL"
:description="$tr('fullDeviceDescription')"
:autofocus="isFullSetup"
/>
<KRadioButton
v-model="selected"
:label="$tr('learnOnlyDeviceLabel')"
:value="Options.LOD"
:description="$tr('learnOnlyDeviceDescription')"
:autofocus="isLODSetup"
/>
</OnboardingStepBase>

Expand Down Expand Up @@ -43,6 +45,14 @@
selected,
};
},
computed: {
isFullSetup() {
return this.selected === Options.FULL;
},
isLODSetup() {
return this.selected === Options.LOD;
},
},
methods: {
handleContinue() {
this.wizardService.send({ type: 'CONTINUE', value: this.selected });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
v-model="setting"
:label="$tr('yesOptionLabel')"
:value="true"
:autofocus="setting"
/>
<KRadioButton
ref="noRadio"
v-model="setting"
:label="$tr('noOptionLabel')"
:value="false"
:autofocus="!setting"
/>
<p class="form">
{{ $tr('changeLater') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
:value="UsePresets.ON_MY_OWN"
:label="$tr('onMyOwnLabel')"
:description="getCommonSyncString('onMyOwn')"
:autofocus="isOnMyOwnSetup"
/>
<KRadioButton
v-model="selected"
:value="UsePresets.GROUP"
:label="$tr('groupLearningLabel')"
:description="$tr('groupLearningDescription')"
:autofocus="isGroupSetup"
/>
</OnboardingStepBase>

Expand Down Expand Up @@ -46,6 +48,9 @@
isOnMyOwnSetup() {
return this.selected === UsePresets.ON_MY_OWN;
},
isGroupSetup() {
return this.selected === UsePresets.GROUP;
},
UsePresets() {
return UsePresets;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
class="radio-button"
:label="$tr('yesOptionLabel')"
:value="true"
:autofocus="setting"
/>
<KRadioButton
ref="noRadio"
v-model="setting"
class="radio-button"
:label="$tr('noOptionLabel')"
:value="false"
:autofocus="!setting"
/>
<p class="description">
{{ getCommonSyncString('changeLater') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
:label="$tr('createFacilityLabel')"
:value="Options.NEW"
class="radio-button"
:autofocus="isNewFacilitySetup"
/>
<KRadioButton
v-model="selected"
:label="$tr('importFacilityLabel')"
:value="Options.IMPORT"
class="radio-button"
:autofocus="isImportFacilitySetup"
/>
<SelectDeviceModalGroup
v-if="showSelectAddressModal"
Expand Down Expand Up @@ -48,6 +50,14 @@
showSelectAddressModal: false,
};
},
computed: {
isNewFacilitySetup() {
return this.selected === Options.NEW;
},
isImportFacilitySetup() {
return this.selected === Options.IMPORT;
},
},
methods: {
handleContinueImport(address) {
this.wizardService.send({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
:isValid.sync="passwordValid"
:shouldValidate="formSubmitted"
:showConfirmationInput="!selectedUser"
:shouldValidateOnEnter="false"
autocomplete="new-password"
/>

Expand Down