diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/FormContactInfo.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/FormContactInfo.json new file mode 100644 index 0000000..56ee6c2 --- /dev/null +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/FormContactInfo.json @@ -0,0 +1,142 @@ +{ + "Page": { + "template": "stack", + "pageType": "moleculeStack", + "screenHeading": "Manage Profile", + "hideFabOverlay": true, + "suppressPostLaunchRequests": false, + "tabBarHidden": true, + "header": { + "moleculeName": "header", + "molecule": { + "moleculeName": "headlineBody", + "headline": { + "moleculeName": "label", + "text": "Zenkey" + } + } + }, + "stack": { + "moleculeName": "stack", + "molecules": [ + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "textField", + "fieldKey": "firstName", + "type": "text", + "errorMessage": "Please enter a valid first name.", + "placeholder": "John A", + "titleLabel": { + "moleculeName": "label", + "text": "First Name" + } + } + }, + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "textField", + "fieldKey": "lastName", + "type": "text", + "placeholder": "Smith", + "errorMessage": "Please enter a valid last name.", + "titleLabel": { + "moleculeName": "label", + "text": "Last Name" + } + } + }, + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "textField", + "fieldKey": "phoneNumber", + "type": "phone", + "placeholder": "212-555-1234", + "title": "Contact Phone Number", + "errorMessage": "Please enter a valid phone number." + } + }, + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "textField", + "fieldKey": "emailID", + "type": "text", + "placeholder": "JSMith123@gmail.com", + "title": "Email", + "errorMessage": "Please enter a valid greeting name." + } + }, + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "textField", + "fieldKey": "zipcode", + "type": "number", + "placeholder": "90210", + "title": "Zip Code", + "errorMessage": "Please enter a valid zip code." + } + } + ] + }, + "footer": { + "moleculeName": "footer", + "molecule": { + "moleculeName": "twoButtonView", + "primaryButton": { + "moleculeName": "button", + "title": "Edit", + "groupName": "default", + "action": { + "actionType": "openPage", + "pageType": "updateProfile", + "extraParameters": { + "from": "none" + }, + "presentationStyle": "push" + } + } + } + }, + "formRules": [ + { + "groupName": "default", + "rules": [ + { + "type": "regex", + "fields": [ + "emailID" + ], + "regex": "^[a-zA-Z0-9](\\.?\\_?\\-?[a-zA-Z0-9]){0,}@[a-zA-Z0-9-_]+\\.([a-zA-Z0-9-_]{1,}\\.){0,}[a-zA-Z]{2,}$" + }, + { + "type": "regex", + "fields": [ + "zipcode" + ], + "regex": "^\\d{5}(?:[-\\s]\\d{4})?$" + }, + { + "regex": "^(\\d{3})[\\s.-]{0,1}(\\d{3})[\\s.-]{0,1}(\\d{4})$", + "type": "regex", + "fields": [ + "phoneNumber" + ] + }, + { + "type": "allRequired", + "ruleId": "requiredRule", + "fields": [ + "emailID", + "firstName", + "lastName" + ] + } + ] + } + ] + } +} diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/FormEnabledChain.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/FormEnabledChain.json index 53dc38e..5e3f8f8 100644 --- a/JSONCreator_iOS/JSONCreator/JSON/Samples/FormEnabledChain.json +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/FormEnabledChain.json @@ -128,13 +128,6 @@ { "groupName": "default", "rules": [ - { - "regex": "^[a-zA-Z0-9](\\.?\\_?\\-?[a-zA-Z0-9]){0,}@[a-zA-Z0-9-_]+\\.([a-zA-Z0-9-_]{1,}\\.){0,}[a-zA-Z]{2,}$", - "type": "regex", - "fields": [ - "emailID" - ] - }, { "regex": "^[a-zA-Z]{1,25}$", "ruleId": "lettersOnly", @@ -155,10 +148,6 @@ { "type": "enableFormFieldEffect", "fieldKey": "preferredLastName", - "ruleIds": [ - "requiredRule", - "lettersOnly" - ], "rules": [ { "type": "anyRequired", @@ -171,9 +160,6 @@ { "type": "enableFormFieldEffect", "fieldKey": "emailID", - "ruleIds": [ - "requiredRule" - ], "rules": [ { "type": "anyRequired", @@ -182,6 +168,18 @@ ] } ] + }, + { + "type": "enableFormFieldEffect", + "fieldKey": "box", + "rules": [ + { + "type": "anyRequired", + "fields": [ + "emailID" + ] + } + ] } ] } diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/FormPronouns-1.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/FormPronouns-1.json new file mode 100644 index 0000000..803efa0 --- /dev/null +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/FormPronouns-1.json @@ -0,0 +1,267 @@ +{ + "Page": { + "template": "stack", + "pageType": "moleculeStack", + "screenHeading": "Manage Profile", + "hideFabOverlay": true, + "suppressPostLaunchRequests": false, + "tabBarHidden": true, + "analyticsData": { + "vzdl.events.flowinitiated": "1", + "vzdl.page.sourceChannel": "MVA", + "vzdl.target.engagement.intent": " ", + "vzdl.page.channel": " ", + "vzdl.page.displayChannel": "MVA", + "vzdl.page.id": "moleculeStack", + "vzdl.page.siteSection": " ", + "contentSquarePageName": "Manage Profile", + "vzdl.page.name": "moleculeStack" + }, + "chaticon": { + "moleculeName": "chatIcon", + "hideFabOverlay": true + }, + "pageStatNames": [ + "/mf/get/email/verify/indicator", + "/vision/customer/profile", + "/mf/cntrlr/mngpfl" + ], + "navigationBar": { + "moleculeName": "navigationBar", + "title": "Manage Profile" + }, + "header": { + "moleculeName": "headerH2Link", + "headlineBody": { + "moleculeName": "headlineBody", + "headline": { + "moleculeName": "label", + "text": "Tell us about yourself." + }, + "body": { + "moleculeName": "label", + "text": "We'll use your preferred name and pronouns online, in print, on the phone and in person to refer to you and your account." + } + }, + "link": { + "moleculeName": "caretLink", + "title": "Why are we asking?", + "action": { + "actionType": "openPage", + "pageType": "learnMorePronouns" + } + } + }, + "stack": { + "moleculeName": "stack", + "molecules": [ + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "textField", + "fieldKey": "preferredFirstName", + "type": "text", + "errorMessage": "Please enter a valid first name.", + "titleLabel": { + "moleculeName": "label", + "text": "Preferred First Name Optional", + "attributes": [ + { + "type": "color", + "location": 21, + "length": 8, + "textColor": "#747676" + } + ] + }, + "feedbackLabel": { + "moleculeName": "label", + "text": "This will replace greeting name if you have one.", + "textColor": "#747676" + } + } + }, + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "textField", + "fieldKey": "preferredLastName", + "type": "text", + "text": "", + "errorMessage": "Please enter a valid last name.", + "titleLabel": { + "moleculeName": "label", + "text": "Preferred Last Name Optional", + "attributes": [ + { + "type": "color", + "location": 20, + "length": 8, + "textColor": "#747676" + } + ] + } + } + }, + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "dropDown", + "fieldKey": "pronoun", + "accessibilityIdentifier": "pronounDropdown", + "options": [ + "", + "He, Him, His", + "She, Her, Hers", + "They, Them, Theirs", + "None of these" + ], + "titleLabel": { + "moleculeName": "label", + "text": "Pronouns Optional", + "attributes": [ + { + "type": "color", + "location": 9, + "length": 8, + "textColor": "#747676" + } + ] + } + , + "errorMessage": "Please select a pronoun" + } + }, + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "textField", + "fieldKey": "greetingName", + "type": "text", + "text": "", + "title": "Greeting name", + "errorMessage": "Please enter a valid greeting name." + } + }, + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "emailVerifyField", + "email": "", + "emailField": { + "text": "", + "fieldKey": "emailID", + "moleculeName": "textField", + "type": "email", + "title": "Email", + "errorMessage": "Please enter a valid email address." + }, + "bottomMolecule": { + "moleculeName": "label", + "attributes": [ + { + "length": 6, + "type": "action", + "location": 0, + "action": { + "analyticsData": { + "vzdl.page.linkName": "Verify", + "vzdl.page.pageLinkName": "/mf/Manage Profile|Email Verify" + }, + "actionType": "openPage", + "pageType": "verifyEmail" + } + } + ], + "text": "Verify" + } + } + }, + { + "moleculeName": "stackItem", + "molecule": { + "moleculeName": "textField", + "fieldKey": "alternateNo", + "type": "phone", + "text": "", + "title": "Alternate contact number", + "feedback" : "This is your easiest way to contact you.", + "errorMessage": "Please enter a valid phone number." + } + } + ] + }, + "footer": { + "moleculeName": "footer", + "molecule": { + "moleculeName": "twoButtonView", + "primaryButton": { + "moleculeName": "button", + "title": "Update", + "groupName": "default", + "action": { + "actionType": "openPage", + "pageType": "updateProfile", + "extraParameters": { + "from": "none" + }, + "presentationStyle": "push" + } + }, + "secondaryButton": { + "moleculeName": "button", + "title": "Cancel", + "action": { + "actionType": "back", + "presentationStyle": "push", + "pageType": "backButton" + } + } + } + }, + "formRules": [ + { + "groupName": "default", + "rules": [ + { + "type": "regex", + "fields": [ + "emailID" + ], + "regex": "^[a-zA-Z0-9](\\.?\\_?\\-?[a-zA-Z0-9]){0,}@[a-zA-Z0-9-_]+\\.([a-zA-Z0-9-_]{1,}\\.){0,}[a-zA-Z]{2,}$" + }, + { + "regex": "^(\\d{3})[\\s.-]{0,1}(\\d{3})[\\s.-]{0,1}(\\d{4})$", + "type": "regex", + "fields": [ + "alternateNo" + ] + }, + { + "type": "allRequired", + "ruleId": "requiredRule", + "fields": [ + "greetingName", + "emailID", + "alternateNo" + ] + } + ], + "effects": [ + { + "type": "enableFormFieldEffect", + "fieldKey": "preferredLastName", + "rules": [ + { + "type": "anyRequired", + "fields": [ + "preferredFirstName" + ] + } + ] + } + ] + } + ] + } +} diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/FormPronouns-2.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/FormPronouns-2.json new file mode 100644 index 0000000..13ead0b --- /dev/null +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/FormPronouns-2.json @@ -0,0 +1,166 @@ +{ + "Page": { + "template": "stack", + "pageType": "moleculeStack", + "screenHeading": "Manage Profile", + "hideFabOverlay": true, + "suppressPostLaunchRequests": false, + "tabBarHidden": true, + "analyticsData": { + "vzdl.events.flowinitiated": "1", + "vzdl.page.sourceChannel": "MVA", + "vzdl.target.engagement.intent": " ", + "vzdl.page.channel": " ", + "vzdl.page.displayChannel": "MVA", + "vzdl.page.id": "moleculeStack", + "vzdl.page.siteSection": " ", + "contentSquarePageName": "Manage Profile", + "vzdl.page.name": "moleculeStack" + }, + "chaticon": { + "moleculeName": "chatIcon", + "hideFabOverlay": true + }, + "pageStatNames": [ + "/mf/get/email/verify/indicator", + "/vision/customer/profile", + "/mf/cntrlr/mngpfl" + ], + "navigationBar": { + "moleculeName": "navigationBar", + "title": "Manage Profile" + }, + "header": { + "moleculeName": "headerH2Link", + "headlineBody": { + "moleculeName": "headlineBody", + "headline": { + "moleculeName": "label", + "text": "Tell us about yourself." + }, + "body": { + "moleculeName": "label", + "text": "We'll use your preferred name and pronouns online, in print, on the phone and in person to refer to you and your account." + } + }, + "link": { + "moleculeName": "caretLink", + "title": "Why are we asking?", + "action": { + "actionType": "openPage", + "pageType": "learnMorePronouns" + } + } + }, + "stack": { + "moleculeName": "stack", + "molecules": [ + { + "moleculeName": "stackItem", + "molecule": { + "enabled" : false, + "moleculeName": "textField", + "fieldKey": "preferredFirstName", + "type": "text", + "errorMessage": "Please enter a valid first name.", + "titleLabel": { + "moleculeName": "label", + "text": "Preferred First Name Optional", + "fontStyle": "RegularMicro", + "textColor": "#000000", + "attributes": [ + { + "type": "color", + "location": 21, + "length": 8, + "textColor": "#747676" + } + ] + }, + "feedbackLabel": { + "moleculeName": "label", + "fontStyle": "RegularMicro", + "text": "This will replace greeting name if you have one.", + "textColor": "#747676" + } + } + } + ] + }, + "footer": { + "moleculeName": "footer", + "molecule": { + "moleculeName": "twoButtonView", + "primaryButton": { + "moleculeName": "button", + "title": "Update", + "groupName": "default", + "action": { + "actionType": "openPage", + "pageType": "updateProfile", + "extraParameters": { + "from": "none" + }, + "presentationStyle": "push" + } + }, + "secondaryButton": { + "moleculeName": "button", + "title": "Cancel", + "action": { + "actionType": "back", + "presentationStyle": "push", + "pageType": "backButton" + } + } + } + }, + "formRules": [ + { + "groupName": "default", + "rules": [ + { + "type": "regex", + "fields": [ + "emailID" + ], + "regex": "^[a-zA-Z0-9](\\.?\\_?\\-?[a-zA-Z0-9]){0,}@[a-zA-Z0-9-_]+\\.([a-zA-Z0-9-_]{1,}\\.){0,}[a-zA-Z]{2,}$" + }, + { + "regex": "^(\\d{3})[\\s.-]{0,1}(\\d{3})[\\s.-]{0,1}(\\d{4})$", + "type": "regex", + "fields": [ + "alternateNo" + ] + }, + { + "type": "allRequired", + "ruleId": "requiredRule", + "fields": [ + "greetingName", + "emailID", + "alternateNo" + ] + } + ], + "effects": [ + { + "type": "enableFormFieldEffect", + "fieldKey": "preferredLastName", + "activatedRuleIds": [ + "requiredRule" + ], + "rules": [ + { + "type": "anyRequired", + "fields": [ + "preferredFirstName" + ] + } + ] + } + ] + } + ] + } +} diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/FormWatcher.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/FormWatcher.json index 900b1a6..b40acbd 100644 --- a/JSONCreator_iOS/JSONCreator/JSON/Samples/FormWatcher.json +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/FormWatcher.json @@ -210,17 +210,16 @@ { "type": "enableFormFieldEffect", "fieldKey": "preferredLastName", - "ruleIds": ["requiredRule"], - "rules": [{ - "regex": "^[a-zA-Z]{1,25}$", - "type": "regex", + "activatedRuleIds": ["requiredRule"], + "rules": [ { + "type": "anyRequired", "fields": [ - "preferredFirstName" + "preferredFirstName" ] - }] + }] }, { - "type": "enableFormFieldEffect", + "type": "disableFormFieldEffect", "fieldKey": "agreement", "rules": [ { "type": "anyRequired", diff --git a/JSONCreator_iOS/JSONCreator/JSON/Samples/RadioBoxesSample.json b/JSONCreator_iOS/JSONCreator/JSON/Samples/RadioBoxesSample.json index 65204f5..b74f950 100644 --- a/JSONCreator_iOS/JSONCreator/JSON/Samples/RadioBoxesSample.json +++ b/JSONCreator_iOS/JSONCreator/JSON/Samples/RadioBoxesSample.json @@ -1,91 +1,91 @@ { - "ResponseInfo" : { - "type" : "Success", - "code" : "00000" + "ResponseInfo": { + "type": "Success", + "code": "00000" }, - "Page" : { - "formRules": [{ - "groupName": "default", - "rules":[{ - "type": "anyValueChanged", - "fields":[ - "box" - ] - }] - }], - "footer" : { -"moleculeName":"footer", -"molecule": { - "moleculeName":"twoButtonView", -"primaryButton":{ - "moleculeName": "button", - "title":"x", - "groupName": "default", - "action": { - "actionType": "openPage", - "pageType": "verifyZip" - } -}, -"secondaryButton":{ - "moleculeName": "button", - "title":"x", - "action": { - "actionType": "back" - } -} - -} - - }, - "molecules" : [ + "Page": { + "template": "list", + "pageType": "x", + "header": {}, + "molecules": [ { - "moleculeName" : "listItem", - "molecule" : { - "moleculeName" : "radioBoxes", - "fieldKey":"box", - "boxes" : [ + "moleculeName": "listItem", + "molecule": { + "moleculeName": "radioBoxes", + "fieldKey": "box", + "boxes": [ { - "moleculeName" : "radioBox", - "text" : "1" + "moleculeName": "radioBox", + "text": "1" }, { - "moleculeName" : "radioBox", - "text" : "2" + "moleculeName": "radioBox", + "text": "2" }, { - "moleculeName" : "radioBox", - "text" : "3", - "selected" : true + "moleculeName": "radioBox", + "text": "3", + "selected": true }, { - "moleculeName" : "radioBox", - "text" : "4", - "enabled" : false + "moleculeName": "radioBox", + "text": "4", + "enabled": false }, { - "moleculeName" : "radioBox", - "text" : "5", - "fieldValue" : "Not 5" + "moleculeName": "radioBox", + "text": "5", + "fieldValue": "Not 5" }, { - "moleculeName" : "radioBox", - "text" : "6", - "strikethrough" : true + "moleculeName": "radioBox", + "text": "6", + "strikethrough": true }, { - "moleculeName" : "radioBox", - "text" : "7", - "strikethrough" : true, - "enabled" : false + "moleculeName": "radioBox", + "text": "7", + "strikethrough": true, + "enabled": false } ] } } ], - "header" : { - + "footer": { + "moleculeName": "footer", + "molecule": { + "moleculeName": "twoButtonView", + "primaryButton": { + "moleculeName": "button", + "title": "x", + "groupName": "default", + "action": { + "actionType": "openPage", + "pageType": "verifyZip" + } + }, + "secondaryButton": { + "moleculeName": "button", + "title": "x", + "action": { + "actionType": "back" + } + } + } }, - "template" : "list", - "pageType" : "x" + "formRules": [ + { + "groupName": "default", + "rules": [ + { + "type": "anyValueChanged", + "fields": [ + "box" + ] + } + ] + } + ] } }