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

Validate faucet inputs #336

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
24 changes: 24 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() {
return (
!this.form.account_name ||
!this.form.owner_key ||
!this.form.active_key ||
this.submitting
);
},
isAnyInputInvalid() {
return (
!this.form.account_name ||
!/^EOS[0-9A-Za-z]{50}$|^PUB_K1_[0-9A-Za-z]{50}$/i.test(
this.form.owner_key
) ||
!/^EOS[0-9A-Za-z]{50}$|^PUB_K1_[0-9A-Za-z]{50}$/i.test(
this.form.active_key
)
);
},
},
methods: {
...mapActions('testnet', ['faucet', 'evmFaucet', 'account']),
async onFaucet() {
Expand Down Expand Up @@ -85,13 +106,15 @@
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 +124,7 @@
size="lg"
unelevated
:loading="submitting"
:disable="isAnyInputInvalid"
@click="onAccount"
)

Expand Down
Loading