fix(MintTokensPanel): Update input fields validation
Closing: https://github.com/status-im/status-desktop/issues/9850 Password: 7 characters max, ascii printable characters Name and description: ascii characters
This commit is contained in:
parent
056dad2ce2
commit
fb86d8745c
|
@ -109,9 +109,10 @@ StatusScrollView {
|
|||
id: symbolInput
|
||||
|
||||
label: qsTr("Token symbol")
|
||||
charLimit: 5
|
||||
charLimit: 7
|
||||
placeholderText: qsTr("Letter token abbreviation e.g. ABC")
|
||||
errorText: qsTr("Token symbol")
|
||||
validator.regularExpression: Constants.regularExpressions.asciiPrintable
|
||||
}
|
||||
|
||||
CustomLabelDescriptionComponent {
|
||||
|
@ -189,6 +190,7 @@ StatusScrollView {
|
|||
id: customInput
|
||||
|
||||
property string errorText
|
||||
property alias validator: regexValidator
|
||||
|
||||
Layout.fillWidth: true
|
||||
validators: [
|
||||
|
@ -198,8 +200,9 @@ StatusScrollView {
|
|||
customInput.errorText)
|
||||
},
|
||||
StatusRegularExpressionValidator {
|
||||
regularExpression: Constants.regularExpressions.alphanumericalExpanded
|
||||
errorMessage: Constants.errorMessages.alphanumericalExpandedRegExp
|
||||
id: regexValidator
|
||||
regularExpression: Constants.regularExpressions.ascii
|
||||
errorMessage: Constants.errorMessages.asciiRegExp
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -580,10 +580,13 @@ QtObject {
|
|||
|
||||
readonly property QtObject regularExpressions: QtObject {
|
||||
readonly property var alphanumericalExpanded: /^$|^[a-zA-Z0-9\-_ ]+$/
|
||||
readonly property var asciiPrintable: /^$|^[!-~]+$/
|
||||
readonly property var ascii: /^$|^[\x00-\x7F]+$/
|
||||
}
|
||||
|
||||
readonly property QtObject errorMessages: QtObject {
|
||||
readonly property string alphanumericalExpandedRegExp: qsTr("Only letters, numbers, underscores, whitespaces and hyphens allowed")
|
||||
readonly property string asciiRegExp: qsTr("Only letters, numbers and ASII characters allowed")
|
||||
}
|
||||
|
||||
readonly property QtObject socialLinkType: QtObject {
|
||||
|
|
Loading…
Reference in New Issue