Skip to content

Commit

Permalink
Merge branch 'release-1.0.0' of github.com:tekdi/shiksha-admin into r…
Browse files Browse the repository at this point in the history
…elease-1.0.0
  • Loading branch information
itsvick committed Dec 3, 2024
2 parents 549f03a + ab05fa4 commit 21b1134
Show file tree
Hide file tree
Showing 8 changed files with 201 additions and 172 deletions.
34 changes: 16 additions & 18 deletions src/pages/course-planner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,27 +202,19 @@ const Foundation = () => {
{loading ? (
<Loader showBackdrop={true} loadingText={t("COMMON.LOADING")} />
) : (
<Box sx={{ pl: "20px", ml: 2 }}>
<Box sx={{ pl: "20px" }}>
<Box sx={{ m: 2 }}>
<Typography>{t("MASTER.STATE")}</Typography>
</Box>
<Divider />
<Grid container spacing={2} mt={5}>

<Grid
container
spacing={2} // Space between grid items
sx={{
display: "grid",
gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))", // Ensures 3-4 items per row
gap: "16px", // Adds consistent spacing between items
marginLeft: "10px",
}}
container spacing={2} sx={{ overflow: "hidden", maxWidth: "100%", mt: 2 }}
>
{role === "Central Admin CCTA"
? stateNames.map((stateName) => (
<Grid
item // Ensure each item is properly treated as a grid item
key={stateName}
<Grid item xs={12} sm={6} md={4} lg={3} key={stateName} >
<Box
sx={{
cursor: "pointer",
border: "1px solid #D0C5B4",
Expand All @@ -233,6 +225,7 @@ const Foundation = () => {
"&:hover": {
backgroundColor: "#D0C5B4",
},
marginTop: "8px"
}}
onClick={() => handleCardClick(stateName)}
>
Expand All @@ -257,20 +250,24 @@ const Foundation = () => {
{/* Add any icon or text for the copy link button */}
</Button>
</Box>
</Grid>
</Box>
</Grid>
))
: store?.matchingstate && (
<Grid
item // Ensure proper treatment as grid item

<Grid item xs={12} sm={6} md={4} lg={3}>
<Box
sx={{
cursor: "pointer",
border: "1px solid #D0C5B4",
borderRadius: "8px",
padding: "10px",
display: "flex",
justifyContent: "space-between",
"&:hover": {
backgroundColor: "#D0C5B4",
},
marginTop:"8px"
}}
onClick={() =>
handleCardClick(store.matchingstate.name)
Expand All @@ -297,10 +294,11 @@ const Foundation = () => {
{/* Add any icon or text for the copy link button */}
</Button>
</Box>
</Grid>
</Box>
</Grid>
)}
</Grid>
</Grid>

</Box>
)}
</>
Expand Down
5 changes: 4 additions & 1 deletion src/pages/district.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const District: React.FC = () => {
const [pageSizeArray, setPageSizeArray] = useState<number[]>([5, 10, 20, 50]);
const [sortBy, setSortBy] = useState<[string, string]>(["name", "asc"]);
const [searchKeyword, setSearchKeyword] = useState("");
const [fetchDistrict, setFetchDistrict] = useState(true);

const [paginationCount, setPaginationCount] = useState<number>(Numbers.ZERO);
const [stateCode, setStateCode] = useState<any>();
const [stateValue, setStateValue] = useState<string>("");
Expand Down Expand Up @@ -161,7 +163,7 @@ const District: React.FC = () => {

useEffect(() => {
fetchDistricts();
}, []);
}, [fetchDistrict]);
// get cohort id of state
const getStatecohorts = async () => {
let userId: any;
Expand Down Expand Up @@ -559,6 +561,7 @@ const District: React.FC = () => {
});

showToastMessage(t("COMMON.DISTRICT_UPDATED_SUCCESS"), "success");
setFetchDistrict(!fetchDistrict);
const windowUrl = window.location.pathname;
const cleanedUrl = windowUrl.replace(/^\//, '');
const env = cleanedUrl.split("/")[0];
Expand Down
10 changes: 5 additions & 5 deletions src/pages/importCsv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ const ImportCsv = () => {
const response = await getTargetedSolutions({
subject: tstore?.taxonomySubject,
class: tstore?.taxonomyGrade,
state: tstore?.state,
state: localStorage.getItem("selectedState") || tstore?.state,
board: tstore?.board,
type: tstore?.taxonomyType,
courseType: tstore?.taxonomyType,
medium: tstore?.taxonomyMedium,
});

Expand Down Expand Up @@ -115,9 +115,9 @@ const ImportCsv = () => {
const updatedResponse = await getTargetedSolutions({
subject: tstore?.taxonomySubject,
class: tstore?.taxonomyGrade,
state: tstore?.state,
state: localStorage.getItem("selectedState") || tstore?.state,
board: tstore?.board,
type: tstore?.taxonomyType,
courseType: tstore?.taxonomyType,
medium: tstore?.taxonomyMedium,
});
setLoading(false);
Expand Down Expand Up @@ -185,7 +185,7 @@ const ImportCsv = () => {
const metaData: CoursePlannerMetaData = {
subject: tstore?.taxonomySubject,
class: tstore?.taxonomyGrade,
state: tstore?.state,
state: localStorage.getItem("selectedState") || tstore?.state,
board: tstore?.board,
type: tstore?.taxonomyType,
medium: tstore?.taxonomyMedium,
Expand Down
26 changes: 25 additions & 1 deletion src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ const LoginPage = () => {

const token = localStorage.getItem("token");
if (token) {
const { locale } = router;
if(locale)
{
router.push("/centers", undefined, { locale: locale });
}
else
router.push("/centers");


}
}
}, []);
Expand Down Expand Up @@ -152,9 +160,25 @@ const LoginPage = () => {
// router.push("/centers");
if (userInfo?.role === Role.SCTA || userInfo?.role === Role.CCTA) {
window.location.href = "/course-planner";
const { locale } = router;
if(locale)
{
router.push("/course-planner", undefined, { locale: locale });
}
else
router.push("/course-planner");

}
else {
window.location.href = "/centers";
//window.location.href = "/centers";
const { locale } = router;
if(locale)
{
router.push("/centers", undefined, { locale: locale });
}
else
router.push("/centers");

}

}
Expand Down
19 changes: 8 additions & 11 deletions src/pages/stateDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const StateDetails = () => {
<IconButton onClick={handleBackClick}>
<ArrowBackIcon />
</IconButton>
<Typography variant="h2" sx={{ ml: 1 }}>
<Typography variant="h2">
{state || "States"}
</Typography>
</Box>
Expand All @@ -86,24 +86,21 @@ const StateDetails = () => {
>
<Typography variant="h2">Boards:</Typography>
</Box>
<Grid container spacing={2} sx={{ overflow: "hidden", maxWidth: "100%" }}>
<Grid container spacing={2} sx={{ overflow: "hidden", maxWidth: "100%", }}>
{boards.map((board: any, index: number) => (
<Grid item xs={12} sm={6} md={4} lg={3} key={index}>
<Box
sx={{
alignItems: "center",
cursor: "pointer",
border: "1px solid #0000001A",
boxShadow: "none",
transition: "background-color 0.3s",
border: "1px solid #D0C5B4",
borderRadius: "8px",
padding: "10px",
display: "flex",
justifyContent: "space-between",
"&:hover": {
backgroundColor: "#EAF2FF",
backgroundColor: "#D0C5B4",
},

marginTop: "8px",
padding: "16px",
display: "flex",
justifyContent: "space-between",
}}
onClick={() => {
handleBoardClick(board.code, board.name);
Expand Down
10 changes: 5 additions & 5 deletions src/pages/subjectDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -821,14 +821,15 @@ const SubjectDetails = () => {
sx={{
display: "flex",
alignItems: "center",
marginLeft: "10px",
marginTop: "16px",
marginBottom: "16px",
gap:'5px'
}}
onClick={handleBackClick}
>
<IconButton onClick={handleBackClick}>

<ArrowBackIcon />
</IconButton>

<Typography variant="h2">{boardName}</Typography>
{/* <Typography variant="h2" sx={{ ml: 1 }}>
Boardasahskj
Expand Down Expand Up @@ -858,7 +859,6 @@ const SubjectDetails = () => {
backgroundColor: "#EAF2FF",
transform: "scale(1.02)",
},
marginTop: "12px",
}}
onClick={() => handleCardClick(subj)}
>
Expand All @@ -883,7 +883,7 @@ const SubjectDetails = () => {
<Typography
variant="h4"
align="center"
sx={{ marginTop: "24px", color: "#6B7280" }}
sx={{ marginTop: "24px", color: "#6B7280", mx:'16px' }}
>
Select Medium, Grade, and Type
</Typography>
Expand Down
Loading

0 comments on commit 21b1134

Please sign in to comment.