fix(ui-test): fix sporadic failures to load CreateChannelPopupPage

thus also fixing the failing `tests/ui` in CI
This commit is contained in:
Lukáš Tinkl 2024-05-03 12:25:59 +02:00 committed by Lukáš Tinkl
parent ac9a240e25
commit caa97737c7
1 changed files with 16 additions and 17 deletions

View File

@ -246,26 +246,25 @@ QtObject {
} }
} }
readonly property var filteredPermissionsModel: SortFilterProxyModel {
sourceModel: root.permissionsModel
filters: [
FastExpressionFilter {
function filterPredicate(id, permissionType) {
return !PermissionTypes.isCommunityPermission(permissionType) && root.permissionsModel.belongsToChat(id, root.channelId)
}
expression: {
return filterPredicate(model.id, model.permissionType)
}
expectedRoles: [ "id", "permissionType" ]
}
]
}
// Channel permissions model containing the temporarely edited permissions // Channel permissions model containing the temporarely edited permissions
property WritableProxyModel channelPermissionsModel: WritableProxyModel { property WritableProxyModel channelPermissionsModel: WritableProxyModel {
sourceModel: SortFilterProxyModel { sourceModel: filteredPermissionsModel
id: filteredPermissionsModel
sourceModel: root.permissionsModel
filters: [
FastExpressionFilter {
function filterPredicate(id, permissionType) {
return !PermissionTypes.isCommunityPermission(permissionType) && root.permissionsModel.belongsToChat(id, root.channelId)
}
expression: {
return filterPredicate(model.id, model.permissionType)
}
expectedRoles: [ "id", "permissionType" ]
}
]
}
} }
// Channels model containing the temporarely edited channel // Channels model containing the temporarely edited channel