Merge branch 'develop' of gitlab.verizon.com:BPHV_MIPS/mvm_core into develop
This commit is contained in:
commit
fc97eea93a
@ -20,6 +20,8 @@
|
||||
|
||||
@optional
|
||||
|
||||
@property (nullable, strong, nonatomic) MVMCoreLoadObject *loadObject;
|
||||
|
||||
// Allows override of the delegate to use.
|
||||
- (nullable DelegateObject *)delegateObject;
|
||||
|
||||
|
||||
@ -10,9 +10,12 @@ 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?
|
||||
// Temporary fix till server changes
|
||||
public var title: String?
|
||||
|
||||
public init(_ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
|
||||
self.extraParameters = extraParameters
|
||||
self.analyticsData = analyticsData
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,10 +15,10 @@ 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) {
|
||||
public init(callNumber: String, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
|
||||
self.callNumber = callNumber
|
||||
self.extraParameters = extraParameters
|
||||
self.analyticsData = analyticsData
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +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 var title: String?
|
||||
|
||||
public init(_ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
|
||||
self.extraParameters = extraParameters
|
||||
self.analyticsData = analyticsData
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -15,10 +15,10 @@ 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) {
|
||||
public init(appURL: String, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
|
||||
self.appURL = appURL
|
||||
self.extraParameters = extraParameters
|
||||
self.analyticsData = analyticsData
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,10 +16,10 @@ import Foundation
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
public var presentationStyle: String?
|
||||
|
||||
// Temporary fix till server changes
|
||||
public var title: 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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -11,11 +11,13 @@ 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?
|
||||
public init(pageType: String) {
|
||||
|
||||
public init(pageType: String, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
|
||||
self.pageType = pageType
|
||||
self.extraParameters = extraParameters
|
||||
self.analyticsData = analyticsData
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +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 var title: String?
|
||||
|
||||
public init(_ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
|
||||
self.extraParameters = extraParameters
|
||||
self.analyticsData = analyticsData
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,11 +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?
|
||||
public var title: String?
|
||||
|
||||
///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
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +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 var title: String?
|
||||
|
||||
public init(_ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
|
||||
self.extraParameters = extraParameters
|
||||
self.analyticsData = analyticsData
|
||||
}
|
||||
}
|
||||
|
||||
@ -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?
|
||||
@ -26,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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user