| | |
| | | String userMode = 'classic';//classic lightning |
| | | String objectType = 'Contact'; |
| | | String recordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId(); |
| | | |
| | | System.debug('record type id ===>' + recordTypeId + ' object type===>' + objectType + ' userMode===>' + userMode); |
| | | boolean useHeader = false; |
| | | String baseurl = System.URL.getOrgDomainUrl().getHost(); |
| | | Map<String,object> detailsMap = new Map<String,object>(); |
| | | Map<String,object> detailsMap2 = new Map<String,object>(); |
| | | Map<String,object> detailsMap3 = new Map<String,object>(); |
| | |
| | | detailsMap3.put('calculated',false); |
| | | detailsMap3.put('autoNumber',false); |
| | | detailsMap3.put('type','repair'); |
| | | String fieldTypeDetail = (String) detailsMap.get('type'); |
| | | |
| | | List<Map<String, object>> componentMapList = new List<Map<String, object>>(); |
| | | List<Map<String, object>> componentMapList2 = new List<Map<String, object>>(); |
| | |
| | | componentMap3.put('type','Field'); |
| | | componentMap3.put('details',detailsMap3); |
| | | componentMapList3.add(componentMap3); |
| | | String apiName = (String) componentMap.get('value'); |
| | | String fieldType = (String) componentMap.get('type'); |
| | | |
| | | List<Map<String, object>> layoutComponentsList = new List<Map<String, object>>(); |
| | | Map<String, object> layoutComponents = new Map<String, object>(); |
| | |
| | | layoutComponents.put('label','Address'); |
| | | layoutComponents.put('placeholder',true); |
| | | layoutComponents.put('editableForNew',true); |
| | | layoutComponents.put('editableForUpdate', true); |
| | | layoutComponents.put('required',false); |
| | | layoutComponentsList.add(layoutComponents); |
| | | Map<String, object> layoutComponents2 = new Map<String, object>(); |
| | |
| | | layoutComponents2.put('label','Repair'); |
| | | layoutComponents2.put('placeholder',true); |
| | | layoutComponents2.put('editableForNew',true); |
| | | layoutComponents2.put('editableForUpdate', true); |
| | | layoutComponents2.put('required',false); |
| | | layoutComponentsList.add(layoutComponents2); |
| | | Map<String, object> layoutComponents3 = new Map<String, object>(); |
| | |
| | | layoutComponents3.put('label','Repair'); |
| | | layoutComponents3.put('placeholder',true); |
| | | layoutComponents3.put('editableForNew',true); |
| | | layoutComponents3.put('editableForUpdate', true); |
| | | layoutComponents3.put('required',false); |
| | | layoutComponentsList.add(layoutComponents3); |
| | | |
| | | |
| | | boolean placeholderF = (boolean) layoutComponents.get('placeholder'); |
| | | boolean isEditable = (boolean) layoutComponents.get('editableForUpdate') || (boolean) layoutComponents.get('editableForNew'); |
| | | System.debug('isEditable ===>' + isEditable); |
| | | List<Map<String,object>> itemList = new List<Map<String,object>>(); |
| | | Map<String,object> item = new Map<String,object>(); |
| | | item.put('layoutItems',layoutComponentsList); |
| | | itemList.add(item); |
| | | |
| | | useHeader = true; |
| | | List<Map<String,object>> sectionList = new List<Map<String,object>>(); |
| | | Map<String,object> section = new Map<String,object>(); |
| | | section.put('heading',''); |
| | | section.put('useHeading',true); |
| | | section.put('useHeading', useHeader); |
| | | section.put('columns',1); |
| | | section.put('useCollapsibleSection',true); |
| | | section.put('layoutRows',itemList); |
| | |
| | | String layoutSectionJson = JSON.serialize(layoutSection); |
| | | LayoutDescriberHelper.ControllerUtil(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(layoutSectionJson,'OK','200')); |
| | | |
| | | Test.startTest(); |
| | | LayoutDescriberHelper.describeSectionWithFieldsWrapper(recordTypeId,objectType,userMode); |
| | | LayoutDescriberHelper.describeSectionWithFieldsWrapper(null,objectType,userMode); |
| | | LayoutDescriberHelper.describeSectionWithFields(recordTypeId, objectType, userMode); |
| | | LayoutDescriberHelper.getLayoutSchema(recordTypeId, objectType, userMode); |
| | | LayoutDescriberHelper.getUrlPrefix(); |
| | | Test.stopTest(); |
| | | } |
| | | } |