From 7663c506790189455177d26a16a06f195d6660e3 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 31 Mar 2020 11:05:13 -0400 Subject: [PATCH 1/5] move legacy files --- MVMCore/MVMCore/MainProtocols/MVMCoreViewControllerProtocol.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MVMCore/MVMCore/MainProtocols/MVMCoreViewControllerProtocol.h b/MVMCore/MVMCore/MainProtocols/MVMCoreViewControllerProtocol.h index 9596929..dba1c92 100644 --- a/MVMCore/MVMCore/MainProtocols/MVMCoreViewControllerProtocol.h +++ b/MVMCore/MVMCore/MainProtocols/MVMCoreViewControllerProtocol.h @@ -20,6 +20,8 @@ @optional +@property (nullable, strong, nonatomic) MVMCoreLoadObject *loadObject; + // Allows override of the delegate to use. - (nullable DelegateObject *)delegateObject; From 68897db7646ee874847b2e608d3e25f5366c7862 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 2 Apr 2020 19:47:52 -0400 Subject: [PATCH 2/5] april jira tasks --- MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift | 2 -- MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift | 2 -- MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift | 1 - MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift | 3 --- MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift | 2 -- MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift | 3 --- MVMCore/MVMCore/Models/ActionType/ActionOpenUrlModel.swift | 3 --- MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift | 1 - .../MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift | 1 - MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift | 1 - MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift | 1 - MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift | 1 - 12 files changed, 21 deletions(-) diff --git a/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift index 72b84f7..0cbfd6b 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift @@ -13,6 +13,4 @@ import Foundation public var actionType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - // Temporary fix till server changes - public var title: String? } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift index 3f13e6a..90e7799 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift @@ -15,8 +15,6 @@ import Foundation public var callNumber: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - // Temporary fix till server changes - public var title: String? public init(callNumber: String) { self.callNumber = callNumber diff --git a/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift index 08bf63c..9a9bcee 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift @@ -13,5 +13,4 @@ import UIKit public var actionType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - public var title: String? } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift b/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift index dc36409..70c3150 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift @@ -13,9 +13,6 @@ public protocol ActionModelProtocol: ModelProtocol { var actionType: String { get } var extraParameters: JSONValueDictionary? { get set } var analyticsData: JSONValueDictionary? { get set } - - // Temporary fix till server changes - var title: String? { get set } } public extension ActionModelProtocol { diff --git a/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift index 9614bc8..79bdf15 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift @@ -15,8 +15,6 @@ import Foundation public var appURL: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - // Temporary fix till server changes - public var title: String? public init(appURL: String) { self.appURL = appURL diff --git a/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift index 413adf8..b51096b 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift @@ -16,9 +16,6 @@ import Foundation public var analyticsData: JSONValueDictionary? public var presentationStyle: String? - // Temporary fix till server changes - public var title: String? - public init(pageType: String) { self.pageType = pageType } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionOpenUrlModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionOpenUrlModel.swift index fc8c11f..527cc5a 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionOpenUrlModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionOpenUrlModel.swift @@ -15,9 +15,6 @@ import Foundation public var browserUrl: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - // Temporary fix till server changes - public var title: String? - //TODO: Should be removed in future releases. This should be MF specific. //Missing params diff --git a/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift index eaff84c..ad2537f 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift @@ -11,7 +11,6 @@ import Foundation @objcMembers public class ActionPopupModel: ActionModelProtocol { public static var identifier: String = "popup" public var actionType: String = ActionPopupModel.identifier - public var title: String? public var pageType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift index f6d5ad7..647b623 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift @@ -13,5 +13,4 @@ import UIKit public var actionType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - public var title: String? } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift index 0cdbae3..6713933 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift @@ -13,7 +13,6 @@ import UIKit public var actionType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - public var title: String? ///Optional pageType, if pageType is nil, will start with pageType launchApp public var pageType: String? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift index 212b526..f9c92e5 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift @@ -13,5 +13,4 @@ import UIKit public var actionType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - public var title: String? } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift index 16da245..2fb5a3a 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift @@ -16,7 +16,6 @@ import UIKit public static var identifier: String = "share" public var actionType: String = ActionShareModel.identifier - public var title: String? public var sharedType: String public var sharedText: String public var extraParameters: JSONValueDictionary? From cd374bfacc41730cfcef15e3fa419abfbbdd948d Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 13 Apr 2020 17:19:50 -0400 Subject: [PATCH 3/5] Fix to models check --- .../MVMCore/Models/Model/ModelRegistry.swift | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/MVMCore/MVMCore/Models/Model/ModelRegistry.swift b/MVMCore/MVMCore/Models/Model/ModelRegistry.swift index b002175..f9ec58b 100644 --- a/MVMCore/MVMCore/Models/Model/ModelRegistry.swift +++ b/MVMCore/MVMCore/Models/Model/ModelRegistry.swift @@ -205,19 +205,18 @@ public extension UnkeyedDecodingContainer { // Iterate and decode each. while !containerCopy.isAtEnd { let nestedContainer = try containerCopy.nestedContainer(keyedBy: AnyCodingKey.self) - if let identifier = try nestedContainer.decodeIfPresent(String.self, forKey: typeCodingKey) { - guard let type = ModelRegistry.getType(for: identifier, with: T.self) else { - MVMCoreLoggingHandler.logDebugMessage(withDelegate: "ModelRegistry Error decoderErrorModelNotMapped: \(identifier)") - throw ModelRegistry.Error.decoderErrorModelNotMapped - } - // Now get the decoder to use for the type - let decoder = try self.superDecoder() - if let model = try type.init(from: decoder) as? T { - models.append(model) - } else { - MVMCoreLoggingHandler.logDebugMessage(withDelegate: "ModelRegistry Error decoderError: \(typeCodingKey)") - throw ModelRegistry.Error.decoderError - } + let identifier = try nestedContainer.decode(String.self, forKey: typeCodingKey) + guard let type = ModelRegistry.getType(for: identifier, with: T.self) else { + MVMCoreLoggingHandler.logDebugMessage(withDelegate: "ModelRegistry Error decoderErrorModelNotMapped: \(identifier)") + throw ModelRegistry.Error.decoderErrorModelNotMapped + } + // Now get the decoder to use for the type + let decoder = try self.superDecoder() + if let model = try type.init(from: decoder) as? T { + models.append(model) + } else { + MVMCoreLoggingHandler.logDebugMessage(withDelegate: "ModelRegistry Error decoderError: \(typeCodingKey)") + throw ModelRegistry.Error.decoderError } } return models From 8124292b7d3ea34ee57821dc46ab70e4c0073642 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 21 Apr 2020 15:51:50 -0400 Subject: [PATCH 4/5] navigation and template --- MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift index 0cbfd6b..b16beb0 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift @@ -10,7 +10,9 @@ import Foundation @objcMembers public class ActionBackModel: ActionModelProtocol { public static var identifier: String = "back" - public var actionType: String + public var actionType: String = ActionBackModel.identifier public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? + + public init() {} } From 9b7f09dcf48603c9f691b43ce9c8c9f2830efa50 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 24 Apr 2020 11:38:58 -0400 Subject: [PATCH 5/5] add convenience inits. --- MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift | 5 ++++- MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift | 4 +++- MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift | 7 ++++++- .../MVMCore/Models/ActionType/ActionOpenAppModel.swift | 4 +++- .../MVMCore/Models/ActionType/ActionOpenPageModel.swift | 5 ++++- MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift | 5 ++++- .../Models/ActionType/ActionPreviousSubmitModel.swift | 7 ++++++- .../MVMCore/Models/ActionType/ActionRestartModel.swift | 8 +++++++- .../MVMCore/Models/ActionType/ActionSettingModel.swift | 7 ++++++- MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift | 4 +++- 10 files changed, 46 insertions(+), 10 deletions(-) diff --git a/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift index b16beb0..cb8b643 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift @@ -14,5 +14,8 @@ import Foundation public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - public init() {} + public init(_ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { + self.extraParameters = extraParameters + self.analyticsData = analyticsData + } } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift index 90e7799..75ce450 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift @@ -16,7 +16,9 @@ import Foundation public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - public init(callNumber: String) { + public init(callNumber: String, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { self.callNumber = callNumber + self.extraParameters = extraParameters + self.analyticsData = analyticsData } } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift index 9a9bcee..0b1b675 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift @@ -10,7 +10,12 @@ import UIKit @objcMembers public class ActionCancelModel: ActionModelProtocol { public static var identifier: String = "cancel" - public var actionType: String + public var actionType: String = ActionCancelModel.identifier public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? + + public init(_ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { + self.extraParameters = extraParameters + self.analyticsData = analyticsData + } } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift index 79bdf15..6dd46a6 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift @@ -16,7 +16,9 @@ import Foundation public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - public init(appURL: String) { + public init(appURL: String, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { self.appURL = appURL + self.extraParameters = extraParameters + self.analyticsData = analyticsData } } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift index b51096b..ac4d537 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift @@ -16,7 +16,10 @@ import Foundation public var analyticsData: JSONValueDictionary? public var presentationStyle: String? - public init(pageType: String) { + public init(pageType: String, _ presentationStyle: String? = nil, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { self.pageType = pageType + self.presentationStyle = presentationStyle + self.extraParameters = extraParameters + self.analyticsData = analyticsData } } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift index ad2537f..9c5ee17 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift @@ -14,7 +14,10 @@ import Foundation public var pageType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - public init(pageType: String) { + + public init(pageType: String, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { self.pageType = pageType + self.extraParameters = extraParameters + self.analyticsData = analyticsData } } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift index 647b623..f64b5ba 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift @@ -10,7 +10,12 @@ import UIKit @objcMembers public class ActionPreviousSubmitModel: ActionModelProtocol { public static var identifier: String = "previousSubmit" - public var actionType: String + public var actionType: String = ActionPreviousSubmitModel.identifier public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? + + public init(_ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { + self.extraParameters = extraParameters + self.analyticsData = analyticsData + } } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift index 6713933..fe9c09d 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift @@ -10,10 +10,16 @@ import UIKit @objcMembers public class ActionRestartModel: ActionModelProtocol { public static var identifier: String = "restart" - public var actionType: String + public var actionType: String = ActionRestartModel.identifier public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? ///Optional pageType, if pageType is nil, will start with pageType launchApp public var pageType: String? + + public init(_ pageType: String? = nil, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { + self.pageType = pageType + self.extraParameters = extraParameters + self.analyticsData = analyticsData + } } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift index f9c92e5..5986e47 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift @@ -10,7 +10,12 @@ import UIKit @objcMembers public class ActionSettingModel: ActionModelProtocol { public static var identifier: String = "openSettings" - public var actionType: String + public var actionType: String = ActionSettingModel.identifier public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? + + public init(_ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { + self.extraParameters = extraParameters + self.analyticsData = analyticsData + } } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift index 2fb5a3a..7dc327f 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift @@ -25,8 +25,10 @@ import UIKit // MARK: - Initializer //-------------------------------------------------- - public init(sharedText: String,sharedType: String) { + public init(sharedText: String, sharedType: String, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { self.sharedType = sharedType self.sharedText = sharedText + self.extraParameters = extraParameters + self.analyticsData = analyticsData } }