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

Proposal confirmation screen #541

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions locale/cnr/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "Interna greška, molimo pokušajte ponovo kasnije" # Internal error, please try again later
Expand Down
11 changes: 11 additions & 0 deletions locale/de/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "Interner Fehler, bitte versuche es später erneut" # Internal error, please try again later
Expand Down
11 changes: 11 additions & 0 deletions locale/en/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "Creating SHIELD transaction..." # Creating SHIELD t
deleteProposal = "Delete Proposal" # Delete Proposal
deleteProposalBody = "Are you sure you want to delete your proposal? Your collateral will be permanently lost." # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "Part of your staked balance may be locked for 100 blocks as your reward matures." # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "Maximum length allowed: {length}" # Maximum length allowed: {length}
formValidationMinLength = "Minimum length allowed: {length}" # Minimum length allowed: {length}
formValidationOther = "Form validation error" # Form validation error
formValidationString = "The string contains invalid characters" # The string contains invalid characters
formValidationUrl = "The URL is invalid" # The URL is invalid
formValidationAddress = "The address provided is invalid" # The address provided is invalid
formValidationMin = "The minimum value is: {value}" # The minimum value is: {value}
formValidationMax = "The maximum value is: {value}" # The maximum value is: {value}
formValidationInvalidNumber = "Invalid Number" # Invalid Number
proposalTotal = "For a total of" # For a total of
proposalConfirm = "Confirm your proposal" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "Internal error, please try again later" # Internal error, please try again later
Expand Down
11 changes: 11 additions & 0 deletions locale/es-mx/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "Error interno, vuelve a intentarlo más tarde" # Internal error, please try again later
Expand Down
11 changes: 11 additions & 0 deletions locale/fr/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "Erreur interne, veuillez réessayer plus tard" # Internal error, please try again later
Expand Down
11 changes: 11 additions & 0 deletions locale/hi/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "क्रिएटिंग शील्ड ट्
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "आंतरिक त्रुटि, कृपया कुछ समय बाद पुनः प्रयास करें" # Internal error, please try again later
Expand Down
11 changes: 11 additions & 0 deletions locale/it/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "Errore interno, rirova più tardi" # Internal error, please try again later
Expand Down
11 changes: 11 additions & 0 deletions locale/nl/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "Interne fout, probeer het later opnieuw" # Internal error, please try again later
Expand Down
11 changes: 11 additions & 0 deletions locale/ph/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "Internal error, Pakiusap uliting muli" # Internal error, please try again later
Expand Down
11 changes: 11 additions & 0 deletions locale/pl/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "Błąd wewnętrzny, spróbuj ponownie później" # Internal error, please try again later
Expand Down
11 changes: 11 additions & 0 deletions locale/pt-br/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
STAKE_ADDR_SET = "<b>Endereço de Cold Staking definido!</b><br>Ao fazer Stake no futuro este endereço irá ser usado." # <b>Cold Address set!</b><br>Future stakes will use this address.
Expand Down
11 changes: 11 additions & 0 deletions locale/pt-pt/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
STAKE_ADDR_SET = "<b>Endereço de Cold Staking definido!</b><br>Ao fazer Stake no futuro irá ser usado este endereço." # <b>Cold Address set!</b><br>Future stakes will use this address.
Expand Down
11 changes: 11 additions & 0 deletions locale/template/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,17 @@ creatingShieldTransaction = "Creating SHIELD transaction..."
deleteProposal = "Delete Proposal"
deleteProposalBody = "Are you sure you want to delete your proposal? Your collateral will be permanently lost."
immatureRewards = "Part of your staked balance may be locked for 100 blocks as your reward matures."
formValidationMaxLength = "Maximum length allowed: {length}"
formValidationMinLength = "Minimum length allowed: {length}"
formValidationMin = "The minimum value is: {value}"
formValidationMax = "The maximum value is: {value}"
formValidationOther = "Form validation error"
formValidationString = "The string contains invalid characters"
formValidationUrl = "The URL is invalid"
formValidationAddress = "The address provided is invalid"
formValidationInvalidNumber = "Invalid Number"
proposalTotal = "For a total of"
proposalConfirm = "Confirm your proposal"

[ALERTS]
INTERNAL_ERROR = "Internal error, please try again later"
Expand Down
11 changes: 11 additions & 0 deletions locale/uwu/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ creatingShieldTransaction = "" # Creating SHIELD transaction...
deleteProposal = "" # Delete Proposal
deleteProposalBody = "" # Are you sure you want to delete your proposal? Your collateral will be permanently lost.
immatureRewards = "" # Part of your staked balance may be locked for 100 blocks as your reward matures.
formValidationMaxLength = "" # Maximum length allowed: {length}
formValidationMinLength = "" # Minimum length allowed: {length}
formValidationOther = "" # Form validation error
formValidationString = "" # The string contains invalid characters
formValidationUrl = "" # The URL is invalid
formValidationAddress = "" # The address provided is invalid
formValidationMin = "" # The minimum value is: {value}
formValidationMax = "" # The maximum value is: {value}
formValidationInvalidNumber = "" # Invalid Number
proposalTotal = "" # For a total of
proposalConfirm = "" # Confirm your proposal

[ALERTS]
INTERNAL_ERROR = "Internal error, pwease try again later" # Internal error, please try again later
Expand Down
48 changes: 48 additions & 0 deletions scripts/form/Form.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<script setup>
import { provide, reactive, ref } from 'vue';
import { translation } from '../i18n.js';

const props = defineProps({
validationFunction: Function,
});
const formData = reactive({});
const error = ref('');
provide('formData', formData);

const emit = defineEmits(['submit']);
const submitForm = () => {
const res = {};
error.value = '';
for (const key in formData) {
// true is the only success
// A string rapresents are error, and is relayed to the user
if (formData[key].validationFunction() !== true) return;
res[key] = formData[key].value;
}
if (props.validationFunction) {
const validation = props.validationFunction(res);
if (validation !== true) {
error.value = validation;
return;
}
}
emit('submit', res);
};
</script>

<template>
<form @submit.prevent="submitForm">
{{ error }}
<slot> </slot>
<slot name="button" :onSubmit="() => submitForm()">
<button
type="button"
class="pivx-button-big"
style="float: right"
@click="submitForm()"
>
{{ translation.popupConfirm }}
</button>
</slot>
</form>
</template>
Loading