diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index c46b69148d..f2ebe9d6cc 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -444,6 +444,7 @@ 69C7B956B74BEC3DB88224EA /* NavigationSplitCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78913D6E120D46138E97C107 /* NavigationSplitCoordinatorTests.swift */; }; 69DE29C3E3180BB17D840690 /* ProgressCursorModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97C8E13A1FBA717B0C277ECC /* ProgressCursorModifier.swift */; }; 6A0E7551E0D1793245F34CDD /* ClientError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09A267106B9585D3D0CFC0D /* ClientError.swift */; }; + 6A54F52443EC52AC5CD772C0 /* JoinRoomScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 869A8A4632E511351BFE2EC4 /* JoinRoomScreen.swift */; }; 6AD722DD92E465E56D2885AB /* BugReportScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA919F521E9F0EE3638AFC85 /* BugReportScreen.swift */; }; 6AECC84BE14A13440120FED8 /* NSESettingsProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FB4F169D653296023ED65E6 /* NSESettingsProtocol.swift */; }; 6B05AA5D9BBCD6D8D63B80EB /* TimelineItemAccessibilityModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C6F3DAD167F972702C8893 /* TimelineItemAccessibilityModifier.swift */; }; @@ -513,8 +514,10 @@ 7A71AEF419904209BB8C2833 /* UserAgentBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F2529D434C750ED78ADF1ED /* UserAgentBuilder.swift */; }; 7B1605C6FFD4D195F264A684 /* RoomPollsHistoryScreenViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B40233F2989AD49906BB310D /* RoomPollsHistoryScreenViewModelTests.swift */; }; 7B5DAB915357BE596529BF25 /* MapTilerStaticMapProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20872C3887F835958CE2F1D0 /* MapTilerStaticMapProtocol.swift */; }; + 7B66DA4E7E5FE4D1A0FCEAA4 /* JoinRoomScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEAB5662310AE73D93815134 /* JoinRoomScreenViewModelProtocol.swift */; }; 7BB31E67648CF32D2AB5E502 /* RoomScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE3C90E487B255B735D73C8 /* RoomScreenViewModel.swift */; }; 7BF368A78E6D9AFD222F25AF /* SecureBackupScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE094FCB6387D268C436161 /* SecureBackupScreenViewModel.swift */; }; + 7C0E29E0279866C62EC67A28 /* JoinRoomScreenViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE5127D6EA05B2E45D0A7D59 /* JoinRoomScreenViewModelTests.swift */; }; 7C1A7B594B2F8143F0DD0005 /* ElementXAttributeScope.swift in Sources */ = {isa = PBXBuildFile; fileRef = C024C151639C4E1B91FCC68B /* ElementXAttributeScope.swift */; }; 7C384A8E54A4B60A14CDE8E5 /* WaitlistScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12F1E7F9C2BE8BB751037826 /* WaitlistScreenCoordinator.swift */; }; 7C6376192F578E0BA801BFEC /* AnalyticsSettingsScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42C64A14EE89928207E3B42B /* AnalyticsSettingsScreenModels.swift */; }; @@ -735,6 +738,7 @@ AF33B9044498211C3D82F1E1 /* UNTextInputNotificationResponse+Creator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 130ED565A078F7E0B59D9D25 /* UNTextInputNotificationResponse+Creator.swift */; }; AF8BFA37791E1756EE243E08 /* SettingsScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8F0ED874DF8C9A51B0AB6F /* SettingsScreenCoordinator.swift */; }; AFA1F2543DFF7B45DF68ACD6 /* CompletionSuggestionModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 170BF6F7923A5C3792442F27 /* CompletionSuggestionModels.swift */; }; + AFE2AB612A1460E49578D746 /* JoinRoomScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BDCCD2F6B405C14B9BCE94E /* JoinRoomScreenCoordinator.swift */; }; B04E9EB589CE99C3929E817A /* HomeScreenRecoveryKeyConfirmationBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05512FB13987D221B7205DE0 /* HomeScreenRecoveryKeyConfirmationBanner.swift */; }; B0CB16349B96262AA65A04AF /* Version in Frameworks */ = {isa = PBXBuildFile; productRef = A05AF81DDD14AD58CB0E1B9B /* Version */; }; B1069F361E604D5436AE9FFD /* StaticLocationScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B06663F7858E45882E63471 /* StaticLocationScreen.swift */; }; @@ -920,6 +924,7 @@ DDE7B4771452300C103B1EB8 /* RoomDirectoryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F6210134203BE1F2DD5C679 /* RoomDirectoryCell.swift */; }; DDFBDEE1DC32BDD5488F898C /* ClientProxyMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F96CCBEAAA7F2185BFA354 /* ClientProxyMock.swift */; }; DE4F8C4E0F1DB4832F09DE97 /* HomeScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31D6764D6976D235926FE5FC /* HomeScreenViewModel.swift */; }; + DEDBD3E9CFCC9F20CAC79881 /* JoinRoomScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136F80A613B55BDD071DCEA5 /* JoinRoomScreenModels.swift */; }; DF004A5B2EABBD0574D06A04 /* SplashScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854BCEAF2A832176FAACD2CB /* SplashScreenCoordinator.swift */; }; DF05F9C9D3D977EB77E13692 /* DeviceKit in Frameworks */ = {isa = PBXBuildFile; productRef = 385D4C28F9DC5CF53BD9ECDB /* DeviceKit */; }; DF504B10A4918F971A57BEF2 /* PostHogAnalyticsClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1715E3D7F53C0748AA50C91C /* PostHogAnalyticsClient.swift */; }; @@ -995,6 +1000,7 @@ EEB9C1555C63B93CA9C372C2 /* EmojiPickerScreenHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B5E29E9A22F45534FBD5B58 /* EmojiPickerScreenHeaderView.swift */; }; EEC40663922856C65D1E0DF5 /* KeychainControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB9C37196A4C79F24CE80C6 /* KeychainControllerTests.swift */; }; EF0D0155DD104C7A41A2EB0E /* PlainMentionBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AE78FA0011E07920AE83135 /* PlainMentionBuilder.swift */; }; + EF47D802A404A53F15D5D4B6 /* JoinRoomScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD7C0A2750998C2D77AD00F /* JoinRoomScreenViewModel.swift */; }; EF5009AC03212227131C8AF2 /* RoomNotificationSettingsProxyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E55B5EA766E89FF1F87C3ACB /* RoomNotificationSettingsProxyProtocol.swift */; }; EF7924005216B8189898F370 /* BackgroundTaskProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CA028DCD4157F9A1F999827 /* BackgroundTaskProtocol.swift */; }; EF890DEF0479E66548F2BA23 /* AppLockTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 490BEADEFB2D6B7C9F618AE8 /* AppLockTimer.swift */; }; @@ -1199,6 +1205,7 @@ 12F1E7F9C2BE8BB751037826 /* WaitlistScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WaitlistScreenCoordinator.swift; sourceTree = ""; }; 1304D9191300873EADA52D6E /* IntegrationTests.xctestplan */ = {isa = PBXFileReference; path = IntegrationTests.xctestplan; sourceTree = ""; }; 130ED565A078F7E0B59D9D25 /* UNTextInputNotificationResponse+Creator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UNTextInputNotificationResponse+Creator.swift"; sourceTree = ""; }; + 136F80A613B55BDD071DCEA5 /* JoinRoomScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenModels.swift; sourceTree = ""; }; 13802897C7AFA360EA74C0B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = ""; }; 1423AB065857FA546444DB15 /* NotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationManager.swift; sourceTree = ""; }; 142808B69851451AC32A2CEA /* RoomSummaryDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryDetails.swift; sourceTree = ""; }; @@ -1238,6 +1245,7 @@ 1C21A715237F2B6D6E80998C /* SecureBackupControllerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackupControllerProtocol.swift; sourceTree = ""; }; 1C7F63EB1525E697CAEB002B /* BlankFormCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlankFormCoordinator.swift; sourceTree = ""; }; 1CC575D1895FA62591451A93 /* RoomMemberDetailsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMemberDetailsScreen.swift; sourceTree = ""; }; + 1CD7C0A2750998C2D77AD00F /* JoinRoomScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenViewModel.swift; sourceTree = ""; }; 1D56469A9EE0CFA2B7BA9760 /* SessionVerificationControllerProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationControllerProxyProtocol.swift; sourceTree = ""; }; 1D652E78832289CD9EB64488 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/InfoPlist.strings; sourceTree = ""; }; 1D67E616BCA82D8A1258D488 /* NetworkMonitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkMonitor.swift; sourceTree = ""; }; @@ -1358,6 +1366,7 @@ 39C0D861FC397AC34BCF089E /* KeychainControllerMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainControllerMock.swift; sourceTree = ""; }; 3B5E97E9615A158C76B2AB77 /* DateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateTests.swift; sourceTree = ""; }; 3BC1B7CB061C9865B2B91B56 /* QRCodeLoginScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCodeLoginScreenViewModel.swift; sourceTree = ""; }; + 3BDCCD2F6B405C14B9BCE94E /* JoinRoomScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenCoordinator.swift; sourceTree = ""; }; 3C1A3D524D63815B28FA4D62 /* EmojiCategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiCategory.swift; sourceTree = ""; }; 3C368CAB3063EF275357ECD4 /* LoginScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginScreenViewModel.swift; sourceTree = ""; }; 3C3E67E09FE5A35D73818C39 /* AppLockScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockScreenModels.swift; sourceTree = ""; }; @@ -1645,6 +1654,7 @@ 86376BEE425704AEE197CA54 /* PillContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PillContext.swift; sourceTree = ""; }; 8642512079EEFD622E3AA66B /* BlockedUsersScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockedUsersScreenModels.swift; sourceTree = ""; }; 86873A768B13069BB5CAECF6 /* InvitesScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitesScreenViewModelProtocol.swift; sourceTree = ""; }; + 869A8A4632E511351BFE2EC4 /* JoinRoomScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreen.swift; sourceTree = ""; }; 86A6F283BC574FDB96ABBB07 /* DeveloperOptionsScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeveloperOptionsScreenViewModel.swift; sourceTree = ""; }; 86C8CE2630F54D5FE1591786 /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/InfoPlist.strings; sourceTree = ""; }; 88410BD213FDF9B28E8B671F /* UserDetailsEditScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDetailsEditScreen.swift; sourceTree = ""; }; @@ -1992,6 +2002,7 @@ DC528B3764E3CF7FCFEF40E7 /* PollInteractionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollInteractionHandler.swift; sourceTree = ""; }; DCF239C619971FDE48132550 /* SecureBackupLogoutConfirmationScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackupLogoutConfirmationScreenModels.swift; sourceTree = ""; }; DD97F9661ABF08CE002054A2 /* AppLockServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockServiceTests.swift; sourceTree = ""; }; + DE5127D6EA05B2E45D0A7D59 /* JoinRoomScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenViewModelTests.swift; sourceTree = ""; }; DE7C80EF77AD102053D3646E /* RoundedLabelItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedLabelItem.swift; sourceTree = ""; }; DEC1D382565A4E9CAC2F14EA /* MediaFileHandleProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaFileHandleProxy.swift; sourceTree = ""; }; DF05DA24F71B455E8EFEBC3B /* SessionVerificationViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationViewModelTests.swift; sourceTree = ""; }; @@ -2064,6 +2075,7 @@ EE378083653EF0C9B5E9D580 /* EmoteRoomTimelineItemContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmoteRoomTimelineItemContent.swift; sourceTree = ""; }; EE6BFF453838CF6C3982C5A3 /* RoomDirectorySearchScreenScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchScreenScreenViewModelTests.swift; sourceTree = ""; }; EEAA2832D93EC7D2608703FB /* NSEUserSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSEUserSession.swift; sourceTree = ""; }; + EEAB5662310AE73D93815134 /* JoinRoomScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenViewModelProtocol.swift; sourceTree = ""; }; EF13BFD415CA84B1272E94F8 /* PINTextFieldTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PINTextFieldTests.swift; sourceTree = ""; }; EF1593DD87F974F8509BB619 /* ElementAnimations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementAnimations.swift; sourceTree = ""; }; EF98A02DED04075F7CF0C721 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/Localizable.strings; sourceTree = ""; }; @@ -3363,6 +3375,14 @@ path = SupportingFiles; sourceTree = ""; }; + 6792D400AF30A6F2ACD426E4 /* View */ = { + isa = PBXGroup; + children = ( + 869A8A4632E511351BFE2EC4 /* JoinRoomScreen.swift */, + ); + path = View; + sourceTree = ""; + }; 679E9837ECA8D6776079D16E /* RoomScreen */ = { isa = PBXGroup; children = ( @@ -3539,6 +3559,7 @@ 505208F28007C0FEC14E1FF0 /* HomeScreenViewModelTests.swift */, CC14E5209C262530E19BC4C1 /* InvitesScreenViewModelTests.swift */, 845DDBDE5A0887E73D38B826 /* InviteUsersViewModelTests.swift */, + DE5127D6EA05B2E45D0A7D59 /* JoinRoomScreenViewModelTests.swift */, FDB9C37196A4C79F24CE80C6 /* KeychainControllerTests.swift */, 6E5725BC6C63604CB769145B /* LegalInformationScreenViewModelTests.swift */, C070FD43DC6BF4E50217965A /* LocalizationTests.swift */, @@ -4850,6 +4871,7 @@ B53CA9BECD3F97805E1432D0 /* HomeScreen */, E3EA13D6E41AD76151C2D100 /* InvitesScreen */, F12966DF3DA87FEF21348D60 /* InviteUsersScreen */, + FFD7C58CA6A7D6BBC2F584B5 /* JoinRoomScreen */, 948DD12A5533BE1BC260E437 /* LocationSharing */, 73E032ADD008D63812791D97 /* LogViewerScreen */, 87E2774157D9C4894BCFF3F8 /* MediaPickerScreen */, @@ -5134,6 +5156,18 @@ path = Audio; sourceTree = ""; }; + FFD7C58CA6A7D6BBC2F584B5 /* JoinRoomScreen */ = { + isa = PBXGroup; + children = ( + 3BDCCD2F6B405C14B9BCE94E /* JoinRoomScreenCoordinator.swift */, + 136F80A613B55BDD071DCEA5 /* JoinRoomScreenModels.swift */, + 1CD7C0A2750998C2D77AD00F /* JoinRoomScreenViewModel.swift */, + EEAB5662310AE73D93815134 /* JoinRoomScreenViewModelProtocol.swift */, + 6792D400AF30A6F2ACD426E4 /* View */, + ); + path = JoinRoomScreen; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -5691,6 +5725,7 @@ A23B8B27A1436A1049EEF68E /* InfoPlistReader.swift in Sources */, A216C83ADCF32BA5EF8A6FBC /* InviteUsersViewModelTests.swift in Sources */, 266C4DF893F2947DCCEF327B /* InvitesScreenViewModelTests.swift in Sources */, + 7C0E29E0279866C62EC67A28 /* JoinRoomScreenViewModelTests.swift in Sources */, EEC40663922856C65D1E0DF5 /* KeychainControllerTests.swift in Sources */, CC961529F9F1854BEC3272C9 /* LayoutMocks.swift in Sources */, 8AC256AF0EC54658321C9241 /* LegalInformationScreenViewModelTests.swift in Sources */, @@ -6039,6 +6074,11 @@ 2AD59AD5B09498EF8B3B04EC /* InvitesScreenModels.swift in Sources */, C287BE1802AD432F3D848D8E /* InvitesScreenViewModel.swift in Sources */, BD6D98676111DA8FC2BE4908 /* InvitesScreenViewModelProtocol.swift in Sources */, + 6A54F52443EC52AC5CD772C0 /* JoinRoomScreen.swift in Sources */, + AFE2AB612A1460E49578D746 /* JoinRoomScreenCoordinator.swift in Sources */, + DEDBD3E9CFCC9F20CAC79881 /* JoinRoomScreenModels.swift in Sources */, + EF47D802A404A53F15D5D4B6 /* JoinRoomScreenViewModel.swift in Sources */, + 7B66DA4E7E5FE4D1A0FCEAA4 /* JoinRoomScreenViewModelProtocol.swift in Sources */, E3CA565A4B9704F191B191F0 /* JoinedRoomSize+MemberCount.swift in Sources */, 1FE593ECEC40A43789105D80 /* KeychainController.swift in Sources */, FD29471C72872F8B7580E3E1 /* KeychainControllerMock.swift in Sources */, @@ -7398,7 +7438,7 @@ repositoryURL = "https://github.com/element-hq/compound-ios"; requirement = { kind = revision; - revision = ed63ed56655956c950a3b9c55e2010fdf1a2d11d; + revision = 43310aaaced1a0861c39894bb1086067375326be; }; }; F76A08D0EA29A07A54F4EB4D /* XCRemoteSwiftPackageReference "swift-collections" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index cd1a42c69b..f2f6c725ab 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/element-hq/compound-ios", "state" : { - "revision" : "ed63ed56655956c950a3b9c55e2010fdf1a2d11d" + "revision" : "43310aaaced1a0861c39894bb1086067375326be" } }, { diff --git a/ElementX/Resources/Assets.xcassets/images/join-room-graphic.imageset/Contents.json b/ElementX/Resources/Assets.xcassets/images/join-room-graphic.imageset/Contents.json new file mode 100644 index 0000000000..d594a51424 --- /dev/null +++ b/ElementX/Resources/Assets.xcassets/images/join-room-graphic.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "join-room-graphic.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/ElementX/Resources/Assets.xcassets/images/join-room-graphic.imageset/join-room-graphic.svg b/ElementX/Resources/Assets.xcassets/images/join-room-graphic.imageset/join-room-graphic.svg new file mode 100644 index 0000000000..4cc9835016 --- /dev/null +++ b/ElementX/Resources/Assets.xcassets/images/join-room-graphic.imageset/join-room-graphic.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index 066172cddc..9bd3c8966e 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -196,6 +196,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg case .roomMemberDetails: userSessionFlowCoordinator?.handleAppRoute(route, animated: true) case .room(let roomID): + // check that the room is joined here, if not use a joinRoom route. if isExternalURL { userSessionFlowCoordinator?.handleAppRoute(route, animated: true) } else { diff --git a/ElementX/Sources/Generated/Assets.swift b/ElementX/Sources/Generated/Assets.swift index 5e21a8033d..5214d00877 100644 --- a/ElementX/Sources/Generated/Assets.swift +++ b/ElementX/Sources/Generated/Assets.swift @@ -39,6 +39,7 @@ internal enum Asset { internal static let stopRecording = ImageAsset(name: "images/stop-recording") internal static let settingsIconWithBadge = ImageAsset(name: "images/settings-icon-with-badge") internal static let joinRoomBackground = ImageAsset(name: "images/join-room-background") + internal static let joinRoomGraphic = ImageAsset(name: "images/join-room-graphic") internal static let launchBackground = ImageAsset(name: "images/launch-background") internal static let locationMarkerShape = ImageAsset(name: "images/location-marker-shape") internal static let mediaPause = ImageAsset(name: "images/media-pause") diff --git a/ElementX/Sources/Other/AvatarSize.swift b/ElementX/Sources/Other/AvatarSize.swift index 4ca16b1f19..9aff963502 100644 --- a/ElementX/Sources/Other/AvatarSize.swift +++ b/ElementX/Sources/Other/AvatarSize.swift @@ -93,6 +93,7 @@ enum RoomAvatarSizeOnScreen { case details case notificationSettings case roomDirectorySearch + case joinRoom var value: CGFloat { switch self { @@ -110,6 +111,8 @@ enum RoomAvatarSizeOnScreen { return 52 case .details: return 70 + case .joinRoom: + return 96 } } } diff --git a/ElementX/Sources/Screens/HomeScreen/View/RoomDirectorySearchView.swift b/ElementX/Sources/Screens/HomeScreen/View/RoomDirectorySearchView.swift index 5862f723e4..8c902250d8 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/RoomDirectorySearchView.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/RoomDirectorySearchView.swift @@ -24,7 +24,7 @@ struct RoomDirectorySearchView: View { Button(action: onTap) { Label(L10n.screenRoomlistRoomDirectoryButtonTitle, icon: \.listBulleted) } - .buttonStyle(.compound(.secondary)) + .buttonStyle(.compound(.super)) .padding(.horizontal, 16) .padding(.vertical, 8) } diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift new file mode 100644 index 0000000000..216b686743 --- /dev/null +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift @@ -0,0 +1,72 @@ +// +// Copyright 2022 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Combine +import SwiftUI + +struct JoinRoomScreenCoordinatorParameters { + let roomID: String + let roomName: String + let avatarURL: URL? + let interaction: JoinRoomScreenInteraction + let clientProxy: ClientProxyProtocol +} + +enum JoinRoomScreenCoordinatorAction { + case joined + case cancelled +} + +final class JoinRoomScreenCoordinator: CoordinatorProtocol { + private let parameters: JoinRoomScreenCoordinatorParameters + private let viewModel: JoinRoomScreenViewModelProtocol + + private var cancellables = Set() + + private let actionsSubject: PassthroughSubject = .init() + var actionsPublisher: AnyPublisher { + actionsSubject.eraseToAnyPublisher() + } + + init(parameters: JoinRoomScreenCoordinatorParameters) { + self.parameters = parameters + + viewModel = JoinRoomScreenViewModel(roomID: parameters.roomID, + roomName: parameters.roomName, + avatarURL: parameters.avatarURL, + interaction: parameters.interaction, + clientProxy: parameters.clientProxy) + } + + func start() { + viewModel.actionsPublisher.sink { [weak self] action in + MXLog.info("Coordinator: received view model action: \(action)") + + guard let self else { return } + switch action { + case .joined: + actionsSubject.send(.joined) + case .cancelled: + actionsSubject.send(.cancelled) + } + } + .store(in: &cancellables) + } + + func toPresentable() -> AnyView { + AnyView(JoinRoomScreen(context: viewModel.context)) + } +} diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift new file mode 100644 index 0000000000..9c2845c0c5 --- /dev/null +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift @@ -0,0 +1,74 @@ +// +// Copyright 2022 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation + +enum JoinRoomScreenViewModelAction { + case joined + case cancelled +} + +struct JoinRoomScreenViewState: BindableState { + // Maybe use room summary details or similar here?? + let roomID: String + let roomName: String + let avatarURL: URL? + + let interaction: JoinRoomScreenInteraction + + var isJoining = false + + var bindings = JoinRoomScreenViewStateBindings() + + var title: String { + switch interaction { + case .knock: + L10n.screenJoinRoomTitleKnock + case .join, .invited: + L10n.screenJoinRoomTitleNoPreview + } + } + + var subtitle: String { + switch interaction { + case .knock: + L10n.screenJoinRoomSubtitleKnock + case .join, .invited: + L10n.screenJoinRoomSubtitleNoPreview + } + } +} + +struct JoinRoomScreenViewStateBindings { + var alertInfo: AlertInfo? +} + +enum JoinRoomScreenAlertType { + case joinFailed +} + +enum JoinRoomScreenInteraction { + case knock + case join + case invited +} + +enum JoinRoomScreenViewAction { + case knock + case join + case acceptInvite + case declineInvite +} diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift new file mode 100644 index 0000000000..0f22c35816 --- /dev/null +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift @@ -0,0 +1,67 @@ +// +// Copyright 2022 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Combine +import SwiftUI + +typealias JoinRoomScreenViewModelType = StateStoreViewModel + +class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewModelProtocol { + private let clientProxy: ClientProxyProtocol + + private let actionsSubject: PassthroughSubject = .init() + var actionsPublisher: AnyPublisher { + actionsSubject.eraseToAnyPublisher() + } + + init(roomID: String, roomName: String, avatarURL: URL?, interaction: JoinRoomScreenInteraction, clientProxy: ClientProxyProtocol) { + self.clientProxy = clientProxy + + super.init(initialViewState: JoinRoomScreenViewState(roomID: roomID, + roomName: roomName, + avatarURL: avatarURL, + interaction: interaction)) + } + + // MARK: - Public + + override func process(viewAction: JoinRoomScreenViewAction) { + MXLog.info("View model: received view action: \(viewAction)") + + switch viewAction { + case .knock: + break + case .join: + Task { await joinRoom() } + case .acceptInvite: + break + case .declineInvite: + break + } + } + + // MARK: - Private + + private func joinRoom() async { + state.isJoining = true + switch await clientProxy.joinRoom(state.roomID) { + case .success: + actionsSubject.send(.joined) + case .failure(let error): + state.bindings.alertInfo = .init(id: .joinFailed) + } + } +} diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModelProtocol.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModelProtocol.swift new file mode 100644 index 0000000000..f9e36914d7 --- /dev/null +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModelProtocol.swift @@ -0,0 +1,23 @@ +// +// Copyright 2022 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Combine + +@MainActor +protocol JoinRoomScreenViewModelProtocol { + var actionsPublisher: AnyPublisher { get } + var context: JoinRoomScreenViewModelType.Context { get } +} diff --git a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift new file mode 100644 index 0000000000..6ac5806d03 --- /dev/null +++ b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift @@ -0,0 +1,130 @@ +// +// Copyright 2022 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Compound +import SwiftUI + +struct JoinRoomScreen: View { + @Environment(\.dynamicTypeSize) private var dynamicTypeSize + + @ObservedObject var context: JoinRoomScreenViewModel.Context + + var body: some View { + FullscreenDialog(topPadding: 80, background: .bloom) { + mainContent + } bottomContent: { + buttons + } + .background() + .backgroundStyle(.compound.bgCanvasDefault) + .navigationBarTitleDisplayMode(.inline) + .toolbar { toolbar } + } + + var mainContent: some View { + VStack(spacing: 16) { + LoadableAvatarImage(url: context.viewState.avatarURL, + name: context.viewState.roomName, + contentID: context.viewState.roomID, + avatarSize: .room(on: .joinRoom), + imageProvider: context.imageProvider) + .dynamicTypeSize(dynamicTypeSize < .accessibility1 ? dynamicTypeSize : .accessibility1) + + VStack(spacing: 8) { + Text(context.viewState.title) + .font(.compound.headingMDBold) + .foregroundStyle(.compound.textPrimary) + .multilineTextAlignment(.center) + + Text(context.viewState.subtitle) + .font(.compound.bodyMD) + .foregroundStyle(.compound.textSecondary) + .multilineTextAlignment(.center) + } + + Image(asset: Asset.Images.joinRoomGraphic) + .padding(.top, 40) + } + } + + @ViewBuilder + var buttons: some View { + switch context.viewState.interaction { + case .knock: + Button(L10n.screenJoinRoomKnockAction) { context.send(viewAction: .knock) } + .buttonStyle(.compound(.primary)) + case .join: + Button(L10n.screenJoinRoomJoinAction) { context.send(viewAction: .join) } + .buttonStyle(.compound(.super)) + case .invited: + ViewThatFits { + HStack(spacing: 8) { inviteButtons } + VStack(spacing: 16) { inviteButtons } + } + } + } + + @ViewBuilder + var inviteButtons: some View { + Button(L10n.actionDecline) { context.send(viewAction: .acceptInvite) } + .buttonStyle(.compound(.secondary)) + Button(L10n.actionAccept) { context.send(viewAction: .declineInvite) } + .buttonStyle(.compound(.primary)) + } + + @ToolbarContentBuilder + var toolbar: some ToolbarContent { + ToolbarItem(placement: .principal) { + RoomHeaderView(roomID: context.viewState.roomID, + roomName: context.viewState.roomName, + avatarURL: context.viewState.avatarURL, + imageProvider: context.imageProvider) + } + } +} + +// MARK: - Previews + +struct JoinRoomScreen_Previews: PreviewProvider, TestablePreview { + static let knockViewModel = makeViewModel(interaction: .knock) + static let joinViewModel = makeViewModel(interaction: .join) + static let inviteViewModel = makeViewModel(interaction: .invited) + + static var previews: some View { + NavigationStack { + JoinRoomScreen(context: knockViewModel.context) + } + .previewDisplayName("Knock") + + NavigationStack { + JoinRoomScreen(context: joinViewModel.context) + } + .previewDisplayName("Join") + + NavigationStack { + JoinRoomScreen(context: inviteViewModel.context) + } + .previewDisplayName("Invite") + } + + static func makeViewModel(interaction: JoinRoomScreenInteraction) -> JoinRoomScreenViewModel { + JoinRoomScreenViewModel(roomID: "6", + roomName: "Room Name", + avatarURL: nil, + interaction: interaction, + clientProxy: ClientProxyMock(.init())) + } +} diff --git a/ElementX/Sources/Screens/RoomScreen/View/RoomHeaderView.swift b/ElementX/Sources/Screens/RoomScreen/View/RoomHeaderView.swift index cb0bc97df4..1480ac0fdf 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/RoomHeaderView.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/RoomHeaderView.swift @@ -19,72 +19,47 @@ import Foundation import SwiftUI struct RoomHeaderView: View { - @ObservedObject var context: RoomScreenViewModel.Context - + let roomID: String + let roomName: String + let avatarURL: URL? + + let imageProvider: ImageProviderProtocol? + var body: some View { HStack(spacing: 12) { roomAvatar .accessibilityHidden(true) - Text(context.viewState.roomTitle) + Text(roomName) .font(.compound.bodyLGSemibold) .accessibilityIdentifier(A11yIdentifiers.roomScreen.name) } // Leading align whilst using the principal toolbar position. .frame(maxWidth: .infinity, alignment: .leading) - // Using a button stops it from getting truncated in the navigation bar - .onTapGesture { - context.send(viewAction: .displayRoomDetails) - } } - - @ViewBuilder private var roomAvatar: some View { - LoadableAvatarImage(url: context.viewState.roomAvatarURL, - name: context.viewState.roomTitle, - contentID: context.viewState.roomID, + + private var roomAvatar: some View { + LoadableAvatarImage(url: avatarURL, + name: roomName, + contentID: roomID, avatarSize: .room(on: .timeline), - imageProvider: context.imageProvider) + imageProvider: imageProvider) .accessibilityIdentifier(A11yIdentifiers.roomScreen.avatar) } } struct RoomHeaderView_Previews: PreviewProvider, TestablePreview { static var previews: some View { - bodyPlain - bodyEncrypted - } - - @ViewBuilder - static var bodyPlain: some View { - let viewModel = RoomScreenViewModel(roomProxy: RoomProxyMock(with: .init(name: "Some Room name", avatarURL: URL.picturesDirectory)), - timelineController: MockRoomTimelineController(), - mediaProvider: MockMediaProvider(), - mediaPlayerProvider: MediaPlayerProviderMock(), - voiceMessageMediaManager: VoiceMessageMediaManagerMock(), - userIndicatorController: ServiceLocator.shared.userIndicatorController, - application: ApplicationMock.default, - appSettings: ServiceLocator.shared.settings, - analyticsService: ServiceLocator.shared.analytics, - notificationCenter: NotificationCenterMock()) - - RoomHeaderView(context: viewModel.context) + RoomHeaderView(roomID: "1", + roomName: "Some Room name", + avatarURL: URL.picturesDirectory, + imageProvider: MockMediaProvider()) .previewLayout(.sizeThatFits) .padding() - } - - @ViewBuilder - static var bodyEncrypted: some View { - let viewModel = RoomScreenViewModel(roomProxy: RoomProxyMock(with: .init(name: "Some Room name")), - timelineController: MockRoomTimelineController(), - mediaProvider: MockMediaProvider(), - mediaPlayerProvider: MediaPlayerProviderMock(), - voiceMessageMediaManager: VoiceMessageMediaManagerMock(), - userIndicatorController: ServiceLocator.shared.userIndicatorController, - application: ApplicationMock.default, - appSettings: ServiceLocator.shared.settings, - analyticsService: ServiceLocator.shared.analytics, - notificationCenter: NotificationCenterMock()) - - RoomHeaderView(context: viewModel.context) + + RoomHeaderView(roomID: "1", + roomName: "Some Room name", + avatarURL: nil, + imageProvider: MockMediaProvider()) .previewLayout(.sizeThatFits) .padding() } diff --git a/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift b/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift index bb926ec075..8fea749498 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift @@ -139,7 +139,14 @@ struct RoomScreen: View { // .principal + .primaryAction works better than .navigation leading + trailing // as the latter disables interaction in the action button for rooms with long names ToolbarItem(placement: .principal) { - RoomHeaderView(context: context) + RoomHeaderView(roomID: context.viewState.roomID, + roomName: context.viewState.roomTitle, + avatarURL: context.viewState.roomAvatarURL, + imageProvider: context.imageProvider) + // Using a button stops it from getting truncated in the navigation bar + .onTapGesture { + context.send(viewAction: .displayRoomDetails) + } } if !ProcessInfo.processInfo.isiOSAppOnMac { diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Invite.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Invite.png new file mode 100644 index 0000000000..29c2bdeea4 --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Invite.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47d269397c823468762d9c7fd7075a6f998b4180f4ef5c126d13623348ba02b2 +size 2089420 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Join.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Join.png new file mode 100644 index 0000000000..53f5414253 --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Join.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1df7a389ffbf315811e1605cb542a01ae560e977872c49e15092dc0f7432b1eb +size 2053936 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png new file mode 100644 index 0000000000..4293e58eba --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf9c852e2d1618056391d08faacfbe402be84ced71793364e25e4e1fd0a84481 +size 2057420 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Invite.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Invite.png new file mode 100644 index 0000000000..0ba98e47e1 --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Invite.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5df7c700584320710a80633c4b06b1045886a88a32ba112a692560b58ce5eaf0 +size 2123755 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Join.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Join.png new file mode 100644 index 0000000000..5a0f98fa87 --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Join.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8945225fb83489edf46bb1454770b0c55d2265b8b330ecd16079534c1fc2ef76 +size 2087732 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png new file mode 100644 index 0000000000..5eb1b37a3f --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e60ad9a4485f37882412ec46821127ea0f605f9abe435598f43d8bc2d5279c83 +size 2104307 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-en-GB.Invite.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-en-GB.Invite.png new file mode 100644 index 0000000000..b31f8ad023 --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-en-GB.Invite.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e17277315e799bbac0caf145de342a624bfc80357aa63f297334fe8d6c81367 +size 826589 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-en-GB.Join.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-en-GB.Join.png new file mode 100644 index 0000000000..dc38a150b9 --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-en-GB.Join.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e45734de2938d98904d8b7c19a44b997fb1f6447839f60909e79c1e620096fd +size 806983 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-en-GB.Knock.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-en-GB.Knock.png new file mode 100644 index 0000000000..29370035fa --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-en-GB.Knock.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0f4de3f95f6242680a8b8b52939fd2a3a79a299d8dea6d5609244038c95bc1a +size 811524 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-pseudo.Invite.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-pseudo.Invite.png new file mode 100644 index 0000000000..4a20fc6645 --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-pseudo.Invite.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0bca263cdc71f987ef6b0f4f3d70f4779ea3865a603f752fc5e3ae773c9f394 +size 857464 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-pseudo.Join.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-pseudo.Join.png new file mode 100644 index 0000000000..5271474475 --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-pseudo.Join.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:171a0753cc99267b93c83f3bc2caf9546d2d72c685251f9fe70796556db5fc3e +size 837228 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-pseudo.Knock.png b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-pseudo.Knock.png new file mode 100644 index 0000000000..446e24deb5 --- /dev/null +++ b/PreviewTests/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-15-pseudo.Knock.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a88bb18fd0311c7c380f76a7c1364a1eb844f708835425b8a22abcc12997c25c +size 851763 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPad-en-GB.1.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPad-en-GB.1.png index 624e278952..399b0e4e77 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPad-en-GB.1.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPad-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4268ac08be6b463369ec4e0c934231e997b033e45baed23df03cb35869007272 -size 82475 +oid sha256:74663f8e4eb478dd77a5776fae6c8e7cf5669afefdbe3d81d645f5149a7c369b +size 102035 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPad-pseudo.1.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPad-pseudo.1.png index 0208ddfd95..b2361dad29 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPad-pseudo.1.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPad-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e267a3678f60b674ec7078a2f5c2ccec2c54c5d18fed5954f0abe00f4fa6aee4 -size 88868 +oid sha256:bd608f8bbc19d99aae193cefeffea78a18fe7f90f7cf36954c7eaf17be1101e3 +size 107314 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPhone-15-en-GB.1.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPhone-15-en-GB.1.png index 3da2b0c12a..95c3e82641 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPhone-15-en-GB.1.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPhone-15-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e0d8ffab7621673199dc80f52821ba7777e889454b530d95da212a929aefbca3 -size 40309 +oid sha256:9d8f2fe2b6221152af219876bae7f5eea2ef13b80a6a361737e2e65000bef447 +size 51457 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPhone-15-pseudo.1.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPhone-15-pseudo.1.png index d88f857457..7eba7f3267 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPhone-15-pseudo.1.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomDirectorySearchView-iPhone-15-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fbdc78f06c3ea80474b399722c2bbfd31cfd4ff79cb7e0b0729e87a41587b3be -size 47531 +oid sha256:83833e81ea928633b3ddbb2df6933093c49f9008f4520fd7d02def0b60588d9c +size 58896 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPad-en-GB.2.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPad-en-GB.2.png index dda6d82e4a..86591d9c02 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPad-en-GB.2.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPad-en-GB.2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a78eb43053c130a296430bc9c26a6e1f51cd90854f28f65822980a21a9c69fd -size 17056 +oid sha256:0d8b960df58dfcceddd04e6b738b0470fed90b5094241bfc908edf445aede761 +size 17145 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPad-pseudo.2.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPad-pseudo.2.png index dda6d82e4a..86591d9c02 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPad-pseudo.2.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPad-pseudo.2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a78eb43053c130a296430bc9c26a6e1f51cd90854f28f65822980a21a9c69fd -size 17056 +oid sha256:0d8b960df58dfcceddd04e6b738b0470fed90b5094241bfc908edf445aede761 +size 17145 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPhone-15-en-GB.2.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPhone-15-en-GB.2.png index ee2d2dc6f7..4528bb6762 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPhone-15-en-GB.2.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPhone-15-en-GB.2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:caa01deca1c554a2809eaef83a5bac2a19018d3bf9ed023da26bc822d2af80f4 -size 12731 +oid sha256:b1c69feb82dedba852ca45ca32e927ca8df49fb6aafbdbef9fdd3c5daebf5d4f +size 12770 diff --git a/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPhone-15-pseudo.2.png b/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPhone-15-pseudo.2.png index ee2d2dc6f7..4528bb6762 100644 --- a/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPhone-15-pseudo.2.png +++ b/PreviewTests/__Snapshots__/PreviewTests/test_roomHeaderView-iPhone-15-pseudo.2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:caa01deca1c554a2809eaef83a5bac2a19018d3bf9ed023da26bc822d2af80f4 -size 12731 +oid sha256:b1c69feb82dedba852ca45ca32e927ca8df49fb6aafbdbef9fdd3c5daebf5d4f +size 12770 diff --git a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift new file mode 100644 index 0000000000..d0ac82d464 --- /dev/null +++ b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift @@ -0,0 +1,46 @@ +// +// Copyright 2022 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import XCTest + +@testable import ElementX + +@MainActor +class JoinRoomScreenViewModelTests: XCTestCase { + var viewModel: JoinRoomScreenViewModelProtocol! + + var context: JoinRoomScreenViewModelType.Context { + viewModel.context + } + + func testInteraction() async throws { + setupViewModel() + + let deferred = deferFulfillment(viewModel.actionsPublisher) { $0 == .joined } + context.send(viewAction: .join) + try await deferred.fulfill() + } + + private func setupViewModel(throwing: Bool = false) { + let clientProxy = ClientProxyMock(.init()) + clientProxy.joinRoomReturnValue = throwing ? .failure(.sdkError(ClientProxyMockError.generic)) : .success(()) + viewModel = JoinRoomScreenViewModel(roomID: "1", + roomName: "Room Name", + avatarURL: nil, + interaction: .join, + clientProxy: clientProxy) + } +} diff --git a/project.yml b/project.yml index 4f2a22ebcd..79a1714c7c 100644 --- a/project.yml +++ b/project.yml @@ -53,7 +53,7 @@ packages: # path: ../matrix-rust-sdk Compound: url: https://github.com/element-hq/compound-ios - revision: ed63ed56655956c950a3b9c55e2010fdf1a2d11d + revision: 43310aaaced1a0861c39894bb1086067375326be # path: ../compound-ios AnalyticsEvents: url: https://github.com/matrix-org/matrix-analytics-events