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

Make testnet faucet page more efficient by adding input validation #259 #331

Merged
merged 4 commits into from
Feb 23, 2024
Merged
Changes from all 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
25 changes: 25 additions & 0 deletions src/pages/testnet/DevelopersPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@
submitting: false,
};
},
computed: {
isCreateAccountButtonDisabled() {

Check failure on line 20 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 8 spaces but found 6
return (

Check failure on line 21 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 12 spaces but found 8
!this.form.account_name ||

Check failure on line 22 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 16 spaces but found 12
!this.form.owner_key ||
!this.form.active_key ||
this.submitting
);

Check failure on line 26 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 12 spaces but found 8
},

Check failure on line 27 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 8 spaces but found 6
isAnyInputInvalid() {

Check failure on line 28 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 8 spaces but found 6
return (

Check failure on line 29 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 12 spaces but found 8
!this.form.account_name ||

Check failure on line 30 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 16 spaces but found 10
(!/^EOS[0-9A-Za-z]{50}$|^PUB_K1_[0-9A-Za-z]{50}$/i.test(
this.form.owner_key

Check failure on line 32 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 14 spaces but found 12
)) ||
(!/^EOS[0-9A-Za-z]{50}$|^PUB_K1_[0-9A-Za-z]{50}$/i.test(
this.form.active_key

Check failure on line 35 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 14 spaces but found 12
))
);
},
},
methods: {
...mapActions('testnet', ['faucet', 'evmFaucet', 'account']),
async onFaucet() {
Expand Down Expand Up @@ -85,13 +106,16 @@
ref="owner_key"
v-model="form.owner_key"
color="accent"
:rules="[ val => (/^EOS[0-9A-Za-z]{50}$|^PUB_K1_[0-9A-Za-z]{50}$/i.test(val)) || 'Please provide a valid Owner key']"

Check warning on line 109 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 125. Maximum allowed is 120
label="Owner key"
outlined
)
q-input.q-mb-lg(
ref="active_key"
v-model="form.active_key"
color="accent"
:rules="[ val => (/^EOS[0-9A-Za-z]{50}$|^PUB_K1_[0-9A-Za-z]{50}$/i.test(val)) || 'Please provide a valid Active key']"

Check warning on line 117 in src/pages/testnet/DevelopersPage.vue

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 126. Maximum allowed is 120

label="Active key"
outlined
)
Expand All @@ -101,6 +125,7 @@
size="lg"
unelevated
:loading="submitting"
:disable="isAnyInputInvalid"
@click="onAccount"
)

Expand Down
Loading