Permissions screen redesign (#4735)

* Redesigned permissions screen

# Conflicts:
#	ElementX.xcodeproj/project.pbxproj

* updated tests

* update proj

* fix pseudo language tests
This commit is contained in:
Mauro
2025-11-12 14:41:44 +01:00
committed by GitHub
parent cd411b57e0
commit cbe0cfe129
76 changed files with 545 additions and 467 deletions
@@ -23,14 +23,13 @@ class RoomChangePermissionsScreenViewModel: RoomChangePermissionsScreenViewModel
}
init(currentPermissions: RoomPermissions,
group: RoomRolesAndPermissionsScreenPermissionsGroup,
roomProxy: JoinedRoomProxyProtocol,
userIndicatorController: UserIndicatorControllerProtocol,
analytics: AnalyticsService) {
self.roomProxy = roomProxy
self.userIndicatorController = userIndicatorController
self.analytics = analytics
super.init(initialViewState: .init(currentPermissions: currentPermissions, group: group))
super.init(initialViewState: .init(currentPermissions: currentPermissions, isSpace: roomProxy.infoPublisher.value.isSpace))
}
// MARK: - Public
@@ -61,7 +60,9 @@ class RoomChangePermissionsScreenViewModel: RoomChangePermissionsScreenViewModel
}
var changes = RoomPowerLevelChanges()
let changedSettings = state.bindings.settings.filter { state.currentPermissions[keyPath: $0.keyPath] != $0.value }
let changedSettings = state.bindings.settings.values
.flatMap { $0 }
.filter { state.currentPermissions[keyPath: $0.keyPath] != $0.value }
for setting in changedSettings {
changes[keyPath: setting.rustKeyPath] = setting.value.powerLevelValue
}