Invite people in an existing room (#915)

* Handle power levels

* Add “invite” button in RoomMembersListScreen

* Refactor DI in RoomDetailsScreenCoordinator

* Add navigation to “select people” coordinator

* Add InviteUsersScreenRoomContext

* Add invite user by id api

* Updare InviteUsersScreenRoomContext

* Support disabled state on FormButtonStyles

* Handle membership in UserProfileCell

* Fix conflicts

* Refactor RoomContext -> RoomType

* Refactor UserProfileCell

* Add invite action

* Setup navigation to user flow coordinator

* Add invite logic

* Fix test build errors

* Address comments

* Fix localisations

* Update required state

* Handle error

* Move invite logic in RoomDetailsScreenCoordinator

* Add navigation from room’s members list

* Fix UTs

* Fix missing display name in RoomMemberDetails

* Add user indicator

* Add feature flag

* Add RoomDetailsViewModel UTs

* Add room details ui tests

* Add InviteUsersViewModelTests UTs

* Add UI tests

* Update UI tests

* Empty commit
This commit is contained in:
Alfonso Grillo
2023-05-22 16:03:07 +02:00
committed by GitHub
parent 8ed8cf6f0c
commit d9e0f36aeb
58 changed files with 708 additions and 172 deletions
@@ -331,6 +331,11 @@ class RoomMemberProxyMock: RoomMemberProxyProtocol {
set(value) { underlyingIsIgnored = value }
}
var underlyingIsIgnored: Bool!
var canInviteUsers: Bool {
get { return underlyingCanInviteUsers }
set(value) { underlyingCanInviteUsers = value }
}
var underlyingCanInviteUsers: Bool!
//MARK: - ignoreUser
@@ -869,6 +874,27 @@ class RoomProxyMock: RoomProxyProtocol {
fetchDetailsForReceivedInvocations.append(eventID)
fetchDetailsForClosure?(eventID)
}
//MARK: - invite
var inviteUserIDCallsCount = 0
var inviteUserIDCalled: Bool {
return inviteUserIDCallsCount > 0
}
var inviteUserIDReceivedUserID: String?
var inviteUserIDReceivedInvocations: [String] = []
var inviteUserIDReturnValue: Result<Void, RoomProxyError>!
var inviteUserIDClosure: ((String) async -> Result<Void, RoomProxyError>)?
func invite(userID: String) async -> Result<Void, RoomProxyError> {
inviteUserIDCallsCount += 1
inviteUserIDReceivedUserID = userID
inviteUserIDReceivedInvocations.append(userID)
if let inviteUserIDClosure = inviteUserIDClosure {
return await inviteUserIDClosure(userID)
} else {
return inviteUserIDReturnValue
}
}
}
class SessionVerificationControllerProxyMock: SessionVerificationControllerProxyProtocol {
var callbacks: PassthroughSubject<SessionVerificationControllerProxyCallback, Never> {