From 1f8bac3897334d79a41a96ccd809bcc32c806c1e Mon Sep 17 00:00:00 2001 From: dana-cfc4 Date: Fri, 19 Dec 2025 15:11:55 +0200 Subject: [PATCH] Change projects urls --- frontend/src/App.tsx | 68 +++++++++---------- .../[year]/mlfs/workspace/page.tsx | 4 +- .../[year]/workspace/page.tsx | 2 +- .../[project_id]/approval/page.tsx | 2 +- .../[project_id]/archive/page.tsx | 2 +- .../[project_id]/compare-versions/page.tsx | 2 +- .../[project_id]/edit/page.tsx | 2 +- .../projects_listing/[project_id]/page.tsx | 2 +- .../[project_id]/post-excom-update/page.tsx | 2 +- .../[project_id]/recommend/page.tsx | 2 +- .../[project_id]/submit/page.tsx | 2 +- .../approval-summary/page.tsx | 2 +- .../app/projects_listing/associate/page.tsx | 2 +- .../blanket-approval-details/page.tsx | 2 +- .../src/app/projects_listing/create/page.tsx | 2 +- .../export/[export_type]/page.tsx | 2 +- .../app/projects_listing/settings/page.tsx | 2 +- .../summary-of-projects/page.tsx | 2 +- .../projects_listing/update-mya-data/page.tsx | 2 +- .../Blocks/ProjectSubmissions/schema.tsx | 6 +- .../manage/Blocks/Projects/schema.tsx | 16 +++-- .../ApprovalSummary/ApprovalSummary.tsx | 2 +- .../create/EnterpriseCreateActionButtons.tsx | 4 +- .../create/EnterpriseCreateWrapper.tsx | 4 +- .../Enterprises/edit/EnterpriseEdit.tsx | 2 +- .../edit/EnterpriseEditActionButtons.tsx | 4 +- .../edit/EnterpriseEditWrapper.tsx | 4 +- .../listing/EnterprisesWrapper.tsx | 4 +- .../Enterprises/listing/schema.tsx | 8 +-- .../Enterprises/view/EnterpriseWrapper.tsx | 11 ++- .../ProjectsListing/HelperComponents.tsx | 4 +- .../ProjectSubmission/AddComponentModal.tsx | 4 +- .../ProjectSubmission/CancelWarningModal.tsx | 2 +- .../ProjectSubmission/ChangeVersionModal.tsx | 2 +- .../ProjectSubmission/CreateActionButtons.tsx | 4 +- .../ProjectSubmission/EditActionButtons.tsx | 12 ++-- .../ProjectSubmission/ProjectsHeader.tsx | 2 +- .../ProjectVersionsComponents.tsx | 5 +- .../ProjectView/ProjectViewWrapper.tsx | 8 +-- .../ProjectsAssociateConfirmation.tsx | 2 +- .../ProjectsAssociateWrapper.tsx | 2 +- .../ProjectsCreate/ProjectsCreateWrapper.tsx | 2 +- .../ProjectsEdit/ProjectsApprovalWrapper.tsx | 2 +- .../ProjectsEdit/ProjectsEdit.tsx | 2 +- .../ProjectsEdit/ProjectsEditWrapper.tsx | 4 +- .../ProjectsPostExComUpdateWrapper.tsx | 2 +- .../create/PEnterpriseCreateActionButtons.tsx | 4 +- .../create/PEnterpriseCreateWrapper.tsx | 4 +- .../edit/PEnterpriseEdit.tsx | 2 +- .../edit/PEnterpriseEditActionButtons.tsx | 6 +- .../edit/PEnterpriseEditWrapper.tsx | 4 +- .../listing/PEnterprisesWrapper.tsx | 4 +- .../view/PEnterpriseViewWrapper.tsx | 10 ++- .../ProjectsListing/GenerateDBMenu.tsx | 12 ++-- .../ProjectsListing/PListingWrapper.tsx | 6 +- .../ProjectsListing/ProjectCard.tsx | 4 +- .../ProjectsListing/ProjectViewButtons.tsx | 10 +-- .../ProjectsListing/schema.tsx | 4 +- .../ProjectsVersionChange.tsx | 8 +-- .../ProjectsVersionChangeWrapper.tsx | 2 +- .../UpdateMyaData/UpdateMyaData.tsx | 2 +- .../manage/Blocks/ProjectsListing/utils.ts | 8 +-- .../Blocks/Table/ProjectsTable/schema.tsx | 5 +- .../theme/Header/HeaderNavigation.tsx | 8 +-- 64 files changed, 165 insertions(+), 168 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 2eeeb95e6..fc6b37796 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -114,7 +114,7 @@ function RedirectToSection() { return } if (isOnlyProjectsUser) { - return + return } return } @@ -281,156 +281,156 @@ export default function App() { */} - {/* + {/* - + */} - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/frontend/src/app/annual-project-report/[year]/mlfs/workspace/page.tsx b/frontend/src/app/annual-project-report/[year]/mlfs/workspace/page.tsx index 18e674fd8..3a5250db3 100644 --- a/frontend/src/app/annual-project-report/[year]/mlfs/workspace/page.tsx +++ b/frontend/src/app/annual-project-report/[year]/mlfs/workspace/page.tsx @@ -360,7 +360,7 @@ export default function APRMLFSWorkspace() { return ( {/* "~" means absolute, outside the nested context */} - + {`Secretariat - Annual Project Report Workspace`} @@ -449,7 +449,7 @@ export default function APRMLFSWorkspace() { )} -
+
{/* Filters section */}
diff --git a/frontend/src/app/annual-project-report/[year]/workspace/page.tsx b/frontend/src/app/annual-project-report/[year]/workspace/page.tsx index 6702334bb..56697fbb0 100644 --- a/frontend/src/app/annual-project-report/[year]/workspace/page.tsx +++ b/frontend/src/app/annual-project-report/[year]/workspace/page.tsx @@ -95,7 +95,7 @@ export default function APRWorkspace() { return ( {/* "~" means absolute, outside the nested context */} - +
{`Annual Progress Report workspace`} diff --git a/frontend/src/app/projects_listing/[project_id]/approval/page.tsx b/frontend/src/app/projects_listing/[project_id]/approval/page.tsx index 48ad7776e..44d742b76 100644 --- a/frontend/src/app/projects_listing/[project_id]/approval/page.tsx +++ b/frontend/src/app/projects_listing/[project_id]/approval/page.tsx @@ -14,7 +14,7 @@ export default function ProjectsApprovalUpdatePage() { const { canApproveProjects } = useContext(PermissionsContext) if (!canApproveProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/[project_id]/archive/page.tsx b/frontend/src/app/projects_listing/[project_id]/archive/page.tsx index 1eb454c03..f067c78e4 100644 --- a/frontend/src/app/projects_listing/[project_id]/archive/page.tsx +++ b/frontend/src/app/projects_listing/[project_id]/archive/page.tsx @@ -14,7 +14,7 @@ export default function Project() { const { canViewProjects } = useContext(PermissionsContext) if (!canViewProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/[project_id]/compare-versions/page.tsx b/frontend/src/app/projects_listing/[project_id]/compare-versions/page.tsx index b5f218074..d8e42f18f 100644 --- a/frontend/src/app/projects_listing/[project_id]/compare-versions/page.tsx +++ b/frontend/src/app/projects_listing/[project_id]/compare-versions/page.tsx @@ -14,7 +14,7 @@ export default function SubmitProject() { const { canViewProjects } = useContext(PermissionsContext) if (!canViewProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/[project_id]/edit/page.tsx b/frontend/src/app/projects_listing/[project_id]/edit/page.tsx index bd4044d32..37684f8f6 100644 --- a/frontend/src/app/projects_listing/[project_id]/edit/page.tsx +++ b/frontend/src/app/projects_listing/[project_id]/edit/page.tsx @@ -26,7 +26,7 @@ export default function EditProject({ mode }: { mode: string }) { (mode === 'edit' && !canEditProjects) || (mode !== 'edit' && !canUpdateProjects) ) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/[project_id]/page.tsx b/frontend/src/app/projects_listing/[project_id]/page.tsx index 66c5a6027..50a041006 100644 --- a/frontend/src/app/projects_listing/[project_id]/page.tsx +++ b/frontend/src/app/projects_listing/[project_id]/page.tsx @@ -15,7 +15,7 @@ export default function Project() { const { canViewProjects } = useContext(PermissionsContext) if (!canViewProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/[project_id]/post-excom-update/page.tsx b/frontend/src/app/projects_listing/[project_id]/post-excom-update/page.tsx index d26112ea0..885efb9fc 100644 --- a/frontend/src/app/projects_listing/[project_id]/post-excom-update/page.tsx +++ b/frontend/src/app/projects_listing/[project_id]/post-excom-update/page.tsx @@ -14,7 +14,7 @@ export default function PostExComUpdateProject() { const { canUpdatePostExcom } = useContext(PermissionsContext) if (!canUpdatePostExcom) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/[project_id]/recommend/page.tsx b/frontend/src/app/projects_listing/[project_id]/recommend/page.tsx index ab0f89d33..21943d186 100644 --- a/frontend/src/app/projects_listing/[project_id]/recommend/page.tsx +++ b/frontend/src/app/projects_listing/[project_id]/recommend/page.tsx @@ -15,7 +15,7 @@ export default function RecommendProject() { useContext(PermissionsContext) if (!canViewProjects || !canRecommendProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/[project_id]/submit/page.tsx b/frontend/src/app/projects_listing/[project_id]/submit/page.tsx index 3cdb40b4e..5dc3d3840 100644 --- a/frontend/src/app/projects_listing/[project_id]/submit/page.tsx +++ b/frontend/src/app/projects_listing/[project_id]/submit/page.tsx @@ -14,7 +14,7 @@ export default function SubmitProject() { const { canViewProjects, canSubmitProjects } = useContext(PermissionsContext) if (!canViewProjects || !canSubmitProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/approval-summary/page.tsx b/frontend/src/app/projects_listing/approval-summary/page.tsx index 8bc2b5115..8766e3ce5 100644 --- a/frontend/src/app/projects_listing/approval-summary/page.tsx +++ b/frontend/src/app/projects_listing/approval-summary/page.tsx @@ -18,7 +18,7 @@ export default function Projects() { const { canApproveProjects } = useContext(PermissionsContext) if (!canApproveProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/associate/page.tsx b/frontend/src/app/projects_listing/associate/page.tsx index 4fd735fbb..bcf0d0506 100644 --- a/frontend/src/app/projects_listing/associate/page.tsx +++ b/frontend/src/app/projects_listing/associate/page.tsx @@ -15,7 +15,7 @@ export default function ProjectsAssociationPage() { useContext(PermissionsContext) if (!canViewProjects || !canAssociateProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/blanket-approval-details/page.tsx b/frontend/src/app/projects_listing/blanket-approval-details/page.tsx index 8334ca7ae..2e7ee0b9a 100644 --- a/frontend/src/app/projects_listing/blanket-approval-details/page.tsx +++ b/frontend/src/app/projects_listing/blanket-approval-details/page.tsx @@ -18,7 +18,7 @@ export default function Projects() { const { canViewProjects } = useContext(PermissionsContext) if (!canViewProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/create/page.tsx b/frontend/src/app/projects_listing/create/page.tsx index 7ded988a4..7b0253986 100644 --- a/frontend/src/app/projects_listing/create/page.tsx +++ b/frontend/src/app/projects_listing/create/page.tsx @@ -12,7 +12,7 @@ export default function CreateProject() { const { canUpdateProjects } = useContext(PermissionsContext) if (!canUpdateProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/export/[export_type]/page.tsx b/frontend/src/app/projects_listing/export/[export_type]/page.tsx index 03c7f8198..c53e2ee5f 100644 --- a/frontend/src/app/projects_listing/export/[export_type]/page.tsx +++ b/frontend/src/app/projects_listing/export/[export_type]/page.tsx @@ -26,7 +26,7 @@ export default function Projects() { const { canViewProjects } = useContext(PermissionsContext) if (!canViewProjects || !['mya', 'all'].includes(export_type)) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/settings/page.tsx b/frontend/src/app/projects_listing/settings/page.tsx index 325a3b4ac..3baa8479c 100644 --- a/frontend/src/app/projects_listing/settings/page.tsx +++ b/frontend/src/app/projects_listing/settings/page.tsx @@ -16,7 +16,7 @@ export default function ProjectsSettingsWrapper() { const { canSetProjectSettings } = useContext(PermissionsContext) if (!canSetProjectSettings) { - return + return } const { data, setParams } = useGetProjectSettings() diff --git a/frontend/src/app/projects_listing/summary-of-projects/page.tsx b/frontend/src/app/projects_listing/summary-of-projects/page.tsx index fe53446f2..bdb9a8cfa 100644 --- a/frontend/src/app/projects_listing/summary-of-projects/page.tsx +++ b/frontend/src/app/projects_listing/summary-of-projects/page.tsx @@ -18,7 +18,7 @@ export default function Projects() { const { canApproveProjects } = useContext(PermissionsContext) if (!canApproveProjects) { - return + return } return ( diff --git a/frontend/src/app/projects_listing/update-mya-data/page.tsx b/frontend/src/app/projects_listing/update-mya-data/page.tsx index 44d94e709..3bf2226c7 100644 --- a/frontend/src/app/projects_listing/update-mya-data/page.tsx +++ b/frontend/src/app/projects_listing/update-mya-data/page.tsx @@ -25,7 +25,7 @@ export default function ProjectsUpdateMyaDataPage() { {!!metaproject_id && ( )}
diff --git a/frontend/src/components/manage/Blocks/ProjectSubmissions/schema.tsx b/frontend/src/components/manage/Blocks/ProjectSubmissions/schema.tsx index aa3c3acbc..3f18da991 100644 --- a/frontend/src/components/manage/Blocks/ProjectSubmissions/schema.tsx +++ b/frontend/src/components/manage/Blocks/ProjectSubmissions/schema.tsx @@ -41,7 +41,7 @@ export function usePSListingGridOptions() { return ( {props.value} @@ -224,7 +224,9 @@ export function usePSListingGridOptions() { }, }, cellRenderer: (props: any) => { - const subsectorNames = props.data.subsectors?.map((s: ProjectSubSectorType) => s.name).join(",") + const subsectorNames = props.data.subsectors + ?.map((s: ProjectSubSectorType) => s.name) + .join(',') return }, field: 'subsectors', diff --git a/frontend/src/components/manage/Blocks/Projects/schema.tsx b/frontend/src/components/manage/Blocks/Projects/schema.tsx index 3c2d5ffa2..449141557 100644 --- a/frontend/src/components/manage/Blocks/Projects/schema.tsx +++ b/frontend/src/components/manage/Blocks/Projects/schema.tsx @@ -47,7 +47,7 @@ export function usePListingGridOptions() { return ( {props.value} @@ -230,7 +230,9 @@ export function usePListingGridOptions() { }, }, cellRenderer: (props: any) => { - const subsectorNames = props.data.subsectors?.map((s: ProjectSubSectorType) => s.name).join(",") + const subsectorNames = props.data.subsectors + ?.map((s: ProjectSubSectorType) => s.name) + .join(',') return }, field: 'subsectors', @@ -346,11 +348,11 @@ export function usePListingGridOptions() { style={ status ? { - backgroundColor: status.color, - color: getContrastText({ - background: status.color, - }), - } + backgroundColor: status.color, + color: getContrastText({ + background: status.color, + }), + } : {} } > diff --git a/frontend/src/components/manage/Blocks/ProjectsListing/ApprovalSummary/ApprovalSummary.tsx b/frontend/src/components/manage/Blocks/ProjectsListing/ApprovalSummary/ApprovalSummary.tsx index 25d73b4e4..6a8d11c3e 100644 --- a/frontend/src/components/manage/Blocks/ProjectsListing/ApprovalSummary/ApprovalSummary.tsx +++ b/frontend/src/components/manage/Blocks/ProjectsListing/ApprovalSummary/ApprovalSummary.tsx @@ -45,7 +45,7 @@ const ApprovalSummaryPreviewTable = (props: { return ( {params.data?.code} diff --git a/frontend/src/components/manage/Blocks/ProjectsListing/Enterprises/create/EnterpriseCreateActionButtons.tsx b/frontend/src/components/manage/Blocks/ProjectsListing/Enterprises/create/EnterpriseCreateActionButtons.tsx index bfeef8412..be6306018 100644 --- a/frontend/src/components/manage/Blocks/ProjectsListing/Enterprises/create/EnterpriseCreateActionButtons.tsx +++ b/frontend/src/components/manage/Blocks/ProjectsListing/Enterprises/create/EnterpriseCreateActionButtons.tsx @@ -32,7 +32,7 @@ const EnterpriseCreateActionButtons = ({ }) setEnterpriseId(result.id) - setLocation(`/projects-listing/enterprises/${result.id}/edit`) + setLocation(`/projects/enterprises/${result.id}/edit`) } catch (error) { await handleErrors(error, setEnterpriseId, setErrors, setOtherErrors) } finally { @@ -43,7 +43,7 @@ const EnterpriseCreateActionButtons = ({ return (
- + {canEditEnterprise && ( { const nonFieldsErrors = errors?.['non_field_errors'] || [] if (!canEditEnterprise) { - return + return } return ( @@ -50,7 +50,7 @@ const EnterpriseCreateWrapper = () => { /> { /> Could not change enterprise status. Please try again., @@ -111,7 +111,7 @@ const EnterpriseEditActionButtons = ({ return ( <>
- + {canEditEnterprise && !isObsolete && (
- + {(canEditEnterprise || canApproveEnterprise) && data.status !== 'Obsolete' && ( (
- +
IA/BA Portal @@ -325,7 +325,7 @@ export const RelatedProjects = ({ '!text-[#801F00]': hasErrors, }, )} - href={`/projects-listing/${entry.id}${['edit', 'tranches'].includes(mode) ? '/edit' : ''}`} + href={`/projects/${entry.id}${['edit', 'tranches'].includes(mode) ? '/edit' : ''}`} target="_blank" rel="noopener noreferrer nofollow" onClick={(e: React.SyntheticEvent) => e.stopPropagation()} diff --git a/frontend/src/components/manage/Blocks/ProjectsListing/ProjectSubmission/AddComponentModal.tsx b/frontend/src/components/manage/Blocks/ProjectsListing/ProjectSubmission/AddComponentModal.tsx index 993e0eff4..5ff66cfbb 100644 --- a/frontend/src/components/manage/Blocks/ProjectsListing/ProjectSubmission/AddComponentModal.tsx +++ b/frontend/src/components/manage/Blocks/ProjectsListing/ProjectSubmission/AddComponentModal.tsx @@ -26,7 +26,7 @@ const AddComponentModal = ({ className="no-underline" target="_blank" rel="noopener noreferrer nofollow" - href={`/projects-listing/create/${id}/full-copy/additional-component`} + href={`/projects/create/${id}/full-copy/additional-component`} >