diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 29059295..8f05c41a 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -12,8 +12,14 @@ "REASON_FOR_DELETION": "Reason for Deletion", "INCORRECT_DATA_ENTRY": "Incorrect Data Entry", "DUPLICATED_USER": "Duplicate User", - "OTHER":"Other", - "SORT":"Sort" + "NO_GO_BACK": "No, go back", + "YES": "Yes", + "SURE_REASSIGN_CENTER": "Are you sure you want to re-assign Center to this user?", + "OTHER": "Other", + "SORT": "Sort", + "EDIT_COHORT_NAME": "Edit Cohort", + "NAME": "Name", + "UPDATE_COHORT": "Update Cohort" }, "LOGIN_PAGE": { "USERNAME": "Username", @@ -67,5 +73,26 @@ "SEARCHBAR_PLACEHOLDER_DISTRICT": "Search Districts", "SEARCHBAR_PLACEHOLDER_BLOCK": "Search Blocks", "BLOCKS": "Blocks" + }, + "CENTERS": { + "CENTERS": "Centers", + "REGULAR_CENTERS": "Regular Centers", + "REMOTE_CENTERS": "Remote Centers", + "REMOTE_CENTER": "Remote Center", + "REGULAR": "Regular", + "REMOTE": "Remote", + "SEARCH_BLOCKS": "Search Blocks", + "BLOCK_REQUEST": "You are sending a request to the state Team Leader to re-assign the Block to this user", + "NEW_CENTER": "New Center", + "CENTER_TYPE": "Center Type", + "UNIT_NAME": "Unit Name", + "NOTE": "Note: This will be the center name", + "CENTER_CREATED": "Center Created Successfully!", + "RENAME_CENTER": "Rename Center", + "REQUEST_TO_DELETE": "Request to Delete", + "RENAME": "Rename", + "CENTER_RENAMED": "Center Renamed Successfully!", + "SEND_REQUEST": "Send Request", + "REQUEST_TO_DELETE_HAS_BEEN_SENT": "Request to Delete has been sent" } } diff --git a/public/locales/hi/common.json b/public/locales/hi/common.json index 2dd75ba9..52efd6bb 100644 --- a/public/locales/hi/common.json +++ b/public/locales/hi/common.json @@ -11,7 +11,18 @@ "PASSWORD_PLACEHOLDER": "पासवर्ड दर्ज करें", "USERNAME_PASSWORD_NOT_CORRECT": "आपका यूजरनेम या पासवर्ड गलत है", "FORGOT_PASSWORD": "पासवर्ड भूल गए?", - "REMEMBER_ME": "मुझे याद रखें" + "REMEMBER_ME": "मुझे याद रखें", + "NO_GO_BACK": "नहीं, वापस जाओ", + "YES": "हाँ", + "OTHER": "अन्य", + "SORT": "क्रमबद्ध करें", + "EDIT_COHORT_NAME": "समूह संपादित करें", + "UPDATE_COHORT": "अद्यतन समूह" + + + }, + "COHORTS": { + "SEARCHBAR_PLACEHOLDER": "कोहॉर्ट्स खोजें.." }, "ACTIONBUTONS": { "EDIT": "संपादित करें", @@ -30,5 +41,26 @@ "BLOCK_NAMES": "ब्लॉक के नाम", "ALL_DISTRICTS": "सभी जिले", "ALL_BLOCKS": "सभी ब्लॉक" + }, + "CENTERS": { + "CENTERS": "केंद्र", + "REGULAR_CENTERS": "नियमित केंद्र", + "REMOTE_CENTERS": "दूरस्थ केंद्र", + "REMOTE_CENTER": "दूरस्थ केंद्र", + "REGULAR": "नियमित", + "REMOTE": "दूरस्थ", + "SEARCH_BLOCKS": "ब्लॉक खोजें", + "BLOCK_REQUEST": "आप इस उपयोगकर्ता को ब्लॉक पुनः असाइन करने के लिए राज्य टीम लीडर को अनुरोध भेज रहे हैं", + "NEW_CENTER": "नया केंद्र", + "CENTER_TYPE": "केंद्र प्रकार", + "UNIT_NAME": "इकाई का नाम", + "NOTE": "नोट: यह केंद्र का नाम होगा", + "CENTER_CREATED": "केंद्र सफलतापूर्वक बनाया गया!", + "RENAME_CENTER": "केंद्र का नाम बदलें", + "REQUEST_TO_DELETE": "हटाने का अनुरोध", + "RENAME": "नाम बदलें", + "CENTER_RENAMED": "केंद्र का नाम सफलतापूर्वक बदला गया!", + "SEND_REQUEST": "अनुरोध भेजें", + "REQUEST_TO_DELETE_HAS_BEEN_SENT": "हटाने का अनुरोध भेजा गया है" } } diff --git a/public/locales/mr/common.json b/public/locales/mr/common.json index f7f50dab..e6b807a9 100644 --- a/public/locales/mr/common.json +++ b/public/locales/mr/common.json @@ -1,7 +1,12 @@ { "COMMON": { "LANGUAGE": "भाषा", - "LOADING": "लोड होत आहे" + "LOADING": "लोड होत आहे", + "OTHER": "इतर", + "SORT": "क्रमवारी लावा", + "EDIT_COHORT_NAME": "समूह संपादित करा", + "NAME": "नाव", + "UPDATE_COHORT": "कोहॉर्ट अपडेट करा" }, "LOGIN_PAGE": { "USERNAME": "वापरकर्तानाव", @@ -11,7 +16,12 @@ "PASSWORD_PLACEHOLDER": "पासवर्ड टाका", "USERNAME_PASSWORD_NOT_CORRECT": "आपलं वापरकर्तानाव किंवा संकेतशब्द चुकीचं आहे", "FORGOT_PASSWORD": "पासवर्ड विसरलात?", - "REMEMBER_ME": "मला लक्षात ठेवा" + "REMEMBER_ME": "मला लक्षात ठेवा", + "NO_GO_BACK": "नाही, परत जा", + "YES": "होय" + }, + "COHORTS": { + "SEARCHBAR_PLACEHOLDER": "कोहॉर्ट्स शोधा.." }, "ACTIONBUTONS": { "EDIT": "संपादित करा", @@ -30,5 +40,26 @@ "BLOCK_NAMES": "ब्लॉकचे नावे", "ALL_DISTRICTS": "सर्व जिल्हे", "ALL_BLOCKS": "सर्व ब्लॉक" + }, + "CENTERS": { + "CENTERS": "केंद्रे", + "REGULAR_CENTERS": "नियमित केंद्रे", + "REMOTE_CENTERS": "दूरस्थ केंद्रे", + "REMOTE_CENTER": "दूरस्थ केंद्र", + "REGULAR": "नियमित", + "REMOTE": "दूरस्थ", + "SEARCH_BLOCKS": "ब्लॉक शोधा", + "BLOCK_REQUEST": "आपण या वापरकर्त्यास ब्लॉक पुन्हा नियुक्त करण्यासाठी राज्य टीम लीडरला विनंती पाठवत आहात", + "NEW_CENTER": "नवीन केंद्र", + "CENTER_TYPE": "केंद्र प्रकार", + "UNIT_NAME": "युनिटचे नाव", + "NOTE": "टीप: हे केंद्राचे नाव असेल", + "CENTER_CREATED": "केंद्र यशस्वीरित्या तयार झाले!", + "RENAME_CENTER": "केंद्राचे नाव बदला", + "REQUEST_TO_DELETE": "हटविण्याची विनंती", + "RENAME": "नाव बदला", + "CENTER_RENAMED": "केंद्राचे नाव यशस्वीरित्या बदलले!", + "SEND_REQUEST": "विनंती पाठवा", + "REQUEST_TO_DELETE_HAS_BEEN_SENT": "हटविण्याची विनंती पाठविण्यात आली आहे" } } diff --git a/public/locales/or/common.json b/public/locales/or/common.json index ea34f99f..e7ec4048 100644 --- a/public/locales/or/common.json +++ b/public/locales/or/common.json @@ -1,7 +1,11 @@ { "COMMON": { "LANGUAGE": "ଭାଷା", - "LOADING": "ଲୋଡ୍ ହେଉଛି (Loading)" + "LOADING": "ଲୋଡ୍ ହେଉଛି (Loading)", + "UPDATE_COHORT": "କୋହୋର୍ଟ୍ ଅଦ୍ୟତନ କରନ୍ତୁ", + "SORT": "ସର୍ଟ", + "OTHER": "ଅନ୍ୟ", + "NAME": "ନାମ" }, "LOGIN_PAGE": { "USERNAME": "ଉପଯୋଗକର୍ତା ନାମ", @@ -11,11 +15,17 @@ "PASSWORD_PLACEHOLDER": "ପାସୱାର୍ଡ ଏଣ୍ଟର କର", "USERNAME_PASSWORD_NOT_CORRECT": "ଆପଣଙ୍କ ବ୍ୟବହାରକୃତ ନାମ କିମ୍ବା ପାସ୍‌ୱାର୍ଡ ଭୁଲ ଅଛି", "FORGOT_PASSWORD": "ପାସ୍‌ୱାର୍ଡ ଭୁଲିଛନ୍ତି?", - "REMEMBER_ME": "ମୋତେ ମନ ରଖ" + "REMEMBER_ME": "ମୋତେ ମନ ରଖ", + "NO_GO_BACK": "ନାହିଁ, ପଛକୁ ଯାଆନ୍ତୁ", + "YES": "ହଁ" }, "ACTIONBUTONS": { "EDIT": "ସଂପାଦନା", - "DELETE": "ବିଲୋପ"}, + "DELETE": "ବିଲୋପ" + }, + "COHORTS": { + "SEARCHBAR_PLACEHOLDER": "କୋହର୍ଟସ୍ ସନ୍ଧାନ କରନ୍ତୁ.." + }, "MASTER": { "STATE": "ରାଜ୍ୟ", "SORT": "ଛାଟାନ୍ତୁ", @@ -29,5 +39,26 @@ "BLOCK_NAMES": "ବ୍ଲକ୍ ନାମ", "ALL_DISTRICTS": "ସମସ୍ତ ଜିଲ୍ଲା", "ALL_BLOCKS": "ସମସ୍ତ ବ୍ଲକ୍‌" + }, + "CENTERS": { + "CENTERS": "କେନ୍ଦ୍ରଗୁଡିକ", + "REGULAR_CENTERS": "ନିୟମିତ କେନ୍ଦ୍ରଗୁଡିକ", + "REMOTE_CENTERS": "ଦୂରସ୍ଥ କେନ୍ଦ୍ରଗୁଡିକ", + "REMOTE_CENTER": "ଦୂରସ୍ଥ କେନ୍ଦ୍ର", + "REGULAR": "ନିୟମିତ", + "REMOTE": "ଦୂରସ୍ଥ", + "SEARCH_BLOCKS": "ବ୍ଲକଗୁଡ଼ିକୁ ଖୋଜନ୍ତୁ", + "BLOCK_REQUEST": "ଆପଣ ଏହି ବ୍ୟବହାରକାରୀଙ୍କୁ ବ୍ଲକ ପୁନଃ ନିଯୁକ୍ତ କରିବା ପାଇଁ ରାଜ୍ୟ ଟିମ୍ ଲିଡରକୁ ଅନୁରୋଧ ପଠାଉଛନ୍ତି", + "NEW_CENTER": "ନୂତନ କେନ୍ଦ୍ର", + "CENTER_TYPE": "କେନ୍ଦ୍ର ପ୍ରକାର", + "UNIT_NAME": "ଅଂଶର ନାମ", + "NOTE": "ଟିପ୍ପଣୀ: ଏହା ହେବ କେନ୍ଦ୍ରର ନାମ", + "CENTER_CREATED": "କେନ୍ଦ୍ର ସଫଳତାପୂର୍ଣ୍ଣ ଭାବରେ ସୃଷ୍ଟି ହେଲା!", + "RENAME_CENTER": "କେନ୍ଦ୍ରର ନାମ ପରିବର୍ତ୍ତନ କରନ୍ତୁ", + "REQUEST_TO_DELETE": "ମିଟାଇବାକୁ ଅନୁରୋଧ", + "RENAME": "ନାମ ପରିବର୍ତ୍ତନ କରନ୍ତୁ", + "CENTER_RENAMED": "କେନ୍ଦ୍ରର ନାମ ସଫଳତାପୂର୍ଣ୍ଣ ଭାବରେ ପରିବର୍ତ୍ତିତ ହେଲା!", + "SEND_REQUEST": "ଅନୁରୋଧ ପଠାଅନ୍ତୁ", + "REQUEST_TO_DELETE_HAS_BEEN_SENT": "ମିଟାଇବା ପାଇଁ ଅନୁରୋଧ ପଠାଯାଇଛି" } } diff --git a/src/components/ActionCell.tsx b/src/components/ActionCell.tsx index b3488d90..84a0623f 100644 --- a/src/components/ActionCell.tsx +++ b/src/components/ActionCell.tsx @@ -45,34 +45,44 @@ const ActionCell: React.FC = ({ }; return ( - - - - - - {extraActions?.map((action, index) => ( - <> - - { - action.onClick(rowData); - handleClose(); - }} - > - {showIcons ? ( - - - - ) : ( - "" - )} - - - - ))} - - + + {extraActions.length > 0 ? ( + + + + + + {extraActions?.map((action, index) => ( + <> + + { + action.onClick(rowData); + handleClose(); + }} + > + {showIcons ? ( + + + + ) : ( + "" + )} + + + + ))} + + + ) : ( + "" + )} + ); }; diff --git a/src/components/ConfirmationModal.tsx b/src/components/ConfirmationModal.tsx new file mode 100644 index 00000000..602f77fc --- /dev/null +++ b/src/components/ConfirmationModal.tsx @@ -0,0 +1,107 @@ +import * as React from "react"; + +import Box from "@mui/material/Box"; +import Button from "@mui/material/Button"; +import { Divider } from "@mui/material"; +import Modal from "@mui/material/Modal"; +import { useTheme } from "@mui/material/styles"; + +interface ConfirmationModalProps { + message: string; + handleAction?: () => void; + buttonNames: ButtonNames; + handleCloseModal: () => void; + modalOpen: boolean; +} + +interface ButtonNames { + primary: string; + secondary: string; +} + +const ConfirmationModal: React.FC = ({ + modalOpen, + message, + handleAction, + buttonNames, + handleCloseModal, +}) => { + const theme = useTheme(); + + const style = { + position: "absolute", + top: "50%", + left: "50%", + transform: "translate(-50%, -50%)", + width: "75%", + bgcolor: "#fff", + boxShadow: 24, + borderRadius: "16px", + "@media (min-width: 600px)": { + width: "350px", + }, + }; + + return ( + + + + {message} + + + + + + + + + ); +}; + +export default ConfirmationModal; diff --git a/src/components/CustomModal.tsx b/src/components/CustomModal.tsx index 617a6c2a..0a7593ca 100644 --- a/src/components/CustomModal.tsx +++ b/src/components/CustomModal.tsx @@ -23,7 +23,7 @@ interface CustomModalProps { showClose?: boolean; backdropClose?: boolean; primaryBtnDisabled?: boolean; - children: React.ReactNode; + children: React.ReactNode; } const CustomModal: React.FC = ({ @@ -38,7 +38,7 @@ const CustomModal: React.FC = ({ showClose = true, backdropClose = true, primaryBtnDisabled = true, - children, + children, }) => { const isSmallScreen = useMediaQuery((theme: Theme) => theme.breakpoints.down("sm") @@ -57,15 +57,14 @@ const CustomModal: React.FC = ({ top: "50%", left: "50%", transform: "translate(-50%, -50%)", - width: isSmallScreen ? '90%' : 400, - maxWidth: '90%', + width: isSmallScreen ? "90%" : 400, + maxWidth: "90%", bgcolor: "background.paper", boxShadow: 24, p: 2, borderRadius: 2, }} > - @@ -78,17 +77,22 @@ const CustomModal: React.FC = ({ )} - {showClose && ( - - - - )} - + {showClose && ( + + + + )} + {children} - {secondaryBtnText && ( diff --git a/src/components/HeaderComponent.tsx b/src/components/HeaderComponent.tsx index 6625d59a..204ffc71 100644 --- a/src/components/HeaderComponent.tsx +++ b/src/components/HeaderComponent.tsx @@ -8,6 +8,7 @@ import { useMediaQuery, Grid, Button, + InputLabel, } from "@mui/material"; import Select, { SelectChangeEvent } from "@mui/material/Select"; import AddIcon from "@mui/icons-material/Add"; @@ -20,6 +21,7 @@ import { getStateList, getDistrictList, } from "../services/MasterDataService"; +import { Archive } from "@mui/icons-material"; const AllStates = [ { name: "Maharashtra", code: "mh" }, @@ -48,6 +50,7 @@ interface Block { label: string; } const Sort = ["A-Z", "Z-A"]; +const Filter = ["Active", "Archived"]; const HeaderComponent = ({ children, @@ -57,10 +60,12 @@ const HeaderComponent = ({ selectedDistrict, selectedBlock, selectedSort, + selectedFilter, handleStateChange, handleDistrictChange, handleBlockChange, handleSortChange, + handleFilterChange, showStateDropdown = true, }: any) => { const { t } = useTranslation(); @@ -80,7 +85,7 @@ const HeaderComponent = ({ } try { const response = await getDistrictList(selectedCodes); - const result=response?.result + const result = response?.result; setAllDistricts(result); } catch (error) { console.log(error); @@ -88,13 +93,16 @@ const HeaderComponent = ({ handleStateChange(selectedNames, selectedCodes); }; - const handleDistrictChangeWrapper = async(selected: string[], selectedCodes: string[]) => { + const handleDistrictChangeWrapper = async ( + selected: string[], + selectedCodes: string[] + ) => { if (selected[0] === "") { handleBlockChange([], []); } try { const response = await getBlockList(selectedCodes); - const result=response?.result + const result = response?.result; setAllBlocks(result); } catch (error) { console.log(error); @@ -102,7 +110,10 @@ const HeaderComponent = ({ handleDistrictChange(selected, selectedCodes); }; - const handleBlockChangeWrapper = (selected: string[], selectedCodes: string[]) => { + const handleBlockChangeWrapper = ( + selected: string[], + selectedCodes: string[] + ) => { handleBlockChange(selected, selectedCodes); }; useEffect(() => { @@ -169,7 +180,9 @@ const HeaderComponent = ({ tagName={t("FACILITATORS.ALL_BLOCKS")} selectedCategories={selectedBlock} onCategoryChange={handleBlockChangeWrapper} - disabled={selectedDistrict.length === 0 || selectedDistrict[0] === ""} + disabled={ + selectedDistrict.length === 0 || selectedDistrict[0] === "" + } /> @@ -182,7 +195,7 @@ const HeaderComponent = ({ sx={{ display: "flex", flexDirection: isMobile || isMediumScreen ? "column" : "row", - gap: isMobile || isMediumScreen ? "8px" : "35%", + gap: isMobile || isMediumScreen ? "8px" : "5%", }} > @@ -193,25 +206,48 @@ const HeaderComponent = ({ fullWidth /> - - + + All - ))} - - + {Filter?.map((filter, index) => ( + + {filter} + + ))} + + + + + +