Skip to content

Commit

Permalink
Introduce list queue interface
Browse files Browse the repository at this point in the history
Restore Swift Package Manager
compatibility in a local package
connectivity mode.

MOB-2594
  • Loading branch information
yurii-glia committed Sep 14, 2023
1 parent acd520a commit 27d7827
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
4 changes: 0 additions & 4 deletions GliaWidgets.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@
75CF8D9129C3A85C00CB1524 /* SecureConversationsWelcomeScreenTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75CF8D9029C3A85C00CB1524 /* SecureConversationsWelcomeScreenTests.swift */; };
75CF8DAD29C8F2B500CB1524 /* SecureConversationsConfirmationScreenTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75CF8DAC29C8F2B500CB1524 /* SecureConversationsConfirmationScreenTests.swift */; };
75F58EE127E7D5300065BA2D /* Survey.ViewController.Props.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F58EE027E7D5300065BA2D /* Survey.ViewController.Props.swift */; };
75FD003F2A80E8C5002DC458 /* CoreSdk.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7552DFB32A6FBC7F0093519B /* CoreSdk.swift */; };
75FF151427F3A2D600FE7BE2 /* Theme+Survey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75FF151327F3A2D600FE7BE2 /* Theme+Survey.swift */; };
75FF151727F4E13900FE7BE2 /* Theme.Survey.BooleanQuestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75FF151627F4E13900FE7BE2 /* Theme.Survey.BooleanQuestion.swift */; };
75FF151B27F4F52D00FE7BE2 /* Theme.Survey.SingleQuestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75FF151A27F4F52D00FE7BE2 /* Theme.Survey.SingleQuestion.swift */; };
Expand Down Expand Up @@ -953,7 +952,6 @@
7543141728806AEB00C9C1C6 /* EnvironmentSettingsTextCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnvironmentSettingsTextCell.swift; sourceTree = "<group>"; };
754CC61427E27C42005676E9 /* Survey.Checkbox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Survey.Checkbox.swift; sourceTree = "<group>"; };
7552DFB02A6FB7DF0093519B /* ChatMessageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatMessageTests.swift; sourceTree = "<group>"; };
7552DFB32A6FBC7F0093519B /* CoreSdk.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreSdk.swift; sourceTree = "<group>"; };
755D186429A6A4E20009F5E8 /* WelcomeStyle+TitleStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WelcomeStyle+TitleStyle.swift"; sourceTree = "<group>"; };
755D186629A6A4FA0009F5E8 /* WelcomeStyle+SubtitleStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WelcomeStyle+SubtitleStyle.swift"; sourceTree = "<group>"; };
755D186829A6A5270009F5E8 /* WelcomeStyle+CheckMessagesButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WelcomeStyle+CheckMessagesButtonStyle.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2656,7 +2654,6 @@
7552DFB22A6FBC6E0093519B /* CoreSdk */ = {
isa = PBXGroup;
children = (
7552DFB32A6FBC7F0093519B /* CoreSdk.swift */,
);
path = CoreSdk;
sourceTree = "<group>";
Expand Down Expand Up @@ -4658,7 +4655,6 @@
754CC61227E2767A005676E9 /* Survey.BooleanQuestionView.swift in Sources */,
755D187529A6A6B70009F5E8 /* WelcomeStyle+SendButton.swift in Sources */,
6EA3516926E139DA00BF5941 /* GliaViewTransitionController.swift in Sources */,
75FD003F2A80E8C5002DC458 /* CoreSdk.swift in Sources */,
C0D2F07929A4E3DF00803B47 /* UserImageView.Mock.swift in Sources */,
84265E6B29912E2100D65842 /* RemoteConfiguration+CallVisualizer.swift in Sources */,
1A1E30C725F9FDAB00850E68 /* ChatImageFileContentView.swift in Sources */,
Expand Down
3 changes: 3 additions & 0 deletions GliaWidgets/Sources/Component/Bubble/BubbleView.Mock.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#if DEBUG

import Foundation

extension BubbleView {
static func mock(
with bubbleStyle: BubbleStyle = .mock(),
Expand Down
6 changes: 4 additions & 2 deletions GliaWidgets/Sources/Interactor/Interactor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,12 @@ extension InteractorState: Equatable {
switch (lhs, rhs) {
case (.none, .none),
(.enqueueing, .enqueueing),
(.enqueued, .enqueued),
(.ended, .ended):
(.enqueued, .enqueued):
return true

case (.ended(let lhsReason), .ended(let rhsReason)):
return lhsReason == rhsReason

case (.engaged(let lhsOperator), .engaged(let rhsOperator)):
return lhsOperator == rhsOperator

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,5 +641,30 @@ extension ChatViewController {
""".data(using: .utf8)
}
}

/// Defines wrapper structure for getting decoding container.
/// This container can be used when message metadata is needed in
/// tests.
struct CoreSdkMessageMetadataContainer: Decodable {
let container: KeyedDecodingContainer<GliaCoreSDK.Message.Metadata.CodingKeys>

init(from decoder: Decoder) throws {
self.container = try decoder.container(
keyedBy: GliaCoreSDK.Message.Metadata.CodingKeys.self
)
}

/// Creates instance with decoding container inside.
/// This initializer can be used for created mocked Metadata with passing
/// json-data inside of this initializer.
/// NB! Empty 'jsonData' will lead to decoding error.
init(
jsonData: Data,
jsonDecoder: JSONDecoder = .init()
) throws {
self = try jsonDecoder.decode(CoreSdkMessageMetadataContainer.self, from: jsonData)
}
}

// swiftlint:enable function_body_length
#endif
26 changes: 0 additions & 26 deletions GliaWidgetsTests/CoreSdk/CoreSdk.swift

This file was deleted.

0 comments on commit 27d7827

Please sign in to comment.