diff --git a/app.config.ts b/app.config.ts index 9f530530..922fc96c 100644 --- a/app.config.ts +++ b/app.config.ts @@ -40,3 +40,13 @@ export const accessControl: { [key: string]: Role[] } = { showBlockLevelCenterData: [Role.TEAM_LEADER], showTeacherLevelCenterData: [Role.TEACHER], }; + +export const fullWidthPages = [ + '/login', + '/forgot-password', + '/reset-password', + '/404', + '/500', + '/offline', + '/unauthorized', +]; \ No newline at end of file diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 2fe6699f..6b2f224a 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -105,7 +105,10 @@ "UPCOMING_EXTRA_SESSION": "Upcoming Extra Sessions", "NO_SESSIONS_SCHEDULED": "No sessions scheduled", "TO_BE_TAUGHT": "What is going to be taught:", - "SELECT_TOPIC": "Select Topic, Sub-topic" + "SELECT_TOPIC": "Select Topic, Sub-topic", + "PAGE_NOT_FOUND": "पृष्ठ नहीं मिला", + "ACCESS_DENIED": "पहुंच निषेधित", + "YOU_DONT_HAVE_PERMISSION_TO_ACCESS_THIS_PAGE": "आपके पास इस पृष्ठ तक पहुंचने की अनुमति नहीं है" }, "LOGIN_PAGE": { "USERNAME": "Username", diff --git a/public/locales/or/common.json b/public/locales/or/common.json index 7a4c631c..08527dac 100644 --- a/public/locales/or/common.json +++ b/public/locales/or/common.json @@ -61,7 +61,10 @@ "SURE_REMOVE": "ଆପଣ ନିଶ୍ଚିତ ଏହି ଶିକ୍ଷାର୍ଥୀକୁ ହଟାଇବାକୁ ଚାହୁଁଛନ୍ତି କି?", "LEARNER_MARKED_DROPOUT": "ଶିକ୍ଷାର୍ଥୀକୁ ଡ୍ରପ୍ ଆଉଟ୍ ଭାବେ ଚିହ୍ନିତ କରାଯାଇଛି", "LEARNER_UNMARKED_DROPOUT": "ଶିକ୍ଷାର୍ଥୀକୁ ଡ୍ରପ୍ ଆଉଟ୍ ଭାବେ ଅଚିହ୍ନିତ କରାଯାଇଛି", - "LEARNER_REMOVED": "ଶିକ୍ଷାର୍ଥୀ କୁ ହଟାଇ ଦିଆଯାଇଛି" + "LEARNER_REMOVED": "ଶିକ୍ଷାର୍ଥୀ କୁ ହଟାଇ ଦିଆଯାଇଛି", + "PAGE_NOT_FOUND": "ପୃଷ୍ଠା ଖୋଜିପାରିବନାହି", + "ACCESS_DENIED": "ପ୍ରବେଶ ନିଷେଧ", + "YOU_DONT_HAVE_PERMISSION_TO_ACCESS_THIS_PAGE": "ଆପଣଙ୍କୁ ଏହି ପୃଷ୍ଠା ପ୍ରବେଶ କରିବା ଅଧିକାର ନାହି" }, "LOGIN_PAGE": { "USERNAME": "ଉପଯୋଗକର୍ତା ନାମ", diff --git a/src/components/DynamicForm.tsx b/src/components/DynamicForm.tsx index a3491314..ec7cc94c 100644 --- a/src/components/DynamicForm.tsx +++ b/src/components/DynamicForm.tsx @@ -59,12 +59,27 @@ const DynamicForm: React.FC = ({ onError(errors); }; + function transformErrors(errors: any) { + return errors.map((error: any) => { + if (error.name === 'pattern') { + error.message = 'Only digits are allowed'; + } + return error; + }); + } + + + function handleChange(event: any) { + console.log('Form data changed:', event); + onChange(event); + } + return ( = ({ widgets={widgets} noHtml5Validate onError={handleError} + transformErrors={transformErrors} // ErrorList={CustomErrorList} /> ); diff --git a/src/components/GeneratedSchemas.tsx b/src/components/GeneratedSchemas.ts similarity index 82% rename from src/components/GeneratedSchemas.tsx rename to src/components/GeneratedSchemas.ts index df5d29b3..2db5c814 100644 --- a/src/components/GeneratedSchemas.tsx +++ b/src/components/GeneratedSchemas.ts @@ -1,6 +1,8 @@ import { UiSchema } from '@rjsf/utils'; import { JSONSchema7 } from 'json-schema'; import { apiResponse } from '@/utils/schema'; +import { i18n } from 'next-i18next'; +import { getTranslatedText } from '@/utils/Helper'; interface FieldOption { label: string; @@ -24,10 +26,12 @@ interface Field { minLength?: number | null; fieldId: string; dependsOn: boolean; + required?: boolean; } const GenerateSchemaAndUiSchema = (apiResponse: any) => { - const schema: JSONSchema7 = { + + const schema: JSONSchema7 = { //Form schema title: 'A registration form', description: 'A simple form example', type: 'object', @@ -36,9 +40,9 @@ const GenerateSchemaAndUiSchema = (apiResponse: any) => { dependencies: {}, }; - const uiSchema: UiSchema = {}; + const uiSchema: UiSchema = {}; //form ui schema - apiResponse.result.forEach((field: Field) => { + apiResponse.fields.forEach((field: Field) => { const { label, name, @@ -49,10 +53,12 @@ const GenerateSchemaAndUiSchema = (apiResponse: any) => { isMultiSelect, maxSelections, dependsOn, + pattern, + required } = field; const fieldSchema: any = { - title: label, + title: getTranslatedText(label), }; const fieldUiSchema: any = {}; @@ -130,6 +136,23 @@ const GenerateSchemaAndUiSchema = (apiResponse: any) => { fieldUiSchema['ui:widget'] = 'MultiSelectCheckboxes'; } + if (pattern) { + fieldSchema.pattern = pattern; + fieldUiSchema["ui:help"]= "Only alphabetic characters are allowed."; + } + + if (required) { + schema.required?.push(name); + } + + if (field?.minLength) { + fieldSchema.minLength = Number(field.minLength); + } + + if (field?.maxLength) { + fieldSchema.maxLength = Number(field.maxLength); + } + if (schema !== undefined && schema.properties) { schema.properties[name] = fieldSchema; uiSchema[name] = fieldUiSchema; @@ -140,5 +163,6 @@ const GenerateSchemaAndUiSchema = (apiResponse: any) => { }; const { schema, uiSchema } = GenerateSchemaAndUiSchema(apiResponse); +console.log(schema, uiSchema); export { schema, uiSchema }; diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 852384d5..cd73a167 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -3,8 +3,12 @@ import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; import ErrorIcon from '../../public/images/404.png'; // Make sure to replace this with the actual path to your image import Image from 'next/image'; +import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; +import { useTranslation } from 'next-i18next'; const PageNotFound = () => { + const { t } = useTranslation(); + return ( { fontWeight="600" color="black" > - Page not Found + {t('COMMON.PAGE_NOT_FOUND')} ); }; +export async function getStaticProps({ locale }: any) { + return { + props: { + ...(await serverSideTranslations(locale, ['common'])), + // Will be passed to the page component as props + }, + }; +} + export default PageNotFound; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 0a3172fd..c4712022 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -22,11 +22,13 @@ import Head from 'next/head'; import IconButton from '@mui/material/IconButton'; import { Poppins } from 'next/font/google'; import { ToastContainer } from 'react-toastify'; -import { appWithTranslation } from 'next-i18next'; +import { UserConfig, appWithTranslation } from 'next-i18next'; import customTheme from '../styles/customTheme'; import { telemetryFactory } from '../utils/telemetry'; import { useEffect } from 'react'; import { useRouter } from 'next/router'; +import { fullWidthPages } from '../../app.config'; +import nextI18NextConfig from '../../next-i18next.config.js'; const queryClient = new QueryClient(); const ColorModeContext = React.createContext({ toggleColorMode: () => {} }); @@ -36,6 +38,13 @@ const poppins = Poppins({ subsets: ['latin'], }); +const emptyInitialI18NextConfig: UserConfig = { + i18n: { + defaultLocale: nextI18NextConfig.i18n.defaultLocale, + locales: nextI18NextConfig.i18n.locales, + }, +}; + export function DarkTheme() { const theme = useTheme(); const colorMode = React.useContext(ColorModeContext); @@ -61,7 +70,7 @@ export function DarkTheme() { function App({ Component, pageProps }: AppProps) { const router = useRouter(); - const Login = router.pathname === '/login'; + const isFullWidthPage = fullWidthPages.includes(router.pathname); useEffect(() => { telemetryFactory.init(); }, []); @@ -136,12 +145,12 @@ function App({ Component, pageProps }: AppProps) { sx={{ padding: '0', '@media (min-width: 900px)': { - width: !Login ? 'calc(100% - 22rem)' : '100%', - marginLeft: !Login ? '351px' : '0', + width: !isFullWidthPage ? 'calc(100% - 22rem)' : '100%', + marginLeft: !isFullWidthPage ? '351px' : '0', }, '@media (min-width: 1600px)': { width: '100%', - marginLeft: !Login ? '351px' : '0', + marginLeft: !isFullWidthPage ? '351px' : '0', }, }} > @@ -159,4 +168,4 @@ function App({ Component, pageProps }: AppProps) { ); } -export default appWithTranslation(App); +export default appWithTranslation(App, emptyInitialI18NextConfig); diff --git a/src/pages/addLearner.tsx b/src/pages/add-learner.tsx similarity index 100% rename from src/pages/addLearner.tsx rename to src/pages/add-learner.tsx diff --git a/src/pages/login.tsx b/src/pages/login.tsx index 2b542476..664aa132 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -55,8 +55,9 @@ const LoginPage = () => { useEffect(() => { if (typeof window !== 'undefined' && window.localStorage) { + let lang; if (localStorage.getItem('preferredLanguage')) { - var lang = localStorage.getItem('preferredLanguage') || 'en'; + lang = localStorage.getItem('preferredLanguage') || 'en'; } else { lang = 'en'; } diff --git a/src/pages/unauthorized.tsx b/src/pages/unauthorized.tsx new file mode 100644 index 00000000..6d127c3e --- /dev/null +++ b/src/pages/unauthorized.tsx @@ -0,0 +1,57 @@ +import React from 'react'; +import Box from '@mui/material/Box'; +import Typography from '@mui/material/Typography'; +import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; +import { useTranslation } from 'next-i18next'; +import { useTheme } from '@mui/material'; + +const Unauthorized = () => { + const { t } = useTranslation(); + const theme = useTheme(); + + return ( + + {/* Error icon */} + + {t('COMMON.ACCESS_DENIED')} + + + + {t('COMMON.YOU_DONT_HAVE_PERMISSION_TO_ACCESS_THIS_PAGE')} + + + + ); +}; + +export async function getStaticProps({ locale }: any) { + return { + props: { + ...(await serverSideTranslations(locale, ['common'])), + // Will be passed to the page component as props + }, + }; +} + +export default Unauthorized; diff --git a/src/store/store.js b/src/store/store.js index 7753fd1d..d773d830 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -5,8 +5,9 @@ const useStore = create( persist( (set) => ({ value: '', - role: '', cohorts: [], + userRole: '', + pairs: [], setValue: (newValue) => set((state) => ({ value: newValue })), setUserRole: (newRole) => set((state) => ({ userRole: newRole })), setCohorts: (newCohorts) => set(() => ({ cohorts: newCohorts })), diff --git a/src/styles/globals.css b/src/styles/globals.css index aeae907a..d491cabe 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -946,3 +946,17 @@ main { .text-7C { color: var(--mui-palette-warning-400) !important; } + + +/* To Hide the caret icon on input type number */ +input[type="number"] { + -moz-appearance: textfield; +} + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + margin: 0; + -webkit-appearance: none; +} + +/* To hide the input type number arrows */ \ No newline at end of file diff --git a/src/utils/Helper.ts b/src/utils/Helper.ts index 40700d74..8a3ca6ae 100644 --- a/src/utils/Helper.ts +++ b/src/utils/Helper.ts @@ -1,5 +1,6 @@ import FingerprintJS from 'fingerprintjs2'; import { Role, Status } from './app.constant'; +import { i18n } from 'next-i18next'; export const ATTENDANCE_ENUM = { PRESENT: 'present', @@ -266,3 +267,11 @@ export const accessGranted = ( } return false; }; + + +export function getTranslatedText(key: string, options?: any): string { + if (!i18n?.t) { + throw new Error('i18n instance is not initialized'); + } + return i18n.t(key, options) as string; +} diff --git a/src/utils/hoc/withAccessControl.tsx b/src/utils/hoc/withAccessControl.tsx index cfd3457c..f1c8d807 100644 --- a/src/utils/hoc/withAccessControl.tsx +++ b/src/utils/hoc/withAccessControl.tsx @@ -12,6 +12,11 @@ const withAccessControl = const router = useRouter(); useEffect(() => { + console.log("userRole", userRole); + if (userRole === '') { + router.replace('/logout'); + return; + } if (!userRole || !accessControl[action]?.includes(userRole)) { router.replace('/unauthorized'); } diff --git a/src/utils/schema.js b/src/utils/schema.js index db67659c..811ab54d 100644 --- a/src/utils/schema.js +++ b/src/utils/schema.js @@ -215,294 +215,731 @@ const formReadResponse = { ], }; + export const apiResponse = { - result: [ - { - label: 'Age', - name: 'age', - type: 'numeric', - isEditable: true, - isPIIField: null, - placeholder: '', - validation: [], - options: [], - isMultiSelect: false, - maxSelections: null, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: '57b50148-2b58-45e5-9b27-6a07c5317c18', - dependsOn: false, - }, - { - label: 'Unit Name', - name: 'unit_name', - type: 'text', - isEditable: false, - isPIIField: null, - placeholder: '', - validation: [], - options: [], - isMultiSelect: false, - maxSelections: null, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: '2f7c44e8-5890-4f09-a759-da08b1fda38c', - dependsOn: false, - }, - { - label: 'Number of Clusters I Teach', - name: 'no_of_clusters', - type: 'numeric', - isEditable: true, - isPIIField: null, - placeholder: '', - validation: [], - options: [], - isMultiSelect: false, - maxSelections: null, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: 'f5249ac0-931a-4136-8c82-8767263a5460', - dependsOn: false, - }, - { - label: 'Year of joining SCP', - name: 'year_of_joining_scp', - type: 'numeric', - isEditable: true, - isPIIField: null, - placeholder: '', - validation: [], - options: [], - isMultiSelect: false, - maxSelections: null, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: 'f9fb37a4-d5d0-4f71-9ff6-cfd7d54a1611', - dependsOn: false, - }, - { - label: 'State', - name: 'state', - type: 'drop_down', - isEditable: true, - isPIIField: null, - placeholder: '', - validation: [], - options: [], - isMultiSelect: true, - maxSelections: 1, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: 'b61edfc6-3787-4079-86d3-37262bf23a9e', - dependsOn: false, - }, - { - label: 'My Main Subjects', - name: 'main_subject', - type: 'checkbox', - isEditable: true, - isPIIField: null, - placeholder: '', - validation: [], - options: [ - { - label: 'English', - value: 'english', - }, - { - label: 'Home Science', - value: 'home_science', - }, - { - label: 'Math', - value: 'math', - }, - { - label: 'Language', - value: 'language', - }, - { - label: 'Science', - value: 'science', - }, - { - label: 'Social Science', - value: 'social_science', - }, - { - label: 'Life Skills', - value: 'life_skills', - }, - ], - isMultiSelect: true, - maxSelections: 7, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: '935bfb34-9be7-4676-b9cc-cec1ec4c0a2c', - dependsOn: false, - }, - { - label: 'Designation', - name: 'designation', - type: 'radio', - isEditable: true, - isPIIField: null, - placeholder: '', - validation: [], - options: [ - { - label: 'Facilitator', - value: 'facilitator', - }, - { - label: 'Team Leader', - value: 'team_leader', - }, - ], - isMultiSelect: false, - maxSelections: null, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: 'cb407d11-f1c5-424c-a422-4755a1c4ab29', - dependsOn: false, - }, - { - label: 'Gender', - name: 'gender', - type: 'radio', - isEditable: true, - isPIIField: null, - placeholder: '', - validation: [], - options: [ - { - label: 'Male', - value: 'male', - }, - { - label: 'Female', - value: 'female', - }, - ], - isMultiSelect: false, - maxSelections: null, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: 'a71fd390-fd67-45c3-ab1e-6994b8d967a2', - dependsOn: false, - }, - { - label: 'District', - name: 'district', - type: 'drop_down', - isEditable: true, - isPIIField: null, - placeholder: '', - validation: [], - options: [ - { - label: 'English', - value: 'english', - }, - { - label: 'Home Science', - value: 'home_science', - }, - { - label: 'Math', - value: 'math', - }, - ], - isMultiSelect: true, - maxSelections: 1, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: 'f2d731dd-2298-40d3-80bb-9ae6c5b38fb8', - dependsOn: true, - }, - { - label: 'Block', - name: 'block', - type: 'drop_down', - isEditable: true, - isPIIField: null, - placeholder: '', - validation: [], - options: [], - isMultiSelect: true, - maxSelections: 1, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: '549d3575-bf01-48a9-9fff-59220fede174', - dependsOn: true, - }, - { - label: 'Subjects I Teach', - name: 'subject_taught', - type: 'checkbox', - isEditable: true, - isPIIField: null, - placeholder: '', - validation: [], - options: [ - { - label: 'English', - value: 'english', - }, - { - label: 'Home Science', - value: 'home_science', - }, - { - label: 'Math', - value: 'math', - }, - { - label: 'Language', - value: 'language', - }, - { - label: 'Science', - value: 'science', - }, - { - label: 'Social Science', - value: 'social_science', - }, - { - label: 'Life Skills', - value: '_lifeskills', - }, - ], - isMultiSelect: true, - maxSelections: 7, - hint: null, - pattern: null, - maxLength: null, - minLength: null, - fieldId: 'abb7f3fe-f7fa-47be-9d28-5747dd3159f2', - dependsOn: false, - }, - ], -}; + "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": [ + "string" + ], + "placeholder": "ENTER_FULL_NAME", + "isMultiSelect": true, //false + "maxSelections": 1, //0 + "sourceDetails": {}, + "required": true, + "pattern": "/[a-zA-Z]+/" + }, + { + "hint": null, + "name": "mobile", + "type": "text", // text + "label": "CONTACT_NUMBER", + "order": "1", + "fieldId": "null", + "options": [], + "pattern": null, + "coreField": 1, + "dependsOn": null, + "maxLength": 10, + "minLength": 10, + "isEditable": true, + "isPIIField": true, + "validation": [ + "numeric" + ], + "placeholder": "ENTER_CONTACT_NUMBER", + "isMultiSelect": false, + "maxSelections": 0, + "sourceDetails": {} + }, + // { + // "label": "How Was the 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": true, // false + // "maxSelections": 1, + // "hint": null, + // "pattern": null, + // "maxLength": null, + // "minLength": null, + // "fieldId": "7adad9b7-0cf2-4a48-bc60-56a80dc02107", + // "dependsOn": false, + // "order": "2" + // }, + // { + // "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": null, + // "minLength": null, + // "fieldId": "2f07caa6-61b8-4a6a-92f4-94b5596a4864", + // "dependsOn": false, + // "order": "3" + // }, + // { + // "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" + // } + ] +} + +// export const apiResponse = { +// result: [ +// { +// label: 'Age', +// name: 'age', +// type: 'numeric', +// isEditable: true, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [], +// isMultiSelect: false, +// maxSelections: null, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: '57b50148-2b58-45e5-9b27-6a07c5317c18', +// dependsOn: false, +// }, +// { +// label: 'Unit Name', +// name: 'unit_name', +// type: 'text', +// isEditable: false, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [], +// isMultiSelect: false, +// maxSelections: null, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: '2f7c44e8-5890-4f09-a759-da08b1fda38c', +// dependsOn: false, +// }, +// { +// label: 'Number of Clusters I Teach', +// name: 'no_of_clusters', +// type: 'numeric', +// isEditable: true, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [], +// isMultiSelect: false, +// maxSelections: null, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: 'f5249ac0-931a-4136-8c82-8767263a5460', +// dependsOn: false, +// }, +// { +// label: 'Year of joining SCP', +// name: 'year_of_joining_scp', +// type: 'numeric', +// isEditable: true, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [], +// isMultiSelect: false, +// maxSelections: null, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: 'f9fb37a4-d5d0-4f71-9ff6-cfd7d54a1611', +// dependsOn: false, +// }, +// { +// label: 'State', +// name: 'state', +// type: 'drop_down', +// isEditable: true, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [], +// isMultiSelect: true, +// maxSelections: 1, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: 'b61edfc6-3787-4079-86d3-37262bf23a9e', +// dependsOn: false, +// }, +// { +// label: 'My Main Subjects', +// name: 'main_subject', +// type: 'checkbox', +// isEditable: true, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [ +// { +// label: 'English', +// value: 'english', +// }, +// { +// label: 'Home Science', +// value: 'home_science', +// }, +// { +// label: 'Math', +// value: 'math', +// }, +// { +// label: 'Language', +// value: 'language', +// }, +// { +// label: 'Science', +// value: 'science', +// }, +// { +// label: 'Social Science', +// value: 'social_science', +// }, +// { +// label: 'Life Skills', +// value: 'life_skills', +// }, +// ], +// isMultiSelect: true, +// maxSelections: 7, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: '935bfb34-9be7-4676-b9cc-cec1ec4c0a2c', +// dependsOn: false, +// }, +// { +// label: 'Designation', +// name: 'designation', +// type: 'radio', +// isEditable: true, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [ +// { +// label: 'Facilitator', +// value: 'facilitator', +// }, +// { +// label: 'Team Leader', +// value: 'team_leader', +// }, +// ], +// isMultiSelect: false, +// maxSelections: null, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: 'cb407d11-f1c5-424c-a422-4755a1c4ab29', +// dependsOn: false, +// }, +// { +// label: 'Gender', +// name: 'gender', +// type: 'radio', +// isEditable: true, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [ +// { +// label: 'Male', +// value: 'male', +// }, +// { +// label: 'Female', +// value: 'female', +// }, +// ], +// isMultiSelect: false, +// maxSelections: null, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: 'a71fd390-fd67-45c3-ab1e-6994b8d967a2', +// dependsOn: false, +// }, +// { +// label: 'District', +// name: 'district', +// type: 'drop_down', +// isEditable: true, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [ +// { +// label: 'English', +// value: 'english', +// }, +// { +// label: 'Home Science', +// value: 'home_science', +// }, +// { +// label: 'Math', +// value: 'math', +// }, +// ], +// isMultiSelect: true, +// maxSelections: 1, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: 'f2d731dd-2298-40d3-80bb-9ae6c5b38fb8', +// dependsOn: true, +// }, +// { +// label: 'Block', +// name: 'block', +// type: 'drop_down', +// isEditable: true, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [], +// isMultiSelect: true, +// maxSelections: 1, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: '549d3575-bf01-48a9-9fff-59220fede174', +// dependsOn: true, +// }, +// { +// label: 'Subjects I Teach', +// name: 'subject_taught', +// type: 'checkbox', +// isEditable: true, +// isPIIField: null, +// placeholder: '', +// validation: [], +// options: [ +// { +// label: 'English', +// value: 'english', +// }, +// { +// label: 'Home Science', +// value: 'home_science', +// }, +// { +// label: 'Math', +// value: 'math', +// }, +// { +// label: 'Language', +// value: 'language', +// }, +// { +// label: 'Science', +// value: 'science', +// }, +// { +// label: 'Social Science', +// value: 'social_science', +// }, +// { +// label: 'Life Skills', +// value: '_lifeskills', +// }, +// ], +// isMultiSelect: true, +// maxSelections: 7, +// hint: null, +// pattern: null, +// maxLength: null, +// minLength: null, +// fieldId: 'abb7f3fe-f7fa-47be-9d28-5747dd3159f2', +// dependsOn: false, +// }, +// ], +// };