From a78fc0ded64654650193a7347d03cff4d2eacc6f Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 9 May 2022 10:40:27 +0200 Subject: [PATCH] fix(@chat): channel/category name max length fixes #5634 --- .../Chat/popups/community/CreateCategoryPopup.qml | 2 +- .../Chat/popups/community/CreateChannelPopup.qml | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml index c5d6e8b229..7cc0fdb0c1 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml @@ -23,7 +23,7 @@ StatusModal { property bool isEdit: false - readonly property int maxCategoryNameLength: 30 + readonly property int maxCategoryNameLength: 24 readonly property var categoryNameValidator: Utils.Validate.NoEmpty | Utils.Validate.TextLength diff --git a/ui/app/AppLayouts/Chat/popups/community/CreateChannelPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CreateChannelPopup.qml index f78a901a74..e63ad348c1 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CreateChannelPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CreateChannelPopup.qml @@ -26,7 +26,7 @@ StatusModal { readonly property var communityColorValidator: Utils.Validate.NoEmpty | Utils.Validate.TextHexColor - readonly property int maxChannelNameLength: 30 + readonly property int maxChannelNameLength: 24 readonly property int maxChannelDescLength: 140 signal createCommunityChannel(string chName, string chDescription, string chEmoji, @@ -109,7 +109,7 @@ StatusModal { id: nameInput label: qsTr("Channel name") charLimit: popup.maxChannelNameLength - input.placeholderText: qsTr("Name the channel") + input.placeholderText: qsTr("# Name the channel") input.onTextChanged: { input.text = Utils.convertSpacesToDashesAndUpperToLowerCase(input.text); input.cursorPosition = input.text.length @@ -123,10 +123,12 @@ StatusModal { popup.emojiPopup.y = popup.y + nameInput.height + 2*Style.current.xlPadding } validationMode: StatusInput.ValidationMode.Always - validators: [StatusMinLengthValidator { - minLength: 1 - errorMessage: Utils.getErrorMessage(nameInput.errors, qsTr("channel name")) - }] + validators: [ + StatusMinLengthValidator { + minLength: 1 + errorMessage: Utils.getErrorMessage(nameInput.errors, qsTr("channel name")) + } + ] } Item {