fix(MembersTabPanel): Sorted Community members list alphabetically (#15163)

This commit is contained in:
Roman Chornii 2024-06-13 20:21:04 +03:00 committed by GitHub
parent 1250373037
commit a36ae5b5e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import QtQuick 2.14
import QtQuick.Layouts 1.14
import QtQuick.Controls 2.14
import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
@ -15,6 +16,8 @@ import shared.controls 1.0
import AppLayouts.Communities.layouts 1.0
import SortFilterProxyModel 0.2
Item {
id: root
@ -62,7 +65,28 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
model: root.model
model: SortFilterProxyModel {
sourceModel: root.model
proxyRoles: FastExpressionRole {
function displayNameProxy(localNickname, ensName, displayName, aliasName) {
return ProfileUtils.displayName(localNickname, ensName, displayName, aliasName);
}
name: "preferredDisplayName"
expectedRoles: ["localNickname", "displayName", "ensName", "alias"]
expression: displayNameProxy(model.localNickname, model.ensName, model.displayName, model.alias);
}
sorters : [
StringSorter {
roleName: "preferredDisplayName"
caseSensitivity: Qt.CaseInsensitive
}
]
}
spacing: 0
delegate: StatusMemberListItem {