Skip to content

Commit

Permalink
Merge pull request #359 from AkshataKatwal16/relese-changes
Browse files Browse the repository at this point in the history
Issue feat:Hide academic year change for SCTA and CCTA
  • Loading branch information
itsvick authored Nov 28, 2024
2 parents 149e632 + a3c5e7e commit 22b848a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/ReassignCenterModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ const ReassignCenterModal: React.FC<ReassignCohortModalProps> = ({
),
"success"
);
reassignButtonStatus
? setReassignButtonStatus(false)
: setReassignButtonStatus(true);
if( userType === Role.FACILITATORS) {
if (selectedDistrict[0] !== districtName)
{
Expand Down
21 changes: 18 additions & 3 deletions src/components/layouts/header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useRef, useState } from "react";
import React, { useEffect, useRef, useState } from "react";
import FeatherIcon from "feather-icons-react";
import { AppBar, Box, IconButton, Toolbar } from "@mui/material";
import MenuItem from "@mui/material/MenuItem";
Expand Down Expand Up @@ -34,6 +34,8 @@ const Header = ({ sx, customClass, toggleMobileSidebar, position }: any) => {
);

const [selectedLanguage, setSelectedLanguage] = useState(lang);
const [userRole, setUserRole] = useState("");

const [academicYearList, setAcademicYearList] = useState<AcademicYear[]>([]);
const [selectedSessionId, setSelectedSessionId] = useState<string>("");

Expand Down Expand Up @@ -62,6 +64,15 @@ const Header = ({ sx, customClass, toggleMobileSidebar, position }: any) => {
}
}, [setLanguage]);



useEffect(() => {
const storedUserData=localStorage.getItem("adminInfo")
if(storedUserData){
const userData = JSON.parse(storedUserData);
setUserRole(userData.role);
}
}, []);
const handleSelectChange = (event: SelectChangeEvent) => {
setSelectedSessionId(event.target.value);
console.log("selected academic year id", event.target.value);
Expand Down Expand Up @@ -137,7 +148,9 @@ const Header = ({ sx, customClass, toggleMobileSidebar, position }: any) => {
{/* ------------ End Menu icon ------------- */}

<Box flexGrow={1} />
<Box sx={{ flexBasis: "20%" }}>


{userRole !== Role.CCTA && userRole !== Role.SCTA && userRole!=="" &&(<Box sx={{ flexBasis: "20%" }}>
{/* <FormControl className="drawer-select" sx={{ width: '100%' }}> */}
<Select
onChange={handleSelectChange}
Expand All @@ -164,7 +177,9 @@ const Header = ({ sx, customClass, toggleMobileSidebar, position }: any) => {
))}
</Select>
{/* </FormControl> */}
</Box>
</Box>)}


<Box
sx={{
display: "flex",
Expand Down

0 comments on commit 22b848a

Please sign in to comment.