fix(MembersTabPanel): Sorted Community members list alphabetically (#15163)
This commit is contained in:
parent
1250373037
commit
a36ae5b5e0
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue