mirror of
https://github.com/status-im/status-desktop.git
synced 2025-03-01 06:51:08 +00:00
fix(Wallet): Don't allow HTML tag special characters in Account Name
Also - Add maximum character filter (40) not to allow unlimited characters that break the visualization updates: #4961
This commit is contained in:
parent
b21a8df418
commit
74e2305ec8
@ -66,8 +66,13 @@ StatusModal {
|
|||||||
//% "You need to enter an account name"
|
//% "You need to enter an account name"
|
||||||
errorMessage: qsTrId("you-need-to-enter-an-account-name")
|
errorMessage: qsTrId("you-need-to-enter-an-account-name")
|
||||||
minLength: 1
|
minLength: 1
|
||||||
|
},
|
||||||
|
StatusRegularExpressionValidator {
|
||||||
|
regularExpression: /^[^<>]+$/
|
||||||
|
errorMessage: qsTr("This is not a valid account name")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
charLimit: 40
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusColorSelectorGrid {
|
StatusColorSelectorGrid {
|
||||||
@ -104,7 +109,7 @@ StatusModal {
|
|||||||
//% "Change Name"
|
//% "Change Name"
|
||||||
text: qsTr("Change Name")
|
text: qsTr("Change Name")
|
||||||
|
|
||||||
enabled: accountNameInput.text !== ""
|
enabled: accountNameInput.text !== "" && accountNameInput.valid
|
||||||
|
|
||||||
MessageDialog {
|
MessageDialog {
|
||||||
id: changeError
|
id: changeError
|
||||||
|
@ -143,8 +143,13 @@ StatusModal {
|
|||||||
//% "You need to enter an account name"
|
//% "You need to enter an account name"
|
||||||
errorMessage: qsTrId("you-need-to-enter-an-account-name")
|
errorMessage: qsTrId("you-need-to-enter-an-account-name")
|
||||||
minLength: 1
|
minLength: 1
|
||||||
|
},
|
||||||
|
StatusRegularExpressionValidator {
|
||||||
|
regularExpression: /^[^<>]+$/
|
||||||
|
errorMessage: qsTr("This is not a valid account name")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
charLimit: 40
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusColorSelectorGrid {
|
StatusColorSelectorGrid {
|
||||||
@ -168,7 +173,7 @@ StatusModal {
|
|||||||
//% "Add account"
|
//% "Add account"
|
||||||
qsTrId("add-account")
|
qsTrId("add-account")
|
||||||
|
|
||||||
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountPKeyInput.text !== ""
|
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid && accountPKeyInput.text !== ""
|
||||||
|
|
||||||
MessageDialog {
|
MessageDialog {
|
||||||
id: accountError
|
id: accountError
|
||||||
|
@ -131,8 +131,13 @@ StatusModal {
|
|||||||
//% "You need to enter an account name"
|
//% "You need to enter an account name"
|
||||||
errorMessage: qsTrId("you-need-to-enter-an-account-name")
|
errorMessage: qsTrId("you-need-to-enter-an-account-name")
|
||||||
minLength: 1
|
minLength: 1
|
||||||
|
},
|
||||||
|
StatusRegularExpressionValidator {
|
||||||
|
regularExpression: /^[^<>]+$/
|
||||||
|
errorMessage: qsTr("This is not a valid account name")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
charLimit: 40
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusColorSelectorGrid {
|
StatusColorSelectorGrid {
|
||||||
@ -156,7 +161,7 @@ StatusModal {
|
|||||||
//% "Add account"
|
//% "Add account"
|
||||||
qsTrId("add-account")
|
qsTrId("add-account")
|
||||||
|
|
||||||
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && seedPhraseTextArea.correctWordCount
|
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid && seedPhraseTextArea.correctWordCount
|
||||||
|
|
||||||
MessageDialog {
|
MessageDialog {
|
||||||
id: accountError
|
id: accountError
|
||||||
|
@ -89,8 +89,13 @@ StatusModal {
|
|||||||
//% "You need to enter an account name"
|
//% "You need to enter an account name"
|
||||||
errorMessage: qsTrId("you-need-to-enter-an-account-name")
|
errorMessage: qsTrId("you-need-to-enter-an-account-name")
|
||||||
minLength: 1
|
minLength: 1
|
||||||
|
},
|
||||||
|
StatusRegularExpressionValidator {
|
||||||
|
regularExpression: /^[^<>]+$/
|
||||||
|
errorMessage: qsTr("This is not a valid account name")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
charLimit: 40
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusColorSelectorGrid {
|
StatusColorSelectorGrid {
|
||||||
@ -114,7 +119,7 @@ StatusModal {
|
|||||||
//% "Add account"
|
//% "Add account"
|
||||||
qsTrId("add-account")
|
qsTrId("add-account")
|
||||||
|
|
||||||
enabled: !loading && addressInput.text !== "" && accountNameInput.text !== ""
|
enabled: !loading && addressInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid
|
||||||
|
|
||||||
MessageDialog {
|
MessageDialog {
|
||||||
id: accountError
|
id: accountError
|
||||||
|
@ -104,8 +104,13 @@ StatusModal {
|
|||||||
//% "You need to enter an account name"
|
//% "You need to enter an account name"
|
||||||
errorMessage: qsTrId("you-need-to-enter-an-account-name")
|
errorMessage: qsTrId("you-need-to-enter-an-account-name")
|
||||||
minLength: 1
|
minLength: 1
|
||||||
|
},
|
||||||
|
StatusRegularExpressionValidator {
|
||||||
|
regularExpression: /^[^<>]+$/
|
||||||
|
errorMessage: qsTr("This is not a valid account name")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
charLimit: 40
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusColorSelectorGrid {
|
StatusColorSelectorGrid {
|
||||||
@ -129,7 +134,7 @@ StatusModal {
|
|||||||
//% "Add account"
|
//% "Add account"
|
||||||
qsTrId("add-account")
|
qsTrId("add-account")
|
||||||
|
|
||||||
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== ""
|
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid
|
||||||
|
|
||||||
MessageDialog {
|
MessageDialog {
|
||||||
id: accountError
|
id: accountError
|
||||||
|
Loading…
x
Reference in New Issue
Block a user