Skip to content

Commit 5aaffb7

Browse files
authored
Make AddUsersView public for being able to duplicate ChatChannelInfoView (#906)
1 parent cb9294c commit 5aaffb7

File tree

29 files changed

+4
-43
lines changed

29 files changed

+4
-43
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
44
# Upcoming
55

66
### ✅ Added
7+
- Make `AddUsersView` used by `ChatChannelInfoView` public for creating custom info views through composition [#906](https://github.com/GetStream/stream-chat-swiftui/pull/906)
78
- Expose `ChannelAvatarViewOptions.init` [#908](https://github.com/GetStream/stream-chat-swiftui/pull/908)
89
### 🐞 Fixed
910
- Fix WebView error handling to enable mp3 attachments loading [#904](https://github.com/GetStream/stream-chat-swiftui/pull/904)

Sources/StreamChatSwiftUI/ChatChannel/ChannelInfo/AddUsersView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import StreamChat
66
import SwiftUI
77

88
/// View for the add users popup.
9-
struct AddUsersView<Factory: ViewFactory>: View {
9+
public struct AddUsersView<Factory: ViewFactory>: View {
1010
@Injected(\.fonts) private var fonts
1111
@Injected(\.colors) private var colors
1212

@@ -24,7 +24,7 @@ struct AddUsersView<Factory: ViewFactory>: View {
2424
@StateObject private var viewModel: AddUsersViewModel
2525
var onUserTap: (ChatUser) -> Void
2626

27-
init(
27+
public init(
2828
factory: Factory = DefaultViewFactory.shared,
2929
loadedUserIds: [String],
3030
onUserTap: @escaping (ChatUser) -> Void
@@ -48,7 +48,7 @@ struct AddUsersView<Factory: ViewFactory>: View {
4848
self.factory = factory
4949
}
5050

51-
var body: some View {
51+
public var body: some View {
5252
VStack {
5353
SearchBar(text: $viewModel.searchText)
5454

StreamChatSwiftUITests/Tests/ChatChannel/MessageActions_Tests.swift

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -374,46 +374,6 @@ class MessageActions_Tests: StreamChatTestCase {
374374
// Then
375375
XCTAssertTrue(messageActions.contains(where: { $0.title == "Edit Message" }))
376376
}
377-
378-
func test_messageActions_currentUser_unmuteUser() throws {
379-
// Given
380-
// Note: internally creates current user controller
381-
let mutedUserId = UserId.unique
382-
try chatClient.databaseContainer.writeSynchronously { session in
383-
try session.saveCurrentUser(
384-
payload: .dummy(
385-
userId: .unique,
386-
role: .admin,
387-
mutedUsers: [
388-
.dummy(userId: mutedUserId)
389-
]
390-
)
391-
)
392-
}
393-
394-
let channel = ChatChannel.mockDMChannel(config: .mock(mutesEnabled: true))
395-
let message = ChatMessage.mock(
396-
id: .unique,
397-
cid: channel.cid,
398-
text: "Test",
399-
author: .mock(id: mutedUserId),
400-
isSentByCurrentUser: false
401-
)
402-
let factory = DefaultViewFactory.shared
403-
404-
// When
405-
let messageActions = MessageAction.defaultActions(
406-
factory: factory,
407-
for: message,
408-
channel: channel,
409-
chatClient: chatClient,
410-
onFinish: { _ in },
411-
onError: { _ in }
412-
)
413-
414-
// Then
415-
XCTAssertTrue(messageActions.contains(where: { $0.title == "Unmute User" }))
416-
}
417377

418378
// MARK: - Private
419379

Loading
320 Bytes
Loading
180 Bytes
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)