diff --git a/JSONCreator_iOS/JSONCreator/DetailViewController.swift b/JSONCreator_iOS/JSONCreator/DetailViewController.swift index c448c0d..ed21a24 100644 --- a/JSONCreator_iOS/JSONCreator/DetailViewController.swift +++ b/JSONCreator_iOS/JSONCreator/DetailViewController.swift @@ -103,6 +103,17 @@ class DetailViewController: UIViewController { navigation.pushViewController(viewController, animated: false) MVMCoreNavigationHandler.shared()?.viewControllerToPresentOn = splitViewController MVMCoreNavigationHandler.shared()?.present(navigation, animated: true) + + // Notify of json change + let systemParameters = jsonObject.optionalDictionaryForKey(KeySystemParameters) + loadObject.responseJSON = jsonObject + loadObject.systemParametersJSON = systemParameters + loadObject.responseInfoMap = jsonObject.optionalDictionaryForKey(KeyResponseInfo) + var pages = jsonObject.dictionaryForKey(KeyPageMap) + if !pages.isEmpty { + MVMCoreLoadRequestOperation.cachePages(pages, loadObject: loadObject, error: &errorObject) + } + } else if let errorObject = errorObject { let error = NSError(domain: ErrorDomainNative, code: ErrorCode.initViewController.rawValue, userInfo: [NSLocalizedDescriptionKey: errorObject.messageToLog ?? errorObject.messageToDisplay!]) diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/Badge.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/Badge.json index e69de29..369a011 100644 --- a/JSONCreator_iOS/JSONCreator/JSON/Samples/Badge.json +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/Badge.json @@ -0,0 +1,21 @@ +{ + "ResponseInfo": { + "code": "00000", + "type": "Success" + }, + "Page": { + "pageType": "x", + "template": "threeLayer", + "header": {}, + "footer": {}, + "middle": { + "moleculeName": "container", + "molecule": { + "moleculeName": "badge", + "text": "hello my name is", + "numberOfLines": 4, + "surface": "light" + } + } + } +} diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/TabsSample.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/TabsSample.json index 92caec3..8bfc7dc 100644 --- a/JSONCreator_iOS/JSONCreator/JSON/Samples/TabsSample.json +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/TabsSample.json @@ -1,297 +1,355 @@ { - "ResponseInfo" : { - "code" : "00000", - "type" : "Success" - }, - "Page": { - "pageType":"x", - "template":"list", - "header": { - "moleculeName":"header", - "molecule": { - "moleculeName": "headlineBody", - "headline":{ - "moleculeName": "label", - "text":"Your lines are on Unlimited plans." - }, - "body":{ - "moleculeName": "label", - "text":"Need something different? Take a minute to explore other plan options." - } - } - + "ResponseInfo": { + "code": "00000", + "type": "Success" + }, + "Page": { + "pageType": "x", + "template": "list", + "header": { + "moleculeName": "header", + "molecule": { + "moleculeName": "headlineBody", + "headline": { + "moleculeName": "label", + "text": "Your lines are on Unlimited plans." }, - "footer":{ - "moleculeName":"footer", - "molecule": { - "moleculeName":"twoButtonView", - "primaryButton":{ - "moleculeName": "button", - "title":"Explore", - "action":{ - "actionType": "openPage", - "pageType": "explore" - } - }, - "secondaryButton":{ - "moleculeName": "button", - "title":"Recommend", - "action":{ - "actionType": "openPage", - "pageType": "recommend" - } - } + "body": { + "moleculeName": "label", + "text": "Need something different? Take a minute to explore other plan options." + } + } + }, + "footer": { + "moleculeName": "footer", + "molecule": { + "moleculeName": "twoButtonView", + "primaryButton": { + "moleculeName": "button", + "title": "Explore", + "action": { + "actionType": "openPage", + "pageType": "explore" + } + }, + "secondaryButton": { + "moleculeName": "button", + "title": "Recommend", + "action": { + "actionType": "openPage", + "pageType": "recommend" + } + } + } + }, + "molecules": [ + { + "moleculeName": "tabsListItem", + "tabs": { + "moleculeName": "tabs", + "tabs": [ + { + "label": { + "moleculeName": "label", + "text": "All" + } + }, + { + "label": { + "moleculeName": "label", + "text": "Work Devices" + } + }, + { + "label": { + "moleculeName": "label", + "text": "3" + } + }, + { + "label": { + "moleculeName": "label", + "text": "4" + } + }, + { + "label": { + "moleculeName": "label", + "text": "5" + } + }, + { + "label": { + "moleculeName": "label", + "text": "6 Devices" + } + }, + { + "label": { + "moleculeName": "label", + "text": "7 Devices" + } + }, + { + "label": { + "moleculeName": "label", + "text": "8 Devices" + } + }, + { + "label": { + "moleculeName": "label", + "text": "9 Devices" + } + }, + { + "label": { + "moleculeName": "label", + "text": "10 Devices" + } } - + ] }, "molecules": [ + [ { - "moleculeName": "tabsListItem", - "tabs": { - "moleculeName": "tabs", - "tabs": [{ - "label":{ - "moleculeName": "label", - "text": "All" - } - } ,{ - "label":{ - "moleculeName": "label", - "text": "Work Devices" - }},{ - "label":{ - "moleculeName": "label", - "text": "3" - }},{ - "label":{ - "moleculeName": "label", - "text": "4" - }},{ - "label":{ - "moleculeName": "label", - "text": "5" - }},{ - "label":{ - "moleculeName": "label", - "text": "6 Devices" - }},{ - "label":{ - "moleculeName": "label", - "text": "7 Devices" - }},{ - "label":{ - "moleculeName": "label", - "text": "8 Devices" - }},{ - "label":{ - "moleculeName": "label", - "text": "9 Devices" - }},{ - "label":{ - "moleculeName": "label", - "text": "10 Devices" - } - }] + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "1 0" + } }, - "molecules": [ - [{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"1 0" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label" - ,"text":"1 1" - - } - }],[{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 1" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 2" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 3" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 4" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 5" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 6" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 7" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 8" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 9" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 10" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 11" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"2 12" - } - }],[{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"3 1" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label" - ,"text":"3 2" - - } - }],[{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"4 1" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label" - ,"text":"4 2" - - } - }],[{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"5 1" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label" - ,"text":"5 2" - - } - }],[{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"6 1" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label" - ,"text":"6 2" - - } - }],[{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"7 1" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label" - ,"text":"7 2" - - } - }],[{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"8 1" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label" - ,"text":"8 2" - - } - }],[{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"9 1" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label" - ,"text":"9 2" - - } - }], - [{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"10 1" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label" - ,"text":"10 2" - - } - }] - ] - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName":"label", - "text":"after" + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "1 1" + } } - }] - } + ], + [ + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 1" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 2" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 3" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 4" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 5" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 6" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 7" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 8" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 9" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 10" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 11" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "2 12" + } + } + ], + [ + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "3 1" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "3 2" + } + } + ], + [ + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "4 1" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "4 2" + } + } + ], + [ + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "5 1" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "5 2" + } + } + ], + [ + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "6 1" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "6 2" + } + } + ], + [ + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "7 1" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "7 2" + } + } + ], + [ + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "8 1" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "8 2" + } + } + ], + [ + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "9 1" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "9 2" + } + } + ], + [ + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "10 1" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "10 2" + } + } + ] + ] + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "This is a List Item label outside of tabs" + } + } + ] + } } diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/TileleListSample.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/TileleListSample.json index 4e56264..bb8b67a 100644 --- a/JSONCreator_iOS/JSONCreator/JSON/Samples/TileleListSample.json +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/TileleListSample.json @@ -5,6 +5,74 @@ "screenHeading": "Select an international plan", "template": "list", "molecules": [ + { + "moleculeName": "listItem", + "molecule": { + "directionalIcon": { + "size": "medium" + }, + "moleculeName": "tilelet", + "subTitle": { + "text": "You are enrolled in Auto Pay & paper-free billing." + }, + "title": { + "text": "You’re getting $50 off on your monthly bill." + }, + "action": { + "actionType": "openPage", + "pageType": "tileletPush", + "presentationStyle": "push", + "title": "Test" + } + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "twoButtonView", + "primaryButton": { + "moleculeName": "button", + "title": "Edit", + "groupName": "default", + "action": { + "actionType": "openPage", + "pageType": "updateProfile", + "extraParameters": { + "from": "none" + }, + "presentationStyle": "push" + } + } + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafaf" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafaf\n\nadsfa\nadfs" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafaf\n\nadsfa\nadfs" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafafttttt" + } + }, { "moleculeName": "listItem", "molecule": { @@ -41,70 +109,103 @@ "title": "Auto Pay discount" } } - }, - { - "moleculeName":"listItem", - "molecule": { - "moleculeName": "twoButtonView", - "primaryButton": { - "moleculeName": "button", - "title": "Edit", - "groupName": "default", - "action": { - "actionType": "openPage", - "pageType": "updateProfile", - "extraParameters": { - "from": "none" - }, - "presentationStyle": "push" - } - } - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName": "label", - "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafaf" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName": "label", - "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafaf" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName": "label", - "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafaf\ndafsdssfafs" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName": "label", - "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafaf\n\nadsfa\nadfs" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName": "label", - "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafafttttt" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName": "label", - "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafaf\n\nadsfa\nadfs" - } - },{ - "moleculeName":"listItem", - "molecule": { - "moleculeName": "label", - "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafafttttt" - } } ], - "middle": { + "middle": {} + }, + "PageMap": { + "tileletPush": { + "pageType": "tileletPush", + "screenHeading": "Select an international plan", + "template": "list", + "molecules": [ + { + "moleculeName": "listItem", + "molecule": { + "directionalIcon": { + "size": "medium" + }, + "moleculeName": "tilelet", + "subTitle": { + "text": "You are enrolled in Auto Pay & paper-free billing." + }, + "title": { + "text": "This was a push test --- awesome." + } + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "twoButtonView", + "primaryButton": { + "moleculeName": "button", + "title": "Edit", + "groupName": "default", + "action": { + "actionType": "openPage", + "pageType": "updateProfile", + "extraParameters": { + "from": "none" + }, + "presentationStyle": "push" + } + } + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafaf" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "moleculeName": "label", + "text": "afa\ndasfdsa\nadfadfda\nasadfsafa\nafsafsa\nafsadfas\nadffafaf" + } + }, + { + "moleculeName": "listItem", + "molecule": { + "directionalIcon": { + "size": "medium" + }, + "moleculeName": "tilelet", + "subTitle": { + "text": "You are enrolled in Auto Pay & paper-free billing." + }, + "title": { + "text": "You’re getting $50 off on your monthly bill." + }, + "action": { + "actionType": "openPage", + "analyticsData": { + "vzdl.page.displayChannel": "mva", + "vzwi.mvmapp.pageTypeLink": "settingsLanding|Auto Pay discount", + "vzdl.page.id": "settingslanding", + "vzdl.page.linkName": "Auto Pay discount", + "vzdl.page.sourceChannel": "mva", + "vzdl.page.name": "settings landing" + }, + "pageType": "managePmts", + "presentationStyle": "push", + "requestURL": "https://mobile-exp-qa2.vzw.com/mobile/nsa/nos/gw/launchapp/l2/webview", + "extraParameters": { + "pageTitle": "Auto Pay discount", + "screenHeading": "Auto Pay discount", + "browserUrl": "https://vzwqa2.verizonwireless.com/digital/nsa/secure/ui/payment/settings#/enrollAandP", + "locale": "EN", + "flowName": "accountsettings" + }, + "title": "Auto Pay discount" + } + } + } + ], + "middle": {} } } } diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/TileletSample.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/TileletSample.json index e9b5dda..cb9c325 100644 --- a/JSONCreator_iOS/JSONCreator/JSON/Samples/TileletSample.json +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/TileletSample.json @@ -56,7 +56,24 @@ "title": "Auto Pay discount" } } + }, + { + "moleculeName": "stackItem", + "molecule": + { + "directionalIcon": { + "size": "medium" + }, + "moleculeName": "tilelet", + "subTitle": { + "text": "Details" + }, + "title": { + "text": "You’re getting $50 off on your monthly bill." + } + } } + ] }, "footer": {} diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/ToggleSample.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/ToggleSample.json index e9a76a0..994b328 100644 --- a/JSONCreator_iOS/JSONCreator/JSON/Samples/ToggleSample.json +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/ToggleSample.json @@ -25,6 +25,13 @@ "moleculeName": "toggle", "fieldKey": "isActive" } + }, + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "badge", + "text": "This is the badge" + } } ] }, @@ -58,3 +65,6 @@ } } + + +