From b0a6f525ffbf77f402fe8989c122a199be0d88a2 Mon Sep 17 00:00:00 2001 From: Sylvain Lafay Date: Wed, 16 Oct 2024 17:38:34 +0200 Subject: [PATCH] =?UTF-8?q?feat(breadcrumb):=20ajout=20datasheetName=20dan?= =?UTF-8?q?s=20les=20rapports=20d=C3=A9taill=C3=A9s=20(refs=20#532)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx | 2 +- .../DatasheetUploadIntegrationDialog.tsx | 9 +++++++-- .../DatasheetUploadIntegrationPage.tsx | 5 +++-- .../DatasetListTab/PyramidList/PyramidListItem.tsx | 2 +- .../DatasetListTab/VectorDbList/VectorDbListItem.tsx | 2 +- assets/modules/entrepot/breadcrumbs.ts | 6 ++++++ assets/router/RouterRenderer.tsx | 8 +++++++- assets/router/router.ts | 2 ++ 8 files changed, 28 insertions(+), 8 deletions(-) diff --git a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx index 9ee2b86d..c1b85614 100644 --- a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx @@ -342,7 +342,7 @@ const DatasheetUploadForm: FC = ({ datastoreId }) => { {addUploadMutation.isSuccess && addUploadMutation.data?._id !== undefined && ( - + )} diff --git a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx index 039847f3..c7275013 100644 --- a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx @@ -52,10 +52,11 @@ type IntegrationStatus = "at_lease_one_failure" | "proc_int_launched" | "all_suc type DatasheetUploadIntegrationDialogProps = { datastoreId: string; + datasheetName: string | undefined; uploadId: string; }; -const DatasheetUploadIntegrationDialog: FC = ({ datastoreId, uploadId }) => { +const DatasheetUploadIntegrationDialog: FC = ({ datastoreId, datasheetName, uploadId }) => { const [shouldPingIntProg, setShouldPingIntProg] = useState(true); const queryClient = useQueryClient(); @@ -210,7 +211,11 @@ const DatasheetUploadIntegrationDialog: FC = ({ datastoreId, uploadId }) => { +const DatasheetUploadIntegrationPage: FC = ({ datastoreId, uploadId, datasheetName }) => { return (

Intégration des données

- +
); diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidListItem.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidListItem.tsx index f973e970..f2e05983 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidListItem.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidListItem.tsx @@ -105,7 +105,7 @@ const PyramidListItem: FC = ({ datasheetName, datastoreId, { text: t("show_details"), iconId: "fr-icon-file-text-fill", - linkProps: routes.datastore_stored_data_details({ datastoreId, storedDataId: pyramid._id }).link, + linkProps: routes.datastore_stored_data_details({ datastoreId, datasheetName, storedDataId: pyramid._id }).link, }, { text: tCommon("delete"), diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbListItem.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbListItem.tsx index 67c25362..089f3cfa 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbListItem.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbListItem.tsx @@ -262,7 +262,7 @@ const VectorDbListItem: FC = ({ datasheetName, datastoreI { text: t("show_details"), iconId: "fr-icon-file-text-fill", - linkProps: routes.datastore_stored_data_details({ datastoreId, storedDataId: vectorDb._id }).link, + linkProps: routes.datastore_stored_data_details({ datastoreId, datasheetName, storedDataId: vectorDb._id }).link, }, { text: tCommon("delete"), diff --git a/assets/modules/entrepot/breadcrumbs.ts b/assets/modules/entrepot/breadcrumbs.ts index 951fb1c7..acd87397 100644 --- a/assets/modules/entrepot/breadcrumbs.ts +++ b/assets/modules/entrepot/breadcrumbs.ts @@ -154,6 +154,12 @@ const getBreadcrumb = (route: Route, datastore?: Datastore): Brea { label: datastore?.name, linkProps: routes.datasheet_list({ datastoreId: route.params.datastoreId }).link }, ], ]; + if ("datasheetName" in route.params && route.params.datasheetName) { + defaultProps.segments.push({ + label: route.params.datasheetName, + linkProps: routes.datastore_datasheet_view({ datastoreId: route.params.datastoreId, datasheetName: route.params.datasheetName }).link, + }); + } return { ...defaultProps, currentPageLabel: t("datastore_stored_data_details") }; case "datastore_wfs_service_new": diff --git a/assets/router/RouterRenderer.tsx b/assets/router/RouterRenderer.tsx index 0bf578fa..5e5a530b 100644 --- a/assets/router/RouterRenderer.tsx +++ b/assets/router/RouterRenderer.tsx @@ -143,7 +143,13 @@ const RouterRenderer: FC = () => { case "datastore_datasheet_upload": return ; case "datastore_datasheet_upload_integration": - return ; + return ( + + ); case "datastore_datasheet_view": return ; case "datastore_stored_data_details": diff --git a/assets/router/router.ts b/assets/router/router.ts index b659afff..8a50d07f 100644 --- a/assets/router/router.ts +++ b/assets/router/router.ts @@ -121,6 +121,7 @@ const routeDefs = { { datastoreId: param.path.string, uploadId: param.query.string, + datasheetName: param.query.optional.string, }, (p) => `${appRoot}/entrepot/${p.datastoreId}/donnees/integration` ), @@ -136,6 +137,7 @@ const routeDefs = { { datastoreId: param.path.string, storedDataId: param.path.string, + datasheetName: param.query.optional.string, }, (p) => `${appRoot}/entrepot/${p.datastoreId}/donnees/${p.storedDataId}/details` ),