From 163fc9945cccc9ee4fda819fd4f6204692470a85 Mon Sep 17 00:00:00 2001
From: Duddino
Date: Tue, 25 Feb 2025 10:37:28 +0100
Subject: [PATCH 1/8] Add new Form component to Proposal form
---
locale/cnr/translation.toml | 9 +
locale/de/translation.toml | 9 +
locale/en/translation.toml | 9 +
locale/es-mx/translation.toml | 9 +
locale/fr/translation.toml | 9 +
locale/hi/translation.toml | 9 +
locale/it/translation.toml | 9 +
locale/nl/translation.toml | 9 +
locale/ph/translation.toml | 9 +
locale/pl/translation.toml | 9 +
locale/pt-br/translation.toml | 9 +
locale/pt-pt/translation.toml | 9 +
locale/template/translation.toml | 9 +
locale/uwu/translation.toml | 9 +
scripts/form/Form.vue | 48 ++++
scripts/form/Input.vue | 102 +++++++
scripts/form/NumericInput.vue | 38 +++
scripts/governance/ProposalCreateModal.vue | 252 ++++++++++--------
.../governance/ProposalCreateModal.spec.js | 32 ++-
19 files changed, 480 insertions(+), 118 deletions(-)
create mode 100644 scripts/form/Form.vue
create mode 100644 scripts/form/Input.vue
create mode 100644 scripts/form/NumericInput.vue
diff --git a/locale/cnr/translation.toml b/locale/cnr/translation.toml
index 561a216e6..020374ba1 100644
--- a/locale/cnr/translation.toml
+++ b/locale/cnr/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "Interna greška, molimo pokušajte ponovo kasnije" # Internal error, please try again later
diff --git a/locale/de/translation.toml b/locale/de/translation.toml
index 44407ab80..50640e862 100644
--- a/locale/de/translation.toml
+++ b/locale/de/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "Interner Fehler, bitte versuche es später erneut" # Internal error, please try again later
diff --git a/locale/en/translation.toml b/locale/en/translation.toml
index 33a01e76c..d757e354e 100644
--- a/locale/en/translation.toml
+++ b/locale/en/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "Internal error, please try again later" # Internal error, please try again later
diff --git a/locale/es-mx/translation.toml b/locale/es-mx/translation.toml
index 3b0f178f4..b68e61c6c 100644
--- a/locale/es-mx/translation.toml
+++ b/locale/es-mx/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "Error interno, vuelve a intentarlo más tarde" # Internal error, please try again later
diff --git a/locale/fr/translation.toml b/locale/fr/translation.toml
index e39ee4690..c51d05c44 100644
--- a/locale/fr/translation.toml
+++ b/locale/fr/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "Erreur interne, veuillez réessayer plus tard" # Internal error, please try again later
diff --git a/locale/hi/translation.toml b/locale/hi/translation.toml
index 31eb6b829..762f7eb52 100644
--- a/locale/hi/translation.toml
+++ b/locale/hi/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "आंतरिक त्रुटि, कृपया कुछ समय बाद पुनः प्रयास करें" # Internal error, please try again later
diff --git a/locale/it/translation.toml b/locale/it/translation.toml
index fa2fca9d5..72a29c519 100644
--- a/locale/it/translation.toml
+++ b/locale/it/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "Errore interno, rirova più tardi" # Internal error, please try again later
diff --git a/locale/nl/translation.toml b/locale/nl/translation.toml
index 48084ec04..3a44635ef 100644
--- a/locale/nl/translation.toml
+++ b/locale/nl/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "Interne fout, probeer het later opnieuw" # Internal error, please try again later
diff --git a/locale/ph/translation.toml b/locale/ph/translation.toml
index b317d4b1d..4189e7fcc 100644
--- a/locale/ph/translation.toml
+++ b/locale/ph/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "Internal error, Pakiusap uliting muli" # Internal error, please try again later
diff --git a/locale/pl/translation.toml b/locale/pl/translation.toml
index cb7aaff4c..7bb85efef 100644
--- a/locale/pl/translation.toml
+++ b/locale/pl/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "Błąd wewnętrzny, spróbuj ponownie później" # Internal error, please try again later
diff --git a/locale/pt-br/translation.toml b/locale/pt-br/translation.toml
index b5a31527e..28cf35c7e 100644
--- a/locale/pt-br/translation.toml
+++ b/locale/pt-br/translation.toml
@@ -87,6 +87,15 @@ 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
[ALERTS]
STAKE_ADDR_SET = "Endereço de Cold Staking definido! Ao fazer Stake no futuro este endereço irá ser usado." # Cold Address set! Future stakes will use this address.
diff --git a/locale/pt-pt/translation.toml b/locale/pt-pt/translation.toml
index aa5fc1df1..21ede79bd 100644
--- a/locale/pt-pt/translation.toml
+++ b/locale/pt-pt/translation.toml
@@ -87,6 +87,15 @@ 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
[ALERTS]
STAKE_ADDR_SET = "Endereço de Cold Staking definido! Ao fazer Stake no futuro irá ser usado este endereço." # Cold Address set! Future stakes will use this address.
diff --git a/locale/template/translation.toml b/locale/template/translation.toml
index c3fc3ebf1..43dc12e07 100644
--- a/locale/template/translation.toml
+++ b/locale/template/translation.toml
@@ -235,6 +235,15 @@ 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"
[ALERTS]
INTERNAL_ERROR = "Internal error, please try again later"
diff --git a/locale/uwu/translation.toml b/locale/uwu/translation.toml
index d37966328..1b13f31f4 100644
--- a/locale/uwu/translation.toml
+++ b/locale/uwu/translation.toml
@@ -211,6 +211,15 @@ 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
[ALERTS]
INTERNAL_ERROR = "Internal error, pwease try again later" # Internal error, please try again later
diff --git a/scripts/form/Form.vue b/scripts/form/Form.vue
new file mode 100644
index 000000000..e404dc26a
--- /dev/null
+++ b/scripts/form/Form.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
diff --git a/scripts/form/Input.vue b/scripts/form/Input.vue
new file mode 100644
index 000000000..a33de1fb8
--- /dev/null
+++ b/scripts/form/Input.vue
@@ -0,0 +1,102 @@
+
+
+
+
+