From 4b0e6a4dbc3ca32634365f1db00bce2ede82eba5 Mon Sep 17 00:00:00 2001 From: Rushikesh-Sonawane99 Date: Thu, 18 Jul 2024 17:29:04 +0530 Subject: [PATCH] Issue #PS-1276 chore: Added logic to overide button of FormWithMaterialUI and added custom buttons --- public/locales/en/common.json | 3 +- src/components/AddLeanerModal.tsx | 15 +- src/components/DynamicForm.tsx | 123 +++- src/components/GeneratedSchemas.ts | 2 +- src/components/ManageUser.tsx | 37 +- src/components/SimpleModal.tsx | 106 ++-- src/utils/schema.js | 864 ++++++++++++++--------------- 7 files changed, 623 insertions(+), 527 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 1fcf7f112..ac6e98ad5 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -110,7 +110,8 @@ "PAGE_NOT_FOUND": "Page not found", "ACCESS_DENIED": "Access Denied", "YOU_DONT_HAVE_PERMISSION_TO_ACCESS_THIS_PAGE": "You don't have access to this page", - "NEW_LEARNER": "New Learner" + "NEW_LEARNER": "New Learner", + "SUBMIT": "Submit" }, "LOGIN_PAGE": { "USERNAME": "Username", diff --git a/src/components/AddLeanerModal.tsx b/src/components/AddLeanerModal.tsx index 520d06973..1f4d9da85 100644 --- a/src/components/AddLeanerModal.tsx +++ b/src/components/AddLeanerModal.tsx @@ -82,19 +82,7 @@ const AddLearnerModal: React.FC = ({ open, onClose }) => { { - const formElement = document.getElementById( - 'dynamic-form' - ) as HTMLFormElement; - if (formElement) { - formElement.dispatchEvent( - new Event('submit', { cancelable: true, bubbles: true }) - ); - } - }} - secondaryText="Create" - secondaryActionHandler={onClose} + showFooter={false} modalTitle={t('COMMON.NEW_LEARNER')} > {schema && uiSchema && ( @@ -107,6 +95,7 @@ const AddLearnerModal: React.FC = ({ open, onClose }) => { widgets={{}} showErrorList={true} customFields={customFields} + showTwoButtons={true} /> )} diff --git a/src/components/DynamicForm.tsx b/src/components/DynamicForm.tsx index dafce0fd3..252e2ecfa 100644 --- a/src/components/DynamicForm.tsx +++ b/src/components/DynamicForm.tsx @@ -7,6 +7,8 @@ import MultiSelectCheckboxes from './MultiSelectCheckboxes'; import CustomRadioWidget from './CustomRadioWidget'; import { RJSFSchema, RegistryFieldsType, WidgetProps } from '@rjsf/utils'; import { useTranslation } from 'next-i18next'; +import { Button, Divider } from '@mui/material'; +import { useTheme } from '@mui/material/styles'; const FormWithMaterialUI = withTheme(MaterialUITheme); @@ -27,6 +29,7 @@ interface DynamicFormProps { customFields: { [key: string]: React.FC>; }; + showTwoButtons?: boolean; } const DynamicForm: React.FC = ({ schema, @@ -36,6 +39,7 @@ const DynamicForm: React.FC = ({ onChange, onError, customFields, + showTwoButtons = false, }) => { const widgets = { MultiSelectCheckboxes: MultiSelectCheckboxes, @@ -43,6 +47,7 @@ const DynamicForm: React.FC = ({ }; const { t } = useTranslation(); + const theme = useTheme(); // console.log('CustomErrorList', CustomErrorList); @@ -125,23 +130,109 @@ const DynamicForm: React.FC = ({ onChange(event); } + const primaryActionHandler = () => { + const formElement = document.getElementById( + 'dynamic-form' + ) as HTMLFormElement; + if (formElement) { + formElement.dispatchEvent( + new Event('submit', { cancelable: true, bubbles: true }) + ); + } + }; + + const secondaryActionHandler = () => { + console.log('Secondary action handler clicked'); + }; + + const CustomSubmitButton = () => ( +
+ {showTwoButtons ? ( + <> + + + + ) : ( + + )} +
+ ); + return ( - +
+ + + + +
); }; diff --git a/src/components/GeneratedSchemas.ts b/src/components/GeneratedSchemas.ts index 067926795..ca7df081b 100644 --- a/src/components/GeneratedSchemas.ts +++ b/src/components/GeneratedSchemas.ts @@ -13,7 +13,7 @@ export const GenerateSchemaAndUiSchema = ( ) => { const schema: JSONSchema7 = { //Form schema - title: formData.title, + title: '', description: '', type: 'object', required: [], diff --git a/src/components/ManageUser.tsx b/src/components/ManageUser.tsx index 4d609d933..01265716a 100644 --- a/src/components/ManageUser.tsx +++ b/src/components/ManageUser.tsx @@ -149,8 +149,7 @@ const manageUsers: React.FC = ({ const resp = await getMyUserList({ limit, page, filters, fields }); const facilitatorList = resp.result?.getUserDetails; - console.log(facilitatorList); - + console.log(facilitatorList); if (!facilitatorList || facilitatorList?.length === 0) { console.log('No users found.'); @@ -158,21 +157,26 @@ const manageUsers: React.FC = ({ } const userIds = facilitatorList?.map((user: any) => user.userId); console.log(userIds); - + const cohortDetailsPromises = userIds?.map((userId: string) => getCohortList(userId, { filter: 'true' }) ); - const cohortDetailsResults = await Promise.allSettled(cohortDetailsPromises); - + const cohortDetailsResults = await Promise.allSettled( + cohortDetailsPromises + ); + const cohortDetails = cohortDetailsResults.map((result) => { if (result.status === 'fulfilled') { return result.value; } else { - console.error('Error fetching cohort details for a user:', result.reason); + console.error( + 'Error fetching cohort details for a user:', + result.reason + ); return null; // or handle the error as needed } }); - + console.log('Cohort Details:', cohortDetails); const extractedData = facilitatorList?.map( @@ -190,10 +194,9 @@ const manageUsers: React.FC = ({ } ); - setTimeout(() => { console.log('extractedData'); - + setUsers(extractedData); }); } @@ -305,11 +308,11 @@ const manageUsers: React.FC = ({ const cohortList = await getCohortList(userId); console.log('Cohort List:', cohortList); - if (cohortList && cohortList?.length > 0 ) { + if (cohortList && cohortList?.length > 0) { const cohortNames = cohortList .map((cohort: { cohortName: any }) => cohort?.cohortName) .join(', '); - + setOpenRemoveUserModal(true); setRemoveCohortNames(cohortNames); } else { @@ -767,12 +770,12 @@ const manageUsers: React.FC = ({ > {' '} - - {t('CENTERS.THE_USER_BELONGS_TO_THE_FOLLOWING_COHORT')}{' '} - {removeCohortNames} -
- {t('CENTERS.PLEASE_REMOVE_THE_USER_FROM_COHORT')} -
+ + {t('CENTERS.THE_USER_BELONGS_TO_THE_FOLLOWING_COHORT')}{' '} + {removeCohortNames} +
+ {t('CENTERS.PLEASE_REMOVE_THE_USER_FROM_COHORT')} +
diff --git a/src/components/SimpleModal.tsx b/src/components/SimpleModal.tsx index 15d0aef9c..eacaf225c 100644 --- a/src/components/SimpleModal.tsx +++ b/src/components/SimpleModal.tsx @@ -18,12 +18,14 @@ import CloseIcon from '@mui/icons-material/Close'; import { showToastMessage } from './Toastify'; import manageUserStore from '@/store/manageUserStore'; import { getCohortList } from '@/services/CohortServices'; +import CloseSharpIcon from '@mui/icons-material/CloseSharp'; interface SimpleModalProps { secondaryActionHandler?: () => void; - primaryActionHandler: () => void; + primaryActionHandler?: () => void; secondaryText?: string; - primaryText: string; + primaryText?: string; + showFooter?: boolean; children: ReactNode; open: boolean; onClose: () => void; @@ -34,10 +36,11 @@ const SimpleModal: React.FC = ({ onClose, primaryText, secondaryText, + showFooter = true, primaryActionHandler, secondaryActionHandler, children, - modalTitle + modalTitle, }) => { const { t } = useTranslation(); const store = manageUserStore(); @@ -55,7 +58,7 @@ const SimpleModal: React.FC = ({ '@media (min-width: 600px)': { width: '450px', maxHeight: '80vh', - overflowY: 'auto', + overflowY: 'auto', }, }; @@ -68,7 +71,7 @@ const SimpleModal: React.FC = ({ @@ -76,60 +79,69 @@ const SimpleModal: React.FC = ({ variant="h2" sx={{ color: theme.palette.warning['A200'], - }} component="h2" > {modalTitle} - + + + {children} - - {primaryText && ( - - )} + {showFooter ? ( + + {primaryText && ( + + )} - {secondaryText && ( - - )} - + {secondaryText && ( + + )} + + ) : null} ); diff --git a/src/utils/schema.js b/src/utils/schema.js index cba21e51e..f7e3c5d2a 100644 --- a/src/utils/schema.js +++ b/src/utils/schema.js @@ -220,438 +220,438 @@ export const apiResponse = { "formid": "a1af6b98-73d4-439f-8537-6f3a901ad462", "title": "CREATE LEARNER", "fields": [ - { - "hint": null, - "name": "name", - "type": "text", - "label": "FULL_NAME", - "order": "0", // change it to number - "fieldId": "null", - "options": [], - "coreField": 1, - "dependsOn": null, - "maxLength": null, // need to add - "minLength": null, - "isEditable": true, - "isPIIField": null, - "validation": [ - "characters-with-space" - ], - "placeholder": "ENTER_FULL_NAME", - "isMultiSelect": true, //false - "maxSelections": 1, //0 - "sourceDetails": {}, - "required": true, - "pattern": "^[a-z A-Z]+$" - }, - { - "hint": null, - "name": "mobile", - "type": "text", // text - "label": "CONTACT_NUMBER", - "order": "1", - "fieldId": "null", - "options": [], - "coreField": 1, - "dependsOn": null, - "maxLength": 10, - "minLength": 10, - "isEditable": true, - "isPIIField": true, - "validation": [ - "numeric" - ], - "placeholder": "ENTER_CONTACT_NUMBER", - "isMultiSelect": false, - "maxSelections": 0, - "sourceDetails": {}, - "pattern": "^\\d*$", - "required": true - }, - { - "label": "HOW_WAS_LEARNER_MOBILISED", //HOW_WAS_LEARNER_MOBILISED - "name": "mobilisation_method", - "type": "drop_down", - "coreField": 0, - "isEditable": true, - "isPIIField": null, - "placeholder": "", - "validation": [], - "options": [ - { - "label": "Second Chance Alumni", //SECOND_CHANCE_ALUMNI - "value": "second_chance_alumni" - }, - { - "label": "Pratham Team Member", //PRATHAM_TEAM_MEMBER - "value": "pratham_team_member" - }, - { - "label": "Other",//OTHER - "value": "other" - } - ], - "isMultiSelect": false, // false - "maxSelections": 1, - "hint": null, - "pattern": null, - "maxLength": null, - "minLength": null, - "fieldId": "7adad9b7-0cf2-4a48-bc60-56a80dc02107", - "dependsOn": false, - "order": "2", - "required": true - }, - { - "label": "AGE", //AGE - "name": "age", - "type": "numeric", //TEXT - "coreField": 0, - "isEditable": true, - "isPIIField": null, - "placeholder": "", - "validation": [], //NUMERIC - "options": [], - "isMultiSelect": false, - "maxSelections": null, - "hint": null, - "pattern": null, - "maxLength": 100, - "minLength": 0, - "fieldId": "2f07caa6-61b8-4a6a-92f4-94b5596a4864", - "dependsOn": false, - "order": "3", - "required": true - }, - // { - // "label": "Gender", //GENDER - // "name": "gender", - // "type": "radio", - // "coreField": 0, - // "isEditable": true, - // "isPIIField": null, - // "placeholder": "", - // "validation": [], - // "options": [ - // { - // "label": "Male", //MALE - // "value": "male" - // }, - // { - // "label": "Female", //FEMALE - // "value": "female" - // } - // ], - // "isMultiSelect": false, - // "maxSelections": null, - // "hint": null, - // "pattern": null, - // "maxLength": null, - // "minLength": null, - // "fieldId": "c81e50d4-87a2-4dc1-9de6-85591c581f5c", - // "dependsOn": false, - // "order": "4" - // }, - // { - // "label": "Learner's Primary Work", //LEARNERS_PRIMARY_WORK - // "name": "primary_work", - // "type": "drop_down", - // "coreField": 0, - // "isEditable": true, - // "isPIIField": null, - // "placeholder": "", - // "validation": [], - // "options": [ - // { - // "label": "Enrolled in educational institute", //ENROLLED_IN_EDUCATIONAL_INSTITUTE - // "value": "enrolled_in_educational_institute" - // }, - // { - // "label": "Own farming", //OWN_FARMING - // "value": "own_farming" - // }, - // { - // "label": "Agricultural farm laborer", //AGRICULTURAL_FARM_LABORER - // "value": "agricultural_farm_laborer" - // }, - // { - // "label": "Non-agricultural laborer", //NON_AGRICULTURAL_LABORER - // "value": "non_agricultural_laborer" - // }, - // { - // "label": "Salaried work", //SALARIED_WORK - // "value": "salaried_work" - // }, - // { - // "label": "Self-employment", //SELF_EMPLOYMENT - // "value": "self_employment" - // }, - // { - // "label": "Unemployed", //UNEMPLOYED - // "value": "unemployed" - // }, - // { - // "label": "Involved in domestic work", //INVOLVED_IN_DOMESTIC_WORK - // "value": "involved_in_domestic_work" - // } - // ], - // "isMultiSelect": true, //false - // "maxSelections": 1, - // "hint": null, - // "pattern": null, - // "maxLength": null, - // "minLength": null, - // "fieldId": "2914814c-2a0f-4422-aff8-6bd3b09d3069", - // "dependsOn": false, - // "order": "5" - // }, - // { - // "label": "Father’s Name", //FATHER_NAME - // "name": "father_name", - // "type": "text", - // "coreField": 0, - // "isEditable": true, - // "isPIIField": null, - // "placeholder": "", //ENTER_YOUR_FATHER_NAME - // "validation": [], //string - // "options": [], - // "isMultiSelect": false, - // "maxSelections": null, - // "hint": null, - // "pattern": null, - // "maxLength": null, - // "minLength": null, - // "fieldId": "f3fac0c3-bc8b-4260-8b56-1608fd31c237", - // "dependsOn": false, - // "order": "6" - // }, - // { - // "label": "Class (Last passed grade)", //CLASS_OR_LAST_PASSED_GRADE - // "name": "class", - // "type": "drop_down", - // "coreField": 0, - // "isEditable": true, - // "isPIIField": null, - // "placeholder": "", - // "validation": [ - // "" - // ], - // "options": [ - // { - // "label": "0", - // "value": "0" - // }, - // { - // "label": "1", - // "value": "1" - // }, - // { - // "label": "2", - // "value": "2" - // }, - // { - // "label": "3", - // "value": "3" - // }, - // { - // "label": "4", - // "value": "4" - // }, - // { - // "label": "5", - // "value": "5" - // }, - // { - // "label": "6", - // "value": "6" - // }, - // { - // "label": "7", - // "value": "7" - // }, - // { - // "label": "8", - // "value": "8" - // }, - // { - // "label": "9", - // "value": "9" - // }, - // { - // "label": "No Schooling", //NO_SCHOOLING - // "value": "no_schooling" - // } - // ], - // "isMultiSelect": true, //false - // "maxSelections": 1, - // "hint": null, - // "pattern": null, - // "maxLength": null, - // "minLength": null, - // "fieldId": "9a4ad601-023b-467f-bbbe-bda1885f87c7", - // "dependsOn": false, - // "order": "7" - // }, - // { - // "label": "Reason for Drop Out From School", //REASON_FOR_DROPOUT_FROM_SCHOOL - // "name": "drop_out_reason", - // "type": "drop_down", - // "coreField": 0, - // "isEditable": true, - // "isPIIField": null, - // "placeholder": "", - // "validation": [], - // "options": [ - // { - // "label": "School inaccessible", //SCHOOL_INACCESSIBLE - // "value": "school_inaccessible" - // }, - // { - // "label": "Financial Constraints", //FINANCIAL_CONSTRAINTS - // "value": "financial_constraints" - // }, - // { - // "label": "Lack of Interest", //LACK_OF_INTEREST - // "value": "lack_of_interest" - // }, - // { - // "label": "Family responsibilities", //FAMILY_RESPONSIBILITIES - // "value": "family_responsibilities" - // }, - // { - // "label": "Failed", //FAILED - // "value": "failed" - // }, - // { - // "label": "Illness", //ILLNESS - // "value": "illness" - // }, - // { - // "label": "Marriage", //MARRIAGE - // "value": "marriage" - // }, - // { - // "label": "Migration", //MIGRATION - // "value": "migration" - // }, - // { - // "label": "Started vocational course", //STARTED_VOCATIONAL_COURSE - // "value": "started_vocational_course" - // }, - // { - // "label": "Started a job", //STARTED_A_JOB - // "value": "started_a_job" - // }, - // { - // "label": "School closure due to covid", //SCHOOL_CLOSURE_DUE_TO_COVID - // "value": "school_closure_due_to_covid" - // } - // ], - // "isMultiSelect": true, //false - // "maxSelections": 1, - // "hint": null, - // "pattern": null, - // "maxLength": null, - // "minLength": null, - // "fieldId": "4f48571b-88fd-43b9-acb3-91afda7901ac", - // "dependsOn": false, - // "order": "8" - // }, - // { - // "label": "Marital Status", //MARITAL_STATUS - // "name": "marital_status", - // "type": "drop_down", - // "coreField": 0, - // "isEditable": true, - // "isPIIField": null, - // "placeholder": "", - // "validation": [], - // "options": [ - // { - // "label": "Unmarried", //UNMARRIED - // "value": "unmarried" - // }, - // { - // "label": "Married", //MARRIED - // "value": "married" - // }, - // { - // "label": "Divorced", //DIVORCED - // "value": "divorced" - // } - // ], - // "isMultiSelect": true, //false - // "maxSelections": 1, - // "hint": null, - // "pattern": null, - // "maxLength": null, - // "minLength": null, - // "fieldId": "ff472647-6c40-42e6-b200-dc74b241e915", - // "dependsOn": false, - // "order": "9" - // }, - // { - // "label": "Type of Phone Available", //PHONE_TYPE_AVAILABLE - // "name": "phone_type_available", - // "type": "drop_down", - // "coreField": 0, - // "isEditable": true, - // "isPIIField": null, - // "placeholder": "", - // "validation": [], - // "options": [ - // { - // "label": "Smartphone", //SMARTPHONE - // "value": "smartphone" - // }, - // { - // "label": "Keypad", //KEYPAD - // "value": "keypad" - // }, - // { - // "label": "No Phone", //NO_PHONE - // "value": "no_phone" - // } - // ], - // "isMultiSelect": true, //false - // "maxSelections": 1, - // "hint": null, - // "pattern": null, - // "maxLength": null, - // "minLength": null, - // "fieldId": "da594b2e-c645-4a96-af15-6e2d24587c9a", - // "dependsOn": false, - // "order": "10" - // }, - // { - // "label": "Is it your own phone?", //IS_IT_YOUR_OWN_PHONE - // "name": "own_phone_check", - // "type": "radio", - // "coreField": 0, - // "isEditable": true, - // "isPIIField": null, - // "placeholder": "", - // "validation": [], - // "options": [ - // { - // "label": "Yes", //YES - // "value": "yes" - // }, - // { - // "label": "No", //NO - // "value": "no" - // } - // ], - // "isMultiSelect": false, - // "maxSelections": null, - // "hint": null, - // "pattern": null, - // "maxLength": null, - // "minLength": null, - // "fieldId": "d119d92f-fab7-4c7d-8370-8b40b5ed23dc", - // "dependsOn": false, - // "order": "11" - // } + { + "hint": null, + "name": "name", + "type": "text", + "label": "FULL_NAME", + "order": "0", // change it to number + "fieldId": "null", + "options": [], + "coreField": 1, + "dependsOn": null, + "maxLength": null, // need to add + "minLength": null, + "isEditable": true, + "isPIIField": null, + "validation": [ + "characters-with-space" + ], + "placeholder": "ENTER_FULL_NAME", + "isMultiSelect": true, //false + "maxSelections": 1, //0 + "sourceDetails": {}, + "required": true, + "pattern": "^[a-z A-Z]+$" + }, + { + "hint": null, + "name": "mobile", + "type": "text", // text + "label": "CONTACT_NUMBER", + "order": "1", + "fieldId": "null", + "options": [], + "coreField": 1, + "dependsOn": null, + "maxLength": 10, + "minLength": 10, + "isEditable": true, + "isPIIField": true, + "validation": [ + "numeric" + ], + "placeholder": "ENTER_CONTACT_NUMBER", + "isMultiSelect": false, + "maxSelections": 0, + "sourceDetails": {}, + "pattern": "^\\d*$", + "required": true + }, + { + "label": "HOW_WAS_LEARNER_MOBILISED", //HOW_WAS_LEARNER_MOBILISED + "name": "mobilisation_method", + "type": "drop_down", + "coreField": 0, + "isEditable": true, + "isPIIField": null, + "placeholder": "", + "validation": [], + "options": [ + { + "label": "Second Chance Alumni", //SECOND_CHANCE_ALUMNI + "value": "second_chance_alumni" + }, + { + "label": "Pratham Team Member", //PRATHAM_TEAM_MEMBER + "value": "pratham_team_member" + }, + { + "label": "Other",//OTHER + "value": "other" + } + ], + "isMultiSelect": false, // false + "maxSelections": 1, + "hint": null, + "pattern": null, + "maxLength": null, + "minLength": null, + "fieldId": "7adad9b7-0cf2-4a48-bc60-56a80dc02107", + "dependsOn": false, + "order": "2", + "required": true + }, + { + "label": "AGE", //AGE + "name": "age", + "type": "numeric", //TEXT + "coreField": 0, + "isEditable": true, + "isPIIField": null, + "placeholder": "", + "validation": [], //NUMERIC + "options": [], + "isMultiSelect": false, + "maxSelections": null, + "hint": null, + "pattern": null, + "maxLength": 100, + "minLength": 0, + "fieldId": "2f07caa6-61b8-4a6a-92f4-94b5596a4864", + "dependsOn": false, + "order": "3", + "required": true + }, + // { + // "label": "Gender", //GENDER + // "name": "gender", + // "type": "radio", + // "coreField": 0, + // "isEditable": true, + // "isPIIField": null, + // "placeholder": "", + // "validation": [], + // "options": [ + // { + // "label": "Male", //MALE + // "value": "male" + // }, + // { + // "label": "Female", //FEMALE + // "value": "female" + // } + // ], + // "isMultiSelect": false, + // "maxSelections": null, + // "hint": null, + // "pattern": null, + // "maxLength": null, + // "minLength": null, + // "fieldId": "c81e50d4-87a2-4dc1-9de6-85591c581f5c", + // "dependsOn": false, + // "order": "4" + // }, + // { + // "label": "Learner's Primary Work", //LEARNERS_PRIMARY_WORK + // "name": "primary_work", + // "type": "drop_down", + // "coreField": 0, + // "isEditable": true, + // "isPIIField": null, + // "placeholder": "", + // "validation": [], + // "options": [ + // { + // "label": "Enrolled in educational institute", //ENROLLED_IN_EDUCATIONAL_INSTITUTE + // "value": "enrolled_in_educational_institute" + // }, + // { + // "label": "Own farming", //OWN_FARMING + // "value": "own_farming" + // }, + // { + // "label": "Agricultural farm laborer", //AGRICULTURAL_FARM_LABORER + // "value": "agricultural_farm_laborer" + // }, + // { + // "label": "Non-agricultural laborer", //NON_AGRICULTURAL_LABORER + // "value": "non_agricultural_laborer" + // }, + // { + // "label": "Salaried work", //SALARIED_WORK + // "value": "salaried_work" + // }, + // { + // "label": "Self-employment", //SELF_EMPLOYMENT + // "value": "self_employment" + // }, + // { + // "label": "Unemployed", //UNEMPLOYED + // "value": "unemployed" + // }, + // { + // "label": "Involved in domestic work", //INVOLVED_IN_DOMESTIC_WORK + // "value": "involved_in_domestic_work" + // } + // ], + // "isMultiSelect": true, //false + // "maxSelections": 1, + // "hint": null, + // "pattern": null, + // "maxLength": null, + // "minLength": null, + // "fieldId": "2914814c-2a0f-4422-aff8-6bd3b09d3069", + // "dependsOn": false, + // "order": "5" + // }, + // { + // "label": "Father’s Name", //FATHER_NAME + // "name": "father_name", + // "type": "text", + // "coreField": 0, + // "isEditable": true, + // "isPIIField": null, + // "placeholder": "", //ENTER_YOUR_FATHER_NAME + // "validation": [], //string + // "options": [], + // "isMultiSelect": false, + // "maxSelections": null, + // "hint": null, + // "pattern": null, + // "maxLength": null, + // "minLength": null, + // "fieldId": "f3fac0c3-bc8b-4260-8b56-1608fd31c237", + // "dependsOn": false, + // "order": "6" + // }, + // { + // "label": "Class (Last passed grade)", //CLASS_OR_LAST_PASSED_GRADE + // "name": "class", + // "type": "drop_down", + // "coreField": 0, + // "isEditable": true, + // "isPIIField": null, + // "placeholder": "", + // "validation": [ + // "" + // ], + // "options": [ + // { + // "label": "0", + // "value": "0" + // }, + // { + // "label": "1", + // "value": "1" + // }, + // { + // "label": "2", + // "value": "2" + // }, + // { + // "label": "3", + // "value": "3" + // }, + // { + // "label": "4", + // "value": "4" + // }, + // { + // "label": "5", + // "value": "5" + // }, + // { + // "label": "6", + // "value": "6" + // }, + // { + // "label": "7", + // "value": "7" + // }, + // { + // "label": "8", + // "value": "8" + // }, + // { + // "label": "9", + // "value": "9" + // }, + // { + // "label": "No Schooling", //NO_SCHOOLING + // "value": "no_schooling" + // } + // ], + // "isMultiSelect": true, //false + // "maxSelections": 1, + // "hint": null, + // "pattern": null, + // "maxLength": null, + // "minLength": null, + // "fieldId": "9a4ad601-023b-467f-bbbe-bda1885f87c7", + // "dependsOn": false, + // "order": "7" + // }, + // { + // "label": "Reason for Drop Out From School", //REASON_FOR_DROPOUT_FROM_SCHOOL + // "name": "drop_out_reason", + // "type": "drop_down", + // "coreField": 0, + // "isEditable": true, + // "isPIIField": null, + // "placeholder": "", + // "validation": [], + // "options": [ + // { + // "label": "School inaccessible", //SCHOOL_INACCESSIBLE + // "value": "school_inaccessible" + // }, + // { + // "label": "Financial Constraints", //FINANCIAL_CONSTRAINTS + // "value": "financial_constraints" + // }, + // { + // "label": "Lack of Interest", //LACK_OF_INTEREST + // "value": "lack_of_interest" + // }, + // { + // "label": "Family responsibilities", //FAMILY_RESPONSIBILITIES + // "value": "family_responsibilities" + // }, + // { + // "label": "Failed", //FAILED + // "value": "failed" + // }, + // { + // "label": "Illness", //ILLNESS + // "value": "illness" + // }, + // { + // "label": "Marriage", //MARRIAGE + // "value": "marriage" + // }, + // { + // "label": "Migration", //MIGRATION + // "value": "migration" + // }, + // { + // "label": "Started vocational course", //STARTED_VOCATIONAL_COURSE + // "value": "started_vocational_course" + // }, + // { + // "label": "Started a job", //STARTED_A_JOB + // "value": "started_a_job" + // }, + // { + // "label": "School closure due to covid", //SCHOOL_CLOSURE_DUE_TO_COVID + // "value": "school_closure_due_to_covid" + // } + // ], + // "isMultiSelect": true, //false + // "maxSelections": 1, + // "hint": null, + // "pattern": null, + // "maxLength": null, + // "minLength": null, + // "fieldId": "4f48571b-88fd-43b9-acb3-91afda7901ac", + // "dependsOn": false, + // "order": "8" + // }, + // { + // "label": "Marital Status", //MARITAL_STATUS + // "name": "marital_status", + // "type": "drop_down", + // "coreField": 0, + // "isEditable": true, + // "isPIIField": null, + // "placeholder": "", + // "validation": [], + // "options": [ + // { + // "label": "Unmarried", //UNMARRIED + // "value": "unmarried" + // }, + // { + // "label": "Married", //MARRIED + // "value": "married" + // }, + // { + // "label": "Divorced", //DIVORCED + // "value": "divorced" + // } + // ], + // "isMultiSelect": true, //false + // "maxSelections": 1, + // "hint": null, + // "pattern": null, + // "maxLength": null, + // "minLength": null, + // "fieldId": "ff472647-6c40-42e6-b200-dc74b241e915", + // "dependsOn": false, + // "order": "9" + // }, + // { + // "label": "Type of Phone Available", //PHONE_TYPE_AVAILABLE + // "name": "phone_type_available", + // "type": "drop_down", + // "coreField": 0, + // "isEditable": true, + // "isPIIField": null, + // "placeholder": "", + // "validation": [], + // "options": [ + // { + // "label": "Smartphone", //SMARTPHONE + // "value": "smartphone" + // }, + // { + // "label": "Keypad", //KEYPAD + // "value": "keypad" + // }, + // { + // "label": "No Phone", //NO_PHONE + // "value": "no_phone" + // } + // ], + // "isMultiSelect": true, //false + // "maxSelections": 1, + // "hint": null, + // "pattern": null, + // "maxLength": null, + // "minLength": null, + // "fieldId": "da594b2e-c645-4a96-af15-6e2d24587c9a", + // "dependsOn": false, + // "order": "10" + // }, + // { + // "label": "Is it your own phone?", //IS_IT_YOUR_OWN_PHONE + // "name": "own_phone_check", + // "type": "radio", + // "coreField": 0, + // "isEditable": true, + // "isPIIField": null, + // "placeholder": "", + // "validation": [], + // "options": [ + // { + // "label": "Yes", //YES + // "value": "yes" + // }, + // { + // "label": "No", //NO + // "value": "no" + // } + // ], + // "isMultiSelect": false, + // "maxSelections": null, + // "hint": null, + // "pattern": null, + // "maxLength": null, + // "minLength": null, + // "fieldId": "d119d92f-fab7-4c7d-8370-8b40b5ed23dc", + // "dependsOn": false, + // "order": "11" + // } ] }