From 8415c0f3f5fd0fb9ec6ea040b6dac9e24e1ee478 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 25 Mar 2020 14:47:15 -0400 Subject: [PATCH 01/12] more accessibility stuff. --- .../Utility/HardCodedServerResponse/MFHardCodedServerResponse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h b/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h index eb9fba9..efa33b6 100644 --- a/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h +++ b/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h @@ -9,7 +9,7 @@ #import #import "MVMCoreRequestParameters.h" -#define ENABLE_HARD_CODED_RESPONSE 0 && DEBUG +#define ENABLE_HARD_CODED_RESPONSE 1 && DEBUG #if ENABLE_HARD_CODED_RESPONSE From 992a06ee8d004da4ca42c0948ea6329e8962a474 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 1 Jul 2020 21:08:28 -0400 Subject: [PATCH 02/12] return --- .../Utility/HardCodedServerResponse/MFHardCodedServerResponse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h b/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h index efa33b6..eb9fba9 100644 --- a/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h +++ b/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h @@ -9,7 +9,7 @@ #import #import "MVMCoreRequestParameters.h" -#define ENABLE_HARD_CODED_RESPONSE 1 && DEBUG +#define ENABLE_HARD_CODED_RESPONSE 0 && DEBUG #if ENABLE_HARD_CODED_RESPONSE From dc16cfecd4ee4d0f9415ef2a92e22318462965f6 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 19 Nov 2020 09:17:01 -0500 Subject: [PATCH 03/12] excluding architecture arm64 --- MVMCore/MVMCore.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MVMCore/MVMCore.xcodeproj/project.pbxproj b/MVMCore/MVMCore.xcodeproj/project.pbxproj index fc17f77..5d06f8b 100644 --- a/MVMCore/MVMCore.xcodeproj/project.pbxproj +++ b/MVMCore/MVMCore.xcodeproj/project.pbxproj @@ -906,6 +906,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -967,6 +968,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; From 57f5bd94aa28c255edd60dedf3a9bd54d0aeb8ff Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 2 Dec 2020 11:40:36 -0500 Subject: [PATCH 04/12] updates made. --- .../MVMCore/Models/ActionType/ActionModelProtocol.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift b/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift index a5d3229..028af05 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift @@ -12,12 +12,18 @@ public protocol ActionModelProtocol: ModelProtocol { var actionType: String { get } var extraParameters: JSONValueDictionary? { get set } var analyticsData: JSONValueDictionary? { get set } + var accessibilityIdentifier: String? { get set } } public extension ActionModelProtocol { var actionType: String { - get { return Self.identifier } + get { Self.identifier } + } + + var accessibilityIdentifier: String? { + get { nil } + set { } } static var categoryCodingKey: String { From 2eb5cc9254664d105551d63c69db7bbc0ac65596 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 3 Dec 2020 14:22:05 -0500 Subject: [PATCH 05/12] formatting updates. Adding identifier for easier testing. --- .../Utility/HardCodedServerResponse/MFHardCodedServerResponse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h b/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h index eb9fba9..efa33b6 100644 --- a/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h +++ b/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h @@ -9,7 +9,7 @@ #import #import "MVMCoreRequestParameters.h" -#define ENABLE_HARD_CODED_RESPONSE 0 && DEBUG +#define ENABLE_HARD_CODED_RESPONSE 1 && DEBUG #if ENABLE_HARD_CODED_RESPONSE From 85401e583d2294a67a4762e2701786c4d4089e54 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Tue, 15 Dec 2020 14:56:18 -0500 Subject: [PATCH 06/12] added script to improve test page access and separate from release compilation. Formatting updates. --- .../MFHardCodedServerResponse.m | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.m b/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.m index e32ec74..ed2feee 100644 --- a/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.m +++ b/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.m @@ -69,16 +69,16 @@ - (NSDictionary *) getHardCodedResponseForRequest:(MVMCoreRequestParameters *)request { NSDictionary *cannedResponse = nil; - if(_jsonDictionary) { + if (_jsonDictionary) { BOOL matchesQuery = NO; - for(NSString *urlKey in _sortedKeys) { + for (NSString *urlKey in _sortedKeys) { NSURLComponents *urlComponents = [[NSURLComponents alloc] initWithString:urlKey]; - if([urlComponents.path isEqualToString:request.pageType]) { + if ([urlComponents.path isEqualToString:request.pageType]) { matchesQuery = YES; - if(urlComponents.query) { - for(NSURLQueryItem *item in urlComponents.queryItems) { + if (urlComponents.query) { + for (NSURLQueryItem *item in urlComponents.queryItems) { NSString *requestVal = [request.parameters stringForKey:item.name]; - if(!requestVal || ![requestVal isEqualToString:item.value]) { + if (!requestVal || ![requestVal isEqualToString:item.value]) { matchesQuery = NO; break; } @@ -88,7 +88,7 @@ cannedResponse = _jsonDictionary[urlKey]; // keep searching to see if there is a more exact match on parameters } - if(matchesQuery) { + if (matchesQuery) { cannedResponse = _jsonDictionary[urlKey]; // found a request parameters match, accept as the best result and break out break; @@ -101,7 +101,6 @@ cannedResponse = [self getHardCodedResponseForPageType:request.pageType]; } - return cannedResponse; } From 02cbfb702c81882fca1f2a579317207823803ecd Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 22 Jan 2021 10:03:28 -0500 Subject: [PATCH 07/12] reset --- .../Utility/HardCodedServerResponse/MFHardCodedServerResponse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h b/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h index efa33b6..eb9fba9 100644 --- a/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h +++ b/MVMCore/MVMCore/Utility/HardCodedServerResponse/MFHardCodedServerResponse.h @@ -9,7 +9,7 @@ #import #import "MVMCoreRequestParameters.h" -#define ENABLE_HARD_CODED_RESPONSE 1 && DEBUG +#define ENABLE_HARD_CODED_RESPONSE 0 && DEBUG #if ENABLE_HARD_CODED_RESPONSE From d7da39ce25ac53ee08a19b07346fa0b5429d7a37 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 28 Jan 2021 11:46:27 -0500 Subject: [PATCH 08/12] Adds url and base url for open page. --- .../MVMCore/LoadHandling/MVMCoreLoadHandler.m | 48 +++++++++---------- .../LoadHandling/MVMCoreRequestParameters.h | 11 +++-- .../LoadHandling/MVMCoreRequestParameters.m | 9 ++++ .../ActionType/ActionOpenPageModel.swift | 3 ++ 4 files changed, 42 insertions(+), 29 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index db3673f..27043bf 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -110,34 +110,32 @@ - (nullable NSURLRequest *)requestWithParameters:(nonnull MVMCoreRequestParameters *)requestParameters error:(MVMCoreErrorObject *_Nonnull *_Nonnull)error { - NSURL *url = nil; - - if (requestParameters.alternateBaseURL) { - url = requestParameters.alternateBaseURL; - } else { - url = [MVMCoreSessionObject sharedGlobal].baseURL; - } - + NSURL *url = requestParameters.URL; if (!url) { - url = [NSURL URLWithString:URLProdPostpayBase]; + if (requestParameters.alternateBaseURL) { + url = requestParameters.alternateBaseURL; + } else { + url = [MVMCoreSessionObject sharedGlobal].baseURL ?: [NSURL URLWithString:URLProdPostpayBase]; + } + + // Appends the context root. + if (requestParameters.contextRoot) { + url = [url URLByAppendingPathComponent:requestParameters.contextRoot]; + } else if ([MVMCoreSessionObject sharedGlobal].contextRoot) { + url = [url URLByAppendingPathComponent:[MVMCoreSessionObject sharedGlobal].contextRoot]; + } + + // Appends the page type + if (requestParameters.pageType) { + url = [url URLByAppendingPathComponent:requestParameters.pageType]; + } + + // This has changed since the initial agreement. Seems server always needs page type now. + /* else if (requestParameters.modules) { + url = [url URLByAppendingPathComponent:KeyModuleMap]; + }*/ } - // Appends the context root. - if (requestParameters.contextRoot) { - url = [url URLByAppendingPathComponent:requestParameters.contextRoot]; - } else if ([MVMCoreSessionObject sharedGlobal].contextRoot) { - url = [url URLByAppendingPathComponent:[MVMCoreSessionObject sharedGlobal].contextRoot]; - } - - // Appends the page type - if (requestParameters.pageType) { - url = [url URLByAppendingPathComponent:requestParameters.pageType]; - } - // This has changed since the initial agreement. Seems server always needs page type now. - /* else if (requestParameters.modules) { - url = [url URLByAppendingPathComponent:KeyModuleMap]; - }*/ - // Adds modules needed to the request parameters. if (requestParameters.modules.count > 0) { [requestParameters addRequestParameters:@{KeyModuleList:requestParameters.modules}]; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h index 15163a0..07768d8 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h @@ -36,9 +36,15 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { // adding parent pageType for freebee @property (nullable, strong, nonatomic) NSString *parentPageType; -// Context root for server +/// App context to use when building the url. For ex: https://baseURL/appContext/pageType @property (nullable, strong, nonatomic) NSString *contextRoot; +/// Host to use when building the url. For ex: https://baseURL/appContext/pageType +@property (nullable, strong, nonatomic) NSURL *alternateBaseURL; + +/// Entire URL to use instead of building the url +@property (nullable, strong, nonatomic) NSURL *URL; + // A flag for if you do not want to try loading any actual view controller. (Unless there is an error screen) @property (assign, nonatomic) BOOL noViewControllerToLoad; @@ -82,9 +88,6 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { // If the request was created with an action map. @property (nullable, strong, nonatomic) NSDictionary *actionMap; -// only used when the base url is not the same as mf -@property (nullable, strong, nonatomic) NSURL *alternateBaseURL; - @property (nullable, strong, nonatomic) NSNumber *customTimeoutTime; // Will open support panel at the end of the load. diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m index f2e689f..5279dcc 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m @@ -66,6 +66,14 @@ if (self = [self initWithPageType:[actionMap stringForKey:KeyPageType] additionalModules:[actionMap array:KeyModuleList] extraParameters:[actionMap dict:KeyExtraParameters]]) { self.contextRoot = [actionMap string:KeyContextRoot]; + NSString *alternateBase = [actionMap string:@"baseURL"]; + if (alternateBase) { + self.alternateBaseURL = [NSURL URLWithString:[alternateBase stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLHostAllowedCharacterSet]]; + } + NSString *url = [actionMap string:@"URL"]; + if (url) { + self.URL = [NSURL URLWithString:[url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; + } self.actionMap = actionMap; self.customTimeoutTime = [actionMap optionalNumberForKey:@"customTimeoutTime"]; self.openSupportPanel = [actionMap boolForKey:KeyOpenSupport]; @@ -136,6 +144,7 @@ copyObject.imageData = self.imageData; copyObject.customTimeoutTime = self.customTimeoutTime; copyObject.backgroundRequest = self.backgroundRequest; + copyObject.URL = self.URL; return copyObject; } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift index a20d343..69adbdc 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift @@ -15,6 +15,9 @@ public static var identifier: String = "openPage" public var actionType: String = ActionOpenPageModel.identifier public var pageType: String + public var baseURL: String? + public var appContext: String? + public var URL: String? public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? public var presentationStyle: String? From 252d96e20cf0a30aef6a6987cb880a89a0c2bfb9 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 28 Jan 2021 11:59:09 -0500 Subject: [PATCH 09/12] comment update --- MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h index 07768d8..df2aa69 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h @@ -36,10 +36,10 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { // adding parent pageType for freebee @property (nullable, strong, nonatomic) NSString *parentPageType; -/// App context to use when building the url. For ex: https://baseURL/appContext/pageType +/// App context to use when building the url. For ex: baseURL/appContext/pageType @property (nullable, strong, nonatomic) NSString *contextRoot; -/// Host to use when building the url. For ex: https://baseURL/appContext/pageType +/// Base URL to use when building the url. For ex: baseURL/appContext/pageType @property (nullable, strong, nonatomic) NSURL *alternateBaseURL; /// Entire URL to use instead of building the url From 5cdb0414bbb20ed1d4a6c04c029f7c7e790c0b21 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 29 Jan 2021 10:18:20 -0500 Subject: [PATCH 10/12] optional modules --- .../MVMCoreLoadRequestOperation.m | 52 +++++++++++-------- .../LoadHandling/MVMCoreRequestParameters.h | 4 ++ .../LoadHandling/MVMCoreRequestParameters.m | 6 +++ 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 966700a..29f35b3 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -191,29 +191,32 @@ // Never use the cache. completionHandler(nil,nil); - } else if (requestParameters.pageType.length != 0 && requestParameters.modules.count > 0) { + } else { + NSArray *modules = [requestParameters allModules]; + if (requestParameters.pageType.length != 0 && modules.count > 0) { - // Check cache function for page json is already in the cache. - [[MVMCoreCache sharedCache] fetchJSONForPageType:requestParameters.pageType completionHandler:^(NSDictionary * _Nullable jsonDictionary) { + // Check cache function for page json is already in the cache. + [[MVMCoreCache sharedCache] fetchJSONForPageType:requestParameters.pageType completionHandler:^(NSDictionary * _Nullable jsonDictionary) { - // Check cache function for modules already in the cache. - NSDictionary *pageDictionary = jsonDictionary; - [[MVMCoreCache sharedCache] fetchJSONForModules:requestParameters.modules completionHandler:^(NSDictionary * _Nullable jsonDictionary) { - completionHandler(pageDictionary,jsonDictionary); + // Check cache function for modules already in the cache. + NSDictionary *pageDictionary = jsonDictionary; + [[MVMCoreCache sharedCache] fetchJSONForModules:modules completionHandler:^(NSDictionary * _Nullable jsonDictionary) { + completionHandler(pageDictionary,jsonDictionary); + }]; }]; - }]; - } else if (requestParameters.pageType.length != 0) { + } else if (requestParameters.pageType.length != 0) { - // Check cache function if page json is already in the cache. - [[MVMCoreCache sharedCache] fetchJSONForPageType:requestParameters.pageType completionHandler:^(NSDictionary * _Nullable jsonDictionary) { - completionHandler(jsonDictionary,nil); - }]; - } else if (requestParameters.modules.count > 0) { - - // Check cache function if modules already in the cache. - [[MVMCoreCache sharedCache] fetchJSONForModules:requestParameters.modules completionHandler:^(NSDictionary * _Nullable jsonDictionary) { - completionHandler(nil,jsonDictionary); - }]; + // Check cache function if page json is already in the cache. + [[MVMCoreCache sharedCache] fetchJSONForPageType:requestParameters.pageType completionHandler:^(NSDictionary * _Nullable jsonDictionary) { + completionHandler(jsonDictionary,nil); + }]; + } else if (modules > 0) { + + // Check cache function if modules already in the cache. + [[MVMCoreCache sharedCache] fetchJSONForModules:modules completionHandler:^(NSDictionary * _Nullable jsonDictionary) { + completionHandler(nil,jsonDictionary); + }]; + } } } @@ -239,16 +242,21 @@ // Check if the page was found in the cache. BOOL pageNotInCache = loadObject.operation.requestParameters.pageType && !loadObject.pageDataFromCache; - // Check all modules were found in the cache + // Check all required modules were found in the cache NSMutableArray *modulesNotInCache = [NSMutableArray array]; - for (NSString *module in loadObject.operation.requestParameters.modules) { + NSMutableArray *requiredModules = [NSMutableArray arrayWithArray:loadObject.operation.requestParameters.modules]; + for (NSString *module in [loadObject.operation.requestParameters allModules]) { if (![loadObject.modulesJSON objectForKey:module]) { + // Missing a module. [modulesNotInCache addObject:module]; + } else { + // Received a required module. + [requiredModules removeObject:module]; } } MVMCoreRequestParameters *requestParametersForServer = nil; - if (pageNotInCache || modulesNotInCache.count > 0) { + if (pageNotInCache || requiredModules.count > 0) { // We are missing data, will need to go to server. requestParametersForServer = [loadObject.operation.requestParameters copy]; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h index df2aa69..7dbe729 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h @@ -29,6 +29,7 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { // request parameters @property (nullable, strong, nonatomic) NSString *pageType; +@property (nullable, strong, nonatomic) NSArray *optionalModules; @property (nullable, strong, nonatomic) NSArray *modules; @property (nullable, strong, nonatomic) NSDictionary *parameters; @property (nullable, strong, nonatomic) NSData *imageData; @@ -120,4 +121,7 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { // Sets the load style based on the server sent presentationStyle - (void)setMFLoadStyleBasedOnPresentationStyle:(nonnull NSString *)presentationStyle; +/// Returns optional and required modules +- (nullable NSArray *)allModules; + @end diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m index 5279dcc..b8e5877 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m @@ -116,6 +116,12 @@ } } +- (nullable NSArray *)allModules { + NSMutableSet *set = [NSMutableSet setWithArray:self.optionalModules]; + [set addObjectsFromArray:self.modules]; + return [set allObjects]; +} + - (id)copyWithZone:(nullable NSZone *)zone { MVMCoreRequestParameters *copyObject = [[MVMCoreRequestParameters alloc] init]; From 6f0735ed0265106d1cb01a875c8d3c3d3d8e0f21 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 29 Jan 2021 11:11:15 -0500 Subject: [PATCH 11/12] Warning fix --- MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m | 2 +- MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m index f4c389d..ddb1fab 100644 --- a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m +++ b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m @@ -395,7 +395,7 @@ NSString * const KeyActionTypeOpen = @"openPage"; } else { [MVMCoreDispatchUtility performBlockInBackground:^{ // Cannot linkaway, show error. - MVMCoreErrorObject *error = error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess] code:ErrorCodeLinkawayFailed domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@_%@",NSStringFromClass([delegateObject.actionDelegate class]),KeyActionTypeLinkAway]]; + MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess] code:ErrorCodeLinkawayFailed domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@_%@",NSStringFromClass([delegateObject.actionDelegate class]),KeyActionTypeLinkAway]]; [self handleActionError:error actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject]; }]; } diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m index 5279dcc..d90af0a 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m @@ -68,11 +68,11 @@ self.contextRoot = [actionMap string:KeyContextRoot]; NSString *alternateBase = [actionMap string:@"baseURL"]; if (alternateBase) { - self.alternateBaseURL = [NSURL URLWithString:[alternateBase stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLHostAllowedCharacterSet]]; + self.alternateBaseURL = [NSURL URLWithString:alternateBase]; } NSString *url = [actionMap string:@"URL"]; if (url) { - self.URL = [NSURL URLWithString:[url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; + self.URL = [NSURL URLWithString:url]; } self.actionMap = actionMap; self.customTimeoutTime = [actionMap optionalNumberForKey:@"customTimeoutTime"]; From 9a1dd39dffbac9a6ee3f7a214fe4a39a71a397fe Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 4 Feb 2021 17:09:53 -0500 Subject: [PATCH 12/12] optional modules --- MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h | 6 +++--- MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h index 7dbe729..2e52a05 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h @@ -29,8 +29,8 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { // request parameters @property (nullable, strong, nonatomic) NSString *pageType; -@property (nullable, strong, nonatomic) NSArray *optionalModules; -@property (nullable, strong, nonatomic) NSArray *modules; +@property (nullable, strong, nonatomic) NSArray *optionalModules; +@property (nullable, strong, nonatomic) NSArray *modules; @property (nullable, strong, nonatomic) NSDictionary *parameters; @property (nullable, strong, nonatomic) NSData *imageData; @@ -122,6 +122,6 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { - (void)setMFLoadStyleBasedOnPresentationStyle:(nonnull NSString *)presentationStyle; /// Returns optional and required modules -- (nullable NSArray *)allModules; +- (nullable NSArray *)allModules; @end diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m index 3ba9319..c4327e1 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m @@ -33,7 +33,8 @@ - (nullable instancetype)initWithPageType:(nonnull NSString *)pageType extraParameters:(nullable NSDictionary *)extraParameters { if (self = [self initWithExtraParameters:extraParameters]) { self.pageType = pageType; - self.modules = [[MVMCoreViewControllerMappingObject sharedViewControllerMappingObject] allModulesForPageType:pageType]; + self.optionalModules = [[MVMCoreViewControllerMappingObject sharedViewControllerMappingObject] modulesOptionalForPageType:pageType]; + self.modules = [[MVMCoreViewControllerMappingObject sharedViewControllerMappingObject] modulesRequiredForPageType:pageType]; } return self; } @@ -127,7 +128,7 @@ MVMCoreRequestParameters *copyObject = [[MVMCoreRequestParameters alloc] init]; copyObject.pageType = [self.pageType copy]; copyObject.parentPageType = self.parentPageType; - + copyObject.optionalModules = [self.optionalModules copy]; copyObject.modules = [self.modules copy]; copyObject.parameters = [self.parameters copy]; copyObject.contextRoot = [self.contextRoot copy];