Activities redirection issue – Redirects to “Marco Secure Solution Pvt Ltd” project by default

This commit is contained in:
Kartik Sharma 2025-09-24 12:22:04 +05:30 committed by pramod.mahajan
parent 4e315aafcf
commit 1286184e1f
2 changed files with 55 additions and 52 deletions

View File

@ -14,13 +14,13 @@ import {
getProjectStatusName,
} from "../../utils/projectStatus";
import GlobalModel from "../common/GlobalModel";
import { useDispatch } from "react-redux";
import { useDispatch } from "react-redux";
import { setProjectId } from "../../slices/localVariablesSlice";
const ProjectCard = ({ projectData, recall }) => {
const [ projectInfo, setProjectInfo ] = useState( projectData );
const [projectInfo, setProjectInfo] = useState(projectData);
const { projects_Details, loading, error, refetch } = useProjectDetails(
projectInfo?.id,false
projectInfo?.id, false
);
const [showModal, setShowModal] = useState(false);
const dispatch = useDispatch()
@ -37,9 +37,9 @@ const ProjectCard = ({ projectData, recall }) => {
},
})
useEffect(()=>{
useEffect(() => {
setProjectInfo(projectData);
}, [ projectData ] )
}, [projectData])
const handleShow = async () => {
try {
@ -63,6 +63,10 @@ const ProjectCard = ({ projectData, recall }) => {
dispatch(setProjectId(projectInfo.id))
navigate(`/projects/details`);
};
const handleViewActivities = () => {
dispatch(setProjectId(projectInfo.id))
navigate(`/activities/records?project=${projectInfo.id}`);
};
const handleFormSubmit = (updatedProject) => {
if (projectInfo?.id) {
@ -71,7 +75,7 @@ const ProjectCard = ({ projectData, recall }) => {
updatedData: updatedProject,
});
}
};
};
return (
<>
@ -157,11 +161,7 @@ const ProjectCard = ({ projectData, recall }) => {
</a>
</li>
<li
onClick={() =>
navigate(
`/activities/records?project=${projectInfo.id}`
)
}
onClick={handleViewActivities}
>
<a className="dropdown-item">
<i className="bx bx-task me-2"></i>

View File

@ -69,6 +69,11 @@ const ProjectListView = ({ projectData, recall }) => {
navigate(`/projects/details`);
};
const handleViewActivities = () => {
dispatch(setProjectId(projectInfo.id))
navigate(`/activities/records?project=${projectInfo.id}`);
};
const handleFormSubmit = (updatedProject) => {
if (projectInfo?.id) {
updateProject({
@ -183,9 +188,7 @@ const ProjectListView = ({ projectData, recall }) => {
</a>
</li>
<li
onClick={() =>
navigate(`/activities/records?project=${projectInfo.id}`)
}
onClick={handleViewActivities}
>
<a className="dropdown-item">
<i className="bx bx-task me-2"></i>