diff --git a/assets/@types/app.ts b/assets/@types/app.ts index de75e8f9..cfd3e2d1 100644 --- a/assets/@types/app.ts +++ b/assets/@types/app.ts @@ -82,7 +82,7 @@ export enum DatasheetDocumentTypeEnum { export type DatasheetDetailed = Datasheet & { vector_db_list: VectorDb[] | undefined; - pyramid_list: Pyramid[] | undefined; + pyramid_vector_list: PyramidVector[] | undefined; upload_list: Upload[] | undefined; service_list: Service[] | undefined; }; @@ -107,7 +107,7 @@ export type VectorDb = StoredData & { }; /** stored_data (donnée stockée) du type ROK4-PYRAMID-VECTOR */ -export type Pyramid = StoredData & { +export type PyramidVector = StoredData & { type: StoredDataPrivateDetailResponseDtoTypeEnum.ROK4PYRAMIDVECTOR; tags: { datasheet_name?: string; diff --git a/assets/components/Layout/DatastoreLayout.tsx b/assets/components/Layout/DatastoreLayout.tsx index ce7e7b33..89014b74 100644 --- a/assets/components/Layout/DatastoreLayout.tsx +++ b/assets/components/Layout/DatastoreLayout.tsx @@ -2,7 +2,7 @@ import { BreadcrumbProps } from "@codegouvfr/react-dsfr/Breadcrumb"; import { useQuery } from "@tanstack/react-query"; import { FC, PropsWithChildren, memo, useMemo } from "react"; -import { Datastore } from "../../@types/app"; +import type { Datastore } from "../../@types/app"; import { datastoreNavItems } from "../../config/datastoreNavItems"; import api from "../../entrepot/api"; import RQKeys from "../../modules/entrepot/RQKeys"; diff --git a/assets/components/Utils/TextWithLink.tsx b/assets/components/Utils/TextWithLink.tsx deleted file mode 100644 index e10b54dd..00000000 --- a/assets/components/Utils/TextWithLink.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { FC } from "react"; - -type TextWithLinkProps = { - text: string; - linkText: string; - linkHref: string; -}; -const TextWithLink: FC = ({ text, linkText, linkHref }) => { - return ( - <> - {text}  - - {linkText} - - - ); -}; - -export default TextWithLink; diff --git a/assets/entrepot/api/index.ts b/assets/entrepot/api/index.ts index 03be498b..a61d3d07 100644 --- a/assets/entrepot/api/index.ts +++ b/assets/entrepot/api/index.ts @@ -9,7 +9,7 @@ import community from "./community"; import user from "./user"; import wfs from "./wfs"; import wmsVector from "./wms-vector"; -import pyramid from "./pyramid"; +import pyramidVector from "./pyramidVector"; import service from "./service"; import epsg from "./epsg"; import annexe from "./annexe"; @@ -31,7 +31,7 @@ const api = { user, wfs, wmsVector, - pyramid, + pyramidVector, service, annexe, style, diff --git a/assets/entrepot/api/pyramid.ts b/assets/entrepot/api/pyramidVector.ts similarity index 91% rename from assets/entrepot/api/pyramid.ts rename to assets/entrepot/api/pyramidVector.ts index 7e1f5654..072f34ed 100644 --- a/assets/entrepot/api/pyramid.ts +++ b/assets/entrepot/api/pyramidVector.ts @@ -3,7 +3,7 @@ import { jsonFetch } from "../../modules/jsonFetch"; import { Service } from "../../@types/app"; const add = (datastoreId: string, formData: FormData | object) => { - const url = SymfonyRouting.generate("cartesgouvfr_api_pyramid_add", { datastoreId }); + const url = SymfonyRouting.generate("cartesgouvfr_api_pyramid_vector_add", { datastoreId }); return jsonFetch( url, { @@ -18,7 +18,7 @@ const add = (datastoreId: string, formData: FormData | object) => { }; const publish = (datastoreId: string, pyramidId: string, formData: FormData | object) => { - const url = SymfonyRouting.generate("cartesgouvfr_api_pyramid_tms_add", { datastoreId, pyramidId }); + const url = SymfonyRouting.generate("cartesgouvfr_api_pyramid_vector_tms_add", { datastoreId, pyramidId }); return jsonFetch( url, { @@ -33,7 +33,7 @@ const publish = (datastoreId: string, pyramidId: string, formData: FormData | ob }; const publishEdit = (datastoreId: string, pyramidId: string, offeringId: string, formData: FormData | object) => { - const url = SymfonyRouting.generate("cartesgouvfr_api_pyramid_tms_edit", { datastoreId, pyramidId, offeringId }); + const url = SymfonyRouting.generate("cartesgouvfr_api_pyramid_vector_tms_edit", { datastoreId, pyramidId, offeringId }); return jsonFetch( url, { diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/DatasetListTab.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/DatasetListTab.tsx index 1e87ed88..9e8786f3 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/DatasetListTab.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/DatasetListTab.tsx @@ -3,9 +3,9 @@ import Button from "@codegouvfr/react-dsfr/Button"; import { FC, memo, useMemo } from "react"; import { symToStr } from "tsafe/symToStr"; -import { routes } from "../../../../../router/router"; import { type DatasheetDetailed } from "../../../../../@types/app"; -import PyramidList from "./PyramidList/PyramidList"; +import { routes } from "../../../../../router/router"; +import PyramidVectorList from "./PyramidVectorList/PyramidVectorList"; import UnfinishedUploadList from "./UnfinishedUploadList"; import VectorDbList from "./VectorDbList/VectorDbList"; @@ -52,7 +52,7 @@ const DatasetListTab: FC = ({ datastoreId, datasheet }) => {
- +
diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidList.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidList.tsx deleted file mode 100644 index 41d6fce8..00000000 --- a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidList.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { fr } from "@codegouvfr/react-dsfr"; -import { FC, memo } from "react"; -import { symToStr } from "tsafe/symToStr"; - -import { Pyramid } from "../../../../../../@types/app"; -import PyramidListItem from "./PyramidListItem"; - -type PyramidListProps = { - datasheetName: string; - datastoreId: string; - pyramidList: Pyramid[] | undefined; -}; - -const PyramidList: FC = ({ datasheetName, datastoreId, pyramidList }) => { - return ( - <> -
-
- -  Pyramides de tuiles vectorielles ({pyramidList?.length}) -
-
- {pyramidList?.map((pyramid) => )} - - ); -}; - -PyramidList.displayName = symToStr({ PyramidList }); - -export default memo(PyramidList); diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidDesc.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorDesc.tsx similarity index 93% rename from assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidDesc.tsx rename to assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorDesc.tsx index ba77e7f4..ff53309e 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidDesc.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorDesc.tsx @@ -3,16 +3,16 @@ import Badge from "@codegouvfr/react-dsfr/Badge"; import { UseQueryResult, useQuery } from "@tanstack/react-query"; import { FC, memo, useMemo } from "react"; -import api from "../../../../../api"; +import { PyramidVector, VectorDb } from "../../../../../../@types/app"; +import { OfferingListResponseDto, ProcessingExecutionStoredDataDto } from "../../../../../../@types/entrepot"; import LoadingText from "../../../../../../components/Utils/LoadingText"; import RQKeys from "../../../../../../modules/entrepot/RQKeys"; -import { Pyramid, VectorDb } from "../../../../../../@types/app"; -import { OfferingListResponseDto, ProcessingExecutionStoredDataDto } from "../../../../../../@types/entrepot"; import { offeringTypeDisplayName } from "../../../../../../utils"; +import api from "../../../../../api"; -type PyramidDescProps = { +type PyramidVectorDescProps = { datastoreId: string; - pyramid: Pyramid; + pyramid: PyramidVector; dataUsesQuery: UseQueryResult< { stored_data_list: ProcessingExecutionStoredDataDto[]; @@ -22,7 +22,7 @@ type PyramidDescProps = { >; }; -const PyramidDesc: FC = ({ datastoreId, pyramid, dataUsesQuery }) => { +const PyramidVectorDesc: FC = ({ datastoreId, pyramid, dataUsesQuery }) => { const vectorDbUsedId = useMemo(() => pyramid.tags.vectordb_id, [pyramid.tags.vectordb_id]); const vectorDbUsedQuery = useQuery({ @@ -82,4 +82,4 @@ const PyramidDesc: FC = ({ datastoreId, pyramid, dataUsesQuery ); }; -export default memo(PyramidDesc); +export default memo(PyramidVectorDesc); diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorList.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorList.tsx new file mode 100644 index 00000000..e53c737f --- /dev/null +++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorList.tsx @@ -0,0 +1,32 @@ +import { fr } from "@codegouvfr/react-dsfr"; +import { FC, memo } from "react"; +import { symToStr } from "tsafe/symToStr"; + +import { PyramidVector } from "../../../../../../@types/app"; +import PyramidVectorListItem from "./PyramidVectorListItem"; + +type PyramidVectorListProps = { + datasheetName: string; + datastoreId: string; + pyramidList: PyramidVector[] | undefined; +}; + +const PyramidVectorList: FC = ({ datasheetName, datastoreId, pyramidList }) => { + return ( + <> +
+
+ +  Pyramides de tuiles vectorielles ({pyramidList?.length}) +
+
+ {pyramidList?.map((pyramid) => ( + + ))} + + ); +}; + +PyramidVectorList.displayName = symToStr({ PyramidVectorList }); + +export default memo(PyramidVectorList); diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidListItem.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorListItem.tsx similarity index 90% rename from assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidListItem.tsx rename to assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorListItem.tsx index f973e970..e428bff3 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidListItem.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorListItem.tsx @@ -7,6 +7,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { FC, memo, useMemo } from "react"; import { createPortal } from "react-dom"; +import { PyramidVector, StoredDataStatusEnum } from "../../../../../../@types/app"; import StoredDataStatusBadge from "../../../../../../components/Utils/Badges/StoredDataStatusBadge"; import LoadingIcon from "../../../../../../components/Utils/LoadingIcon"; import LoadingText from "../../../../../../components/Utils/LoadingText"; @@ -16,21 +17,20 @@ import useToggle from "../../../../../../hooks/useToggle"; import { Translations, declareComponentKeys, getTranslation, useTranslation } from "../../../../../../i18n/i18n"; import RQKeys from "../../../../../../modules/entrepot/RQKeys"; import { routes } from "../../../../../../router/router"; -import { Pyramid, StoredDataStatusEnum } from "../../../../../../@types/app"; import { formatDateFromISO, offeringTypeDisplayName } from "../../../../../../utils"; import api from "../../../../../api"; -import PyramidDesc from "./PyramidDesc"; +import PyramidVectorDesc from "./PyramidVectorDesc"; -type PyramidListItemProps = { +type PyramidVectorListItemProps = { datasheetName: string; - pyramid: Pyramid; + pyramid: PyramidVector; datastoreId: string; }; const { t: tCommon } = getTranslation("Common"); -const PyramidListItem: FC = ({ datasheetName, datastoreId, pyramid }) => { - const { t } = useTranslation({ PyramidListItem }); +const PyramidVectorListItem: FC = ({ datasheetName, datastoreId, pyramid }) => { + const { t } = useTranslation({ PyramidVectorListItem }); const [showDescription, toggleShowDescription] = useToggle(false); @@ -77,6 +77,11 @@ const PyramidListItem: FC = ({ datasheetName, datastoreId, onClick={toggleShowDescription} /> {pyramid.name} + {pyramid.tags?.is_sample === "true" && ( + + Echantillon + + )} @@ -117,7 +122,7 @@ const PyramidListItem: FC = ({ datasheetName, datastoreId, - {showDescription && } + {showDescription && } {deletePyramidMutation.error && ( = ({ datasheetName, datastoreId, ); }; -export default memo(PyramidListItem); +export default memo(PyramidVectorListItem); // traductions export const { i18n } = declareComponentKeys< @@ -192,10 +197,10 @@ export const { i18n } = declareComponentKeys< | "following_services_deleted" | { K: "error_deleting"; P: { pyramidName: string }; R: string } >()({ - PyramidListItem, + PyramidVectorListItem, }); -export const PyramidListItemFrTranslations: Translations<"fr">["PyramidListItem"] = { +export const PyramidVectorListItemFrTranslations: Translations<"fr">["PyramidVectorListItem"] = { show_linked_datas: "Voir les données liées", other_actions: "Autres actions", show_details: "Voir les détails", @@ -205,7 +210,7 @@ export const PyramidListItemFrTranslations: Translations<"fr">["PyramidListItem" error_deleting: ({ pyramidName }) => `La suppression de la pyramide ${pyramidName} a échoué`, }; -export const PyramidListItemEnTranslations: Translations<"en">["PyramidListItem"] = { +export const PyramidVectorListItemEnTranslations: Translations<"en">["PyramidVectorListItem"] = { show_linked_datas: "Show linked datas", other_actions: "Other actions", show_details: "Show details", diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbDesc.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbDesc.tsx index 94ef6dac..ab5c2eea 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbDesc.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbDesc.tsx @@ -3,9 +3,9 @@ import Badge from "@codegouvfr/react-dsfr/Badge"; import { UseQueryResult } from "@tanstack/react-query"; import { FC, memo, useMemo } from "react"; -import LoadingText from "../../../../../../components/Utils/LoadingText"; import { StoredDataStatusEnum, StoredDataTypeEnum } from "../../../../../../@types/app"; import { OfferingListResponseDto, ProcessingExecutionStoredDataDto } from "../../../../../../@types/entrepot"; +import LoadingText from "../../../../../../components/Utils/LoadingText"; import { offeringTypeDisplayName } from "../../../../../../utils"; type VectorDbDescProps = { diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView.tsx index 55624a97..01d9e27a 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView.tsx @@ -166,7 +166,7 @@ const DatasheetView: FC = ({ datastoreId, datasheetName }) = }, { label: t("tab_label.datasets", { - num: (datasheetQuery.data?.vector_db_list?.length || 0) + (datasheetQuery.data?.pyramid_list?.length || 0), + num: (datasheetQuery.data?.vector_db_list?.length || 0) + (datasheetQuery.data?.pyramid_vector_list?.length || 0), }), tabId: DatasheetViewActiveTabEnum.Dataset, }, @@ -237,8 +237,8 @@ const DatasheetView: FC = ({ datastoreId, datasheetName }) = {datasheetQuery?.data?.vector_db_list?.length && datasheetQuery?.data?.vector_db_list.length > 0 ? (
  • {datasheetQuery?.data?.vector_db_list.length} base(s) de données
  • ) : null} - {datasheetQuery?.data?.pyramid_list?.length && datasheetQuery?.data?.pyramid_list.length > 0 ? ( -
  • {datasheetQuery?.data?.pyramid_list.length} pyramide(s) de tuiles vectorielles
  • + {datasheetQuery?.data?.pyramid_vector_list?.length && datasheetQuery?.data?.pyramid_vector_list.length > 0 ? ( +
  • {datasheetQuery?.data?.pyramid_vector_list.length} pyramide(s) de tuiles vectorielles
  • ) : null} {datasheetQuery?.data?.service_list?.length && datasheetQuery?.data?.service_list.length > 0 ? (
  • {datasheetQuery?.data?.service_list.length} service(s) publié(s)
  • @@ -249,7 +249,7 @@ const DatasheetView: FC = ({ datastoreId, datasheetName }) = {metadataQuery.data &&
  • La métadonnée associée ({metadataQuery.data.file_identifier})
  • } - {/* TODO : pyramides tuiles vectorielles, raster, métadonnées etc... */} + {/* TODO : pyramides tuiles raster, documents etc... */} , document.body diff --git a/assets/entrepot/pages/datasheet/DatasheetView/MetadataTab/MetadataTab.tsx b/assets/entrepot/pages/datasheet/DatasheetView/MetadataTab/MetadataTab.tsx index ef864fb5..9f57514f 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/MetadataTab/MetadataTab.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/MetadataTab/MetadataTab.tsx @@ -41,8 +41,8 @@ const MetadataTab: FC = ({ datastoreId, datasheet, metadataQue }, [metadata]); const storedDataList: StoredData[] = useMemo( - () => [...(datasheet?.vector_db_list ?? []), ...(datasheet?.pyramid_list ?? [])], - [datasheet?.vector_db_list, datasheet?.pyramid_list] + () => [...(datasheet?.vector_db_list ?? []), ...(datasheet?.pyramid_vector_list ?? [])], + [datasheet?.vector_db_list, datasheet?.pyramid_vector_list] ); const catalogueDatasheetUrl = useMemo(() => { diff --git a/assets/entrepot/pages/datasheet/DatasheetView/ServiceListTab/ServiceDesc.tsx b/assets/entrepot/pages/datasheet/DatasheetView/ServiceListTab/ServiceDesc.tsx index 869d2bcc..5973f7a4 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/ServiceListTab/ServiceDesc.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/ServiceListTab/ServiceDesc.tsx @@ -5,7 +5,7 @@ import { FC, useMemo } from "react"; import api from "../../../../api"; import LoadingText from "../../../../../components/Utils/LoadingText"; import RQKeys from "../../../../../modules/entrepot/RQKeys"; -import { ConfigurationTypeEnum, Pyramid, Service, VectorDb } from "../../../../../@types/app"; +import { ConfigurationTypeEnum, PyramidVector, Service, VectorDb } from "../../../../../@types/app"; type ServiceDescProps = { service: Service; @@ -30,7 +30,7 @@ const ServiceDesc: FC = ({ service, datastoreId }) => { if (pyramidUsedId === undefined) { return Promise.reject(); } - return api.storedData.get(datastoreId, pyramidUsedId, { signal }); + return api.storedData.get(datastoreId, pyramidUsedId, { signal }); }, staleTime: 600000, enabled: !!pyramidUsedId, diff --git a/assets/entrepot/pages/service/metadatas/AdditionalInfo.tsx b/assets/entrepot/pages/service/metadatas/AdditionalInfo.tsx index 876fbbc7..ea2a8866 100644 --- a/assets/entrepot/pages/service/metadatas/AdditionalInfo.tsx +++ b/assets/entrepot/pages/service/metadatas/AdditionalInfo.tsx @@ -4,7 +4,7 @@ import Select from "@codegouvfr/react-dsfr/Select"; import { FC, useMemo } from "react"; import { Controller, UseFormReturn } from "react-hook-form"; -import type { Pyramid, ServiceFormValuesBaseType, VectorDb } from "../../../../@types/app"; +import type { PyramidVector, ServiceFormValuesBaseType, VectorDb } from "../../../../@types/app"; import AutocompleteSelect from "../../../../components/Input/AutocompleteSelect"; import ignProducts from "../../../../data/md_resolutions.json"; import { getTranslation } from "../../../../i18n/i18n"; @@ -28,7 +28,7 @@ import { LanguageType, charsets, getLanguages } from "../../../../utils"; // }; type AdditionalInfoProps = { - storedData: VectorDb | Pyramid; + storedData: VectorDb | PyramidVector; visible: boolean; form: UseFormReturn; datastoreId: string; diff --git a/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx b/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx index 85c7b8b8..8b01c7a5 100644 --- a/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx +++ b/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx @@ -4,7 +4,7 @@ import Button from "@codegouvfr/react-dsfr/Button"; import ButtonsGroup from "@codegouvfr/react-dsfr/ButtonsGroup"; import Stepper from "@codegouvfr/react-dsfr/Stepper"; import { yupResolver } from "@hookform/resolvers/yup"; -import { useQuery } from "@tanstack/react-query"; +import { useQuery, useQueryClient } from "@tanstack/react-query"; import { FC, useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import * as yup from "yup"; @@ -84,6 +84,8 @@ const PyramidVectorGenerateForm: FC = ({ datastoreId, vec /* l'etape courante */ const [currentStep, setCurrentStep] = useState(STEPS.TABLES_SELECTION); + const queryClient = useQueryClient(); + const vectorDbQuery = useQuery({ queryKey: RQKeys.datastore_stored_data(datastoreId, vectorDbId), queryFn: () => api.storedData.get(datastoreId, vectorDbId), @@ -137,10 +139,13 @@ const PyramidVectorGenerateForm: FC = ({ datastoreId, vec setIsSubmitting(true); - api.pyramid + api.pyramidVector .add(datastoreId, formatted) .then(() => { if (vectorDbQuery.data?.tags?.datasheet_name) { + queryClient.invalidateQueries({ + queryKey: RQKeys.datastore_datasheet(datastoreId, vectorDbQuery.data?.tags.datasheet_name), + }); routes.datastore_datasheet_view({ datastoreId, datasheetName: vectorDbQuery.data?.tags.datasheet_name, activeTab: "dataset" }).push(); } else { routes.datasheet_list({ datastoreId }).push(); diff --git a/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm.tsx b/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm.tsx index 9f383b30..c86f0c55 100644 --- a/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm.tsx +++ b/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm.tsx @@ -9,7 +9,7 @@ import { declareComponentKeys } from "i18nifty"; import { FC, useCallback, useMemo, useState } from "react"; import { useForm } from "react-hook-form"; -import { ConfigurationTypeEnum, EndpointTypeEnum, Pyramid, Service, ServiceFormValuesBaseType } from "../../../../@types/app"; +import { ConfigurationTypeEnum, EndpointTypeEnum, PyramidVector, Service, ServiceFormValuesBaseType } from "../../../../@types/app"; import DatastoreLayout from "../../../../components/Layout/DatastoreLayout"; import LoadingIcon from "../../../../components/Utils/LoadingIcon"; import LoadingText from "../../../../components/Utils/LoadingText"; @@ -58,7 +58,7 @@ const PyramidVectorTmsServiceForm: FC = ({ dat const createServiceMutation = useMutation({ mutationFn: () => { const formValues = getFormValues(); - return api.pyramid.publish(datastoreId, pyramidId, formValues); + return api.pyramidVector.publish(datastoreId, pyramidId, formValues); }, onSuccess() { if (pyramidQuery.data?.tags?.datasheet_name) { @@ -79,8 +79,7 @@ const PyramidVectorTmsServiceForm: FC = ({ dat } const formValues = getFormValues(); - - return api.pyramid.publishEdit(datastoreId, pyramidId, offeringId, formValues); + return api.pyramidVector.publishEdit(datastoreId, pyramidId, offeringId, formValues); }, onSuccess() { if (offeringId !== undefined) { @@ -103,7 +102,7 @@ const PyramidVectorTmsServiceForm: FC = ({ dat const pyramidQuery = useQuery({ queryKey: RQKeys.datastore_stored_data(datastoreId, pyramidId), - queryFn: () => api.storedData.get(datastoreId, pyramidId), + queryFn: () => api.storedData.get(datastoreId, pyramidId), staleTime: Infinity, enabled: !(createServiceMutation.isPending || editServiceMutation.isPending), }); diff --git a/assets/entrepot/pages/stored_data/StoredDataDetails/PreviewTab/PreviewTab.tsx b/assets/entrepot/pages/stored_data/StoredDataDetails/PreviewTab/PreviewTab.tsx index 98d0053b..bd3c83bd 100644 --- a/assets/entrepot/pages/stored_data/StoredDataDetails/PreviewTab/PreviewTab.tsx +++ b/assets/entrepot/pages/stored_data/StoredDataDetails/PreviewTab/PreviewTab.tsx @@ -4,7 +4,7 @@ import Table from "@codegouvfr/react-dsfr/Table"; import { UseQueryResult, useQuery } from "@tanstack/react-query"; import { FC, Fragment, useMemo } from "react"; -import { Pyramid, StoredDataTypeEnum, VectorDb } from "../../../../../@types/app"; +import { PyramidVector, StoredDataTypeEnum, VectorDb } from "../../../../../@types/app"; import ExtentMap from "../../../../../components/Utils/ExtentMap"; import RQKeys from "../../../../../modules/entrepot/RQKeys"; import { CartesApiException } from "../../../../../modules/jsonFetch"; @@ -21,9 +21,9 @@ const PreviewTab: FC = ({ datastoreId, reportQuery }) => { const storedData = useMemo(() => reportQuery.data?.stored_data, [reportQuery.data?.stored_data]); const vectorDbQuery = useQuery({ - queryKey: RQKeys.datastore_stored_data(datastoreId, (storedData as Pyramid).tags.vectordb_id!), - queryFn: ({ signal }) => api.storedData.get(datastoreId, (storedData as Pyramid).tags.vectordb_id!, { signal }), - enabled: !!(storedData as Pyramid).tags.vectordb_id, + queryKey: RQKeys.datastore_stored_data(datastoreId, (storedData as PyramidVector).tags.vectordb_id!), + queryFn: ({ signal }) => api.storedData.get(datastoreId, (storedData as PyramidVector).tags.vectordb_id!, { signal }), + enabled: !!(storedData as PyramidVector).tags.vectordb_id, staleTime: 3600000, }); diff --git a/assets/entrepot/pages/stored_data/StoredDataDetails/ReportTab/Logs.tsx b/assets/entrepot/pages/stored_data/StoredDataDetails/ReportTab/Logs.tsx index e736011a..846bd1be 100644 --- a/assets/entrepot/pages/stored_data/StoredDataDetails/ReportTab/Logs.tsx +++ b/assets/entrepot/pages/stored_data/StoredDataDetails/ReportTab/Logs.tsx @@ -7,7 +7,7 @@ type LogsProps = { const Logs: FC = ({ logs }) => { return ( <> - Journal : + Journal : {logs.length > 0 ? (
                          = {
         navItems: navItemsEnTranslations,
         datastoreNavItems: datastoreNavItemsEnTranslations,
         VectorDbListItem: VectorDbListItemEnTranslations,
    -    PyramidListItem: PyramidListItemFrTranslations,
    +    PyramidVectorListItem: PyramidVectorListItemFrTranslations,
         DatasheetView: DatasheetViewEnTranslations,
         SldStyleValidationErrors: SldStyleValidationErrorsEnTranslations,
         mapboxStyleValidation: mapboxStyleValidationEnTranslations,
    diff --git a/assets/i18n/languages/fr.tsx b/assets/i18n/languages/fr.tsx
    index 3ace06bb..055b17f7 100644
    --- a/assets/i18n/languages/fr.tsx
    +++ b/assets/i18n/languages/fr.tsx
    @@ -6,7 +6,7 @@ import { CommunityMembersFrTranslations } from "../../entrepot/pages/communities
     import { DashboardProFrTranslations } from "../../entrepot/pages/dashboard/DashboardPro";
     import { DatasheetListFrTranslations } from "../../entrepot/pages/datasheet/DatasheetList/DatasheetList";
     import { DatasheetUploadFormFrTranslations } from "../../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm";
    -import { PyramidListItemFrTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidList/PyramidListItem";
    +import { PyramidVectorListItemFrTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorListItem";
     import { VectorDbListItemFrTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbListItem";
     import { DatasheetViewFrTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasheetView";
     import { DatastorePermissionsFrTranslations } from "../../entrepot/pages/datastore/ManagePermissions/DatastorePermissionsTr";
    @@ -55,7 +55,7 @@ export const translations: Translations<"fr"> = {
         navItems: navItemsFrTranslations,
         datastoreNavItems: datastoreNavItemsFrTranslations,
         VectorDbListItem: VectorDbListItemFrTranslations,
    -    PyramidListItem: PyramidListItemFrTranslations,
    +    PyramidVectorListItem: PyramidVectorListItemFrTranslations,
         DatasheetView: DatasheetViewFrTranslations,
         SldStyleValidationErrors: SldStyleValidationErrorsFrTranslations,
         mapboxStyleValidation: mapboxStyleValidationFrTranslations,
    diff --git a/src/Controller/Entrepot/DatasheetController.php b/src/Controller/Entrepot/DatasheetController.php
    index 93926e51..cabc1336 100644
    --- a/src/Controller/Entrepot/DatasheetController.php
    +++ b/src/Controller/Entrepot/DatasheetController.php
    @@ -130,7 +130,7 @@ public function getDetailed(string $datastoreId, string $datasheetName): JsonRes
             return $this->json([
                 ...$datasheet,
                 'vector_db_list' => $vectorDbList,
    -            'pyramid_list' => $pyramidList,
    +            'pyramid_vector_list' => $pyramidList,
                 'upload_list' => $uploadList,
                 'service_list' => $services,
             ]);
    diff --git a/src/Controller/Entrepot/PyramidController.php b/src/Controller/Entrepot/PyramidVectorController.php
    similarity index 96%
    rename from src/Controller/Entrepot/PyramidController.php
    rename to src/Controller/Entrepot/PyramidVectorController.php
    index 7625dc03..456b3e3f 100644
    --- a/src/Controller/Entrepot/PyramidController.php
    +++ b/src/Controller/Entrepot/PyramidVectorController.php
    @@ -7,9 +7,9 @@
     use App\Constants\EntrepotApi\Sandbox;
     use App\Constants\EntrepotApi\ZoomLevels;
     use App\Controller\ApiControllerInterface;
    -use App\Dto\Pyramid\AddPyramidDTO;
    -use App\Dto\Pyramid\CompositionDTO;
    -use App\Dto\Pyramid\PublishPyramidDTO;
    +use App\Dto\PyramidVector\AddPyramidDTO;
    +use App\Dto\PyramidVector\CompositionDTO;
    +use App\Dto\PyramidVector\PublishPyramidDTO;
     use App\Exception\ApiException;
     use App\Exception\CartesApiException;
     use App\Services\CapabilitiesService;
    @@ -25,12 +25,12 @@
     use Symfony\Component\Routing\Annotation\Route;
     
     #[Route(
    -    '/api/datastores/{datastoreId}/pyramid',
    -    name: 'cartesgouvfr_api_pyramid_',
    +    '/api/datastores/{datastoreId}/pyramid-vector',
    +    name: 'cartesgouvfr_api_pyramid_vector_',
         options: ['expose' => true],
         condition: 'request.isXmlHttpRequest()'
     )]
    -class PyramidController extends ServiceController implements ApiControllerInterface
    +class PyramidVectorController extends ServiceController implements ApiControllerInterface
     {
         public function __construct(
             DatastoreApiService $datastoreApiService,
    @@ -80,7 +80,7 @@ public function add(string $datastoreId, #[MapRequestPayload] AddPyramidDTO $dto
                     $parameters['area'] = $dto->area;
                 }
     
    -            $processing = $this->sandboxService->getProcGeneratePyramid($datastoreId);
    +            $processing = $this->sandboxService->getProcGeneratePyramidVector($datastoreId);
     
                 $requestBody = [
                     'processing' => $processing,
    @@ -96,10 +96,6 @@ public function add(string $datastoreId, #[MapRequestPayload] AddPyramidDTO $dto
                 $processingExecution = $this->processingApiService->addExecution($datastoreId, $requestBody);
                 $pyramidId = $processingExecution['output']['stored_data']['_id'];
     
    -            $this->storedDataApiService->addTags($datastoreId, $dto->vectordb_id, [
    -                'pyramid_id' => $pyramidId,
    -            ]);
    -
                 $pyramidTags = [
                     CommonTags::DATASHEET_NAME => $vectordb['tags'][CommonTags::DATASHEET_NAME],
                     'upload_id' => $vectordb['tags']['upload_id'],
    diff --git a/src/Dto/Pyramid/AddPyramidDTO.php b/src/Dto/PyramidVector/AddPyramidDTO.php
    similarity index 96%
    rename from src/Dto/Pyramid/AddPyramidDTO.php
    rename to src/Dto/PyramidVector/AddPyramidDTO.php
    index ffe9abdb..89aa100c 100644
    --- a/src/Dto/Pyramid/AddPyramidDTO.php
    +++ b/src/Dto/PyramidVector/AddPyramidDTO.php
    @@ -1,6 +1,6 @@
     isSandboxDatastore($datastoreId) ? 'sandbox' : 'api_entrepot';
             $processings = $this->parameterBag->get($apiEntrepot)['processings'];