From 0423937e8c8fac7c86a09dae2d14cc1ea056088e Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Wed, 3 Oct 2018 15:25:25 -0400 Subject: [PATCH 01/10] customTimeoutTime --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m | 2 +- MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index a3b244e..583fa2e 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -151,7 +151,7 @@ } NSTimeInterval timeOutInterval = 60; - if (requestParameters.customTimeoutTime) { + if (requestParameters.customTimeoutTime && requestParameters.customTimeoutTime.integerValue > TimeOutTimeProd) { timeOutInterval = requestParameters.customTimeoutTime.floatValue; } else if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(timeOutIntervalForRequest:)]) { timeOutInterval = [[MVMCoreObject sharedInstance].globalLoadDelegate timeOutIntervalForRequest:requestParameters]; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m index 8524bf3..e9a3ad3 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m @@ -67,6 +67,7 @@ if (self = [self initWithPageType:[actionMap stringForKey:KeyPageType] additionalModules:[actionMap array:KeyModuleList] extraParameters:[actionMap dict:KeyExtraParameters]]) { self.contextRoot = [actionMap string:KeyContextRoot]; self.actionMap = actionMap; + self.customTimeoutTime = @([actionMap integer:@"customTimeoutTime"]); self.openSupportPanel = [actionMap boolForKey:KeyOpenSupport]; // Right now server is sending default.... can't uncomment this until they remove default @@ -132,6 +133,7 @@ copyObject.alternateBaseURL = self.alternateBaseURL; copyObject.openSupportPanel = self.openSupportPanel; copyObject.imageData = self.imageData; + copyObject.customTimeoutTime = self.customTimeoutTime; return copyObject; } From b802ef630dd69c458f19f3929f6be9c45cc50bbe Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Wed, 3 Oct 2018 15:31:27 -0400 Subject: [PATCH 02/10] customTimeoutTime --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index 583fa2e..d095485 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -151,7 +151,7 @@ } NSTimeInterval timeOutInterval = 60; - if (requestParameters.customTimeoutTime && requestParameters.customTimeoutTime.integerValue > TimeOutTimeProd) { + if (requestParameters.customTimeoutTime && requestParameters.customTimeoutTime.integerValue > 30.0) { timeOutInterval = requestParameters.customTimeoutTime.floatValue; } else if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(timeOutIntervalForRequest:)]) { timeOutInterval = [[MVMCoreObject sharedInstance].globalLoadDelegate timeOutIntervalForRequest:requestParameters]; From 4c506b5b593d0b6c4344ee9a791d82b07e90c87c Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Wed, 3 Oct 2018 17:47:42 -0400 Subject: [PATCH 03/10] buttonMap --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h | 3 +++ MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m | 2 ++ 2 files changed, 5 insertions(+) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h index 014e4ba..51848dd 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h @@ -23,6 +23,9 @@ // The data for hte page that was loaded @property (nullable, strong, nonatomic) NSDictionary *pageJSON; +// Contains the button map +@property (nullable, nonatomic, strong) NSDictionary *buttonMap; + // the modules that are needed @property (nullable, strong, nonatomic) NSDictionary *modulesJSON; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m index 388f911..e9127c2 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m @@ -18,6 +18,8 @@ if (self = [self initWithRequestParameters:requestParameters dataForPage:dataForPage delegate:delegate]) { self.pageJSON = pageJSON; self.modulesJSON = modulesJSON; + + self.buttonMap = [pageJSON dictionaryForKey:@"ButtonMap"]; } return self; } From 35da51bc7497172ebfd2560ca7008eabc96a2bf6 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Sat, 6 Oct 2018 15:05:37 -0400 Subject: [PATCH 04/10] button map --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m index e9127c2..6b98642 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m @@ -19,11 +19,15 @@ self.pageJSON = pageJSON; self.modulesJSON = modulesJSON; - self.buttonMap = [pageJSON dictionaryForKey:@"ButtonMap"]; + //self.buttonMap = [pageJSON dictionaryForKey:@"ButtonMap"]; } return self; } +- (NSDictionary *) buttonMap { + return [self.pageJSON dictionaryForKey:@"ButtonMap"]; +} + - (nullable instancetype)initWithRequestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegate:(nullable NSObject*)delegate { if (self = [self initWithDelegate:delegate]) { self.requestParameters = requestParameters; From 41a454440eaa45234e74aef3ee3edd7b1c82b58c Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 11 Oct 2018 16:23:16 -0400 Subject: [PATCH 05/10] changes to the custom time and button map removal --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m | 2 +- MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h | 3 --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m | 6 ------ MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m | 2 +- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index d095485..a3b244e 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -151,7 +151,7 @@ } NSTimeInterval timeOutInterval = 60; - if (requestParameters.customTimeoutTime && requestParameters.customTimeoutTime.integerValue > 30.0) { + if (requestParameters.customTimeoutTime) { timeOutInterval = requestParameters.customTimeoutTime.floatValue; } else if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(timeOutIntervalForRequest:)]) { timeOutInterval = [[MVMCoreObject sharedInstance].globalLoadDelegate timeOutIntervalForRequest:requestParameters]; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h index 51848dd..014e4ba 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h @@ -23,9 +23,6 @@ // The data for hte page that was loaded @property (nullable, strong, nonatomic) NSDictionary *pageJSON; -// Contains the button map -@property (nullable, nonatomic, strong) NSDictionary *buttonMap; - // the modules that are needed @property (nullable, strong, nonatomic) NSDictionary *modulesJSON; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m index 6b98642..388f911 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m @@ -18,16 +18,10 @@ if (self = [self initWithRequestParameters:requestParameters dataForPage:dataForPage delegate:delegate]) { self.pageJSON = pageJSON; self.modulesJSON = modulesJSON; - - //self.buttonMap = [pageJSON dictionaryForKey:@"ButtonMap"]; } return self; } -- (NSDictionary *) buttonMap { - return [self.pageJSON dictionaryForKey:@"ButtonMap"]; -} - - (nullable instancetype)initWithRequestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegate:(nullable NSObject*)delegate { if (self = [self initWithDelegate:delegate]) { self.requestParameters = requestParameters; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m index e9a3ad3..b72132a 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m @@ -67,7 +67,7 @@ if (self = [self initWithPageType:[actionMap stringForKey:KeyPageType] additionalModules:[actionMap array:KeyModuleList] extraParameters:[actionMap dict:KeyExtraParameters]]) { self.contextRoot = [actionMap string:KeyContextRoot]; self.actionMap = actionMap; - self.customTimeoutTime = @([actionMap integer:@"customTimeoutTime"]); + self.customTimeoutTime = [actionMap objectForKey:@"customTimeoutTime" ofType:[NSNumber class]]; self.openSupportPanel = [actionMap boolForKey:KeyOpenSupport]; // Right now server is sending default.... can't uncomment this until they remove default From adda2f461b8577b701298fe2b4879554c8269989 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Sun, 14 Oct 2018 23:57:41 -0400 Subject: [PATCH 06/10] button map read only property --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h | 3 +++ MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h index 014e4ba..6699e27 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h @@ -23,6 +23,9 @@ // The data for hte page that was loaded @property (nullable, strong, nonatomic) NSDictionary *pageJSON; +// Contains the button map +@property (nullable, nonatomic, strong, readonly) NSDictionary *buttonMap; + // the modules that are needed @property (nullable, strong, nonatomic) NSDictionary *modulesJSON; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m index 388f911..f48bdf5 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m @@ -22,6 +22,10 @@ return self; } +- (NSDictionary *) buttonMap { + return [self.pageJSON dictionaryForKey:@"ButtonMap"]; +} + - (nullable instancetype)initWithRequestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegate:(nullable NSObject*)delegate { if (self = [self initWithDelegate:delegate]) { self.requestParameters = requestParameters; From c860e20258bd8aec6dc92e8f8144d568006d3e88 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 30 Oct 2018 14:29:11 -0400 Subject: [PATCH 07/10] lenient bool.... web view clean up --- MVMCore/MVMCore/Categories/NSDictionary+MFConvenience.h | 3 +++ MVMCore/MVMCore/Categories/NSDictionary+MFConvenience.m | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/MVMCore/MVMCore/Categories/NSDictionary+MFConvenience.h b/MVMCore/MVMCore/Categories/NSDictionary+MFConvenience.h index ed5931f..6ae8fc6 100644 --- a/MVMCore/MVMCore/Categories/NSDictionary+MFConvenience.h +++ b/MVMCore/MVMCore/Categories/NSDictionary+MFConvenience.h @@ -24,6 +24,9 @@ - (CGFloat)floatForKey:(nonnull id)key; - (double)doubleForKey:(nonnull id)key; +// Not strict, can accept either string or boolean. +- (BOOL)lenientBoolForKey:(nonnull id)key; + // Gets an object that is nested using a series of keys or indexes to reach it. // All keys should be of type NSString and is used for nested dictionaries. // All indexes should be of type NSNumber and is used for nested arrays. diff --git a/MVMCore/MVMCore/Categories/NSDictionary+MFConvenience.m b/MVMCore/MVMCore/Categories/NSDictionary+MFConvenience.m index 8de5180..f4e087d 100644 --- a/MVMCore/MVMCore/Categories/NSDictionary+MFConvenience.m +++ b/MVMCore/MVMCore/Categories/NSDictionary+MFConvenience.m @@ -32,6 +32,15 @@ return [[self objectForKey:key ofType:[NSNumber class]] boolValue]; } +- (BOOL)lenientBoolForKey:(nonnull id)key { + NSObject *object = [self objectForKey:key]; + if ([object isKindOfClass:[NSString class]]) { + return [((NSString *)object) isEqualToString:@"true"]; + } else { + return [((NSNumber *)([object isKindOfClass:[NSNumber class]] ? object : nil)) boolValue]; + } +} + - (CGFloat)floatForKey:(nonnull id)key { return [[self objectForKey:key ofType:[NSNumber class]] floatValue]; } From 8ea5b126e7e1a26eea4c812733871b44b847518a Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 31 Oct 2018 15:29:18 -0400 Subject: [PATCH 08/10] panel protocol available --- MVMCore/MVMCore/MainStructure/PanelProtocol.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MVMCore/MVMCore/MainStructure/PanelProtocol.h b/MVMCore/MVMCore/MainStructure/PanelProtocol.h index 5ab0ae3..2db89c7 100644 --- a/MVMCore/MVMCore/MainStructure/PanelProtocol.h +++ b/MVMCore/MVMCore/MainStructure/PanelProtocol.h @@ -14,6 +14,9 @@ @optional +// The panel can return if it should be available or not. +- (BOOL)panelAvailable; + - (void)panel:(UIViewController *_Nullable)panel viewWillAppear:(BOOL)animated; - (void)panel:(UIViewController *_Nullable)panel viewDidAppear:(BOOL)animated; - (void)panel:(UIViewController *_Nullable)panel viewWillDisappear:(BOOL)animated; From 44d10688ce147cd9526ff8a17dcce50343d5dc13 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 31 Oct 2018 15:49:58 -0400 Subject: [PATCH 09/10] clean load object change --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m index f48bdf5..30a2b19 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m @@ -22,8 +22,8 @@ return self; } -- (NSDictionary *) buttonMap { - return [self.pageJSON dictionaryForKey:@"ButtonMap"]; +- (NSDictionary *)buttonMap { + return [self.pageJSON dict:@"ButtonMap"]; } - (nullable instancetype)initWithRequestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegate:(nullable NSObject*)delegate { From 6bad0e1b344e9868e42560976688a10163ede817 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 31 Oct 2018 15:51:20 -0400 Subject: [PATCH 10/10] fix to use key --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m index 30a2b19..5c56b3a 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m @@ -23,7 +23,7 @@ } - (NSDictionary *)buttonMap { - return [self.pageJSON dict:@"ButtonMap"]; + return [self.pageJSON dict:KeyButtonMap]; } - (nullable instancetype)initWithRequestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegate:(nullable NSObject*)delegate {