Skip to content

Commit

Permalink
feat: compléter le fil d'ariane de la route de reprise d'intégration #…
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrousseau1 committed Dec 17, 2024
1 parent ed328c4 commit e299e02
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ const UnfinishedUploadList: FC<UnfinishedUploadListProps> = ({ datastoreId, uplo

<div className={fr.cx("fr-col")}>
<div className={fr.cx("fr-grid-row", "fr-grid-row--right", "fr-grid-row--middle")}>
<Button className={fr.cx("fr-mr-2w")} linkProps={routes.datastore_delivery_details({ datastoreId, uploadDataId: upload._id }).link}>
<Button
className={fr.cx("fr-mr-2w")}
linkProps={
routes.datastore_delivery_details({ datastoreId, uploadDataId: upload._id, datasheetName: upload.tags.datasheet_name }).link
}
>
{"Voir le rapport"}
</Button>
<Button iconId="fr-icon-delete-fill" priority="secondary">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ const DeliveryDetails: FC<DeliveryDetailsProps> = ({ datastoreId, uploadDataId }
{reportQuery.isLoading && <LoadingIcon className={fr.cx("fr-ml-2v")} largeIcon={true} />}
</h1>
</div>

<div className={fr.cx("fr-grid-row", "fr-grid-row--middle", "fr-mb-4w")}>
{reportQuery.isError && <Alert severity="error" closable title={reportQuery.error.message} onClose={reportQuery.refetch} />}
</div>
{reportQuery?.data?.input_upload?.name && (
<div className={fr.cx("fr-grid-row", "fr-grid-row--middle", "fr-mb-4w")}>
<h2>{reportQuery?.data?.input_upload?.name}</h2>
</div>
)}

<div className={fr.cx("fr-grid-row", "fr-grid-row--middle", "fr-mb-4w")}>
{reportQuery.isError && <Alert severity="error" closable title={reportQuery.error.message} onClose={reportQuery.refetch} />}
</div>

{reportQuery.data && (
<div className={fr.cx("fr-grid-row")}>
<div className={fr.cx("fr-col")}>
Expand Down
3 changes: 3 additions & 0 deletions assets/i18n/Breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const { i18n } = declareComponentKeys<
| "upload"
| "datastore_datasheet_upload_integration"
| "datastore_stored_data_details"
| "datastore_delivery_details"
| "datastore_wfs_service_new"
| "datastore_wfs_service_edit"
| "datastore_wms_vector_service_new"
Expand Down Expand Up @@ -74,6 +75,7 @@ export const BreadcrumbFrTranslations: Translations<"fr">["Breadcrumb"] = {
upload: "Téléversement",
datastore_datasheet_upload_integration: "Intégration de données",
datastore_stored_data_details: "Détails d'une donnée stockée",
datastore_delivery_details: "Détails d'une livraison",
datastore_wfs_service_new: "Création d'un service WFS",
datastore_wfs_service_edit: "Modification d'un service WFS",
datastore_wms_vector_service_new: "Création d'un service WMS",
Expand Down Expand Up @@ -116,6 +118,7 @@ export const BreadcrumbEnTranslations: Translations<"en">["Breadcrumb"] = {
upload: "Upload",
datastore_datasheet_upload_integration: "Data integration",
datastore_stored_data_details: "Details of stored data",
datastore_delivery_details: "Details of delivery",
datastore_wfs_service_new: "Create a WFS service",
datastore_wfs_service_edit: "Modify WFS service",
datastore_wms_vector_service_new: "Create a WMS service",
Expand Down
15 changes: 15 additions & 0 deletions assets/modules/entrepot/breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,21 @@ const getBreadcrumb = (route: Route<typeof routes>, datastore?: Datastore): Brea
});
}
return { ...defaultProps, currentPageLabel: t("datastore_stored_data_details") };
case "datastore_delivery_details":
defaultProps.segments = [
...defaultProps.segments,
...[
{ label: t("dashboard_pro"), linkProps: routes.dashboard_pro().link },
{ 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_delivery_details") };

case "datastore_wfs_service_new":
case "datastore_wfs_service_edit":
Expand Down
1 change: 1 addition & 0 deletions assets/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const routeDefs = {
{
datastoreId: param.path.string,
uploadDataId: param.path.string,
datasheetName: param.query.optional.string,
},
(p) => `${appRoot}/entrepot/${p.datastoreId}/donnees/${p.uploadDataId}/rapport`
),
Expand Down

0 comments on commit e299e02

Please sign in to comment.