From 9eb57a3dc14042e167cc22f55a6fa8eb362bb59c Mon Sep 17 00:00:00 2001 From: Nishit Suwal <81785002+NSUWAL123@users.noreply.github.com> Date: Fri, 8 Mar 2024 07:29:39 +0545 Subject: [PATCH] fix: remove add org btn, redirect for submissions page (#1332) * fix taskSectionPopup: redirect to submissionsPage on btn file btn click * fix createNewProject: remove organization add button besides organization list * fix submissionDetail: nav link route add to submission instance page * fix projectModel: remove organisation from types --- .../ProjectDetailsV2/TaskSectionPopup.tsx | 5 +++- .../ProjectSubmissions/ProjectInfo.tsx | 28 +++++++++++-------- .../createnewproject/ProjectDetailsForm.tsx | 6 ---- .../src/models/project/projectModel.ts | 1 - src/frontend/src/views/SubmissionDetails.tsx | 25 +++++++++++++++++ 5 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/frontend/src/components/ProjectDetailsV2/TaskSectionPopup.tsx b/src/frontend/src/components/ProjectDetailsV2/TaskSectionPopup.tsx index a5856e49fd..782a718bbe 100644 --- a/src/frontend/src/components/ProjectDetailsV2/TaskSectionPopup.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/TaskSectionPopup.tsx @@ -5,6 +5,7 @@ import { ProjectActions } from '@/store/slices/ProjectSlice'; import environment from '@/environment'; import { ProjectFilesById } from '@/api/Files'; import QrcodeComponent from '@/components/QrcodeComponent'; +import { useNavigate } from 'react-router-dom'; type TaskSectionPopupPropType = { taskId: number | null; @@ -14,6 +15,7 @@ type TaskSectionPopupPropType = { const TaskSectionPopup = ({ taskId, body, feature }: TaskSectionPopupPropType) => { const dispatch = CoreModules.useAppDispatch(); + const navigate = useNavigate(); const [task_status, set_task_status] = useState('READY'); const taskModalStatus = CoreModules.useAppSelector((state) => state.project.taskModalStatus); const params = CoreModules.useParams(); @@ -69,12 +71,13 @@ const TaskSectionPopup = ({ taskId, body, feature }: TaskSectionPopupPropType) = className="hover:fmtm-text-primaryRed" onClick={() => { dispatch(ProjectActions.ToggleGenerateMbTilesModalStatus(true)); + dispatch(ProjectActions.ToggleTaskModalStatus(false)); }} /> {}} + onClick={() => navigate(`/project-submissions/${params.id}?tab=table&task_id=${taskId}`)} /> { return (
-
-

- navigate(`/project_details/${encodedId}`)} - > - {projectInfo?.title}{' '} - - > - Dashboard -

-
+ {projectDashboardLoading ? ( + + ) : ( +
+

+ navigate(`/project_details/${encodedId}`)} + > + {projectInfo?.title}{' '} + + > + Dashboard +

+
+ )}
{projectDashboardLoading ? ( diff --git a/src/frontend/src/components/createnewproject/ProjectDetailsForm.tsx b/src/frontend/src/components/createnewproject/ProjectDetailsForm.tsx index 93785541da..e3ad721b58 100644 --- a/src/frontend/src/components/createnewproject/ProjectDetailsForm.tsx +++ b/src/frontend/src/components/createnewproject/ProjectDetailsForm.tsx @@ -9,8 +9,6 @@ import useForm from '@/hooks/useForm'; import CreateProjectValidation from '@/components/createnewproject/validation/CreateProjectValidation'; import Button from '@/components/common/Button'; import { CommonActions } from '@/store/slices/CommonSlice'; -import AssetModules from '@/shared/AssetModules.js'; -import { createPopup } from '@/utilfunctions/createPopup'; import { CustomSelect } from '@/components/common/Select'; import { OrganisationService } from '@/api/CreateProjectService'; import { CustomCheckbox } from '@/components/common/Checkbox'; @@ -182,10 +180,6 @@ const ProjectDetailsForm = ({ flag }) => { setSelectedOrganisation(value); }} /> - createPopup('Create Organization', 'createOrganisation?popup=true')} - />
{errors.organisation_id && (

{errors.organisation_id}

diff --git a/src/frontend/src/models/project/projectModel.ts b/src/frontend/src/models/project/projectModel.ts index 622ad040d0..2a25e3b2f5 100644 --- a/src/frontend/src/models/project/projectModel.ts +++ b/src/frontend/src/models/project/projectModel.ts @@ -79,7 +79,6 @@ export type projectDashboardDetailTypes = { total_submission: number | null; total_contributors: number | null; last_active: string; - organisation: string; }; export type projectTaskBoundriesType = { diff --git a/src/frontend/src/views/SubmissionDetails.tsx b/src/frontend/src/views/SubmissionDetails.tsx index dff26f1c2d..ce97851142 100644 --- a/src/frontend/src/views/SubmissionDetails.tsx +++ b/src/frontend/src/views/SubmissionDetails.tsx @@ -8,10 +8,12 @@ import Button from '@/components/common/Button'; import { SubmissionActions } from '@/store/slices/SubmissionSlice'; import UpdateReviewStatusModal from '@/components/ProjectSubmissions/UpdateReviewStatusModal'; import { useAppSelector } from '@/types/reduxTypes'; +import { useNavigate } from 'react-router-dom'; const SubmissionDetails = () => { const dispatch = CoreModules.useAppDispatch(); const params = CoreModules.useParams(); + const navigate = useNavigate(); const encodedProjectId = params.projectId; const decodedProjectId = environment.decode(encodedProjectId); const taskId = params.taskId; @@ -114,6 +116,29 @@ const SubmissionDetails = () => { return (
+ {projectDashboardLoading ? ( + + ) : ( +
+

+ navigate(`/project_details/${encodedProjectId}`)} + > + {projectDashboardDetail?.project_name_prefix} + + > + navigate(`/project-submissions/${encodedProjectId}?tab=table`)} + > + Dashboard + + > + Submissions +

+
+ )}
{projectDashboardLoading ? (