fix(@desktop/wallet): Several fixes (#10971)

This commit is contained in:
Cuteivist 2023-06-12 11:08:37 +02:00 committed by GitHub
parent 82dced8826
commit cc7a2e9d32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -25,7 +25,7 @@ Item {
colorSelection.selectedColorIndex = Math.floor(Math.random() * colorSelection.model.length) colorSelection.selectedColorIndex = Math.floor(Math.random() * colorSelection.model.length)
} }
else { else {
let ind = d.evaluateColorIndex(root.store.addAccountModule.selectedColorId) let ind = d.evaluateColorIndex(Utils.getColorForId(root.store.addAccountModule.selectedColorId))
colorSelection.selectedColorIndex = ind colorSelection.selectedColorIndex = ind
} }
@ -130,8 +130,8 @@ Item {
errorMessage: Utils.getErrorMessage(accountName.errors, qsTr("wallet account name")) errorMessage: Utils.getErrorMessage(accountName.errors, qsTr("wallet account name"))
}, },
StatusRegularExpressionValidator { StatusRegularExpressionValidator {
regularExpression: Constants.regularExpressions.alphanumerical regularExpression: Constants.regularExpressions.alphanumericalWithSpace
errorMessage: Constants.errorMessages.alphanumericalRegExp errorMessage: Constants.errorMessages.alphanumericalWithSpaceRegExp
} }
] ]

View File

@ -198,7 +198,7 @@ Rectangle {
readonly property bool itemLoaded: !model.assetsLoading // needed for e2e tests readonly property bool itemLoaded: !model.assetsLoading // needed for e2e tests
width: ListView.view.width - Style.current.padding * 2 width: ListView.view.width - Style.current.padding * 2
highlighted: !ListView.view.footerItem.button.highlighted && highlighted: !ListView.view.footerItem.button.highlighted &&
RootStore.overview.name === model.name RootStore.overview.mixedcaseAddress.toLowerCase() === model.address.toLowerCase()
anchors.horizontalCenter: !!parent ? parent.horizontalCenter : undefined anchors.horizontalCenter: !!parent ? parent.horizontalCenter : undefined
title: model.name title: model.name
subTitle: LocaleUtils.currencyAmountToLocaleString(model.currencyBalance) subTitle: LocaleUtils.currencyAmountToLocaleString(model.currencyBalance)

View File

@ -596,6 +596,7 @@ QtObject {
readonly property QtObject regularExpressions: QtObject { readonly property QtObject regularExpressions: QtObject {
readonly property var alphanumerical: /^$|^[a-zA-Z0-9]+$/ readonly property var alphanumerical: /^$|^[a-zA-Z0-9]+$/
readonly property var alphanumericalExpanded: /^$|^[a-zA-Z0-9\-_ ]+$/ readonly property var alphanumericalExpanded: /^$|^[a-zA-Z0-9\-_ ]+$/
readonly property var alphanumericalWithSpace: /^$|^[a-zA-Z0-9\s]+$/
readonly property var asciiPrintable: /^$|^[!-~]+$/ readonly property var asciiPrintable: /^$|^[!-~]+$/
readonly property var ascii: /^$|^[\x00-\x7F]+$/ readonly property var ascii: /^$|^[\x00-\x7F]+$/
readonly property var capitalOnly: /^$|^[A-Z]+$/ readonly property var capitalOnly: /^$|^[A-Z]+$/
@ -604,6 +605,7 @@ QtObject {
readonly property QtObject errorMessages: QtObject { readonly property QtObject errorMessages: QtObject {
readonly property string alphanumericalRegExp: qsTr("Only letters and numbers allowed") readonly property string alphanumericalRegExp: qsTr("Only letters and numbers allowed")
readonly property string alphanumericalWithSpaceRegExp: qsTr("Special characters are not allowed")
readonly property string alphanumericalExpandedRegExp: qsTr("Only letters, numbers, underscores, whitespaces and hyphens allowed") 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 string asciiRegExp: qsTr("Only letters, numbers and ASII characters allowed")
} }