From afa20185b6c00b90ea219f50f79433194c160225 Mon Sep 17 00:00:00 2001 From: upendraTekdi Date: Thu, 1 Aug 2024 23:13:32 +0530 Subject: [PATCH 1/2] Task #224216: Create Cohort on admin dashboard by using block_id --- public/locales/en/common.json | 4 +- src/components/AddNewCenters.tsx | 453 +++++++++++++++++++++++++++++++ src/pages/centers.tsx | 71 ++--- src/utils/useLocationState.tsx | 306 +++++++++++---------- 4 files changed, 666 insertions(+), 168 deletions(-) create mode 100644 src/components/AddNewCenters.tsx diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 536de7aa..d2d083e9 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -214,7 +214,9 @@ "MY_MAIN_SUBJECTS": "Main subjects", "NUMBER_OF_CLUSTERS_I_TEACH": "Number of cluster", "DESIGNATION": "Designation", - "NOTE_THIS_WILL_BE_CENTER_NAME": "Note : This Will Be Center Name" + "NOTE_THIS_WILL_BE_CENTER_NAME": "Note : This will be center name", + "REGULAR": "Regular", + "REMOTE": "Remote" }, "FORM_ERROR_MESSAGES": { "INVALID_INPUT": "Invalid Input.", diff --git a/src/components/AddNewCenters.tsx b/src/components/AddNewCenters.tsx new file mode 100644 index 00000000..c2d98ee1 --- /dev/null +++ b/src/components/AddNewCenters.tsx @@ -0,0 +1,453 @@ +import DynamicForm from "@/components/DynamicForm"; +import { + GenerateSchemaAndUiSchema, + customFields, +} from "@/components/GeneratedSchemas"; +import SimpleModal from "@/components/SimpleModal"; +import { + createUser, + getFormRead, + updateUser, +} from "@/services/CreateUserService"; +import { generateUsernameAndPassword } from "@/utils/Helper"; +import { CustomField, FormData } from "@/utils/Interfaces"; +import { + FormContext, + FormContextType, + Role, + RoleId, +} from "@/utils/app.constant"; +import { useLocationState } from "@/utils/useLocationState"; +import { Box, Button, Typography, useTheme } from "@mui/material"; +import { IChangeEvent } from "@rjsf/core"; +import { RJSFSchema } from "@rjsf/utils"; +import React, { useEffect } from "react"; +import { useTranslation } from "react-i18next"; +import { transformArray } from "../utils/Helper"; +import AreaSelection from "./AreaSelection"; +import { showToastMessage } from "./Toastify"; +import { createCohort } from "@/services/CohortService/cohortService"; + +interface CohortDetails { + name?: string; + type?: string; + parentId?: string | null; + customFields?: CustomField[]; +} +interface AddLearnerModalProps { + open: boolean; + onClose: () => void; + formData?: object; + isEditModal?: boolean; + userId?: string; +} +interface FieldProp { + value: string; + label: string; +} +const AddNewCenters: React.FC = ({ + open, + onClose, + formData, + isEditModal = false, + userId, +}) => { + const [schema, setSchema] = React.useState(); + const [uiSchema, setUiSchema] = React.useState(); + const [openAddNewCohort, setOpenAddNewCohort] = + React.useState(false); + + const [credentials, setCredentials] = React.useState({ + username: "", + password: "", + }); + const { t } = useTranslation(); + const theme = useTheme(); + const { + states, + districts, + blocks, + allCenters, + isMobile, + isMediumScreen, + selectedState, + selectedStateCode, + selectedDistrict, + selectedDistrictCode, + selectedCenter, + dynamicForm, + selectedBlock, + selectedBlockCode, + handleStateChangeWrapper, + handleDistrictChangeWrapper, + handleBlockChangeWrapper, + handleCenterChangeWrapper, + selectedCenterCode, + selectedBlockFieldId, + dynamicFormForBlock, + } = useLocationState(open, onClose); + + // useEffect(() => { + // const getAddLearnerFormData = async () => { + // try { + // const response: FormData = await getFormRead( + // FormContext.USERS, + // FormContextType.STUDENT + // ); + // console.log("sortedFields", response); + + // if (response) { + // const { schema, uiSchema } = GenerateSchemaAndUiSchema(response, t); + // setSchema(schema); + // console.log(schema); + // setUiSchema(uiSchema); + // } + // } catch (error) { + // console.error("Error fetching form data:", error); + // } + // }; + // getAddLearnerFormData(); + // }, []); + + // const handleSubmit = async ( + // data: IChangeEvent, + // event: React.FormEvent + // ) => { + // // setOpenModal(true); + // const target = event.target as HTMLFormElement; + // const elementsArray = Array.from(target.elements); + + // console.log("onsubmit", data); + // // for (const element of elementsArray) { + // // if ( + // // (element instanceof HTMLInputElement || + // // element instanceof HTMLSelectElement || + // // element instanceof HTMLTextAreaElement) && + // // (element.value === "" || + // // (Array.isArray(element.value) && element.value.length === 0)) + // // ) { + // // element.focus(); + // // return; + // // } + // // } + // console.log("Form data submitted:", data.formData); + + // const formData = data.formData; + // console.log("Form data submitted:", formData); + // const schemaProperties = schema.properties; + // let cohortId; + // if (typeof window !== "undefined" && window.localStorage) { + // var teacherData = JSON.parse(localStorage.getItem("teacherApp") || ""); + // cohortId = "3f6825ab-9c94-4ee4-93e8-ef21e27dcc67"; + // } + // const { username, password } = generateUsernameAndPassword( + // selectedStateCode, + // Role.STUDENT + // ); + + // let apiBody: any = { + // username: username, + // password: password, + // tenantCohortRoleMapping: [ + // { + // tenantId: "ef99949b-7f3a-4a5f-806a-e67e683e38f3", + // roleId: RoleId.STUDENT, + // cohortId: [selectedCenterCode], + // }, + // ], + // customFields: [], + // }; + + // Object.entries(formData).forEach(([fieldKey, fieldValue]) => { + // const fieldSchema = schemaProperties[fieldKey]; + // const fieldId = fieldSchema?.fieldId; + // console.log( + // `FieldID: ${fieldId}, FieldValue: ${fieldValue}, type: ${typeof fieldValue}` + // ); + + // if (fieldId === null || fieldId === "null") { + // if (typeof fieldValue !== "object") { + // apiBody[fieldKey] = fieldValue; + // } + // } else { + // if ( + // fieldSchema?.hasOwnProperty("isDropdown") || + // fieldSchema.hasOwnProperty("isCheckbox") + // ) { + // apiBody.customFields.push({ + // fieldId: fieldId, + // value: [String(fieldValue)], + // }); + // } else { + // apiBody.customFields.push({ + // fieldId: fieldId, + // value: String(fieldValue), + // }); + // } + // } + // }); + // if (!isEditModal) { + // apiBody.customFields.push({ + // fieldId: "a717bb68-5c8a-45cb-b6dd-376caa605736", + // value: [selectedBlockCode], + // }); + // apiBody.customFields.push({ + // fieldId: "61b5909a-0b45-4282-8721-e614fd36d7bd", + // value: [selectedStateCode], + // }); + // apiBody.customFields.push({ + // fieldId: "aecb84c9-fe4c-4960-817f-3d228c0c7300", + // value: [selectedDistrictCode], + // }); + // } + + // try { + // if (isEditModal && userId) { + // console.log("apiBody", apiBody); + // const userData = { + // name: apiBody.name, + // mobile: apiBody.mobile, + // father_name: apiBody.father_name, + // }; + // const customFields = apiBody.customFields; + // console.log(customFields); + // const object = { + // userData: userData, + // customFields: customFields, + // }; + // const response = await updateUser(userId, object); + // showToastMessage(t("LEARNERS.LEARNER_UPDATED_SUCCESSFULLY"), "success"); + // } else { + // const response = await createUser(apiBody); + // showToastMessage(t("LEARNERS.LEARNER_CREATED_SUCCESSFULLY"), "success"); + // } + // onClose(); + // } catch (error) { + // onClose(); + // console.log(error); + // } + // }; + + // const handleChange = (event: IChangeEvent) => { + // console.log("Form data changed:", event.formData); + // // setFormData({ + // // ...formData, + // // [event.target.name]: event.target.value + // // }); + // }; + + // const handleError = (errors: any) => { + // console.log("Form errors:", errors); + // }; + + // const CustomSubmitButton: React.FC<{ onClose: () => void }> = ({ + // onClose, + // }) => ( + //
+ // <> + // + // + // + //
+ // ); + + // const primaryActionHandler = () => { + // onClose(); + // }; + + // const secondaryActionHandler = async (e: React.FormEvent) => { + // // console.log('Secondary action handler clicked'); + // e.preventDefault(); + // // handleGenerateCredentials(); + // // try { + // // const response = await createUser(learnerFormData); + // // console.log('User created successfully', response); + // // } catch (error) { + // // console.error('Error creating user', error); + // // } + // }; + console.log("selectedBlockFieldId", selectedBlockFieldId); + useEffect(() => { + const getAddLearnerFormData = async () => { + try { + const response = await getFormRead("cohorts", "cohort"); + console.log("sortedFields", response); + + if (response) { + const { schema, uiSchema } = GenerateSchemaAndUiSchema(response, t); + console.log("schema", schema); + console.log("uiSchema", uiSchema); + setSchema(schema); + setUiSchema(uiSchema); + } + } catch (error) { + console.error("Error fetching form data:", error); + } + }; + getAddLearnerFormData(); + }, []); + const onCloseAddNewCohort = () => { + setOpenAddNewCohort(false); + }; + + const handleSubmit = async ( + data: IChangeEvent, + event: React.FormEvent + ) => { + const formData = data.formData; + + if (selectedBlockFieldId) { + const parentId = selectedBlockFieldId; + const cohortDetails: CohortDetails = { + name: formData.name, + type: "COHORT", + parentId: parentId, + customFields: [], + }; + + Object.entries(formData).forEach(([fieldKey, fieldValue]) => { + const fieldSchema = schema.properties[fieldKey]; + const fieldId = fieldSchema?.fieldId; + + if (fieldId !== null) { + cohortDetails?.customFields?.push({ + fieldId: fieldId, + value: formData.cohort_type, + }); + } + }); + console.log("cohortDetails"); + if ( + cohortDetails?.customFields && + cohortDetails?.customFields?.length > 0 && + cohortDetails?.name + ) { + const cohortData = await createCohort(cohortDetails); + if (cohortData) { + showToastMessage(t("CENTERS.CENTER_CREATED_SUCCESSFULLY"), "success"); + setOpenAddNewCohort(false); + onClose(); + // fetchUserList(); + } + } else { + showToastMessage("Please Input Data", "warning"); + } + } else { + showToastMessage( + "Not Able To Create Cohort For Current Selected Data", + "error" + ); + } + }; + + const handleChangeForm = (event: IChangeEvent) => { + console.log("Form data changed:", event.formData); + // setFormData({ + // ...formData, + // [event.target.name]: event.target.value + // }); + }; + + const handleError = () => { + console.log("error"); + }; + console.log("dynamicForm", dynamicForm); + console.log("schema", schema); + + return ( + <> + + + {/* {!dynamicForm && ( + + {t("LEARNERS.FIRST_SELECT_REQUIRED_FIELDS")}{" "} + + )} */} + + + + {dynamicFormForBlock && schema && uiSchema && ( + + )} + + + ); +}; + +export default AddNewCenters; diff --git a/src/pages/centers.tsx b/src/pages/centers.tsx index 2a8a30ad..d7758cdf 100644 --- a/src/pages/centers.tsx +++ b/src/pages/centers.tsx @@ -35,6 +35,9 @@ import { IChangeEvent } from "@rjsf/core"; import { RJSFSchema } from "@rjsf/utils"; import { CustomField } from "@/utils/Interfaces"; import { showToastMessage } from "@/components/Toastify"; +import AreaSelection from "@/components/AreaSelection"; +import { transformArray } from "@/utils/Helper"; +import AddNewCenters from "@/components/AddNewCenters"; type cohortFilterDetails = { type?: string; @@ -124,7 +127,7 @@ const Center: React.FC = () => { const [cohortName, setCohortName] = React.useState(""); const [loading, setLoading] = useState(undefined); const [userId, setUserId] = useState(""); - const [formData, setFormData] = React.useState([]); + // const [formData, setFormData] = React.useState([]); const [schema, setSchema] = React.useState(); const [uiSchema, setUiSchema] = React.useState(); const [openAddNewCohort, setOpenAddNewCohort] = @@ -141,6 +144,12 @@ const Center: React.FC = () => { const [selectedStateCode, setSelectedStateCode] = useState(""); const [selectedDistrictCode, setSelectedDistrictCode] = useState(""); const [selectedBlockCode, setSelectedBlockCode] = useState(""); + const [formdata, setFormData] = useState(); + const [openAddLearnerModal, setOpenAddLearnerModal] = React.useState(false); + const handleCloseAddLearnerModal = () => { + setOpenAddNewCohort(false); + // setOpenAddLearnerModal(false); + }; // use api calls useEffect(() => { if (typeof window !== "undefined" && window.localStorage) { @@ -460,8 +469,8 @@ const Center: React.FC = () => { // add extra buttons const extraActions: any = [ - { name: "Edit", onClick: handleEdit, icon: EditIcon }, - { name: "Delete", onClick: handleDelete, icon: DeleteIcon }, + { name: t("COMMON.EDIT"), onClick: handleEdit, icon: EditIcon }, + { name: t("COMMON.DELETE"), onClick: handleDelete, icon: DeleteIcon }, ]; const onCloseEditMOdel = () => { @@ -474,23 +483,34 @@ const Center: React.FC = () => { }; const handleUpdateAction = async () => { - setLoading(true); - setConfirmButtonDisable(true); - if (selectedCohortId) { + try { + setLoading(true); + setConfirmButtonDisable(true); + + if (!selectedCohortId) { + setLoading(false); + console.log("No cohort Id Selected"); + showToastMessage(t("CENTERS.NO_COHORT_ID_SELECTED"), "error"); + return; + } + let cohortDetails = { name: inputName, }; + const resp = await updateCohortUpdate(selectedCohortId, cohortDetails); - setLoading(false); console.log("resp:", resp); + showToastMessage(t("CENTERS.CENTER_UPDATE_SUCCESSFULLY"), "success"); - } else { + } catch (error) { + console.error("Error updating cohort:", error); + showToastMessage(t("CENTERS.CENTER_UPDATE_FAILED"), "error"); + } finally { setLoading(false); - console.log("No cohort Id Selected"); + setConfirmButtonDisable(false); + onCloseEditMOdel(); + fetchUserList(); } - onCloseEditMOdel(); - fetchUserList(); - setLoading(false); }; const onCloseAddNewCohort = () => { @@ -636,26 +656,15 @@ const Center: React.FC = () => { )} + + - - {schema && uiSchema && ( - - )} - ); }; diff --git a/src/utils/useLocationState.tsx b/src/utils/useLocationState.tsx index ab94db6c..14a31923 100644 --- a/src/utils/useLocationState.tsx +++ b/src/utils/useLocationState.tsx @@ -1,17 +1,18 @@ -import { useState, useEffect, useCallback } from 'react'; -import { useMediaQuery } from '@mui/material'; -import { getStateBlockDistrictList, getCenterList } from '../services/MasterDataService'; // Update the import path as needed +import { useState, useEffect, useCallback } from "react"; +import { useMediaQuery } from "@mui/material"; import { - getCohortList, -} from "@/services/CohortService/cohortService"; + getStateBlockDistrictList, + getCenterList, +} from "../services/MasterDataService"; // Update the import path as needed +import { getCohortList } from "@/services/CohortService/cohortService"; interface FieldProp { value: string; label: string; } interface CenterProp { - cohortId: string; - name: string; - } + cohortId: string; + name: string; +} export const useLocationState = (open: boolean, onClose: () => void) => { const [states, setStates] = useState([]); @@ -30,143 +31,159 @@ export const useLocationState = (open: boolean, onClose: () => void) => { const [selectedBlock, setSelectedBlock] = useState([]); const [selectedBlockCode, setSelectedBlockCode] = useState(""); - const [selectedCenterCode, setSelectedCenterCode] = useState(""); - const [selectedBlockFieldId, setSelectedBlockFieldId] = useState(""); - - - const handleStateChangeWrapper = useCallback(async ( - selectedNames: string[], - selectedCodes: string[] - ) => { - try { - setSelectedStateCode(selectedCodes[0]) - - const object = { - controllingfieldfk: selectedCodes[0], - fieldName: "districts", - }; - const response = await getStateBlockDistrictList(object); - const result = response?.result; - setDistricts(result); - } catch (error) { - console.log(error); - } - handleStateChange(selectedNames, selectedCodes); - }, [selectedStateCode]); - - const handleDistrictChangeWrapper = useCallback(async ( - selected: string[], - selectedCodes: string[] - ) => { - if (selected[0] === "") { - handleBlockChange([], []); - } - try { - setSelectedDistrictCode(selectedCodes[0]) - const object = { - controllingfieldfk: selectedCodes[0], - fieldName: "blocks", - }; - const response = await getStateBlockDistrictList(object); - const result = response?.result; - setBlocks(result); - } catch (error) { - console.log(error); - } - handleDistrictChange(selected, selectedCodes); - }, [selectedDistrictCode]); + const [selectedCenterCode, setSelectedCenterCode] = useState(""); + const [selectedBlockFieldId, setSelectedBlockFieldId] = useState(""); + + const handleStateChangeWrapper = useCallback( + async (selectedNames: string[], selectedCodes: string[]) => { + try { + setSelectedStateCode(selectedCodes[0]); - const handleBlockChangeWrapper = useCallback(async(selected: string[], selectedCodes: string[]) => { - if (selected[0] === "") { + const object = { + controllingfieldfk: selectedCodes[0], + fieldName: "districts", + }; + const response = await getStateBlockDistrictList(object); + const result = response?.result?.values; + setDistricts(result); + } catch (error) { + console.log(error); + } + handleStateChange(selectedNames, selectedCodes); + }, + [selectedStateCode] + ); + + const handleDistrictChangeWrapper = useCallback( + async (selected: string[], selectedCodes: string[]) => { + if (selected[0] === "") { + handleBlockChange([], []); + } + try { + setSelectedDistrictCode(selectedCodes[0]); + const object = { + controllingfieldfk: selectedCodes[0], + fieldName: "blocks", + }; + const response = await getStateBlockDistrictList(object); + const result = response?.result?.values; + setBlocks(result); + } catch (error) { + console.log(error); + } + handleDistrictChange(selected, selectedCodes); + }, + [selectedDistrictCode] + ); + + const handleBlockChangeWrapper = useCallback( + async (selected: string[], selectedCodes: string[]) => { + if (selected[0] === "") { handleCenterChange([], []); } try { - console.log(selectedStateCode,selectedDistrictCode,) + console.log(selectedStateCode, selectedDistrictCode); const object = { - "limit":200, - "offset": 0, - "filters": { - "type": "COHORT", - "status": [ - "active" - ], - "states": selectedStateCode, - "districts": selectedDistrictCode, - "blocks": selectedCodes[0] - } + limit: 200, + offset: 0, + filters: { + type: "COHORT", + status: ["active"], + states: selectedStateCode, + districts: selectedDistrictCode, + blocks: selectedCodes[0], + }, + }; + console.log(selected); + const getBlockIdObject = { + limit: 200, + offset: 0, + filters: { + type: "BLOCK", + status: ["active"], + name: selected[0], + }, }; - console.log(selected) - const getBlockIdObject={ - "limit": 200, - "offset": 0, "filters": { - "type":"BLOCK", - "status": [ - "active" - ], - "name": selected[0] - }, - } const response = await getCenterList(getBlockIdObject); - setSelectedBlockFieldId(response?.result?.results?.cohortDetails[0].cohortId) - console.log(response?.result?.results?.cohortDetails[0].cohortId) - // const result = response?.result?.cohortDetails; - const dataArray=response?.result?.results?.cohortDetails; + setSelectedBlockFieldId( + response?.result?.results?.cohortDetails[0].cohortId + ); + console.log(response?.result?.results?.cohortDetails[0].cohortId); + // const result = response?.result?.cohortDetails; + const dataArray = response?.result?.results?.cohortDetails; const cohortInfo = dataArray?.map((item: any) => ({ - cohortId: item?.cohortId, - name: item?.name + cohortId: item?.cohortId, + name: item?.name, })); - console.log(dataArray) - setAllCenters(cohortInfo); + console.log(dataArray); + setAllCenters(cohortInfo); } catch (error) { setAllCenters([]); console.log(error); } - handleBlockChange(selected, selectedCodes); - }, [selectedBlockCode, selectedDistrictCode, selectedStateCode]); - - const handleCenterChangeWrapper = useCallback((selected: string[], selectedCodes: string[]) => { - handleCenterChange(selected, selectedCodes); - }, []); - - const handleStateChange = useCallback((selected: string[], code: string[]) => { - setSelectedDistrict([]); - setSelectedBlock([]); - setSelectedCenter([]); - setSelectedState(selected); - const stateCodes = code?.join(","); - setSelectedStateCode(stateCodes); - console.log("Selected categories:", typeof code[0]); - }, []); - - const handleDistrictChange = useCallback((selected: string[], code: string[]) => { - setSelectedBlock([]); - setSelectedCenter([]); - setSelectedDistrict(selected); - const districts = code?.join(","); - setSelectedDistrictCode(districts); - console.log("Selected categories:", districts); - }, []); - - const handleBlockChange = useCallback((selected: string[], code: string[]) => { - setSelectedCenter([]); - setSelectedBlock(selected); - const blocks = code?.join(","); - setSelectedBlockCode(blocks); - setdynamicFormForBlock(true) - console.log("Selected categories:", blocks); - }, []); - - const handleCenterChange = useCallback((selected: string[], code: string[]) => { - // handle center change logic - setSelectedCenter(selected); - const centers = code?.join(","); - setSelectedCenterCode(centers) - setDynamicForm(true); - - console.log("Selected categories:", selected) - }, []); + handleBlockChange(selected, selectedCodes); + }, + [selectedBlockCode, selectedDistrictCode, selectedStateCode] + ); + + const handleCenterChangeWrapper = useCallback( + (selected: string[], selectedCodes: string[]) => { + handleCenterChange(selected, selectedCodes); + }, + [] + ); + + const handleStateChange = useCallback( + (selected: string[], code: string[]) => { + setSelectedDistrict([]); + setSelectedBlock([]); + setSelectedCenter([]); + setSelectedState(selected); + const stateCodes = code?.join(","); + setSelectedStateCode(stateCodes); + console.log("Selected categories:", typeof code[0]); + }, + [] + ); + + const handleDistrictChange = useCallback( + (selected: string[], code: string[]) => { + setSelectedBlock([]); + setSelectedCenter([]); + setSelectedDistrict(selected); + const districts = code?.join(","); + setSelectedDistrictCode(districts); + console.log("Selected categories:", districts); + }, + [] + ); + + const handleBlockChange = useCallback( + (selected: string[], code: string[]) => { + setSelectedCenter([]); + setSelectedBlock(selected); + const blocks = code?.join(","); + setSelectedBlockCode(blocks); + setdynamicFormForBlock(true); + console.log("Selected categories:", blocks); + }, + [] + ); + + const handleCenterChange = useCallback( + (selected: string[], code: string[]) => { + // handle center change logic + setSelectedCenter(selected); + const centers = code?.join(","); + setSelectedCenterCode(centers); + setDynamicForm(true); + + console.log("Selected categories:", selected); + }, + [] + ); useEffect(() => { if (!open) { @@ -175,7 +192,7 @@ export const useLocationState = (open: boolean, onClose: () => void) => { setSelectedState([]); setSelectedCenter([]); setDynamicForm(false); - setdynamicFormForBlock(false) + setdynamicFormForBlock(false); } }, [onClose, open]); @@ -186,7 +203,7 @@ export const useLocationState = (open: boolean, onClose: () => void) => { fieldName: "states", }; const response = await getStateBlockDistrictList(object); - const result = response?.result; + const result = response?.result?.values; setStates(result); console.log(typeof states); } catch (error) { @@ -198,9 +215,26 @@ export const useLocationState = (open: boolean, onClose: () => void) => { }, []); return { - states, districts, blocks, allCenters, isMobile, isMediumScreen, - selectedState, selectedStateCode, selectedDistrict, selectedDistrictCode, - selectedCenter, dynamicForm, selectedBlock, selectedBlockCode,dynamicFormForBlock, - handleStateChangeWrapper, handleDistrictChangeWrapper, handleBlockChangeWrapper, handleCenterChangeWrapper,selectedCenterCode, selectedBlockFieldId + states, + districts, + blocks, + allCenters, + isMobile, + isMediumScreen, + selectedState, + selectedStateCode, + selectedDistrict, + selectedDistrictCode, + selectedCenter, + dynamicForm, + selectedBlock, + selectedBlockCode, + dynamicFormForBlock, + handleStateChangeWrapper, + handleDistrictChangeWrapper, + handleBlockChangeWrapper, + handleCenterChangeWrapper, + selectedCenterCode, + selectedBlockFieldId, }; }; From 2fcadab11306d60977389952cb0d549bc81605ab Mon Sep 17 00:00:00 2001 From: upendraTekdi Date: Fri, 2 Aug 2024 12:31:04 +0530 Subject: [PATCH 2/2] Task #224216: add font family --- src/styles/globals.css | 4 ++++ src/styles/style.css | 10 ++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/styles/globals.css b/src/styles/globals.css index bb8ced63..1d173d5c 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -1,3 +1,5 @@ +@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap"); + :root { --foreground-rgb: 0, 0, 0; --background-start-rgb: 214, 219, 220; @@ -22,6 +24,8 @@ body { rgb(var(--background-end-rgb)) ) rgb(var(--background-start-rgb)); + + font-family: "Poppins" !important; } @layer utilities { diff --git a/src/styles/style.css b/src/styles/style.css index 6e82d324..dfc27212 100644 --- a/src/styles/style.css +++ b/src/styles/style.css @@ -8,16 +8,10 @@ border-bottom: 2px solid #ececec; } -.table-header { - font-family: "Poppins", sans-serif !important; - font-size: small; -} - .table-cell { - font-family: "Poppins", sans-serif !important; - font-size: small; + font-size: medium; } .ka-table { - font-family: "Poppins" !important; + font-size: medium; }