+ Vous souhaitez demander au producteur des données décrites sur cette fiche du catalogue un accès aux services de diffusion de
+ données dont l'accès est restreint. Sélectionnez les couches de données et types de services auxquels vous souhaitez accéder : (sélectionner au
+ moins une couche)
+
+ ),
+ explain_no_access: "Cette fiche ne décrit aucun service de diffusion dont l’accès est restreint. Vous avez déjà accès à toutes les données décrites.",
+ back_to_dashboard: "Retour au tableau de bord",
+ beneficiaries: "Bénéficiaires",
+ beneficiaries_hintext: (
+
+ Vous pouvez demander au producteur des données de vous accorder une permission d'accès personnelle ou
+
+ demander qu'il accorde cette permission à tous les membres d'une communauté à laquelle vous appartenez.
+
+ ),
+ myself: "Moi-même",
+ community: ({ name }) => `La communauté ${name}`,
+ min_layers_error: "Vous devez sélectionner au moins une couche",
+ sending_message: "Votre message est en cours d’envoi ...",
+};
+
+export const AccessesRequestEnTranslations: Translations<"en">["AccessesRequest"] = {
+ title: undefined,
+ explain: undefined,
+ explain_no_access: undefined,
+ back_to_dashboard: undefined,
+ beneficiaries: "Bénéficiaries",
+ beneficiaries_hintext: undefined,
+ myself: "Myself",
+ community: ({ name }) => `Community ${name}`,
+ min_layers_error: undefined,
+ sending_message: undefined,
+};
diff --git a/assets/entrepot/pages/AccessesRequest.tsx b/assets/entrepot/pages/accesses-request/AccessesRequest.tsx
similarity index 77%
rename from assets/entrepot/pages/AccessesRequest.tsx
rename to assets/entrepot/pages/accesses-request/AccessesRequest.tsx
index b1755a57..5b2469cd 100644
--- a/assets/entrepot/pages/AccessesRequest.tsx
+++ b/assets/entrepot/pages/accesses-request/AccessesRequest.tsx
@@ -10,17 +10,17 @@ import { ComponentProps, FC, ReactNode, useMemo, useState } from "react";
import { useForm } from "react-hook-form";
import * as yup from "yup";
-import type { GeonetworkMetadataResponse } from "../../@types/app";
-import AppLayout from "../../components/Layout/AppLayout";
-import LoadingText from "../../components/Utils/LoadingText";
-import Wait from "../../components/Utils/Wait";
-import { Translations, declareComponentKeys, useTranslation } from "../../i18n/i18n";
-import SymfonyRouting from "../../modules/Routing";
-import RQKeys from "../../modules/entrepot/RQKeys";
-import { CartesApiException, jsonFetch } from "../../modules/jsonFetch";
-import { catalogueUrl, routes } from "../../router/router";
-import { useAuthStore } from "../../stores/AuthStore";
-import api from "../api";
+import { GeonetworkMetadataResponse } from "../../../@types/app";
+import AppLayout from "../../../components/Layout/AppLayout";
+import LoadingText from "../../../components/Utils/LoadingText";
+import Wait from "../../../components/Utils/Wait";
+import { useTranslation } from "../../../i18n/i18n";
+import SymfonyRouting from "../../../modules/Routing";
+import RQKeys from "../../../modules/entrepot/RQKeys";
+import { CartesApiException, jsonFetch } from "../../../modules/jsonFetch";
+import { catalogueUrl, routes } from "../../../router/router";
+import { useAuthStore } from "../../../stores/AuthStore";
+import api from "../../api";
type AskForAccesses = {
fileIdentifier: string;
@@ -227,57 +227,3 @@ const AccessesRequest: FC = ({ fileIdentifier }) => {
};
export default AccessesRequest;
-
-// traductions
-export const { i18n } = declareComponentKeys<
- | "title"
- | { K: "explain"; P: { url: string }; R: JSX.Element }
- | "explain_no_access"
- | "back_to_dashboard"
- | "beneficiaries"
- | { K: "beneficiaries_hintext"; R: JSX.Element }
- | "myself"
- | { K: "community"; P: { name: string }; R: string }
- | "min_layers_error"
- | "sending_message"
->()({
- AccessesRequest,
-});
-
-export const AccessesRequestFrTranslations: Translations<"fr">["AccessesRequest"] = {
- title: "Demande d’accès",
- explain: ({ url }) => (
-
- Vous souhaitez demander au producteur des données décrites sur cette fiche du catalogue un accès aux services de diffusion de
- données dont l'accès est restreint. Sélectionnez les couches de données et types de services auxquels vous souhaitez accéder : (sélectionner au
- moins une couche)
-
- ),
- explain_no_access: "Cette fiche ne décrit aucun service de diffusion dont l’accès est restreint. Vous avez déjà accès à toutes les données décrites.",
- back_to_dashboard: "Retour au tableau de bord",
- beneficiaries: "Bénéficiaires",
- beneficiaries_hintext: (
-
- Vous pouvez demander au producteur des données de vous accorder une permission d'accès personnelle ou
-
- demander qu'il accorde cette permission à tous les membres d'une communauté à laquelle vous appartenez.
-
- ),
- myself: "Moi-même",
- community: ({ name }) => `La communauté ${name}`,
- min_layers_error: "Vous devez sélectionner au moins une couche",
- sending_message: "Votre message est en cours d’envoi ...",
-};
-
-export const AccessesRequestEnTranslations: Translations<"en">["AccessesRequest"] = {
- title: undefined,
- explain: undefined,
- explain_no_access: undefined,
- back_to_dashboard: undefined,
- beneficiaries: "Bénéficiaries",
- beneficiaries_hintext: undefined,
- myself: "Myself",
- community: ({ name }) => `Community ${name}`,
- min_layers_error: undefined,
- sending_message: undefined,
-};
diff --git a/assets/entrepot/pages/communities/AddMember/AddMember.locale.tsx b/assets/entrepot/pages/communities/AddMember/AddMember.locale.tsx
new file mode 100644
index 00000000..fe798341
--- /dev/null
+++ b/assets/entrepot/pages/communities/AddMember/AddMember.locale.tsx
@@ -0,0 +1,28 @@
+import { declareComponentKeys } from "i18nifty";
+
+import { Translations } from "../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ "add_user_title" | "user_id" | "rights_granted" | "id_mandatory" | "id_must_be_uuid" | { K: "already_member"; P: { userId: string }; R: string } | "running"
+>()("AddMember");
+export type I18n = typeof i18n;
+
+export const AddMemberFrTranslations: Translations<"fr">["AddMember"] = {
+ add_user_title: "Ajouter un utilisateur",
+ user_id: "Identifiant de l’utilisateur",
+ rights_granted: "Permissions accordées",
+ id_mandatory: "L’identifiant est obligatoire",
+ id_must_be_uuid: "L’Identifiant doit être un UUID",
+ already_member: ({ userId }) => `l’utilisateur ${userId} est déjà membre de cet espace de travail`,
+ running: "Ajout d’utilisateur en cours ...",
+};
+
+export const AddMemberEnTranslations: Translations<"en">["AddMember"] = {
+ add_user_title: "Add user",
+ user_id: "User identifier",
+ rights_granted: "Rights granted",
+ id_mandatory: "Identifier is mandatory",
+ id_must_be_uuid: "Identifier must be an UUID",
+ already_member: ({ userId }) => `User ${userId} is already a member of this community`,
+ running: "Ajout d’utilisateur running ...",
+};
diff --git a/assets/entrepot/pages/communities/AddMember.tsx b/assets/entrepot/pages/communities/AddMember/AddMember.tsx
similarity index 73%
rename from assets/entrepot/pages/communities/AddMember.tsx
rename to assets/entrepot/pages/communities/AddMember/AddMember.tsx
index 1a9c8b7c..201636c1 100644
--- a/assets/entrepot/pages/communities/AddMember.tsx
+++ b/assets/entrepot/pages/communities/AddMember/AddMember.tsx
@@ -11,15 +11,16 @@ import { createPortal } from "react-dom";
import { useForm } from "react-hook-form";
import * as yup from "yup";
-import type { UserRightsResponseDto } from "../../../@types/app";
-import LoadingIcon from "../../../components/Utils/LoadingIcon";
-import { ComponentKey, Translations, declareComponentKeys, getTranslation, useTranslation } from "../../../i18n/i18n";
-import RQKeys from "../../../modules/entrepot/RQKeys";
-import { CartesApiException } from "../../../modules/jsonFetch";
-import { routes } from "../../../router/router";
-import { regex } from "../../../utils";
-import api from "../../api";
-import { getRights, rightTypes } from "./UserRights";
+import type { UserRightsResponseDto } from "../../../../@types/app";
+import LoadingIcon from "../../../../components/Utils/LoadingIcon";
+import { useTranslation } from "../../../../i18n/i18n";
+import { ComponentKey } from "../../../../i18n/types";
+import RQKeys from "../../../../modules/entrepot/RQKeys";
+import { CartesApiException } from "../../../../modules/jsonFetch";
+import { routes } from "../../../../router/router";
+import { regex } from "../../../../utils";
+import api from "../../../api";
+import { getRights, rightTypes } from "../UserRights";
const addMemberModal = createModal({
id: "add-member-modal",
@@ -32,11 +33,10 @@ type AddMemberProps = {
userId?: string;
};
-const { t: tCommon } = getTranslation("Common");
-const { t: translateRights } = getTranslation("Rights");
-
const AddMember: FC = ({ communityId, communityMemberIds, userId }) => {
const { t } = useTranslation({ AddMember });
+ const { t: tCommon } = useTranslation("Common");
+ const { t: translateRights } = useTranslation("Rights");
const schema = (t: TranslationFunction<"AddMember", ComponentKey>) => {
return yup.object({
@@ -152,30 +152,3 @@ const AddMember: FC = ({ communityId, communityMemberIds, userId
};
export { AddMember, addMemberModal };
-
-// traductions
-export const { i18n } = declareComponentKeys<
- "add_user_title" | "user_id" | "rights_granted" | "id_mandatory" | "id_must_be_uuid" | { K: "already_member"; P: { userId: string }; R: string } | "running"
->()({
- AddMember,
-});
-
-export const AddMemberFrTranslations: Translations<"fr">["AddMember"] = {
- add_user_title: "Ajouter un utilisateur",
- user_id: "Identifiant de l’utilisateur",
- rights_granted: "Permissions accordées",
- id_mandatory: "L’identifiant est obligatoire",
- id_must_be_uuid: "L’Identifiant doit être un UUID",
- already_member: ({ userId }) => `l’utilisateur ${userId} est déjà membre de cet espace de travail`,
- running: "Ajout d’utilisateur en cours ...",
-};
-
-export const AddMemberEnTranslations: Translations<"en">["AddMember"] = {
- add_user_title: "Add user",
- user_id: "User identifier",
- rights_granted: "Rights granted",
- id_mandatory: "Identifier is mandatory",
- id_must_be_uuid: "Identifier must be an UUID",
- already_member: ({ userId }) => `User ${userId} is already a member of this community`,
- running: "Ajout d’utilisateur running ...",
-};
diff --git a/assets/entrepot/pages/communities/CommunityList.tsx b/assets/entrepot/pages/communities/CommunityList.tsx
index 957e29fd..61b26bf2 100644
--- a/assets/entrepot/pages/communities/CommunityList.tsx
+++ b/assets/entrepot/pages/communities/CommunityList.tsx
@@ -12,7 +12,7 @@ import api from "../../api";
import AppLayout from "../../../components/Layout/AppLayout";
import LoadingText from "../../../components/Utils/LoadingText";
import Wait from "../../../components/Utils/Wait";
-import { datastoreNavItems } from "../../../config/datastoreNavItems";
+import { datastoreNavItems } from "../../../config/navItems/datastoreNavItems";
import RQKeys from "../../../modules/entrepot/RQKeys";
import Translator from "../../../modules/Translator";
import { CartesApiException } from "../../../modules/jsonFetch";
diff --git a/assets/entrepot/pages/communities/CommunityMembers/CommunityMembers.locale.tsx b/assets/entrepot/pages/communities/CommunityMembers/CommunityMembers.locale.tsx
new file mode 100644
index 00000000..b756ca1e
--- /dev/null
+++ b/assets/entrepot/pages/communities/CommunityMembers/CommunityMembers.locale.tsx
@@ -0,0 +1,45 @@
+import { declareComponentKeys } from "i18nifty";
+import { Translations } from "../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | { K: "community_members"; P: { communityName: string }; R: string }
+ | { K: "already_member"; P: { userId: string }; R: string }
+ | "rights"
+ | "name"
+ | "me"
+ | "supervisor"
+ | "add_user"
+ | "remove_user"
+ | "confirm_remove"
+ | { K: "add_remove_right_title"; P: { right: string }; R: string }
+ | "no_necessary_rights"
+>()("CommunityMembers");
+export type I18n = typeof i18n;
+
+export const CommunityMembersFrTranslations: Translations<"fr">["CommunityMembers"] = {
+ community_members: ({ communityName }) => `Membres de ${communityName}`,
+ already_member: ({ userId }) => `l’utilisateur ${userId} est déjà membre de cet espace de travail`,
+ rights: "Permissions du compte",
+ name: "Nom",
+ me: "moi",
+ supervisor: "superviseur",
+ add_user: "Ajouter un utilisateur",
+ remove_user: "Supprimer cet utilisateur",
+ confirm_remove: "Êtes-vous sûr de vouloir supprimer cet utilisateur ?",
+ add_remove_right_title: ({ right }) => `Ajouter/supprimer le droit ${right}`,
+ no_necessary_rights: "Vous n'avez pas les droits nécessaires pour visualiser les membres de cet espace de travail.",
+};
+
+export const CommunityMembersEnTranslations: Translations<"en">["CommunityMembers"] = {
+ community_members: ({ communityName }) => `Members of ${communityName}`,
+ already_member: ({ userId }) => `User ${userId} is already a member of this community`,
+ rights: "User rights",
+ name: "Name",
+ me: "me",
+ supervisor: "supervisor",
+ add_user: "Add user",
+ remove_user: "Remove this user",
+ confirm_remove: "Are you sure you want to delete this user ?",
+ add_remove_right_title: ({ right }) => `Add/remove right ${right} to user`,
+ no_necessary_rights: "You do not have the necessary rights to view and modify the users of this community.",
+};
diff --git a/assets/entrepot/pages/communities/CommunityMembers.tsx b/assets/entrepot/pages/communities/CommunityMembers/CommunityMembers.tsx
similarity index 83%
rename from assets/entrepot/pages/communities/CommunityMembers.tsx
rename to assets/entrepot/pages/communities/CommunityMembers/CommunityMembers.tsx
index 70e06a62..64cfa873 100644
--- a/assets/entrepot/pages/communities/CommunityMembers.tsx
+++ b/assets/entrepot/pages/communities/CommunityMembers/CommunityMembers.tsx
@@ -5,21 +5,22 @@ import { ToggleSwitch } from "@codegouvfr/react-dsfr/ToggleSwitch";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { FC, useEffect, useMemo, useState } from "react";
-import { UserRightsResponseDto } from "../../../@types/app";
-import { CommunityMemberDtoRightsEnum, CommunityUserResponseDto, UserDto } from "../../../@types/entrepot";
-import DatastoreLayout from "../../../components/Layout/DatastoreLayout";
-import ConfirmDialog, { ConfirmDialogModal } from "../../../components/Utils/ConfirmDialog";
-import LoadingText from "../../../components/Utils/LoadingText";
-import Wait from "../../../components/Utils/Wait";
-import { declareComponentKeys, Translations, useTranslation } from "../../../i18n/i18n";
-import RQKeys from "../../../modules/entrepot/RQKeys";
-import { CartesApiException } from "../../../modules/jsonFetch";
-import { routes } from "../../../router/router";
-import "../../../sass/pages/community_members.scss";
-import { useAuthStore } from "../../../stores/AuthStore";
-import api from "../../api";
-import { AddMember, addMemberModal } from "./AddMember";
-import { complete, getTranslatedRightTypes, UserRights } from "./UserRights";
+import { UserRightsResponseDto } from "../../../../@types/app";
+import { CommunityMemberDtoRightsEnum, CommunityUserResponseDto, UserDto } from "../../../../@types/entrepot";
+import DatastoreLayout from "../../../../components/Layout/DatastoreLayout";
+import ConfirmDialog, { ConfirmDialogModal } from "../../../../components/Utils/ConfirmDialog";
+import LoadingText from "../../../../components/Utils/LoadingText";
+import Wait from "../../../../components/Utils/Wait";
+import { useTranslation } from "../../../../i18n/i18n";
+import RQKeys from "../../../../modules/entrepot/RQKeys";
+import { CartesApiException } from "../../../../modules/jsonFetch";
+import { routes } from "../../../../router/router";
+import { useAuthStore } from "../../../../stores/AuthStore";
+import api from "../../../api";
+import { AddMember, addMemberModal } from "../AddMember/AddMember";
+import { complete, getTranslatedRightTypes, UserRights } from "../UserRights";
+
+import "../../../../sass/pages/community_members.scss";
type CommunityMembersProps = {
communityId: string;
@@ -306,48 +307,3 @@ const CommunityMembers: FC = ({ communityId, userId }) =>
};
export default CommunityMembers;
-
-// traductions
-export const { i18n } = declareComponentKeys<
- | { K: "community_members"; P: { communityName: string }; R: string }
- | { K: "already_member"; P: { userId: string }; R: string }
- | "rights"
- | "name"
- | "me"
- | "supervisor"
- | "add_user"
- | "remove_user"
- | "confirm_remove"
- | { K: "add_remove_right_title"; P: { right: string }; R: string }
- | "no_necessary_rights"
->()({
- CommunityMembers,
-});
-
-export const CommunityMembersFrTranslations: Translations<"fr">["CommunityMembers"] = {
- community_members: ({ communityName }) => `Membres de ${communityName}`,
- already_member: ({ userId }) => `l’utilisateur ${userId} est déjà membre de cet espace de travail`,
- rights: "Permissions du compte",
- name: "Nom",
- me: "moi",
- supervisor: "superviseur",
- add_user: "Ajouter un utilisateur",
- remove_user: "Supprimer cet utilisateur",
- confirm_remove: "Êtes-vous sûr de vouloir supprimer cet utilisateur ?",
- add_remove_right_title: ({ right }) => `Ajouter/supprimer le droit ${right}`,
- no_necessary_rights: "Vous n'avez pas les droits nécessaires pour visualiser les membres de cet espace de travail.",
-};
-
-export const CommunityMembersEnTranslations: Translations<"en">["CommunityMembers"] = {
- community_members: ({ communityName }) => `Members of ${communityName}`,
- already_member: ({ userId }) => `User ${userId} is already a member of this community`,
- rights: "User rights",
- name: "Name",
- me: "me",
- supervisor: "supervisor",
- add_user: "Add user",
- remove_user: "Remove this user",
- confirm_remove: "Are you sure you want to delete this user ?",
- add_remove_right_title: ({ right }) => `Add/remove right ${right} to user`,
- no_necessary_rights: "You do not have the necessary rights to view and modify the users of this community.",
-};
diff --git a/assets/i18n/Rights.tsx b/assets/entrepot/pages/communities/Rights.locale.tsx
similarity index 90%
rename from assets/i18n/Rights.tsx
rename to assets/entrepot/pages/communities/Rights.locale.tsx
index 1f603409..fc0f1c43 100644
--- a/assets/i18n/Rights.tsx
+++ b/assets/entrepot/pages/communities/Rights.locale.tsx
@@ -1,6 +1,7 @@
-import { declareComponentKeys, type Translations } from "./i18n";
+import { declareComponentKeys } from "../../../i18n/i18n";
+import { type Translations } from "../../../i18n/types";
-export const { i18n } = declareComponentKeys<
+const { i18n } = declareComponentKeys<
| "annex"
| "broadcast"
| "community"
@@ -12,6 +13,7 @@ export const { i18n } = declareComponentKeys<
| "processing_explain"
| "upload_explain"
>()("Rights");
+export type I18n = typeof i18n;
export const RightsFrTranslations: Translations<"fr">["Rights"] = {
annex: "Annexes",
diff --git a/assets/entrepot/pages/dashboard/DashboardPro.locale.tsx b/assets/entrepot/pages/dashboard/DashboardPro.locale.tsx
new file mode 100644
index 00000000..87ead024
--- /dev/null
+++ b/assets/entrepot/pages/dashboard/DashboardPro.locale.tsx
@@ -0,0 +1,18 @@
+import { declareComponentKeys } from "i18nifty";
+
+import { Translations } from "../../../i18n/types";
+
+const { i18n } = declareComponentKeys<"document_title" | "espaceco_frontoffice_list" | "datastore_for_tests">()("DashboardPro");
+export type I18n = typeof i18n;
+
+export const DashboardProFrTranslations: Translations<"fr">["DashboardPro"] = {
+ document_title: "Tableau de bord professionnel",
+ espaceco_frontoffice_list: "Liste des guichets de l’espace collaboratif",
+ datastore_for_tests: "À des fins de test",
+};
+
+export const DashboardProEnTranslations: Translations<"en">["DashboardPro"] = {
+ document_title: "Professional dashboard",
+ espaceco_frontoffice_list: "List of collaborative space front offices",
+ datastore_for_tests: "For testing purposes",
+};
diff --git a/assets/entrepot/pages/dashboard/DashboardPro.tsx b/assets/entrepot/pages/dashboard/DashboardPro.tsx
index 3499feb1..88ae618f 100644
--- a/assets/entrepot/pages/dashboard/DashboardPro.tsx
+++ b/assets/entrepot/pages/dashboard/DashboardPro.tsx
@@ -2,15 +2,14 @@ import { fr } from "@codegouvfr/react-dsfr";
import Button from "@codegouvfr/react-dsfr/Button";
import { Tile } from "@codegouvfr/react-dsfr/Tile";
import { useMutation, useQuery } from "@tanstack/react-query";
-import { declareComponentKeys } from "i18nifty";
import { useEffect } from "react";
import { CartesUser, Datastore } from "../../../@types/app";
import AppLayout from "../../../components/Layout/AppLayout";
import LoadingIcon from "../../../components/Utils/LoadingIcon";
import Skeleton from "../../../components/Utils/Skeleton";
-import { datastoreNavItems } from "../../../config/datastoreNavItems";
-import { Translations, useTranslation } from "../../../i18n/i18n";
+import { datastoreNavItems } from "../../../config/navItems/datastoreNavItems";
+import { useTranslation } from "../../../i18n/i18n";
import Translator from "../../../modules/Translator";
import RQKeys from "../../../modules/entrepot/RQKeys";
import { CartesApiException } from "../../../modules/jsonFetch";
@@ -193,17 +192,3 @@ const DashboardPro = () => {
};
export default DashboardPro;
-
-export const { i18n } = declareComponentKeys<"document_title" | "espaceco_frontoffice_list" | "datastore_for_tests">()("DashboardPro");
-
-export const DashboardProFrTranslations: Translations<"fr">["DashboardPro"] = {
- document_title: "Tableau de bord professionnel",
- espaceco_frontoffice_list: "Liste des guichets de l’espace collaboratif",
- datastore_for_tests: "À des fins de test",
-};
-
-export const DashboardProEnTranslations: Translations<"en">["DashboardPro"] = {
- document_title: "Professional dashboard",
- espaceco_frontoffice_list: "List of collaborative space front offices",
- datastore_for_tests: "For testing purposes",
-};
diff --git a/assets/entrepot/pages/datasheet/DatasheetList/DatasheetList.locale.tsx b/assets/entrepot/pages/datasheet/DatasheetList/DatasheetList.locale.tsx
new file mode 100644
index 00000000..cb2e663f
--- /dev/null
+++ b/assets/entrepot/pages/datasheet/DatasheetList/DatasheetList.locale.tsx
@@ -0,0 +1,40 @@
+import { declareComponentKeys } from "i18nifty";
+import { ReactNode } from "react";
+import { Translations } from "../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | { K: "title"; P: { datastoreName?: string }; R: string }
+ | "create_datasheet"
+ | "datasheet_creation_impossible"
+ | "metadata_endpoint_quota_reached"
+ | { K: "services_published"; P: { nbServices?: number }; R: string }
+ | "no_services_published"
+ | { K: "sandbox_datastore_explanation"; R: ReactNode }
+>()("DatasheetList");
+export type I18n = typeof i18n;
+
+export const DatasheetListFrTranslations: Translations<"fr">["DatasheetList"] = {
+ title: ({ datastoreName }) => `Données ${datastoreName ?? ""}`,
+ create_datasheet: "Créer une fiche de données",
+ datasheet_creation_impossible: "Création d’une nouvelle fiche de données impossible",
+ metadata_endpoint_quota_reached: "Quota du point d’accès de métadonnées atteint",
+ services_published: ({ nbServices }) => `Publié (${nbServices})`,
+ no_services_published: "Non publié",
+ sandbox_datastore_explanation: (
+
+ {
+ "Cet espace permet de tester les fonctions d’alimentation et de diffusion de la Géoplateforme. Les services publiés dans cet espace ne sont pas visibles sur le catalogue."
+ }
+
+ ),
+};
+
+export const DatasheetListEnTranslations: Translations<"en">["DatasheetList"] = {
+ title: undefined,
+ create_datasheet: undefined,
+ datasheet_creation_impossible: undefined,
+ metadata_endpoint_quota_reached: undefined,
+ services_published: undefined,
+ no_services_published: undefined,
+ sandbox_datastore_explanation: undefined,
+};
diff --git a/assets/entrepot/pages/datasheet/DatasheetList/DatasheetList.tsx b/assets/entrepot/pages/datasheet/DatasheetList/DatasheetList.tsx
index 7328050e..14d6ab29 100644
--- a/assets/entrepot/pages/datasheet/DatasheetList/DatasheetList.tsx
+++ b/assets/entrepot/pages/datasheet/DatasheetList/DatasheetList.tsx
@@ -2,14 +2,13 @@ import { fr } from "@codegouvfr/react-dsfr";
import Alert from "@codegouvfr/react-dsfr/Alert";
import Button from "@codegouvfr/react-dsfr/Button";
import { useQuery } from "@tanstack/react-query";
-import { declareComponentKeys } from "i18nifty";
-import { FC, ReactNode, useMemo } from "react";
+import { FC, useMemo } from "react";
import { Datasheet, EndpointTypeEnum } from "../../../../@types/app";
import DatastoreLayout from "../../../../components/Layout/DatastoreLayout";
import LoadingIcon from "../../../../components/Utils/LoadingIcon";
import Skeleton from "../../../../components/Utils/Skeleton";
-import { Translations, useTranslation } from "../../../../i18n/i18n";
+import { useTranslation } from "../../../../i18n/i18n";
import RQKeys from "../../../../modules/entrepot/RQKeys";
import { routes } from "../../../../router/router";
import api from "../../../api";
@@ -77,41 +76,3 @@ const DatasheetList: FC = ({ datastoreId }) => {
};
export default DatasheetList;
-
-export const { i18n } = declareComponentKeys<
- | { K: "title"; P: { datastoreName?: string }; R: string }
- | "create_datasheet"
- | "datasheet_creation_impossible"
- | "metadata_endpoint_quota_reached"
- | { K: "services_published"; P: { nbServices?: number }; R: string }
- | "no_services_published"
- | { K: "sandbox_datastore_explanation"; R: ReactNode }
->()({
- DatasheetList,
-});
-
-export const DatasheetListFrTranslations: Translations<"fr">["DatasheetList"] = {
- title: ({ datastoreName }) => `Données ${datastoreName ?? ""}`,
- create_datasheet: "Créer une fiche de données",
- datasheet_creation_impossible: "Création d’une nouvelle fiche de données impossible",
- metadata_endpoint_quota_reached: "Quota du point d’accès de métadonnées atteint",
- services_published: ({ nbServices }) => `Publié (${nbServices})`,
- no_services_published: "Non publié",
- sandbox_datastore_explanation: (
-
- {
- "Cet espace permet de tester les fonctions d’alimentation et de diffusion de la Géoplateforme. Les services publiés dans cet espace ne sont pas visibles sur le catalogue."
- }
-
- ),
-};
-
-export const DatasheetListEnTranslations: Translations<"en">["DatasheetList"] = {
- title: undefined,
- create_datasheet: undefined,
- datasheet_creation_impossible: undefined,
- metadata_endpoint_quota_reached: undefined,
- services_published: undefined,
- no_services_published: undefined,
- sandbox_datastore_explanation: undefined,
-};
diff --git a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.locale.tsx b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.locale.tsx
new file mode 100644
index 00000000..e2ad9919
--- /dev/null
+++ b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.locale.tsx
@@ -0,0 +1,83 @@
+import { declareComponentKeys } from "i18nifty";
+import { Translations } from "../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | { K: "title"; P: { datasheetName: string | undefined }; R: string }
+ | { K: "back_to"; P: { datasheetName: string | undefined }; R: string }
+ | "datasheet.name"
+ | "datasheet.name_hint"
+ | "datasheet.name_mandatory_error"
+ | "datasheet.name_max_length_error"
+ | "datasheet.name_regex_error"
+ | { K: "datasheet.name_already_exists_error"; P: { datasheetName: string }; R: string }
+ | "datasheet.creation_running"
+ | "upload"
+ | "upload_hint"
+ | "upload_nofile_error"
+ | { K: "upload_extension_error"; P: { filename: string }; R: string }
+ | { K: "upload_max_size_error"; P: { maxSize: number }; R: string }
+ | "upload_running"
+ | "technical_name"
+ | "technical_name_hint"
+ | "technical_name_mandatory_error"
+ | "projection"
+ | "projection_mandatory_error"
+ | "select_projection"
+ | "upload_file"
+ | "data_infos_title"
+>()("DatasheetUploadForm");
+export type I18n = typeof i18n;
+
+export const DatasheetUploadFormFrTranslations: Translations<"fr">["DatasheetUploadForm"] = {
+ title: ({ datasheetName }) => (datasheetName === undefined ? "Créer une fiche de données" : "Ajouter un fichier de données"),
+ back_to: ({ datasheetName }) => (datasheetName === undefined ? "Retour à ma liste de données" : "Retour à ma fiche de données"),
+ "datasheet.name": "Nom de votre fiche de donnée",
+ "datasheet.name_hint": "Ce nom vous permettra d’identifier votre donnée dans la géoplateforme, soyez aussi clair que possible.",
+ "datasheet.name_mandatory_error": "Le nom de la donnée est obligatoire",
+ "datasheet.name_max_length_error": "Le nombre maximal de caractères pour le nom de la fiche de donnée est de 99",
+ "datasheet.name_regex_error":
+ "Le nom de la fiche de donnée ne peut contenir que des caractères alphanumériques, espaces blancs et certains caractères spéciaux",
+ "datasheet.name_already_exists_error": ({ datasheetName }) => `Une fiche de donnée existe déjà avec le nom "${datasheetName}"`,
+ "datasheet.creation_running": "Création de la fiche en cours ...",
+ upload: "Déposez votre fichier de données",
+ // NB: la taille maximale doit correspondre à celle effectivement implémentée dans DatasheetUploadForm
+ upload_hint: "Taille maximale : 1 Go. Formats de fichiers autorisés : Geopackage ou archive zip contenant un Geopackage (recommandé)",
+ upload_nofile_error: "Aucun fichier téléversé",
+ upload_extension_error: ({ filename }) => `L’extension du fichier ${filename} n'est pas correcte`,
+ upload_max_size_error: ({ maxSize }) => `La taille maximale pour un fichier est de ${maxSize}`,
+ upload_running: "Téléversement en cours ...",
+ technical_name: "Nom technique de votre donnée",
+ technical_name_hint: "Ce nom technique est invisible par votre utilisateur final. Il apparaitra uniquement dans votre espace de travail",
+ technical_name_mandatory_error: "Le nom technique de la donnée est obligatoire",
+ projection: "Projection de vos données",
+ projection_mandatory_error: "La projection (srid) est obligatoire",
+ select_projection: "Selectionnez une projection",
+ upload_file: "Déposer votre fichier",
+ data_infos_title: "Les données suivantes ont été détectées. Modifiez les si besoin",
+};
+
+export const DatasheetUploadFormEnTranslations: Translations<"en">["DatasheetUploadForm"] = {
+ title: undefined,
+ back_to: undefined,
+ "datasheet.name": undefined,
+ "datasheet.name_hint": undefined,
+ "datasheet.name_mandatory_error": undefined,
+ "datasheet.name_max_length_error": undefined,
+ "datasheet.name_regex_error": undefined,
+ "datasheet.name_already_exists_error": undefined,
+ "datasheet.creation_running": undefined,
+ upload: undefined,
+ upload_hint: undefined,
+ upload_nofile_error: undefined,
+ upload_extension_error: undefined,
+ upload_max_size_error: undefined,
+ upload_running: undefined,
+ technical_name: undefined,
+ technical_name_hint: undefined,
+ technical_name_mandatory_error: undefined,
+ projection: undefined,
+ projection_mandatory_error: undefined,
+ select_projection: undefined,
+ upload_file: undefined,
+ data_infos_title: undefined,
+};
diff --git a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx
index c1b85614..da73e950 100644
--- a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx
+++ b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx
@@ -20,7 +20,7 @@ import Progress from "../../../../components/Utils/Progress";
import Wait from "../../../../components/Utils/Wait";
import defaultProjections from "../../../../data/default_projections.json";
import ignfProjections from "../../../../data/ignf_projections.json";
-import { Translations, declareComponentKeys, useTranslation } from "../../../../i18n/i18n";
+import { useTranslation } from "../../../../i18n/i18n";
import FileUploader from "../../../../modules/FileUploader";
import RQKeys from "../../../../modules/entrepot/RQKeys";
import { routes, useRoute } from "../../../../router/router";
@@ -352,86 +352,3 @@ const DatasheetUploadForm: FC = ({ datastoreId }) => {
DatasheetUploadForm.displayName = symToStr({ DatasheetUploadForm });
export default DatasheetUploadForm;
-
-// traductions
-export const { i18n } = declareComponentKeys<
- | { K: "title"; P: { datasheetName: string | undefined }; R: string }
- | { K: "back_to"; P: { datasheetName: string | undefined }; R: string }
- | "datasheet.name"
- | "datasheet.name_hint"
- | "datasheet.name_mandatory_error"
- | "datasheet.name_max_length_error"
- | "datasheet.name_regex_error"
- | { K: "datasheet.name_already_exists_error"; P: { datasheetName: string }; R: string }
- | "datasheet.creation_running"
- | "upload"
- | "upload_hint"
- | "upload_nofile_error"
- | { K: "upload_extension_error"; P: { filename: string }; R: string }
- | { K: "upload_max_size_error"; P: { maxSize: number }; R: string }
- | "upload_running"
- | "technical_name"
- | "technical_name_hint"
- | "technical_name_mandatory_error"
- | "projection"
- | "projection_mandatory_error"
- | "select_projection"
- | "upload_file"
- | "data_infos_title"
->()({
- DatasheetUploadForm,
-});
-
-export const DatasheetUploadFormFrTranslations: Translations<"fr">["DatasheetUploadForm"] = {
- title: ({ datasheetName }) => (datasheetName === undefined ? "Créer une fiche de données" : "Ajouter un fichier de données"),
- back_to: ({ datasheetName }) => (datasheetName === undefined ? "Retour à ma liste de données" : "Retour à ma fiche de données"),
- "datasheet.name": "Nom de votre fiche de donnée",
- "datasheet.name_hint": "Ce nom vous permettra d’identifier votre donnée dans la géoplateforme, soyez aussi clair que possible.",
- "datasheet.name_mandatory_error": "Le nom de la donnée est obligatoire",
- "datasheet.name_max_length_error": "Le nombre maximal de caractères pour le nom de la fiche de donnée est de 99",
- "datasheet.name_regex_error":
- "Le nom de la fiche de donnée ne peut contenir que des caractères alphanumériques, espaces blancs et certains caractères spéciaux",
- "datasheet.name_already_exists_error": ({ datasheetName }) => `Une fiche de donnée existe déjà avec le nom "${datasheetName}"`,
- "datasheet.creation_running": "Création de la fiche en cours ...",
- upload: "Déposez votre fichier de données",
- // NB: la taille maximale doit correspondre à celle effectivement implémentée dans DatasheetUploadForm
- upload_hint: "Taille maximale : 1 Go. Formats de fichiers autorisés : Geopackage ou archive zip contenant un Geopackage (recommandé)",
- upload_nofile_error: "Aucun fichier téléversé",
- upload_extension_error: ({ filename }) => `L’extension du fichier ${filename} n'est pas correcte`,
- upload_max_size_error: ({ maxSize }) => `La taille maximale pour un fichier est de ${maxSize}`,
- upload_running: "Téléversement en cours ...",
- technical_name: "Nom technique de votre donnée",
- technical_name_hint: "Ce nom technique est invisible par votre utilisateur final. Il apparaitra uniquement dans votre espace de travail",
- technical_name_mandatory_error: "Le nom technique de la donnée est obligatoire",
- projection: "Projection de vos données",
- projection_mandatory_error: "La projection (srid) est obligatoire",
- select_projection: "Selectionnez une projection",
- upload_file: "Déposer votre fichier",
- data_infos_title: "Les données suivantes ont été détectées. Modifiez les si besoin",
-};
-
-export const DatasheetUploadFormEnTranslations: Translations<"en">["DatasheetUploadForm"] = {
- title: undefined,
- back_to: undefined,
- "datasheet.name": undefined,
- "datasheet.name_hint": undefined,
- "datasheet.name_mandatory_error": undefined,
- "datasheet.name_max_length_error": undefined,
- "datasheet.name_regex_error": undefined,
- "datasheet.name_already_exists_error": undefined,
- "datasheet.creation_running": undefined,
- upload: undefined,
- upload_hint: undefined,
- upload_nofile_error: undefined,
- upload_extension_error: undefined,
- upload_max_size_error: undefined,
- upload_running: undefined,
- technical_name: undefined,
- technical_name_hint: undefined,
- technical_name_mandatory_error: undefined,
- projection: undefined,
- projection_mandatory_error: undefined,
- select_projection: undefined,
- upload_file: undefined,
- data_infos_title: undefined,
-};
diff --git a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx
index 7c16fd68..7e5eb701 100644
--- a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx
+++ b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx
@@ -8,7 +8,7 @@ import RQKeys from "../../../../../modules/entrepot/RQKeys";
import Translator from "../../../../../modules/Translator";
import { routes } from "../../../../../router/router";
import api from "../../../../api";
-import { DatasheetViewActiveTabEnum } from "../../DatasheetView/DatasheetView";
+import { DatasheetViewActiveTabEnum } from "../../DatasheetView/DatasheetView/DatasheetView";
const getStepIcon = (status: string) => {
let icon = ;
diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidRasterList/PyramidRasterList.locale.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidRasterList/PyramidRasterList.locale.tsx
new file mode 100644
index 00000000..94829adb
--- /dev/null
+++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidRasterList/PyramidRasterList.locale.tsx
@@ -0,0 +1,50 @@
+import { declareComponentKeys } from "i18nifty";
+
+import { Translations } from "../../../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | "show_linked_datas"
+ | "other_actions"
+ | "show_details"
+ | "publish_pyramid_raster"
+ | "choose_service_type"
+ | "wms_raster_label"
+ | "wms_raster_hint_text"
+ | "wmts_label"
+ | "wmts_hint_text"
+ | { K: "confirm_delete_modal.title"; P: { pyramidName: string }; R: string }
+ | "following_services_deleted"
+ | { K: "error_deleting"; P: { pyramidName: string }; R: string }
+>()("PyramidRasterList");
+export type I18n = typeof i18n;
+
+export const PyramidRasterListFrTranslations: Translations<"fr">["PyramidRasterList"] = {
+ show_linked_datas: "Voir les données liées",
+ other_actions: "Autres actions",
+ show_details: "Voir les détails",
+ publish_pyramid_raster: "Publier",
+ choose_service_type: "Choisir le service à configurer",
+ wms_raster_hint_text:
+ "Création puis publication d'images à partir d'une pyramide de tuiles raster. Ce service s'appuie sur le protocole WMS en version 1.3.0.",
+ wms_raster_label: "Service d'images (Web Map Service - WMS)",
+ wmts_hint_text: "Création puis publication d'images à partir d'une pyramide de tuiles raster. Ce service s'appuie sur le protocole WMTS en version 1.0.0.",
+ wmts_label: "Services d'images tuilées (Web Map Tile Service - WMTS)",
+ "confirm_delete_modal.title": ({ pyramidName }) => `Êtes-vous sûr de vouloir supprimer la pyramide ${pyramidName} ?`,
+ following_services_deleted: "Les services suivants seront aussi supprimés :",
+ error_deleting: ({ pyramidName }) => `La suppression de la pyramide ${pyramidName} a échoué`,
+};
+
+export const PyramidRasterListEnTranslations: Translations<"en">["PyramidRasterList"] = {
+ show_linked_datas: "Show linked datas",
+ other_actions: "Other actions",
+ show_details: "Show details",
+ publish_pyramid_raster: "Publish",
+ choose_service_type: "Define service to create",
+ wms_raster_hint_text: undefined,
+ wms_raster_label: undefined,
+ wmts_hint_text: undefined,
+ wmts_label: undefined,
+ "confirm_delete_modal.title": ({ pyramidName }) => `Are you sure you want to delete pyramid ${pyramidName} ?`,
+ following_services_deleted: "The following services will be deleted :",
+ error_deleting: ({ pyramidName }) => `Deleting ${pyramidName} pyramid failed`,
+};
diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidRasterList/PyramidRasterListItem.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidRasterList/PyramidRasterListItem.tsx
index 0bf3aae3..b4cbeb0e 100644
--- a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidRasterList/PyramidRasterListItem.tsx
+++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidRasterList/PyramidRasterListItem.tsx
@@ -14,7 +14,7 @@ import LoadingText from "../../../../../../components/Utils/LoadingText";
import MenuList from "../../../../../../components/Utils/MenuList";
import Wait from "../../../../../../components/Utils/Wait";
import useToggle from "../../../../../../hooks/useToggle";
-import { declareComponentKeys, Translations, useTranslation } from "../../../../../../i18n/i18n";
+import { useTranslation } from "../../../../../../i18n/i18n";
import RQKeys from "../../../../../../modules/entrepot/RQKeys";
import { routes } from "../../../../../../router/router";
import { formatDateFromISO, offeringTypeDisplayName } from "../../../../../../utils";
@@ -48,7 +48,7 @@ type PyramidRasterListItemProps = {
};
const PyramidRasterListItem: FC = ({ datasheetName, datastoreId, pyramid }) => {
- const { t } = useTranslation({ PyramidRasterListItem });
+ const { t } = useTranslation("PyramidRasterList");
const { t: tCommon } = useTranslation("Common");
const [showDescription, toggleShowDescription] = useToggle(false);
@@ -263,52 +263,3 @@ const PyramidRasterListItem: FC = ({ datasheetName,
};
export default memo(PyramidRasterListItem);
-
-// traductions
-export const { i18n } = declareComponentKeys<
- | "show_linked_datas"
- | "other_actions"
- | "show_details"
- | "publish_pyramid_raster"
- | "choose_service_type"
- | "wms_raster_label"
- | "wms_raster_hint_text"
- | "wmts_label"
- | "wmts_hint_text"
- | { K: "confirm_delete_modal.title"; P: { pyramidName: string }; R: string }
- | "following_services_deleted"
- | { K: "error_deleting"; P: { pyramidName: string }; R: string }
->()({
- PyramidRasterListItem,
-});
-
-export const PyramidRasterListItemFrTranslations: Translations<"fr">["PyramidRasterListItem"] = {
- show_linked_datas: "Voir les données liées",
- other_actions: "Autres actions",
- show_details: "Voir les détails",
- publish_pyramid_raster: "Publier",
- choose_service_type: "Choisir le service à configurer",
- wms_raster_hint_text:
- "Création puis publication d'images à partir d'une pyramide de tuiles raster. Ce service s'appuie sur le protocole WMS en version 1.3.0.",
- wms_raster_label: "Service d'images (Web Map Service - WMS)",
- wmts_hint_text: "Création puis publication d'images à partir d'une pyramide de tuiles raster. Ce service s'appuie sur le protocole WMTS en version 1.0.0.",
- wmts_label: "Services d'images tuilées (Web Map Tile Service - WMTS)",
- "confirm_delete_modal.title": ({ pyramidName }) => `Êtes-vous sûr de vouloir supprimer la pyramide ${pyramidName} ?`,
- following_services_deleted: "Les services suivants seront aussi supprimés :",
- error_deleting: ({ pyramidName }) => `La suppression de la pyramide ${pyramidName} a échoué`,
-};
-
-export const PyramidRasterListItemEnTranslations: Translations<"en">["PyramidRasterListItem"] = {
- show_linked_datas: "Show linked datas",
- other_actions: "Other actions",
- show_details: "Show details",
- publish_pyramid_raster: "Publish",
- choose_service_type: "Define service to create",
- wms_raster_hint_text: undefined,
- wms_raster_label: undefined,
- wmts_hint_text: undefined,
- wmts_label: undefined,
- "confirm_delete_modal.title": ({ pyramidName }) => `Are you sure you want to delete pyramid ${pyramidName} ?`,
- following_services_deleted: "The following services will be deleted :",
- error_deleting: ({ pyramidName }) => `Deleting ${pyramidName} pyramid failed`,
-};
diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorList.locale.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorList.locale.tsx
new file mode 100644
index 00000000..6b81a661
--- /dev/null
+++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorList.locale.tsx
@@ -0,0 +1,34 @@
+import { declareComponentKeys } from "i18nifty";
+
+import { Translations } from "../../../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | "show_linked_datas"
+ | "other_actions"
+ | "show_details"
+ | "publish_tms_service"
+ | { K: "confirm_delete_modal.title"; P: { pyramidName: string }; R: string }
+ | "following_services_deleted"
+ | { K: "error_deleting"; P: { pyramidName: string }; R: string }
+>()("PyramidVectorList");
+export type I18n = typeof i18n;
+
+export const PyramidVectorListFrTranslations: Translations<"fr">["PyramidVectorList"] = {
+ show_linked_datas: "Voir les données liées",
+ other_actions: "Autres actions",
+ show_details: "Voir les détails",
+ publish_tms_service: "Publier le service TMS",
+ "confirm_delete_modal.title": ({ pyramidName }) => `Êtes-vous sûr de vouloir supprimer la pyramide ${pyramidName} ?`,
+ following_services_deleted: "Les services suivants seront aussi supprimés :",
+ error_deleting: ({ pyramidName }) => `La suppression de la pyramide ${pyramidName} a échoué`,
+};
+
+export const PyramidVectorListEnTranslations: Translations<"en">["PyramidVectorList"] = {
+ show_linked_datas: "Show linked datas",
+ other_actions: "Other actions",
+ show_details: "Show details",
+ publish_tms_service: "Publish TMS service",
+ "confirm_delete_modal.title": ({ pyramidName }) => `Are you sure you want to delete pyramid ${pyramidName} ?`,
+ following_services_deleted: "The following services will be deleted :",
+ error_deleting: ({ pyramidName }) => `Deleting ${pyramidName} pyramid failed`,
+};
diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorListItem.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorListItem.tsx
index 5d049dad..0cce965a 100644
--- a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorListItem.tsx
+++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorListItem.tsx
@@ -14,7 +14,7 @@ import LoadingText from "../../../../../../components/Utils/LoadingText";
import MenuList from "../../../../../../components/Utils/MenuList";
import Wait from "../../../../../../components/Utils/Wait";
import useToggle from "../../../../../../hooks/useToggle";
-import { Translations, declareComponentKeys, getTranslation, useTranslation } from "../../../../../../i18n/i18n";
+import { getTranslation, useTranslation } from "../../../../../../i18n/i18n";
import RQKeys from "../../../../../../modules/entrepot/RQKeys";
import { routes } from "../../../../../../router/router";
import { formatDateFromISO, offeringTypeDisplayName } from "../../../../../../utils";
@@ -30,7 +30,7 @@ type PyramidVectorListItemProps = {
const { t: tCommon } = getTranslation("Common");
const PyramidVectorListItem: FC = ({ datasheetName, datastoreId, pyramid }) => {
- const { t } = useTranslation({ PyramidVectorListItem });
+ const { t } = useTranslation("PyramidVectorList");
const [showDescription, toggleShowDescription] = useToggle(false);
@@ -186,36 +186,3 @@ const PyramidVectorListItem: FC = ({ datasheetName,
};
export default memo(PyramidVectorListItem);
-
-// traductions
-export const { i18n } = declareComponentKeys<
- | "show_linked_datas"
- | "other_actions"
- | "show_details"
- | "publish_tms_service"
- | { K: "confirm_delete_modal.title"; P: { pyramidName: string }; R: string }
- | "following_services_deleted"
- | { K: "error_deleting"; P: { pyramidName: string }; R: string }
->()({
- PyramidVectorListItem,
-});
-
-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",
- publish_tms_service: "Publier le service TMS",
- "confirm_delete_modal.title": ({ pyramidName }) => `Êtes-vous sûr de vouloir supprimer la pyramide ${pyramidName} ?`,
- following_services_deleted: "Les services suivants seront aussi supprimés :",
- error_deleting: ({ pyramidName }) => `La suppression de la pyramide ${pyramidName} a échoué`,
-};
-
-export const PyramidVectorListItemEnTranslations: Translations<"en">["PyramidVectorListItem"] = {
- show_linked_datas: "Show linked datas",
- other_actions: "Other actions",
- show_details: "Show details",
- publish_tms_service: "Publish TMS service",
- "confirm_delete_modal.title": ({ pyramidName }) => `Are you sure you want to delete pyramid ${pyramidName} ?`,
- following_services_deleted: "The following services will be deleted :",
- error_deleting: ({ pyramidName }) => `Deleting ${pyramidName} pyramid failed`,
-};
diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbList.locale.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbList.locale.tsx
new file mode 100644
index 00000000..344c92bf
--- /dev/null
+++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbList.locale.tsx
@@ -0,0 +1,70 @@
+import { declareComponentKeys } from "i18nifty";
+import { Translations } from "../../../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | "create_service"
+ | "define_service"
+ | "show_linked_datas"
+ | "other_actions"
+ | "replace_datas"
+ | "show_details"
+ | "tms_label"
+ | "wfs_label"
+ | "wmsv_label"
+ | "tms_hint_text"
+ | "wfs_hint_text"
+ | "wmsv_hint_text"
+ | "tile_technical_name"
+ | "tile_technical_name_hint_text"
+ | "technical_name_is_mandatory"
+ | { K: "confirm_delete_modal.title"; P: { dbname: string }; R: string }
+ | "following_services_deleted"
+ | { K: "error_deleting"; P: { dbname: string }; R: string }
+>()("VectorDbList");
+export type I18n = typeof i18n;
+
+export const VectorDbListFrTranslations: Translations<"fr">["VectorDbList"] = {
+ create_service: "Créer un service",
+ define_service: "Choisir le service à configurer",
+ show_linked_datas: "Voir les données liées",
+ other_actions: "Autres actions",
+ replace_datas: "Remplacer les données",
+ show_details: "Voir les détails",
+ tms_label: "Service de tuiles vectorielles (Tile Map Service - TMS)",
+ wfs_label: "Service de sélection WFS (Web Feature Service - WFS)",
+ wmsv_label: "Service d’images (Web Map Service - WMS)",
+ tms_hint_text:
+ "Création puis publication d’une pyramide de tuiles vectorielles dont le rendu peut être personnalisable avec des fichiers de style proposés par vos soins ou définis par un utilisateur final. Ce service s'appuie sur le protocole TMS en version 1.0.0.",
+ wfs_hint_text:
+ "Création puis publication d’un service permettant de manipuler des objets géographiques. Ce service s'appuie sur le protocole WFS en version 2.0.0",
+ wmsv_hint_text: "Création puis publication d’images à partir de données vectorielles. Ce service s'appuie sur le protocole WMS en version 1.3.0",
+ tile_technical_name: "Nom technique de la pyramide de tuiles vectorielles",
+ tile_technical_name_hint_text:
+ "II s'agit du nom technique du service qui apparaitra dans votre espace de travail, il ne sera pas publié en ligne. Si vous le renommez, choisissez un nom explicite.",
+ technical_name_is_mandatory: "Le nom technique est obligatoire",
+ "confirm_delete_modal.title": ({ dbname }) => `Êtes-vous sûr de vouloir supprimer la base de données ${dbname} ?`,
+ following_services_deleted: "Les services suivants seront aussi supprimés :",
+ error_deleting: ({ dbname }) => `La suppression de la base de données ${dbname} a échoué`,
+};
+
+export const VectorDbListEnTranslations: Translations<"en">["VectorDbList"] = {
+ create_service: "Create service",
+ define_service: "Define service to create",
+ show_linked_datas: "Show linked datas",
+ other_actions: "Other actions",
+ replace_datas: "Replace datas",
+ show_details: "Show details",
+ tms_label: undefined,
+ wfs_label: undefined,
+ wmsv_label: undefined,
+ tms_hint_text: undefined,
+ wfs_hint_text: undefined,
+ wmsv_hint_text: undefined,
+ tile_technical_name: "Technical name of vector tile pyramid [TODO]",
+ tile_technical_name_hint_text:
+ "This is the technical name of the service which will appear in your workspace, it will not be published online. If you rename it, choose a meaningful name. [TODO]",
+ technical_name_is_mandatory: "Technical name is mandatory",
+ "confirm_delete_modal.title": ({ dbname }) => `Are you sure you want to delete database ${dbname} ?`,
+ following_services_deleted: "The following services will be deleted :",
+ error_deleting: ({ dbname }) => `Deleting ${dbname} database failed`,
+};
diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbListItem.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbListItem.tsx
index 089f3cfa..f1edf89e 100644
--- a/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbListItem.tsx
+++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbListItem.tsx
@@ -19,7 +19,8 @@ import LoadingText from "../../../../../../components/Utils/LoadingText";
import MenuList from "../../../../../../components/Utils/MenuList";
import Wait from "../../../../../../components/Utils/Wait";
import useToggle from "../../../../../../hooks/useToggle";
-import { ComponentKey, Translations, declareComponentKeys, getTranslation, useTranslation } from "../../../../../../i18n/i18n";
+import { getTranslation, useTranslation } from "../../../../../../i18n/i18n";
+import { ComponentKey } from "../../../../../../i18n/types";
import RQKeys from "../../../../../../modules/entrepot/RQKeys";
import { routes } from "../../../../../../router/router";
import { formatDateFromISO, offeringTypeDisplayName } from "../../../../../../utils";
@@ -46,7 +47,7 @@ type QuotaType = {
const getHintText = (
quotas: Record,
type: EndpointDetailResponseDtoTypeEnum,
- t: TranslationFunction<"VectorDbListItem", ComponentKey>
+ t: TranslationFunction<"VectorDbList", ComponentKey>
): JSX.Element => {
const parts: {
reactNode: ReactNode;
@@ -97,7 +98,7 @@ const getHintText = (
};
const VectorDbListItem: FC = ({ datasheetName, datastoreId, vectorDb }) => {
- const { t } = useTranslation({ VectorDbListItem });
+ const { t } = useTranslation("VectorDbList");
// création d'un service
const [serviceType, setServiceType] = useState();
@@ -407,73 +408,3 @@ const VectorDbListItem: FC = ({ datasheetName, datastoreI
VectorDbListItem.displayName = symToStr({ VectorDbListItem });
export default memo(VectorDbListItem);
-
-// traductions
-export const { i18n } = declareComponentKeys<
- | "create_service"
- | "define_service"
- | "show_linked_datas"
- | "other_actions"
- | "replace_datas"
- | "show_details"
- | "tms_label"
- | "wfs_label"
- | "wmsv_label"
- | "tms_hint_text"
- | "wfs_hint_text"
- | "wmsv_hint_text"
- | "tile_technical_name"
- | "tile_technical_name_hint_text"
- | "technical_name_is_mandatory"
- | { K: "confirm_delete_modal.title"; P: { dbname: string }; R: string }
- | "following_services_deleted"
- | { K: "error_deleting"; P: { dbname: string }; R: string }
->()({
- VectorDbListItem,
-});
-
-export const VectorDbListItemFrTranslations: Translations<"fr">["VectorDbListItem"] = {
- create_service: "Créer un service",
- define_service: "Choisir le service à configurer",
- show_linked_datas: "Voir les données liées",
- other_actions: "Autres actions",
- replace_datas: "Remplacer les données",
- show_details: "Voir les détails",
- tms_label: "Service de tuiles vectorielles (Tile Map Service - TMS)",
- wfs_label: "Service de sélection WFS (Web Feature Service - WFS)",
- wmsv_label: "Service d’images (Web Map Service - WMS)",
- tms_hint_text:
- "Création puis publication d’une pyramide de tuiles vectorielles dont le rendu peut être personnalisable avec des fichiers de style proposés par vos soins ou définis par un utilisateur final. Ce service s'appuie sur le protocole TMS en version 1.0.0.",
- wfs_hint_text:
- "Création puis publication d’un service permettant de manipuler des objets géographiques. Ce service s'appuie sur le protocole WFS en version 2.0.0",
- wmsv_hint_text: "Création puis publication d’images à partir de données vectorielles. Ce service s'appuie sur le protocole WMS en version 1.3.0",
- tile_technical_name: "Nom technique de la pyramide de tuiles vectorielles",
- tile_technical_name_hint_text:
- "II s'agit du nom technique du service qui apparaitra dans votre espace de travail, il ne sera pas publié en ligne. Si vous le renommez, choisissez un nom explicite.",
- technical_name_is_mandatory: "Le nom technique est obligatoire",
- "confirm_delete_modal.title": ({ dbname }) => `Êtes-vous sûr de vouloir supprimer la base de données ${dbname} ?`,
- following_services_deleted: "Les services suivants seront aussi supprimés :",
- error_deleting: ({ dbname }) => `La suppression de la base de données ${dbname} a échoué`,
-};
-
-export const VectorDbListItemEnTranslations: Translations<"en">["VectorDbListItem"] = {
- create_service: "Create service",
- define_service: "Define service to create",
- show_linked_datas: "Show linked datas",
- other_actions: "Other actions",
- replace_datas: "Replace datas",
- show_details: "Show details",
- tms_label: undefined,
- wfs_label: undefined,
- wmsv_label: undefined,
- tms_hint_text: undefined,
- wfs_hint_text: undefined,
- wmsv_hint_text: undefined,
- tile_technical_name: "Technical name of vector tile pyramid [TODO]",
- tile_technical_name_hint_text:
- "This is the technical name of the service which will appear in your workspace, it will not be published online. If you rename it, choose a meaningful name. [TODO]",
- technical_name_is_mandatory: "Technical name is mandatory",
- "confirm_delete_modal.title": ({ dbname }) => `Are you sure you want to delete database ${dbname} ?`,
- following_services_deleted: "The following services will be deleted :",
- error_deleting: ({ dbname }) => `Deleting ${dbname} database failed`,
-};
diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetThumbnail.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetThumbnail.tsx
index 8e3b3fc1..394a5924 100644
--- a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetThumbnail.tsx
+++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetThumbnail.tsx
@@ -16,7 +16,8 @@ import * as yup from "yup";
import type { Datasheet, DatasheetDetailed, DatasheetThumbnailAnnexe } from "../../../../@types/app";
import { ConfirmDialog, ConfirmDialogModal } from "../../../../components/Utils/ConfirmDialog";
import Wait from "../../../../components/Utils/Wait";
-import { ComponentKey, useTranslation } from "../../../../i18n/i18n";
+import { useTranslation } from "../../../../i18n/i18n";
+import { ComponentKey } from "../../../../i18n/types";
import RQKeys from "../../../../modules/entrepot/RQKeys";
import { CartesApiException } from "../../../../modules/jsonFetch";
import { getFileExtension } from "../../../../utils";
diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.locale.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.locale.tsx
new file mode 100644
index 00000000..d7261ca7
--- /dev/null
+++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.locale.tsx
@@ -0,0 +1,226 @@
+import { declareComponentKeys } from "i18nifty";
+import { ThumbnailAction } from "../DatasheetThumbnail";
+import { DatasheetDocument, DatasheetDocumentTypeEnum } from "../../../../../@types/app";
+import { Translations } from "../../../../../i18n/types";
+import { getFileExtension } from "../../../../../utils";
+
+const { i18n } = declareComponentKeys<
+ | "tab_label.metadata"
+ | { K: "tab_label.datasets"; P: { num: number }; R: string }
+ | { K: "tab_label.services"; P: { num: number }; R: string }
+ | { K: "tab_label.documents"; P: { num: number }; R: string }
+ | "datasheet.back_to_list"
+ | "datasheet.remove"
+ | { K: "datasheet.being_removed"; P: { datasheetName: string }; R: string }
+ | "file_validation.required_error"
+ | "file_validation.size_error"
+ | "file_validation.format_error"
+ | "button.title"
+ | "thumbnail_modal.title"
+ | "thumbnail_modal.file_hint"
+ | { K: "thumbnail_modal.action_being"; P: { action: ThumbnailAction }; R: string }
+ | { K: "thumbnail_action"; P: { action: ThumbnailAction }; R: string }
+ | "thumbnail_confirm_delete_modal.title"
+ | { K: "datasheet_confirm_delete_modal.title"; P: { datasheetName: string }; R: string }
+ | "datasheet_confirm_delete_modal.text"
+ | "metadata_tab.metadata.absent"
+ | "metadata_tab.metadata.is_loading"
+ | "documents_tab.documents_list.is_loading"
+ | "documents_tab.add_document"
+ | "documents_tab.add_document.type.label"
+ | { K: "documents_tab.add_document.type.options.label"; P: { docType: DatasheetDocumentTypeEnum }; R: string }
+ | "documents_tab.add_document.in_progress"
+ | "documents_tab.add_document.error.name_required"
+ | { K: "documents_tab.add_document.error.extention_incorrect"; P: { fileExtension: string; acceptedExtensions: string[] }; R: string }
+ | "documents_tab.add_document.error.extension_missing"
+ | "documents_tab.add_document.error.file_required"
+ | { K: "documents_tab.add_document.error.file_too_large"; P: { maxFileSize: number }; R: string }
+ | "documents_tab.add_document.error.url_required"
+ | "documents_tab.add_document.error.url_invalid"
+ | "documents_tab.add_document.name.label"
+ | "documents_tab.add_document.description.label"
+ | "documents_tab.add_document.file.label"
+ | { K: "documents_tab.add_document.file.hint"; P: { acceptedExtensions: string[] }; R: string }
+ | "documents_tab.add_document.link.label"
+ | { K: "documents_tab.delete_document.confirmation"; P: { display?: string }; R: string }
+ | "documents_tab.delete_document.in_progress"
+ | "documents_tab.list.no_documents"
+ | { K: "documents_tab.list.document_type"; P: { doc: DatasheetDocument }; R: string }
+ | { K: "documents_tab.edit_document"; P: { name?: string }; R: string }
+ | "documents_tab.edit_document.in_progress"
+>()("DatasheetView");
+export type I18n = typeof i18n;
+
+export const DatasheetViewFrTranslations: Translations<"fr">["DatasheetView"] = {
+ "tab_label.metadata": "Métadonnées",
+ "tab_label.datasets": ({ num }) => `Jeux de données (${num})`,
+ "tab_label.services": ({ num }) => `Services (${num})`,
+ "tab_label.documents": ({ num }) => `Documents (${num})`,
+ "datasheet.back_to_list": "Retour à ma liste de données",
+ "datasheet.remove": "Supprimer la fiche de données",
+ "datasheet.being_removed": ({ datasheetName }) => `Suppression de la fiche de données ${datasheetName} en cours ...`,
+ "file_validation.required_error": "Aucun fichier n'a été choisi",
+ "file_validation.size_error": "La taille du fichier ne peut excéder 2 Mo",
+ "file_validation.format_error": "Le fichier doit être au format jpeg ou png",
+ "button.title": "Ajouter, modifier ou supprimer la vignette",
+ "thumbnail_modal.title": "Vignette pour la fiche de données",
+ "thumbnail_modal.file_hint": "Taille maximale : 2 Mo. Formats acceptés : jpg, png",
+ "thumbnail_modal.action_being": ({ action }) => {
+ switch (action) {
+ case "add":
+ return "Ajout de la vignette en cours ...";
+ case "modify":
+ return "Remplacement de la vignette en cours ...";
+ case "delete":
+ return "Suppression de la vignette en cours ...";
+ }
+ },
+ thumbnail_action: ({ action }) => {
+ switch (action) {
+ case "add":
+ return "Ajouter une vignette";
+ case "modify":
+ return "Remplacer la vignette";
+ case "delete":
+ return "Supprimer la vignette";
+ }
+ },
+ "thumbnail_confirm_delete_modal.title": "Êtes-vous sûr de vouloir supprimer la vignette de cette fiche de données ?",
+ "datasheet_confirm_delete_modal.title": ({ datasheetName }) => `Êtes-vous sûr de supprimer la fiche de données ${datasheetName} ?`,
+ "datasheet_confirm_delete_modal.text": "Les éléments suivants seront supprimés :",
+ "metadata_tab.metadata.absent":
+ "Les métadonnées de cette fiche ne sont pas encore disponibles. Créez un premier service à partir d’un de vos jeux de données pour les compléter.",
+ "metadata_tab.metadata.is_loading": "Les métadonnées sont en cours de chargement",
+ "documents_tab.documents_list.is_loading": "Les documents sont en cours de chargement",
+ "documents_tab.add_document": "Ajouter un document",
+ "documents_tab.add_document.type.label": "Type de document",
+ "documents_tab.add_document.type.options.label": ({ docType }) => {
+ switch (docType) {
+ case DatasheetDocumentTypeEnum.File:
+ return "Fichier";
+ case DatasheetDocumentTypeEnum.Link:
+ return "Lien externe";
+ }
+ },
+ "documents_tab.add_document.in_progress": "Ajout de document en cours",
+ "documents_tab.add_document.error.name_required": "Le nom est obligatoire",
+ "documents_tab.add_document.error.extention_incorrect": ({ fileExtension, acceptedExtensions }) => {
+ let str = `L'extension ${fileExtension} n'est pas acceptée, `;
+
+ if (acceptedExtensions.length === 1) {
+ str += ` l'extension acceptée est ${acceptedExtensions[0]}`;
+ } else {
+ const lastExtension = acceptedExtensions.pop();
+
+ str += `les extensions acceptées sont ${acceptedExtensions.join(", ")} et ${lastExtension}`;
+ }
+
+ return str;
+ },
+ "documents_tab.add_document.error.extension_missing": "Extension du fichier manquante",
+ "documents_tab.add_document.error.file_required": "Le fichier est obligatoire",
+ "documents_tab.add_document.error.file_too_large": ({ maxFileSize }) => `La taille du fichier téléversé ne peux excéder ${maxFileSize} Mo`,
+ "documents_tab.add_document.error.url_required": "L'URL est obligatoire",
+ "documents_tab.add_document.error.url_invalid": "L'URL est invalide",
+ "documents_tab.add_document.name.label": "Nom du document",
+ "documents_tab.add_document.description.label": "Description du document (optionnelle)",
+ "documents_tab.add_document.file.label": "Téléverser un fichier",
+ "documents_tab.add_document.file.hint": ({ acceptedExtensions }) => {
+ let acceptedExtensionsStr: string;
+
+ if (acceptedExtensions.length === 1) {
+ acceptedExtensionsStr = acceptedExtensions[0];
+ } else {
+ const lastExtension = acceptedExtensions.pop();
+ acceptedExtensionsStr = `${acceptedExtensions.join(", ")} ou ${lastExtension}`;
+ }
+
+ return `Fichier ${acceptedExtensionsStr} de moins de 5 Mo uniquement`;
+ },
+ "documents_tab.add_document.link.label": "Lien vers le document",
+ "documents_tab.delete_document.confirmation": ({ display }) => `Êtes-vous sûr de vouloir supprimer le document ${display} ?`,
+ "documents_tab.delete_document.in_progress": "Suppression du document en cours",
+ "documents_tab.list.no_documents": "Il n'y a pas encore de documents liés à cette fiche de données.",
+ "documents_tab.list.document_type": ({ doc }) => {
+ if (doc.type === DatasheetDocumentTypeEnum.Link.valueOf()) {
+ return "Lien externe";
+ }
+
+ const fileExtension = getFileExtension(doc.url)?.toLowerCase();
+
+ switch (fileExtension) {
+ case "pdf":
+ return "PDF";
+ case "qgz":
+ return "Projet QGIS";
+ default:
+ return doc.type.toUpperCase();
+ }
+ },
+ "documents_tab.edit_document": ({ name }) => `Modifier le document ${name}`,
+ "documents_tab.edit_document.in_progress": "Modification du document en cours",
+};
+
+export const DatasheetViewEnTranslations: Translations<"en">["DatasheetView"] = {
+ "tab_label.metadata": "Metadata",
+ "tab_label.datasets": ({ num }) => `Datasets (${num})`,
+ "tab_label.services": ({ num }) => `Services (${num})`,
+ "tab_label.documents": ({ num }) => `Documents (${num})`,
+ "datasheet.back_to_list": "Back to my data list",
+ "datasheet.remove": "Delete datasheet",
+ "datasheet.being_removed": ({ datasheetName }) => `Datasheet ${datasheetName} being removed ...`,
+ "file_validation.required_error": "No files have been chosen",
+ "file_validation.size_error": "File size cannot exceed 2 MB",
+ "file_validation.format_error": "Format required for file is jpeg or png",
+ "button.title": "Add, modify or remove thumbnail",
+ "thumbnail_modal.title": "Datasheet thumbnail",
+ "thumbnail_modal.file_hint": "Max size : 2 Mo. Accepted formats : jpg, png",
+ "thumbnail_modal.action_being": ({ action }) => {
+ switch (action) {
+ case "add":
+ return "Thumbnail being added ...";
+ case "modify":
+ return "Thumbnail being replaced ...";
+ case "delete":
+ return "Thumbnail being deleted ...";
+ }
+ },
+ thumbnail_action: ({ action }) => {
+ switch (action) {
+ case "add":
+ return "Add thumbnail";
+ case "modify":
+ return "Replace thumbnail";
+ case "delete":
+ return "Delete thumbnail";
+ }
+ },
+ "thumbnail_confirm_delete_modal.title": "Are you sure you want to remove the thumbnail from this data sheet",
+ "datasheet_confirm_delete_modal.title": ({ datasheetName }) => `Are you sure you want to delete datasheet ${datasheetName} ?`,
+ "datasheet_confirm_delete_modal.text": "The following items will be deleted :",
+ "metadata_tab.metadata.absent": undefined,
+ "metadata_tab.metadata.is_loading": undefined,
+ "documents_tab.documents_list.is_loading": undefined,
+ "documents_tab.add_document": undefined,
+ "documents_tab.add_document.type.label": undefined,
+ "documents_tab.add_document.type.options.label": undefined,
+ "documents_tab.add_document.in_progress": undefined,
+ "documents_tab.add_document.error.name_required": undefined,
+ "documents_tab.add_document.error.extention_incorrect": undefined,
+ "documents_tab.add_document.error.extension_missing": undefined,
+ "documents_tab.add_document.error.file_required": undefined,
+ "documents_tab.add_document.error.file_too_large": undefined,
+ "documents_tab.add_document.error.url_required": undefined,
+ "documents_tab.add_document.error.url_invalid": undefined,
+ "documents_tab.add_document.name.label": undefined,
+ "documents_tab.add_document.description.label": undefined,
+ "documents_tab.add_document.file.label": undefined,
+ "documents_tab.add_document.file.hint": undefined,
+ "documents_tab.add_document.link.label": undefined,
+ "documents_tab.delete_document.confirmation": undefined,
+ "documents_tab.delete_document.in_progress": undefined,
+ "documents_tab.list.no_documents": undefined,
+ "documents_tab.list.document_type": undefined,
+ "documents_tab.edit_document": undefined,
+ "documents_tab.edit_document.in_progress": undefined,
+};
diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.tsx
similarity index 50%
rename from assets/entrepot/pages/datasheet/DatasheetView/DatasheetView.tsx
rename to assets/entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.tsx
index dcbdc527..ae6c8584 100644
--- a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView.tsx
+++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.tsx
@@ -10,21 +10,20 @@ import { FC } from "react";
import { createPortal } from "react-dom";
import { symToStr } from "tsafe/symToStr";
-import { DatasheetDocumentTypeEnum, type Datasheet, type DatasheetDetailed, type DatasheetDocument, type Metadata } from "../../../../@types/app";
-import DatastoreLayout from "../../../../components/Layout/DatastoreLayout";
-import LoadingIcon from "../../../../components/Utils/LoadingIcon";
-import Wait from "../../../../components/Utils/Wait";
-import { Translations, declareComponentKeys, useTranslation } from "../../../../i18n/i18n";
-import RQKeys from "../../../../modules/entrepot/RQKeys";
-import { type CartesApiException } from "../../../../modules/jsonFetch";
-import { routes, useRoute } from "../../../../router/router";
-import { getFileExtension } from "../../../../utils";
-import api from "../../../api";
-import DatasetListTab from "./DatasetListTab/DatasetListTab";
-import DatasheetThumbnail, { type ThumbnailAction } from "./DatasheetThumbnail";
-import DocumentsTab from "./DocumentsTab/DocumentsTab";
-import MetadataTab from "./MetadataTab/MetadataTab";
-import ServicesListTab from "./ServiceListTab/ServicesListTab";
+import { type Datasheet, type DatasheetDetailed, type Metadata } from "../../../../../@types/app";
+import DatastoreLayout from "../../../../../components/Layout/DatastoreLayout";
+import LoadingIcon from "../../../../../components/Utils/LoadingIcon";
+import Wait from "../../../../../components/Utils/Wait";
+import { useTranslation } from "../../../../../i18n/i18n";
+import RQKeys from "../../../../../modules/entrepot/RQKeys";
+import { type CartesApiException } from "../../../../../modules/jsonFetch";
+import { routes, useRoute } from "../../../../../router/router";
+import api from "../../../../api";
+import DatasetListTab from "../DatasetListTab/DatasetListTab";
+import DatasheetThumbnail from "../DatasheetThumbnail";
+import DocumentsTab from "../DocumentsTab/DocumentsTab";
+import MetadataTab from "../MetadataTab/MetadataTab";
+import ServicesListTab from "../ServiceListTab/ServicesListTab";
const deleteDataConfirmModal = createModal({
id: "delete-data-confirm-modal",
@@ -271,226 +270,3 @@ const DatasheetView: FC = ({ datastoreId, datasheetName }) =
DatasheetView.displayName = symToStr({ DatasheetView });
export default DatasheetView;
-
-// Traductions
-export const { i18n } = declareComponentKeys<
- | "tab_label.metadata"
- | { K: "tab_label.datasets"; P: { num: number }; R: string }
- | { K: "tab_label.services"; P: { num: number }; R: string }
- | { K: "tab_label.documents"; P: { num: number }; R: string }
- | "datasheet.back_to_list"
- | "datasheet.remove"
- | { K: "datasheet.being_removed"; P: { datasheetName: string }; R: string }
- | "file_validation.required_error"
- | "file_validation.size_error"
- | "file_validation.format_error"
- | "button.title"
- | "thumbnail_modal.title"
- | "thumbnail_modal.file_hint"
- | { K: "thumbnail_modal.action_being"; P: { action: ThumbnailAction }; R: string }
- | { K: "thumbnail_action"; P: { action: ThumbnailAction }; R: string }
- | "thumbnail_confirm_delete_modal.title"
- | { K: "datasheet_confirm_delete_modal.title"; P: { datasheetName: string }; R: string }
- | "datasheet_confirm_delete_modal.text"
- | "metadata_tab.metadata.absent"
- | "metadata_tab.metadata.is_loading"
- | "documents_tab.documents_list.is_loading"
- | "documents_tab.add_document"
- | "documents_tab.add_document.type.label"
- | { K: "documents_tab.add_document.type.options.label"; P: { docType: DatasheetDocumentTypeEnum }; R: string }
- | "documents_tab.add_document.in_progress"
- | "documents_tab.add_document.error.name_required"
- | { K: "documents_tab.add_document.error.extention_incorrect"; P: { fileExtension: string; acceptedExtensions: string[] }; R: string }
- | "documents_tab.add_document.error.extension_missing"
- | "documents_tab.add_document.error.file_required"
- | { K: "documents_tab.add_document.error.file_too_large"; P: { maxFileSize: number }; R: string }
- | "documents_tab.add_document.error.url_required"
- | "documents_tab.add_document.error.url_invalid"
- | "documents_tab.add_document.name.label"
- | "documents_tab.add_document.description.label"
- | "documents_tab.add_document.file.label"
- | { K: "documents_tab.add_document.file.hint"; P: { acceptedExtensions: string[] }; R: string }
- | "documents_tab.add_document.link.label"
- | { K: "documents_tab.delete_document.confirmation"; P: { display?: string }; R: string }
- | "documents_tab.delete_document.in_progress"
- | "documents_tab.list.no_documents"
- | { K: "documents_tab.list.document_type"; P: { doc: DatasheetDocument }; R: string }
- | { K: "documents_tab.edit_document"; P: { name?: string }; R: string }
- | "documents_tab.edit_document.in_progress"
->()({
- DatasheetView,
-});
-
-export const DatasheetViewFrTranslations: Translations<"fr">["DatasheetView"] = {
- "tab_label.metadata": "Métadonnées",
- "tab_label.datasets": ({ num }) => `Jeux de données (${num})`,
- "tab_label.services": ({ num }) => `Services (${num})`,
- "tab_label.documents": ({ num }) => `Documents (${num})`,
- "datasheet.back_to_list": "Retour à ma liste de données",
- "datasheet.remove": "Supprimer la fiche de données",
- "datasheet.being_removed": ({ datasheetName }) => `Suppression de la fiche de données ${datasheetName} en cours ...`,
- "file_validation.required_error": "Aucun fichier n'a été choisi",
- "file_validation.size_error": "La taille du fichier ne peut excéder 2 Mo",
- "file_validation.format_error": "Le fichier doit être au format jpeg ou png",
- "button.title": "Ajouter, modifier ou supprimer la vignette",
- "thumbnail_modal.title": "Vignette pour la fiche de données",
- "thumbnail_modal.file_hint": "Taille maximale : 2 Mo. Formats acceptés : jpg, png",
- "thumbnail_modal.action_being": ({ action }) => {
- switch (action) {
- case "add":
- return "Ajout de la vignette en cours ...";
- case "modify":
- return "Remplacement de la vignette en cours ...";
- case "delete":
- return "Suppression de la vignette en cours ...";
- }
- },
- thumbnail_action: ({ action }) => {
- switch (action) {
- case "add":
- return "Ajouter une vignette";
- case "modify":
- return "Remplacer la vignette";
- case "delete":
- return "Supprimer la vignette";
- }
- },
- "thumbnail_confirm_delete_modal.title": "Êtes-vous sûr de vouloir supprimer la vignette de cette fiche de données ?",
- "datasheet_confirm_delete_modal.title": ({ datasheetName }) => `Êtes-vous sûr de supprimer la fiche de données ${datasheetName} ?`,
- "datasheet_confirm_delete_modal.text": "Les éléments suivants seront supprimés :",
- "metadata_tab.metadata.absent":
- "Les métadonnées de cette fiche ne sont pas encore disponibles. Créez un premier service à partir d’un de vos jeux de données pour les compléter.",
- "metadata_tab.metadata.is_loading": "Les métadonnées sont en cours de chargement",
- "documents_tab.documents_list.is_loading": "Les documents sont en cours de chargement",
- "documents_tab.add_document": "Ajouter un document",
- "documents_tab.add_document.type.label": "Type de document",
- "documents_tab.add_document.type.options.label": ({ docType }) => {
- switch (docType) {
- case DatasheetDocumentTypeEnum.File:
- return "Fichier";
- case DatasheetDocumentTypeEnum.Link:
- return "Lien externe";
- }
- },
- "documents_tab.add_document.in_progress": "Ajout de document en cours",
- "documents_tab.add_document.error.name_required": "Le nom est obligatoire",
- "documents_tab.add_document.error.extention_incorrect": ({ fileExtension, acceptedExtensions }) => {
- let str = `L'extension ${fileExtension} n'est pas acceptée, `;
-
- if (acceptedExtensions.length === 1) {
- str += ` l'extension acceptée est ${acceptedExtensions[0]}`;
- } else {
- const lastExtension = acceptedExtensions.pop();
-
- str += `les extensions acceptées sont ${acceptedExtensions.join(", ")} et ${lastExtension}`;
- }
-
- return str;
- },
- "documents_tab.add_document.error.extension_missing": "Extension du fichier manquante",
- "documents_tab.add_document.error.file_required": "Le fichier est obligatoire",
- "documents_tab.add_document.error.file_too_large": ({ maxFileSize }) => `La taille du fichier téléversé ne peux excéder ${maxFileSize} Mo`,
- "documents_tab.add_document.error.url_required": "L'URL est obligatoire",
- "documents_tab.add_document.error.url_invalid": "L'URL est invalide",
- "documents_tab.add_document.name.label": "Nom du document",
- "documents_tab.add_document.description.label": "Description du document (optionnelle)",
- "documents_tab.add_document.file.label": "Téléverser un fichier",
- "documents_tab.add_document.file.hint": ({ acceptedExtensions }) => {
- let acceptedExtensionsStr: string;
-
- if (acceptedExtensions.length === 1) {
- acceptedExtensionsStr = acceptedExtensions[0];
- } else {
- const lastExtension = acceptedExtensions.pop();
- acceptedExtensionsStr = `${acceptedExtensions.join(", ")} ou ${lastExtension}`;
- }
-
- return `Fichier ${acceptedExtensionsStr} de moins de 5 Mo uniquement`;
- },
- "documents_tab.add_document.link.label": "Lien vers le document",
- "documents_tab.delete_document.confirmation": ({ display }) => `Êtes-vous sûr de vouloir supprimer le document ${display} ?`,
- "documents_tab.delete_document.in_progress": "Suppression du document en cours",
- "documents_tab.list.no_documents": "Il n'y a pas encore de documents liés à cette fiche de données.",
- "documents_tab.list.document_type": ({ doc }) => {
- if (doc.type === DatasheetDocumentTypeEnum.Link.valueOf()) {
- return "Lien externe";
- }
-
- const fileExtension = getFileExtension(doc.url)?.toLowerCase();
-
- switch (fileExtension) {
- case "pdf":
- return "PDF";
- case "qgz":
- return "Projet QGIS";
- default:
- return doc.type.toUpperCase();
- }
- },
- "documents_tab.edit_document": ({ name }) => `Modifier le document ${name}`,
- "documents_tab.edit_document.in_progress": "Modification du document en cours",
-};
-
-export const DatasheetViewEnTranslations: Translations<"en">["DatasheetView"] = {
- "tab_label.metadata": "Metadata",
- "tab_label.datasets": ({ num }) => `Datasets (${num})`,
- "tab_label.services": ({ num }) => `Services (${num})`,
- "tab_label.documents": ({ num }) => `Documents (${num})`,
- "datasheet.back_to_list": "Back to my data list",
- "datasheet.remove": "Delete datasheet",
- "datasheet.being_removed": ({ datasheetName }) => `Datasheet ${datasheetName} being removed ...`,
- "file_validation.required_error": "No files have been chosen",
- "file_validation.size_error": "File size cannot exceed 2 MB",
- "file_validation.format_error": "Format required for file is jpeg or png",
- "button.title": "Add, modify or remove thumbnail",
- "thumbnail_modal.title": "Datasheet thumbnail",
- "thumbnail_modal.file_hint": "Max size : 2 Mo. Accepted formats : jpg, png",
- "thumbnail_modal.action_being": ({ action }) => {
- switch (action) {
- case "add":
- return "Thumbnail being added ...";
- case "modify":
- return "Thumbnail being replaced ...";
- case "delete":
- return "Thumbnail being deleted ...";
- }
- },
- thumbnail_action: ({ action }) => {
- switch (action) {
- case "add":
- return "Add thumbnail";
- case "modify":
- return "Replace thumbnail";
- case "delete":
- return "Delete thumbnail";
- }
- },
- "thumbnail_confirm_delete_modal.title": "Are you sure you want to remove the thumbnail from this data sheet",
- "datasheet_confirm_delete_modal.title": ({ datasheetName }) => `Are you sure you want to delete datasheet ${datasheetName} ?`,
- "datasheet_confirm_delete_modal.text": "The following items will be deleted :",
- "metadata_tab.metadata.absent": undefined,
- "metadata_tab.metadata.is_loading": undefined,
- "documents_tab.documents_list.is_loading": undefined,
- "documents_tab.add_document": undefined,
- "documents_tab.add_document.type.label": undefined,
- "documents_tab.add_document.type.options.label": undefined,
- "documents_tab.add_document.in_progress": undefined,
- "documents_tab.add_document.error.name_required": undefined,
- "documents_tab.add_document.error.extention_incorrect": undefined,
- "documents_tab.add_document.error.extension_missing": undefined,
- "documents_tab.add_document.error.file_required": undefined,
- "documents_tab.add_document.error.file_too_large": undefined,
- "documents_tab.add_document.error.url_required": undefined,
- "documents_tab.add_document.error.url_invalid": undefined,
- "documents_tab.add_document.name.label": undefined,
- "documents_tab.add_document.description.label": undefined,
- "documents_tab.add_document.file.label": undefined,
- "documents_tab.add_document.file.hint": undefined,
- "documents_tab.add_document.link.label": undefined,
- "documents_tab.delete_document.confirmation": undefined,
- "documents_tab.delete_document.in_progress": undefined,
- "documents_tab.list.no_documents": undefined,
- "documents_tab.list.document_type": undefined,
- "documents_tab.edit_document": undefined,
- "documents_tab.edit_document.in_progress": undefined,
-};
diff --git a/assets/entrepot/pages/datastore/Confirmation.tsx b/assets/entrepot/pages/datastore/Confirmation.tsx
index 5858767d..691d5721 100644
--- a/assets/entrepot/pages/datastore/Confirmation.tsx
+++ b/assets/entrepot/pages/datastore/Confirmation.tsx
@@ -2,7 +2,7 @@ import { fr } from "@codegouvfr/react-dsfr";
import Alert from "@codegouvfr/react-dsfr/Alert";
import Button from "@codegouvfr/react-dsfr/Button";
import AppLayout from "../../../components/Layout/AppLayout";
-import { datastoreNavItems } from "../../../config/datastoreNavItems";
+import { datastoreNavItems } from "../../../config/navItems/datastoreNavItems";
import Translator from "../../../modules/Translator";
import { routes } from "../../../router/router";
diff --git a/assets/entrepot/pages/datastore/DatastoreCreationForm.tsx b/assets/entrepot/pages/datastore/DatastoreCreationForm.tsx
index 6c98f913..a65315ae 100644
--- a/assets/entrepot/pages/datastore/DatastoreCreationForm.tsx
+++ b/assets/entrepot/pages/datastore/DatastoreCreationForm.tsx
@@ -13,7 +13,7 @@ import { jsonFetch } from "../../../modules/jsonFetch";
import { removeDiacritics } from "../../../utils";
import Wait from "../../../components/Utils/Wait";
import Alert from "@codegouvfr/react-dsfr/Alert";
-import { datastoreNavItems } from "../../../config/datastoreNavItems";
+import { datastoreNavItems } from "../../../config/navItems/datastoreNavItems";
const DatastoreCreationForm: FC = () => {
const schema = yup
diff --git a/assets/entrepot/pages/datastore/ManagePermissions/DatastorePermissionsTr.ts b/assets/entrepot/pages/datastore/ManagePermissions/DatastorePermissions.locale.tsx
similarity index 98%
rename from assets/entrepot/pages/datastore/ManagePermissions/DatastorePermissionsTr.ts
rename to assets/entrepot/pages/datastore/ManagePermissions/DatastorePermissions.locale.tsx
index 8a578862..fc8421cc 100644
--- a/assets/entrepot/pages/datastore/ManagePermissions/DatastorePermissionsTr.ts
+++ b/assets/entrepot/pages/datastore/ManagePermissions/DatastorePermissions.locale.tsx
@@ -1,11 +1,12 @@
import { compareAsc } from "date-fns";
import { declareComponentKeys } from "i18nifty";
-import { Translations } from "../../../../i18n/i18n";
+
import { DatastorePermissionResponseDto, PermissionBeneficiaryDto } from "../../../../@types/entrepot";
+import type { Translations } from "../../../../i18n/types";
import { formatDateFromISO } from "../../../../utils";
// traductions
-export const { i18n } = declareComponentKeys<
+const { i18n } = declareComponentKeys<
| { K: "list.title"; P: { datastoreName?: string }; R: string }
| "list.licence_header"
| "list.expiration_date_header"
@@ -48,6 +49,7 @@ export const { i18n } = declareComponentKeys<
| { K: "info.granted_to"; P: { beneficiary?: PermissionBeneficiaryDto }; R: string }
| "info.oauth_required"
>()("DatastorePermissions");
+export type I18n = typeof i18n;
const getExpiredDate = (lang: "fr" | "en", endDate?: string) => {
if (endDate === undefined) {
diff --git a/assets/entrepot/pages/datastore/ManagePermissions/ValidationSchemas.tsx b/assets/entrepot/pages/datastore/ManagePermissions/ValidationSchemas.tsx
index 97f1f85b..5d9a75c8 100644
--- a/assets/entrepot/pages/datastore/ManagePermissions/ValidationSchemas.tsx
+++ b/assets/entrepot/pages/datastore/ManagePermissions/ValidationSchemas.tsx
@@ -1,8 +1,8 @@
+import { TranslationFunction } from "i18nifty/typeUtils/TranslationFunction";
import { isUUID } from "validator";
import * as yup from "yup";
import { PermissionCreateDtoTypeEnum } from "../../../../@types/entrepot";
-import { ComponentKey } from "../../../../i18n/i18n";
-import { TranslationFunction } from "i18nifty/typeUtils/TranslationFunction";
+import type { ComponentKey } from "../../../../i18n/types";
const types: string[] = Object.values(PermissionCreateDtoTypeEnum);
diff --git a/assets/entrepot/pages/datastore/ManageStorage/DatastoreManageStorage.locale.tsx b/assets/entrepot/pages/datastore/ManageStorage/DatastoreManageStorage.locale.tsx
new file mode 100644
index 00000000..6da9af05
--- /dev/null
+++ b/assets/entrepot/pages/datastore/ManageStorage/DatastoreManageStorage.locale.tsx
@@ -0,0 +1,239 @@
+import { declareComponentKeys } from "i18nifty";
+import { StoredDataTypeEnum, UploadTypeEnum } from "../../../../@types/app";
+import { Translations } from "../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ // commun
+ | { K: "title"; P: { datastoreName?: string }; R: string }
+ | "explanation"
+ | "storage.not_found"
+ | "data.size.unknown"
+ | { K: "stored_data.type.title"; P: { type: StoredDataTypeEnum }; R: string }
+
+ // FILESYSTEM
+ | { K: "storage.filesystem.label"; R: JSX.Element }
+ | "storage.filesystem.stored_data_list.loading"
+ | { K: "storage.filesystem.deletion.confirmation"; P: { storedDataName?: string; storedDataId?: string }; R: string }
+ | "storage.filesystem.deletion.in_progress"
+ | "storage.filesystem.explanation"
+
+ // POSTGRES
+ | { K: "storage.postgresql.label"; R: JSX.Element }
+ | "storage.postgresql.vectordb.loading"
+ | { K: "storage.postgresql.deletion.confirmation"; P: { storedDataName?: string; storedDataId?: string }; R: string }
+ | "storage.postgresql.deletion.in_progress"
+ | "storage.postgresql.explanation"
+
+ // S3
+ | { K: "storage.s3.label"; R: JSX.Element }
+ | "storage.s3.stored_data_list.loading"
+ | { K: "storage.s3.deletion.confirmation"; P: { storedDataName?: string; storedDataId?: string }; R: string }
+ | "storage.s3.deletion.in_progress"
+ | "storage.s3.explanation"
+
+ // upload
+ | { K: "storage.upload.label"; R: JSX.Element }
+ | "storage.upload.loading"
+ | { K: "storage.upload.deletion.confirmation"; P: { uploadName?: string; uploadId?: string }; R: string }
+ | "storage.upload.deletion.in_progress"
+ | "storage.upload.explanation"
+ | { K: "storage.upload.type.title"; P: { type: UploadTypeEnum }; R: string }
+
+ // annexe
+ | { K: "storage.annexe.label"; R: JSX.Element }
+ | "storage.annexe.loading"
+ | { K: "storage.annexe.deletion.confirmation"; P: { annexeId?: string }; R: string }
+ | "storage.annexe.deletion.in_progress"
+ | "storage.annexe.explanation"
+ | { K: "storage.annexe.labels.type"; P: { type: string }; R: string }
+
+ // endpoint
+ | { K: "storage.endpoints.label"; R: JSX.Element }
+ | "storage.endpoints.loading"
+ | { K: "storage.endpoints.deletion.confirmation"; P: { offeringName?: string; offeringId?: string }; R: string }
+ | "storage.endpoints.deletion.in_progress"
+ | "storage.endpoints.explanation"
+
+ // endpoint metadata
+ | { K: "storage.endpoints.metadata.deletion.confirmation"; P: { metadataIdentifier?: string; metadataId?: string }; R: string }
+ | "storage.endpoints.metadata.deletion.in_progress"
+
+ // statics
+ | { K: "storage.statics.label"; R: JSX.Element }
+ | "storage.statics.loading"
+ | { K: "storage.statics.deletion.confirmation"; P: { staticId?: string }; R: string }
+ | "storage.statics.deletion.in_progress"
+ | "storage.statics.explanation"
+>()("DatastoreManageStorage");
+export type I18n = typeof i18n;
+
+export const DatastoreManageStorageFrTranslations: Translations<"fr">["DatastoreManageStorage"] = {
+ title: ({ datastoreName }) => `Suivi des consommations de l’espace de travail${datastoreName ? " " + datastoreName : ""}`,
+ explanation:
+ "Cette page vous permet de voir en un seul coup d'œil le volume de vos données et votre situation par rapport aux différents quotas qui vous sont alloués.",
+ "storage.not_found": "Aucun stockage de ce type n'est attribué à votre espace de travail.",
+ "data.size.unknown": "Taille inconnue",
+ "stored_data.type.title": ({ type }) => {
+ switch (type) {
+ case StoredDataTypeEnum.VECTORDB:
+ return "Données vectorielles en BD PostgreSQL";
+ case StoredDataTypeEnum.ROK4PYRAMIDVECTOR:
+ return "Pyramide de tuiles vectorielles";
+ case StoredDataTypeEnum.ROK4PYRAMIDRASTER:
+ return "Pyramide de tuiles raster";
+ default:
+ return type;
+ }
+ },
+ "storage.upload.type.title": ({ type }) => {
+ switch (type) {
+ case UploadTypeEnum.VECTOR:
+ return "Vecteur";
+ case UploadTypeEnum.RASTER:
+ return "Raster";
+ default:
+ return type;
+ }
+ },
+ "storage.filesystem.label": (
+
+ Données intégrées sous forme de fichiers
+
+ ),
+ "storage.filesystem.stored_data_list.loading": "Chargement des données stockées sous forme de fichiers.",
+ "storage.filesystem.deletion.confirmation": ({ storedDataName, storedDataId }) =>
+ `Êtes-vous sûr de vouloir supprimer la donnée stockée ${storedDataName} (${storedDataId}) ?`,
+ "storage.filesystem.deletion.in_progress": "Suppression de la donnée stockée en cours",
+ "storage.filesystem.explanation": "Cet espace est utilisé pour le stockage des pyramides de tuiles vectorielles.",
+ "storage.postgresql.label": (
+
+ Données intégrées en base
+
+ ),
+ "storage.postgresql.vectordb.loading": "Chargement des données vectorielles en BD PostgreSQL en cours",
+ "storage.postgresql.deletion.confirmation": ({ storedDataName, storedDataId }) =>
+ `Êtes-vous sûr de vouloir supprimer la donnée stockée ${storedDataName} (${storedDataId}) ?`,
+ "storage.postgresql.deletion.in_progress": "Suppression de la donnée stockée en cours",
+ "storage.postgresql.explanation":
+ "Il s'agit de l’espace occupé par des données sur les serveurs PostgreSQL de votre espace de travail. Il s'agit de données intermédiaires qui ne sont pas directement visibles de vos utilisateurs.",
+ "storage.s3.label": (
+
+ Stockage de masse
+
+ ),
+ "storage.s3.stored_data_list.loading": "Chargement des données stockées dans le stockage de masse en cours",
+ "storage.s3.deletion.confirmation": ({ storedDataName, storedDataId }) =>
+ `Êtes-vous sûr de vouloir supprimer la donnée stockée ${storedDataName} (${storedDataId}) ?`,
+ "storage.s3.deletion.in_progress": "Suppression de la donnée stockée en cours",
+ "storage.s3.explanation":
+ "Cet espace est utilisé pour le stockage des pyramides de tuiles vectorielles. Il est plus performant que le stockage sous forme de fichiers.",
+ "storage.upload.label": (
+
+ Données déposées
+
+ ),
+ "storage.upload.loading": "Chargement des données déposées en cours",
+ "storage.upload.deletion.confirmation": ({ uploadName, uploadId }) => `Êtes-vous sûr de vouloir supprimer la donnée déposée ${uploadName} (${uploadId}) ?`,
+ "storage.upload.deletion.in_progress": "Suppression de la donnée déposée en cours",
+ "storage.upload.explanation":
+ "Il s'agit de l’espace occupé par les fichiers de données bruts que vous avez téléversés (fichiers csv, geopackage...). Ces fichiers sont normalement supprimés dès l’intégration en base réussie de vos données. Il est possible qu'il reste des traces de fichiers dans cet espace lorsque les intégrations en base ont échoué.",
+
+ "storage.annexe.label": (
+
+ Fichiers annexes
+
+ ),
+ "storage.annexe.loading": "Chargement des annexes",
+ "storage.annexe.deletion.confirmation": ({ annexeId }) => `Êtes-vous sûr de vouloir supprimer l’annexe ${annexeId} ?`,
+ "storage.annexe.deletion.in_progress": "Suppression de l’annexe en cours",
+ "storage.annexe.explanation":
+ "Cet espace est occupé par les fichiers mis à disposition de vos utilisateurs via des adresses publiques. Il s'agit généralement des fichiers de style au format JSON qui servent à symboliser vos pyramides de tuiles vectorielles.",
+ "storage.annexe.labels.type": ({ type }) => {
+ switch (type) {
+ case "style":
+ return "style";
+ case "thumbnail":
+ return "vignette";
+ default:
+ return type;
+ }
+ },
+ "storage.endpoints.label": (
+
+ Points de publication
+
+ ),
+ "storage.endpoints.loading": "Chargement des flux publiés et des métadonnées en cours",
+ "storage.endpoints.deletion.confirmation": ({ offeringName, offeringId }) => `Êtes-vous sûr de vouloir dépublier le flux ${offeringName} (${offeringId}) ?`,
+ "storage.endpoints.deletion.in_progress": "Suppression du flux en cours",
+ "storage.endpoints.explanation": "Il s'agit du nombre de couches et de métadonnées publiées par point de publication dans votre espace de travail.",
+
+ "storage.endpoints.metadata.deletion.confirmation": ({ metadataIdentifier, metadataId }) =>
+ `Êtes-vous sûr de vouloir supprimer la métadonnée ${metadataIdentifier} (${metadataId}) ?`,
+ "storage.endpoints.metadata.deletion.in_progress": "Suppression de la métadonnée en cours",
+
+ "storage.statics.label": (
+
+ Fichiers statiques
+
+ ),
+ "storage.statics.loading": "Chargement des fichiers statiques",
+ "storage.statics.deletion.confirmation": ({ staticId }) => `Êtes-vous sûr de vouloir supprimer le fichier statique ${staticId} ?`,
+ "storage.statics.deletion.in_progress": "Suppression du fichier statique en cours",
+ "storage.statics.explanation":
+ "Cet espace est occupé par des fichiers statiques. Il s'agit généralement des fichiers de styles au format SLD ou FTL déposés lors de la publication d'un service WMS-VECTOR.",
+};
+export const DatastoreManageStorageEnTranslations: Translations<"en">["DatastoreManageStorage"] = {
+ title: undefined,
+ explanation: undefined,
+ "storage.not_found": undefined,
+ "data.size.unknown": undefined,
+ "stored_data.type.title": undefined,
+ "storage.upload.type.title": undefined,
+
+ "storage.filesystem.label": undefined,
+ "storage.filesystem.stored_data_list.loading": undefined,
+ "storage.filesystem.deletion.confirmation": undefined,
+ "storage.filesystem.deletion.in_progress": undefined,
+ "storage.filesystem.explanation": undefined,
+
+ "storage.postgresql.label": undefined,
+ "storage.postgresql.vectordb.loading": undefined,
+ "storage.postgresql.deletion.confirmation": undefined,
+ "storage.postgresql.deletion.in_progress": undefined,
+ "storage.postgresql.explanation": undefined,
+
+ "storage.s3.label": undefined,
+ "storage.s3.stored_data_list.loading": undefined,
+ "storage.s3.deletion.confirmation": undefined,
+ "storage.s3.deletion.in_progress": undefined,
+ "storage.s3.explanation": undefined,
+
+ "storage.upload.label": undefined,
+ "storage.upload.loading": undefined,
+ "storage.upload.deletion.confirmation": undefined,
+ "storage.upload.deletion.in_progress": undefined,
+ "storage.upload.explanation": undefined,
+
+ "storage.annexe.label": undefined,
+ "storage.annexe.loading": undefined,
+ "storage.annexe.deletion.confirmation": undefined,
+ "storage.annexe.deletion.in_progress": undefined,
+ "storage.annexe.explanation": undefined,
+ "storage.annexe.labels.type": undefined,
+
+ "storage.endpoints.label": undefined,
+ "storage.endpoints.loading": undefined,
+ "storage.endpoints.deletion.confirmation": undefined,
+ "storage.endpoints.deletion.in_progress": undefined,
+ "storage.endpoints.explanation": undefined,
+
+ "storage.endpoints.metadata.deletion.confirmation": undefined,
+ "storage.endpoints.metadata.deletion.in_progress": undefined,
+
+ "storage.statics.label": undefined,
+ "storage.statics.loading": undefined,
+ "storage.statics.deletion.confirmation": undefined,
+ "storage.statics.deletion.in_progress": undefined,
+ "storage.statics.explanation": undefined,
+};
diff --git a/assets/entrepot/pages/datastore/ManageStorage/DatastoreManageStorage.tsx b/assets/entrepot/pages/datastore/ManageStorage/DatastoreManageStorage.tsx
index 92eb1b57..9ddc67d7 100644
--- a/assets/entrepot/pages/datastore/ManageStorage/DatastoreManageStorage.tsx
+++ b/assets/entrepot/pages/datastore/ManageStorage/DatastoreManageStorage.tsx
@@ -1,13 +1,11 @@
import { fr } from "@codegouvfr/react-dsfr";
import Tabs, { TabsProps } from "@codegouvfr/react-dsfr/Tabs";
import { useQuery } from "@tanstack/react-query";
-import { declareComponentKeys } from "i18nifty";
-import { FC, JSX, useMemo } from "react";
+import { FC, useMemo } from "react";
-import { StoredDataTypeEnum, UploadTypeEnum } from "../../../../@types/app";
import DatastoreLayout from "../../../../components/Layout/DatastoreLayout";
import LoadingIcon from "../../../../components/Utils/LoadingIcon";
-import { useTranslation, type Translations } from "../../../../i18n/i18n";
+import { useTranslation } from "../../../../i18n/i18n";
import RQKeys from "../../../../modules/entrepot/RQKeys";
import api from "../../../api";
import AnnexeUsage from "./storages/AnnexeUsage";
@@ -97,240 +95,3 @@ const DatastoreManageStorage: FC = ({ datastoreId }
};
export default DatastoreManageStorage;
-
-export const { i18n } = declareComponentKeys<
- // commun
- | { K: "title"; P: { datastoreName?: string }; R: string }
- | "explanation"
- | "storage.not_found"
- | "data.size.unknown"
- | { K: "stored_data.type.title"; P: { type: StoredDataTypeEnum }; R: string }
-
- // FILESYSTEM
- | { K: "storage.filesystem.label"; R: JSX.Element }
- | "storage.filesystem.stored_data_list.loading"
- | { K: "storage.filesystem.deletion.confirmation"; P: { storedDataName?: string; storedDataId?: string }; R: string }
- | "storage.filesystem.deletion.in_progress"
- | "storage.filesystem.explanation"
-
- // POSTGRES
- | { K: "storage.postgresql.label"; R: JSX.Element }
- | "storage.postgresql.vectordb.loading"
- | { K: "storage.postgresql.deletion.confirmation"; P: { storedDataName?: string; storedDataId?: string }; R: string }
- | "storage.postgresql.deletion.in_progress"
- | "storage.postgresql.explanation"
-
- // S3
- | { K: "storage.s3.label"; R: JSX.Element }
- | "storage.s3.stored_data_list.loading"
- | { K: "storage.s3.deletion.confirmation"; P: { storedDataName?: string; storedDataId?: string }; R: string }
- | "storage.s3.deletion.in_progress"
- | "storage.s3.explanation"
-
- // upload
- | { K: "storage.upload.label"; R: JSX.Element }
- | "storage.upload.loading"
- | { K: "storage.upload.deletion.confirmation"; P: { uploadName?: string; uploadId?: string }; R: string }
- | "storage.upload.deletion.in_progress"
- | "storage.upload.explanation"
- | { K: "storage.upload.type.title"; P: { type: UploadTypeEnum }; R: string }
-
- // annexe
- | { K: "storage.annexe.label"; R: JSX.Element }
- | "storage.annexe.loading"
- | { K: "storage.annexe.deletion.confirmation"; P: { annexeId?: string }; R: string }
- | "storage.annexe.deletion.in_progress"
- | "storage.annexe.explanation"
- | { K: "storage.annexe.labels.type"; P: { type: string }; R: string }
-
- // endpoint
- | { K: "storage.endpoints.label"; R: JSX.Element }
- | "storage.endpoints.loading"
- | { K: "storage.endpoints.deletion.confirmation"; P: { offeringName?: string; offeringId?: string }; R: string }
- | "storage.endpoints.deletion.in_progress"
- | "storage.endpoints.explanation"
-
- // endpoint metadata
- | { K: "storage.endpoints.metadata.deletion.confirmation"; P: { metadataIdentifier?: string; metadataId?: string }; R: string }
- | "storage.endpoints.metadata.deletion.in_progress"
-
- // statics
- | { K: "storage.statics.label"; R: JSX.Element }
- | "storage.statics.loading"
- | { K: "storage.statics.deletion.confirmation"; P: { staticId?: string }; R: string }
- | "storage.statics.deletion.in_progress"
- | "storage.statics.explanation"
->()({
- DatastoreManageStorage,
-});
-
-export const DatastoreManageStorageFrTranslations: Translations<"fr">["DatastoreManageStorage"] = {
- title: ({ datastoreName }) => `Suivi des consommations de l’espace de travail${datastoreName ? " " + datastoreName : ""}`,
- explanation:
- "Cette page vous permet de voir en un seul coup d'œil le volume de vos données et votre situation par rapport aux différents quotas qui vous sont alloués.",
- "storage.not_found": "Aucun stockage de ce type n'est attribué à votre espace de travail.",
- "data.size.unknown": "Taille inconnue",
- "stored_data.type.title": ({ type }) => {
- switch (type) {
- case StoredDataTypeEnum.VECTORDB:
- return "Données vectorielles en BD PostgreSQL";
- case StoredDataTypeEnum.ROK4PYRAMIDVECTOR:
- return "Pyramide de tuiles vectorielles";
- case StoredDataTypeEnum.ROK4PYRAMIDRASTER:
- return "Pyramide de tuiles raster";
- default:
- return type;
- }
- },
- "storage.upload.type.title": ({ type }) => {
- switch (type) {
- case UploadTypeEnum.VECTOR:
- return "Vecteur";
- case UploadTypeEnum.RASTER:
- return "Raster";
- default:
- return type;
- }
- },
- "storage.filesystem.label": (
-
- Données intégrées sous forme de fichiers
-
- ),
- "storage.filesystem.stored_data_list.loading": "Chargement des données stockées sous forme de fichiers.",
- "storage.filesystem.deletion.confirmation": ({ storedDataName, storedDataId }) =>
- `Êtes-vous sûr de vouloir supprimer la donnée stockée ${storedDataName} (${storedDataId}) ?`,
- "storage.filesystem.deletion.in_progress": "Suppression de la donnée stockée en cours",
- "storage.filesystem.explanation": "Cet espace est utilisé pour le stockage des pyramides de tuiles vectorielles.",
- "storage.postgresql.label": (
-
- Données intégrées en base
-
- ),
- "storage.postgresql.vectordb.loading": "Chargement des données vectorielles en BD PostgreSQL en cours",
- "storage.postgresql.deletion.confirmation": ({ storedDataName, storedDataId }) =>
- `Êtes-vous sûr de vouloir supprimer la donnée stockée ${storedDataName} (${storedDataId}) ?`,
- "storage.postgresql.deletion.in_progress": "Suppression de la donnée stockée en cours",
- "storage.postgresql.explanation":
- "Il s'agit de l’espace occupé par des données sur les serveurs PostgreSQL de votre espace de travail. Il s'agit de données intermédiaires qui ne sont pas directement visibles de vos utilisateurs.",
- "storage.s3.label": (
-
- Stockage de masse
-
- ),
- "storage.s3.stored_data_list.loading": "Chargement des données stockées dans le stockage de masse en cours",
- "storage.s3.deletion.confirmation": ({ storedDataName, storedDataId }) =>
- `Êtes-vous sûr de vouloir supprimer la donnée stockée ${storedDataName} (${storedDataId}) ?`,
- "storage.s3.deletion.in_progress": "Suppression de la donnée stockée en cours",
- "storage.s3.explanation":
- "Cet espace est utilisé pour le stockage des pyramides de tuiles vectorielles. Il est plus performant que le stockage sous forme de fichiers.",
- "storage.upload.label": (
-
- Données déposées
-
- ),
- "storage.upload.loading": "Chargement des données déposées en cours",
- "storage.upload.deletion.confirmation": ({ uploadName, uploadId }) => `Êtes-vous sûr de vouloir supprimer la donnée déposée ${uploadName} (${uploadId}) ?`,
- "storage.upload.deletion.in_progress": "Suppression de la donnée déposée en cours",
- "storage.upload.explanation":
- "Il s'agit de l’espace occupé par les fichiers de données bruts que vous avez téléversés (fichiers csv, geopackage...). Ces fichiers sont normalement supprimés dès l’intégration en base réussie de vos données. Il est possible qu'il reste des traces de fichiers dans cet espace lorsque les intégrations en base ont échoué.",
-
- "storage.annexe.label": (
-
- Fichiers annexes
-
- ),
- "storage.annexe.loading": "Chargement des annexes",
- "storage.annexe.deletion.confirmation": ({ annexeId }) => `Êtes-vous sûr de vouloir supprimer l’annexe ${annexeId} ?`,
- "storage.annexe.deletion.in_progress": "Suppression de l’annexe en cours",
- "storage.annexe.explanation":
- "Cet espace est occupé par les fichiers mis à disposition de vos utilisateurs via des adresses publiques. Il s'agit généralement des fichiers de style au format JSON qui servent à symboliser vos pyramides de tuiles vectorielles.",
- "storage.annexe.labels.type": ({ type }) => {
- switch (type) {
- case "style":
- return "style";
- case "thumbnail":
- return "vignette";
- default:
- return type;
- }
- },
- "storage.endpoints.label": (
-
- Points de publication
-
- ),
- "storage.endpoints.loading": "Chargement des flux publiés et des métadonnées en cours",
- "storage.endpoints.deletion.confirmation": ({ offeringName, offeringId }) => `Êtes-vous sûr de vouloir dépublier le flux ${offeringName} (${offeringId}) ?`,
- "storage.endpoints.deletion.in_progress": "Suppression du flux en cours",
- "storage.endpoints.explanation": "Il s'agit du nombre de couches et de métadonnées publiées par point de publication dans votre espace de travail.",
-
- "storage.endpoints.metadata.deletion.confirmation": ({ metadataIdentifier, metadataId }) =>
- `Êtes-vous sûr de vouloir supprimer la métadonnée ${metadataIdentifier} (${metadataId}) ?`,
- "storage.endpoints.metadata.deletion.in_progress": "Suppression de la métadonnée en cours",
-
- "storage.statics.label": (
-
- Fichiers statiques
-
- ),
- "storage.statics.loading": "Chargement des fichiers statiques",
- "storage.statics.deletion.confirmation": ({ staticId }) => `Êtes-vous sûr de vouloir supprimer le fichier statique ${staticId} ?`,
- "storage.statics.deletion.in_progress": "Suppression du fichier statique en cours",
- "storage.statics.explanation":
- "Cet espace est occupé par des fichiers statiques. Il s'agit généralement des fichiers de styles au format SLD ou FTL déposés lors de la publication d'un service WMS-VECTOR.",
-};
-export const DatastoreManageStorageEnTranslations: Translations<"en">["DatastoreManageStorage"] = {
- title: undefined,
- explanation: undefined,
- "storage.not_found": undefined,
- "data.size.unknown": undefined,
- "stored_data.type.title": undefined,
- "storage.upload.type.title": undefined,
-
- "storage.filesystem.label": undefined,
- "storage.filesystem.stored_data_list.loading": undefined,
- "storage.filesystem.deletion.confirmation": undefined,
- "storage.filesystem.deletion.in_progress": undefined,
- "storage.filesystem.explanation": undefined,
-
- "storage.postgresql.label": undefined,
- "storage.postgresql.vectordb.loading": undefined,
- "storage.postgresql.deletion.confirmation": undefined,
- "storage.postgresql.deletion.in_progress": undefined,
- "storage.postgresql.explanation": undefined,
-
- "storage.s3.label": undefined,
- "storage.s3.stored_data_list.loading": undefined,
- "storage.s3.deletion.confirmation": undefined,
- "storage.s3.deletion.in_progress": undefined,
- "storage.s3.explanation": undefined,
-
- "storage.upload.label": undefined,
- "storage.upload.loading": undefined,
- "storage.upload.deletion.confirmation": undefined,
- "storage.upload.deletion.in_progress": undefined,
- "storage.upload.explanation": undefined,
-
- "storage.annexe.label": undefined,
- "storage.annexe.loading": undefined,
- "storage.annexe.deletion.confirmation": undefined,
- "storage.annexe.deletion.in_progress": undefined,
- "storage.annexe.explanation": undefined,
- "storage.annexe.labels.type": undefined,
-
- "storage.endpoints.label": undefined,
- "storage.endpoints.loading": undefined,
- "storage.endpoints.deletion.confirmation": undefined,
- "storage.endpoints.deletion.in_progress": undefined,
- "storage.endpoints.explanation": undefined,
-
- "storage.endpoints.metadata.deletion.confirmation": undefined,
- "storage.endpoints.metadata.deletion.in_progress": undefined,
-
- "storage.statics.label": undefined,
- "storage.statics.loading": undefined,
- "storage.statics.deletion.confirmation": undefined,
- "storage.statics.deletion.in_progress": undefined,
- "storage.statics.explanation": undefined,
-};
diff --git a/assets/entrepot/pages/service/common/AccessRestrictions/AccessRestrictions.locale.tsx b/assets/entrepot/pages/service/common/AccessRestrictions/AccessRestrictions.locale.tsx
new file mode 100644
index 00000000..62deba39
--- /dev/null
+++ b/assets/entrepot/pages/service/common/AccessRestrictions/AccessRestrictions.locale.tsx
@@ -0,0 +1,44 @@
+import { declareComponentKeys } from "i18nifty";
+import { Translations } from "../../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | "title"
+ | "share_with"
+ | "share_with_all_public"
+ | "share_with_all_public_hint_text"
+ | "share_with_your_community"
+ | "share_with_your_community_hint_text"
+ | "share_with_value_change_warning_title"
+ | "share_with_value_change_warning_desc_restricted_to_public"
+ | "share_with_value_change_warning_desc_public_to_restricted"
+>()("AccessRestrictions");
+export type I18n = typeof i18n;
+
+export const AccessRestrictionsFrTranslations: Translations<"fr">["AccessRestrictions"] = {
+ title: "Restrictions d’accès",
+ share_with: "A quel public souhaitez-vous que ce service soit accessible ?",
+ share_with_all_public: "Tout public",
+ share_with_all_public_hint_text: "Le service sera accessible à tout utilisateur sans restriction.",
+ share_with_your_community: "Restreint",
+ share_with_your_community_hint_text:
+ "Vous devrez accorder une permission aux communautés et/ou utilisateurs souhaités pour leur autoriser l’accès. Ils devront par la suite configurer une clé à partir de cette permission pour accéder au service. Une permission va être créée automatiquement votre propre communauté.",
+ share_with_value_change_warning_title: "Changement de restrictions d’accès",
+ share_with_value_change_warning_desc_restricted_to_public:
+ // eslint-disable-next-line quotes
+ 'Vous êtes sur le point de modifier les restrictions d\'accès de "Restreint" à "Tout public". Le service changera d\'adresse et les permissions que vous aviez configurées seront supprimées définitivement car elles ne seront plus nécessaires.',
+ share_with_value_change_warning_desc_public_to_restricted:
+ // eslint-disable-next-line quotes
+ 'Vous êtes sur le point de modifier les restrictions d\'accès de "Tout public" à "Restreint". Le service changera d\'adresse.',
+};
+
+export const AccessRestrictionsEnTranslations: Translations<"en">["AccessRestrictions"] = {
+ title: undefined,
+ share_with: undefined,
+ share_with_all_public: undefined,
+ share_with_all_public_hint_text: undefined,
+ share_with_your_community: undefined,
+ share_with_your_community_hint_text: undefined,
+ share_with_value_change_warning_title: undefined,
+ share_with_value_change_warning_desc_restricted_to_public: undefined,
+ share_with_value_change_warning_desc_public_to_restricted: undefined,
+};
diff --git a/assets/entrepot/pages/service/AccessRestrictions.tsx b/assets/entrepot/pages/service/common/AccessRestrictions/AccessRestrictions.tsx
similarity index 61%
rename from assets/entrepot/pages/service/AccessRestrictions.tsx
rename to assets/entrepot/pages/service/common/AccessRestrictions/AccessRestrictions.tsx
index 7300a16c..8ab24b30 100644
--- a/assets/entrepot/pages/service/AccessRestrictions.tsx
+++ b/assets/entrepot/pages/service/common/AccessRestrictions/AccessRestrictions.tsx
@@ -1,15 +1,14 @@
import { fr } from "@codegouvfr/react-dsfr";
+import Alert from "@codegouvfr/react-dsfr/Alert";
import RadioButtons from "@codegouvfr/react-dsfr/RadioButtons";
import { useQuery } from "@tanstack/react-query";
-import { declareComponentKeys } from "i18nifty";
import { FC, useMemo } from "react";
import { UseFormReturn } from "react-hook-form";
-import { DatastoreEndpoint, EndpointTypeEnum, Service, ServiceFormValuesBaseType } from "../../../@types/app";
-import { Translations, useTranslation } from "../../../i18n/i18n";
-import RQKeys from "../../../modules/entrepot/RQKeys";
-import api from "../../api";
-import Alert from "@codegouvfr/react-dsfr/Alert";
+import { DatastoreEndpoint, EndpointTypeEnum, Service, ServiceFormValuesBaseType } from "../../../../../@types/app";
+import { useTranslation } from "../../../../../i18n/i18n";
+import RQKeys from "../../../../../modules/entrepot/RQKeys";
+import api from "../../../../api";
type AccessRestrictionProps = {
datastoreId: string;
@@ -110,46 +109,3 @@ const AccessRestrictions: FC = ({ datastoreId, endpointT
};
export default AccessRestrictions;
-
-export const { i18n } = declareComponentKeys<
- | "title"
- | "share_with"
- | "share_with_all_public"
- | "share_with_all_public_hint_text"
- | "share_with_your_community"
- | "share_with_your_community_hint_text"
- | "share_with_value_change_warning_title"
- | "share_with_value_change_warning_desc_restricted_to_public"
- | "share_with_value_change_warning_desc_public_to_restricted"
->()({
- AccessRestrictions,
-});
-
-export const AccessRestrictionsFrTranslations: Translations<"fr">["AccessRestrictions"] = {
- title: "Restrictions d’accès",
- share_with: "A quel public souhaitez-vous que ce service soit accessible ?",
- share_with_all_public: "Tout public",
- share_with_all_public_hint_text: "Le service sera accessible à tout utilisateur sans restriction.",
- share_with_your_community: "Restreint",
- share_with_your_community_hint_text:
- "Vous devrez accorder une permission aux communautés et/ou utilisateurs souhaités pour leur autoriser l’accès. Ils devront par la suite configurer une clé à partir de cette permission pour accéder au service. Une permission va être créée automatiquement votre propre communauté.",
- share_with_value_change_warning_title: "Changement de restrictions d’accès",
- share_with_value_change_warning_desc_restricted_to_public:
- // eslint-disable-next-line quotes
- 'Vous êtes sur le point de modifier les restrictions d\'accès de "Restreint" à "Tout public". Le service changera d\'adresse et les permissions que vous aviez configurées seront supprimées définitivement car elles ne seront plus nécessaires.',
- share_with_value_change_warning_desc_public_to_restricted:
- // eslint-disable-next-line quotes
- 'Vous êtes sur le point de modifier les restrictions d\'accès de "Tout public" à "Restreint". Le service changera d\'adresse.',
-};
-
-export const AccessRestrictionsEnTranslations: Translations<"en">["AccessRestrictions"] = {
- title: undefined,
- share_with: undefined,
- share_with_all_public: undefined,
- share_with_all_public_hint_text: undefined,
- share_with_your_community: undefined,
- share_with_your_community_hint_text: undefined,
- share_with_value_change_warning_title: undefined,
- share_with_value_change_warning_desc_restricted_to_public: undefined,
- share_with_value_change_warning_desc_public_to_restricted: undefined,
-};
diff --git a/assets/entrepot/pages/service/common/TableSelection/TableSelection.locale.tsx b/assets/entrepot/pages/service/common/TableSelection/TableSelection.locale.tsx
new file mode 100644
index 00000000..05f5495d
--- /dev/null
+++ b/assets/entrepot/pages/service/common/TableSelection/TableSelection.locale.tsx
@@ -0,0 +1,15 @@
+import { declareComponentKeys } from "i18nifty";
+import { Translations } from "../../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<"title" | { K: "tables_detected_hint"; P: { nbTables: number }; R: string }>()("TableSelection");
+export type I18n = typeof i18n;
+
+export const TableSelectionFrTranslations: Translations<"fr">["TableSelection"] = {
+ title: "Sélectionnez les tables nécessaires au service",
+ tables_detected_hint: ({ nbTables }) => (nbTables > 1 ? `${nbTables} tables détectées` : "1 table détectée"),
+};
+
+export const TableSelectionEnTranslations: Translations<"en">["TableSelection"] = {
+ title: undefined,
+ tables_detected_hint: undefined,
+};
diff --git a/assets/entrepot/pages/service/TableSelection.tsx b/assets/entrepot/pages/service/common/TableSelection/TableSelection.tsx
similarity index 73%
rename from assets/entrepot/pages/service/TableSelection.tsx
rename to assets/entrepot/pages/service/common/TableSelection/TableSelection.tsx
index d267dd5c..b65601cc 100644
--- a/assets/entrepot/pages/service/TableSelection.tsx
+++ b/assets/entrepot/pages/service/common/TableSelection/TableSelection.tsx
@@ -3,11 +3,11 @@ import { Checkbox } from "@codegouvfr/react-dsfr/Checkbox";
import { FC, useCallback, useMemo } from "react";
import { useWatch, type UseFormReturn } from "react-hook-form";
-import { filterGeometricRelations } from "../../../helpers";
-import { type Translations, declareComponentKeys, useTranslation } from "../../../i18n/i18n";
-import { type VectorDb } from "../../../@types/app";
-import { type PyramidVectorGenerateFormValuesType } from "./tms/PyramidVectorGenerateForm";
-import { type WmsVectorServiceFormValuesType } from "./wms-vector/WmsVectorServiceForm";
+import { type VectorDb } from "../../../../../@types/app";
+import { filterGeometricRelations } from "../../../../../helpers";
+import { useTranslation } from "../../../../../i18n/i18n";
+import { type PyramidVectorGenerateFormValuesType } from "../../tms/PyramidVectorGenerateForm";
+import { type WmsVectorServiceFormValuesType } from "../../wms-vector/WmsVectorServiceForm";
type TablesSelectionProps = {
filterGeometric?: boolean;
@@ -78,17 +78,3 @@ const TableSelection: FC = ({ filterGeometric = false, vec
};
export default TableSelection;
-
-export const { i18n } = declareComponentKeys<"title" | { K: "tables_detected_hint"; P: { nbTables: number }; R: string }>()({
- TableSelection,
-});
-
-export const TableSelectionFrTranslations: Translations<"fr">["TableSelection"] = {
- title: "Sélectionnez les tables nécessaires au service",
- tables_detected_hint: ({ nbTables }) => (nbTables > 1 ? `${nbTables} tables détectées` : "1 table détectée"),
-};
-
-export const TableSelectionEnTranslations: Translations<"en">["TableSelection"] = {
- title: undefined,
- tables_detected_hint: undefined,
-};
diff --git a/assets/entrepot/pages/service/common-schemas-validation.ts b/assets/entrepot/pages/service/common/common-schemas-validation.ts
similarity index 97%
rename from assets/entrepot/pages/service/common-schemas-validation.ts
rename to assets/entrepot/pages/service/common/common-schemas-validation.ts
index 91590d67..ad39c304 100644
--- a/assets/entrepot/pages/service/common-schemas-validation.ts
+++ b/assets/entrepot/pages/service/common/common-schemas-validation.ts
@@ -1,8 +1,8 @@
import * as yup from "yup";
-import { getTranslation } from "../../../i18n/i18n";
-import { regex } from "../../../utils";
-import validations from "../../../validations";
+import { getTranslation } from "../../../../i18n/i18n";
+import { regex } from "../../../../utils";
+import validations from "../../../../validations";
const { t: tValidMD } = getTranslation("ValidationMetadatas");
export class CommonSchemasValidation {
diff --git a/assets/entrepot/pages/service/default-values.ts b/assets/entrepot/pages/service/common/default-values.ts
similarity index 95%
rename from assets/entrepot/pages/service/default-values.ts
rename to assets/entrepot/pages/service/common/default-values.ts
index 3f6f7998..eef5c95b 100644
--- a/assets/entrepot/pages/service/default-values.ts
+++ b/assets/entrepot/pages/service/common/default-values.ts
@@ -1,11 +1,11 @@
import { format as datefnsFormat } from "date-fns";
-import { EndpointTypeEnum, Metadata, MetadataFormValuesType, MetadataHierarchyLevel, Service, StoredData } from "../../../@types/app";
-import { ConfigurationWfsDetailsContent, ConfigurationWmsVectorDetailsContent, ConfigurationWmtsTmsDetailsContent } from "../../../@types/entrepot";
-import { getProjectionCode, removeDiacritics } from "../../../utils";
-import { PyramidVectorTmsServiceFormValuesType } from "./tms/PyramidVectorTmsServiceForm";
-import { WfsServiceFormValuesType, WfsTableInfos } from "./wfs/WfsServiceForm";
-import { WmsVectorServiceFormValuesType } from "./wms-vector/WmsVectorServiceForm";
+import { EndpointTypeEnum, Metadata, MetadataFormValuesType, MetadataHierarchyLevel, Service, StoredData } from "../../../../@types/app";
+import { ConfigurationWfsDetailsContent, ConfigurationWmsVectorDetailsContent, ConfigurationWmtsTmsDetailsContent } from "../../../../@types/entrepot";
+import { getProjectionCode, removeDiacritics } from "../../../../utils";
+import { PyramidVectorTmsServiceFormValuesType } from "../tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm";
+import { WfsServiceFormValuesType, WfsTableInfos } from "../wfs/WfsServiceForm";
+import { WmsVectorServiceFormValuesType } from "../wms-vector/WmsVectorServiceForm";
const DEFAULT_CHARSET = "utf8";
const DEFAULT_LANGUAGE = { language: "français", code: "fre" };
diff --git a/assets/entrepot/pages/service/metadatas/AdditionalInfo.tsx b/assets/entrepot/pages/service/metadata/AdditionalInfo.tsx
similarity index 100%
rename from assets/entrepot/pages/service/metadatas/AdditionalInfo.tsx
rename to assets/entrepot/pages/service/metadata/AdditionalInfo.tsx
diff --git a/assets/entrepot/pages/service/metadatas/Description.tsx b/assets/entrepot/pages/service/metadata/Description.tsx
similarity index 100%
rename from assets/entrepot/pages/service/metadatas/Description.tsx
rename to assets/entrepot/pages/service/metadata/Description.tsx
diff --git a/assets/entrepot/pages/service/metadatas/metadatas-form-tr.tsx b/assets/entrepot/pages/service/metadata/MetadataForm.locale.tsx
similarity index 98%
rename from assets/entrepot/pages/service/metadatas/metadatas-form-tr.tsx
rename to assets/entrepot/pages/service/metadata/MetadataForm.locale.tsx
index de838290..2047785b 100644
--- a/assets/entrepot/pages/service/metadatas/metadatas-form-tr.tsx
+++ b/assets/entrepot/pages/service/metadata/MetadataForm.locale.tsx
@@ -1,6 +1,7 @@
-import { declareComponentKeys, type Translations } from "../../../../i18n/i18n";
+import { declareComponentKeys } from "../../../../i18n/i18n";
+import { Translations } from "../../../../i18n/types";
-export const { i18n } = declareComponentKeys<
+const { i18n } = declareComponentKeys<
| "metadata.upload_form.title"
| "metadata.upload_form.drag_and_drop_file"
| "metadata.upload_form.used_format"
@@ -56,6 +57,7 @@ export const { i18n } = declareComponentKeys<
| "metadata.additionnal_infos_form.spatial_resolution"
| { K: "metadata.additionnal_infos_form.hint_spatial_resolution"; R: JSX.Element }
>()("MetadatasForm");
+export type I18n = typeof i18n;
export const MetadatasFormFrTranslations: Translations<"fr">["MetadatasForm"] = {
"metadata.upload_form.title": "Source des metadonnées",
diff --git a/assets/entrepot/pages/service/metadatas/metadatas-validation-tr.ts b/assets/entrepot/pages/service/metadata/MetadataValidation.locale.tsx
similarity index 94%
rename from assets/entrepot/pages/service/metadatas/metadatas-validation-tr.ts
rename to assets/entrepot/pages/service/metadata/MetadataValidation.locale.tsx
index 00481bab..93a60235 100644
--- a/assets/entrepot/pages/service/metadatas/metadatas-validation-tr.ts
+++ b/assets/entrepot/pages/service/metadata/MetadataValidation.locale.tsx
@@ -1,12 +1,7 @@
-import { declareComponentKeys, type Translations } from "../../../../i18n/i18n";
+import { declareComponentKeys } from "../../../../i18n/i18n";
+import { Translations } from "../../../../i18n/types";
-const ValidationMetadatas = () => {
- return null;
-};
-
-export default ValidationMetadatas;
-
-export const { i18n } = declareComponentKeys<
+const { i18n } = declareComponentKeys<
| "metadatas.technical_name_error"
| "metadatas.technical_name_regex"
| "metadatas.technical_name_unicity_error"
@@ -30,9 +25,8 @@ export const { i18n } = declareComponentKeys<
| "attribution.url_required_error"
| "attribution.url_error"
| "share_with_error"
->()({
- ValidationMetadatas,
-});
+>()("ValidationMetadatas");
+export type I18n = typeof i18n;
export const ValidationMetadatasFrTranslations: Translations<"fr">["ValidationMetadatas"] = {
"metadatas.technical_name_error": "Le nom technique est obligatoire",
diff --git a/assets/entrepot/pages/service/metadatas/UploadMDFile.tsx b/assets/entrepot/pages/service/metadata/UploadMDFile.tsx
similarity index 100%
rename from assets/entrepot/pages/service/metadatas/UploadMDFile.tsx
rename to assets/entrepot/pages/service/metadata/UploadMDFile.tsx
diff --git a/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx b/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx
index 8b01c7a5..b718e5a1 100644
--- a/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx
+++ b/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx
@@ -20,7 +20,7 @@ import RQKeys from "../../../../modules/entrepot/RQKeys";
import { CartesApiException } from "../../../../modules/jsonFetch";
import { routes } from "../../../../router/router";
import api from "../../../api";
-import TableSelection from "../TableSelection";
+import TableSelection from "../common/TableSelection/TableSelection";
import formatForm from "./format-form";
import Sample, { type SampleType } from "./sample/Sample";
import TableAttributeSelection from "./tables/TableAttributeSelection";
diff --git a/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm.locale.tsx b/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm.locale.tsx
new file mode 100644
index 00000000..9ba78805
--- /dev/null
+++ b/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm.locale.tsx
@@ -0,0 +1,62 @@
+import { declareComponentKeys } from "i18nifty";
+import { Translations } from "../../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | { K: "title"; P: { editMode: boolean }; R: string }
+ | "stored_data.loading"
+ | "stored_data_and_offering.loading"
+ | "stored_data.fetch_failed"
+ | "offering.fetch_failed"
+ | { K: "step.title"; P: { stepNumber: number }; R: string }
+ | "previous_step"
+ | "continue"
+ | "publish"
+ | "publish.in_progress"
+ | "modify.in_progress"
+ | "back_to_data_list"
+>()("PyramidVectorTmsServiceForm");
+export type I18n = typeof i18n;
+
+export const PyramidVectorTmsServiceFormFrTranslations: Translations<"fr">["PyramidVectorTmsServiceForm"] = {
+ title: ({ editMode }) => (editMode ? "Modifier le service TMS" : "Publier un service TMS"),
+ "stored_data.loading": "Chargement de la donnée stockée...",
+ "stored_data_and_offering.loading": "Chargement de la donnée stockée et du service à modifier...",
+ "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué",
+ "offering.fetch_failed": "Récupération des informations sur le service à modifier a échoué",
+ "step.title": ({ stepNumber }) => {
+ switch (stepNumber) {
+ case 1:
+ return "Source des métadonnées";
+ case 2:
+ return "Description de la ressource";
+ case 3:
+ return "Informations supplémentaires";
+ case 4:
+ return "Restrictions d’accès";
+
+ default:
+ return "";
+ }
+ },
+ previous_step: "Étape précédente",
+ continue: "Continuer",
+ publish: "Publier le service maintenant",
+ "publish.in_progress": "Création du service TMS en cours",
+ "modify.in_progress": "Modification des informations du service TMS en cours",
+ back_to_data_list: "Retour à mes données",
+};
+
+export const PyramidVectorTmsServiceFormEnTranslations: Translations<"en">["PyramidVectorTmsServiceForm"] = {
+ title: undefined,
+ "stored_data.loading": undefined,
+ "stored_data_and_offering.loading": undefined,
+ "stored_data.fetch_failed": undefined,
+ "offering.fetch_failed": undefined,
+ "step.title": undefined,
+ previous_step: undefined,
+ continue: undefined,
+ publish: undefined,
+ "publish.in_progress": undefined,
+ "modify.in_progress": undefined,
+ back_to_data_list: undefined,
+};
diff --git a/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm.tsx b/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm.tsx
similarity index 78%
rename from assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm.tsx
rename to assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm.tsx
index 6ba76f46..8a6e0eb5 100644
--- a/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm.tsx
+++ b/assets/entrepot/pages/service/tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm.tsx
@@ -5,27 +5,26 @@ import ButtonsGroup from "@codegouvfr/react-dsfr/ButtonsGroup";
import Stepper from "@codegouvfr/react-dsfr/Stepper";
import { yupResolver } from "@hookform/resolvers/yup";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { declareComponentKeys } from "i18nifty";
import { FC, useCallback, useMemo, useState } from "react";
import { useForm } from "react-hook-form";
-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";
-import Wait from "../../../../components/Utils/Wait";
-import useScrollToTopEffect from "../../../../hooks/useScrollToTopEffect";
-import { Translations, useTranslation } from "../../../../i18n/i18n";
-import RQKeys from "../../../../modules/entrepot/RQKeys";
-import { CartesApiException } from "../../../../modules/jsonFetch";
-import { routes } from "../../../../router/router";
-import api from "../../../api";
-import AccessRestrictions from "../AccessRestrictions";
-import { CommonSchemasValidation } from "../common-schemas-validation";
-import { getPyramidVectorTmsServiceFormDefaultValues } from "../default-values";
-import AdditionalInfo from "../metadatas/AdditionalInfo";
-import Description from "../metadatas/Description";
-import UploadMDFile from "../metadatas/UploadMDFile";
+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";
+import Wait from "../../../../../components/Utils/Wait";
+import useScrollToTopEffect from "../../../../../hooks/useScrollToTopEffect";
+import { useTranslation } from "../../../../../i18n/i18n";
+import RQKeys from "../../../../../modules/entrepot/RQKeys";
+import { CartesApiException } from "../../../../../modules/jsonFetch";
+import { routes } from "../../../../../router/router";
+import api from "../../../../api";
+import AccessRestrictions from "../../common/AccessRestrictions/AccessRestrictions";
+import { CommonSchemasValidation } from "../../common/common-schemas-validation";
+import { getPyramidVectorTmsServiceFormDefaultValues } from "../../common/default-values";
+import AdditionalInfo from "../../metadata/AdditionalInfo";
+import Description from "../../metadata/Description";
+import UploadMDFile from "../../metadata/UploadMDFile";
export type PyramidVectorTmsServiceFormValuesType = ServiceFormValuesBaseType;
@@ -280,58 +279,3 @@ const PyramidVectorTmsServiceForm: FC = ({ dat
};
export default PyramidVectorTmsServiceForm;
-
-export const { i18n } = declareComponentKeys<
- | { K: "title"; P: { editMode: boolean }; R: string }
- | "stored_data.loading"
- | "stored_data_and_offering.loading"
- | "stored_data.fetch_failed"
- | "offering.fetch_failed"
- | { K: "step.title"; P: { stepNumber: number }; R: string }
- | "publish"
- | "publish.in_progress"
- | "modify.in_progress"
- | "back_to_data_list"
->()({
- PyramidVectorTmsServiceForm,
-});
-
-export const PyramidVectorTmsServiceFormFrTranslations: Translations<"fr">["PyramidVectorTmsServiceForm"] = {
- title: ({ editMode }) => (editMode ? "Modifier le service TMS" : "Publier un service TMS"),
- "stored_data.loading": "Chargement de la donnée stockée",
- "stored_data_and_offering.loading": "Chargement de la donnée stockée et du service à modifier",
- "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué",
- "offering.fetch_failed": "Récupération des informations sur le service à modifier a échoué",
- "step.title": ({ stepNumber }) => {
- switch (stepNumber) {
- case 1:
- return "Source des métadonnées";
- case 2:
- return "Description de la ressource";
- case 3:
- return "Informations supplémentaires";
- case 4:
- return "Restrictions d’accès";
-
- default:
- return "";
- }
- },
- publish: "Publier le service maintenant",
- "publish.in_progress": "Création du service TMS en cours",
- "modify.in_progress": "Modification des informations du service TMS en cours",
- back_to_data_list: "Retour à mes données",
-};
-
-export const PyramidVectorTmsServiceFormEnTranslations: Translations<"en">["PyramidVectorTmsServiceForm"] = {
- title: undefined,
- "stored_data.loading": undefined,
- "stored_data_and_offering.loading": undefined,
- "stored_data.fetch_failed": undefined,
- "offering.fetch_failed": undefined,
- "step.title": undefined,
- publish: undefined,
- "publish.in_progress": undefined,
- "modify.in_progress": undefined,
- back_to_data_list: undefined,
-};
diff --git a/assets/i18n/Style.tsx b/assets/entrepot/pages/service/view/Style/Style.locale.tsx
similarity index 88%
rename from assets/i18n/Style.tsx
rename to assets/entrepot/pages/service/view/Style/Style.locale.tsx
index 661328ae..f9948412 100644
--- a/assets/i18n/Style.tsx
+++ b/assets/entrepot/pages/service/view/Style/Style.locale.tsx
@@ -1,6 +1,7 @@
-import { declareComponentKeys, type Translations } from "./i18n";
+import { declareComponentKeys } from "../../../../../i18n";
+import { type Translations } from "../../../../../i18n/types";
-export const { i18n } = declareComponentKeys<
+const { i18n } = declareComponentKeys<
| "my_styles"
| "add_style"
| { K: "add_file"; P: { format: string }; R: string }
@@ -8,6 +9,7 @@ export const { i18n } = declareComponentKeys<
| { K: "remove_style"; P: { styleName: string | undefined }; R: string }
| "qml_message"
>()("Style");
+export type I18n = typeof i18n;
export const StyleFrTranslations: Translations<"fr">["Style"] = {
my_styles: "Mes styles :",
diff --git a/assets/entrepot/pages/service/wfs/WfsServiceForm.locale.tsx b/assets/entrepot/pages/service/wfs/WfsServiceForm.locale.tsx
new file mode 100644
index 00000000..6dccf1ba
--- /dev/null
+++ b/assets/entrepot/pages/service/wfs/WfsServiceForm.locale.tsx
@@ -0,0 +1,70 @@
+import { declareComponentKeys } from "i18nifty";
+import { Translations } from "../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | { K: "title"; P: { editMode: boolean }; R: string }
+ | "stored_data.loading"
+ | "stored_data_and_offering.loading"
+ | "stored_data.fetch_failed"
+ | "offering.fetch_failed"
+ | { K: "step.title"; P: { stepNumber: number }; R: string }
+ | "previous_step"
+ | "continue"
+ | "publish"
+ | "publish.in_progress"
+ | "modify.in_progress"
+ | "back_to_data_list"
+ | "trimmed_error"
+ | "public_name_regex"
+>()("WfsServiceForm");
+export type I18n = typeof i18n;
+
+export const WfsServiceFormFrTranslations: Translations<"fr">["WfsServiceForm"] = {
+ title: ({ editMode }) => (editMode ? "Modifier le service WFS" : "Créer et publier un service WFS"),
+ "stored_data.loading": "Chargement de la donnée stockée...",
+ "stored_data_and_offering.loading": "Chargement de la donnée stockée et du service à modifier...",
+ "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué",
+ "offering.fetch_failed": "Récupération des informations sur le service à modifier a échoué",
+ "step.title": ({ stepNumber }) => {
+ switch (stepNumber) {
+ case 1:
+ return "Tables";
+ case 2:
+ return "Source des métadonnées";
+ case 3:
+ return "Description de la ressource";
+ case 4:
+ return "Informations supplémentaires";
+ case 5:
+ return "Restrictions d'accès";
+ default:
+ return "";
+ }
+ },
+ previous_step: "Étape précédente",
+ continue: "Continuer",
+ publish: "Publier le service maintenant",
+ "publish.in_progress": "Création du service WFS en cours",
+ "modify.in_progress": "Modification des informations du service WFS en cours",
+ back_to_data_list: "Retour à mes données",
+ trimmed_error: "La chaîne de caractères ne doit contenir aucun espace en début et fin",
+ public_name_regex:
+ "Le nom public de la table ne doit contenir que des lettres, chiffres, tirets (-), underscores (_), ou points (.) et ne peut commencer que par une lettre ou un underscore",
+};
+
+export const WfsServiceFormEnTranslations: Translations<"en">["WfsServiceForm"] = {
+ title: undefined,
+ "stored_data.loading": undefined,
+ "stored_data_and_offering.loading": undefined,
+ "stored_data.fetch_failed": undefined,
+ "offering.fetch_failed": undefined,
+ "step.title": undefined,
+ previous_step: undefined,
+ continue: undefined,
+ publish: undefined,
+ "publish.in_progress": undefined,
+ "modify.in_progress": undefined,
+ back_to_data_list: undefined,
+ trimmed_error: undefined,
+ public_name_regex: undefined,
+};
diff --git a/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx b/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx
index bb492061..1a3caae4 100644
--- a/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx
+++ b/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx
@@ -5,7 +5,6 @@ import ButtonsGroup from "@codegouvfr/react-dsfr/ButtonsGroup";
import Stepper from "@codegouvfr/react-dsfr/Stepper";
import { yupResolver } from "@hookform/resolvers/yup";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { declareComponentKeys } from "i18nifty";
import { FC, useCallback, useMemo, useState } from "react";
import { useForm, useWatch } from "react-hook-form";
import { symToStr } from "tsafe/symToStr";
@@ -18,18 +17,18 @@ import LoadingText from "../../../../components/Utils/LoadingText";
import Wait from "../../../../components/Utils/Wait";
import { filterGeometricRelations } from "../../../../helpers";
import useScrollToTopEffect from "../../../../hooks/useScrollToTopEffect";
-import { Translations, useTranslation } from "../../../../i18n/i18n";
+import { useTranslation } from "../../../../i18n/i18n";
import RQKeys from "../../../../modules/entrepot/RQKeys";
import { CartesApiException } from "../../../../modules/jsonFetch";
import { routes } from "../../../../router/router";
import { trimObject } from "../../../../utils";
import api from "../../../api";
-import AccessRestrictions from "../AccessRestrictions";
-import { CommonSchemasValidation } from "../common-schemas-validation";
-import { getWfsServiceFormDefaultValues } from "../default-values";
-import AdditionalInfo from "../metadatas/AdditionalInfo";
-import Description from "../metadatas/Description";
-import UploadMDFile from "../metadatas/UploadMDFile";
+import AccessRestrictions from "../common/AccessRestrictions/AccessRestrictions";
+import { CommonSchemasValidation } from "../common/common-schemas-validation";
+import { getWfsServiceFormDefaultValues } from "../common/default-values";
+import AdditionalInfo from "../metadata/AdditionalInfo";
+import Description from "../metadata/Description";
+import UploadMDFile from "../metadata/UploadMDFile";
import TableInfosForm from "./TablesInfoForm";
import { regex } from "../../../../utils";
@@ -391,72 +390,3 @@ const WfsServiceForm: FC = ({ datastoreId, vectorDbId, offe
WfsServiceForm.displayName = symToStr({ WfsServiceForm });
export default WfsServiceForm;
-
-export const { i18n } = declareComponentKeys<
- | { K: "title"; P: { editMode: boolean }; R: string }
- | "stored_data.loading"
- | "stored_data_and_offering.loading"
- | "stored_data.fetch_failed"
- | "offering.fetch_failed"
- | { K: "step.title"; P: { stepNumber: number }; R: string }
- | "previous_step"
- | "continue"
- | "publish"
- | "publish.in_progress"
- | "modify.in_progress"
- | "back_to_data_list"
- | "trimmed_error"
- | "public_name_regex"
->()({
- WfsServiceForm,
-});
-
-export const WfsServiceFormFrTranslations: Translations<"fr">["WfsServiceForm"] = {
- title: ({ editMode }) => (editMode ? "Modifier le service WFS" : "Créer et publier un service WFS"),
- "stored_data.loading": "Chargement de la donnée stockée...",
- "stored_data_and_offering.loading": "Chargement de la donnée stockée et du service à modifier...",
- "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué",
- "offering.fetch_failed": "Récupération des informations sur le service à modifier a échoué",
- "step.title": ({ stepNumber }) => {
- switch (stepNumber) {
- case 1:
- return "Tables";
- case 2:
- return "Source des métadonnées";
- case 3:
- return "Description de la ressource";
- case 4:
- return "Informations supplémentaires";
- case 5:
- return "Restrictions d'accès";
- default:
- return "";
- }
- },
- previous_step: "Étape précédente",
- continue: "Continuer",
- publish: "Publier le service maintenant",
- "publish.in_progress": "Création du service WFS en cours",
- "modify.in_progress": "Modification des informations du service WFS en cours",
- back_to_data_list: "Retour à mes données",
- trimmed_error: "La chaîne de caractères ne doit contenir aucun espace en début et fin",
- public_name_regex:
- "Le nom public de la table ne doit contenir que des lettres, chiffres, tirets (-), underscores (_), ou points (.) et ne peut commencer que par une lettre ou un underscore",
-};
-
-export const WfsServiceFormEnTranslations: Translations<"en">["WfsServiceForm"] = {
- title: undefined,
- "stored_data.loading": undefined,
- "stored_data_and_offering.loading": undefined,
- "stored_data.fetch_failed": undefined,
- "offering.fetch_failed": undefined,
- "step.title": undefined,
- previous_step: undefined,
- continue: undefined,
- publish: undefined,
- "publish.in_progress": undefined,
- "modify.in_progress": undefined,
- back_to_data_list: undefined,
- trimmed_error: undefined,
- public_name_regex: undefined,
-};
diff --git a/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm/PyramidRasterGenerateForm.locale.tsx b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm/PyramidRasterGenerateForm.locale.tsx
new file mode 100644
index 00000000..15d139c7
--- /dev/null
+++ b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm/PyramidRasterGenerateForm.locale.tsx
@@ -0,0 +1,66 @@
+import { declareComponentKeys } from "i18nifty";
+
+import { Translations } from "../../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | "title"
+ | { K: "step.title"; P: { stepNumber: number }; R: string }
+ | "wmsv-service.loading"
+ | "wmsv-service.fetch_failed"
+ | "wmsv-service.bbox_not_found"
+ | "back_to_datasheet"
+ | "technical_name.lead_text"
+ | "technical_name.label"
+ | "technical_name.explanation"
+ | "technical_name.error.mandatory"
+ | "zoom_range.lead_text"
+ | "zoom_range.explanation"
+ | "zoom_range.error"
+ | "generate.in_progress"
+>()("PyramidRasterGenerateForm");
+export type I18n = typeof i18n;
+
+export const PyramidRasterGenerateFormFrTranslations: Translations<"fr">["PyramidRasterGenerateForm"] = {
+ title: "Générer une pyramide de tuiles raster",
+ "step.title": ({ stepNumber }) => {
+ switch (stepNumber) {
+ case 1:
+ return "Nom de la pyramide de tuiles raster";
+ case 2:
+ return "Niveaux de pyramide";
+ default:
+ return "";
+ }
+ },
+ "wmsv-service.loading": "Chargement du service WMS-Vecteur...",
+ "wmsv-service.fetch_failed": "Récupération des informations sur le service WMS-Vecteur a échoué",
+ "wmsv-service.bbox_not_found": "La bbox du service WMS-Vecteur n'a pas été trouvée, veuillez vérifier le service et la donnée stockée utilisée",
+ back_to_datasheet: "Retour à la fiche de données",
+ "technical_name.lead_text": "Choisissez le nom technique de la pyramide de tuiles raster",
+ "technical_name.label": "Nom technique de la pyramide de tuiles raster",
+ "technical_name.explanation":
+ "II s'agit du nom technique du service qui apparaitra dans votre espace de travail, il ne sera pas publié en ligne. Si vous le renommez, choisissez un nom explicite.",
+ "technical_name.error.mandatory": "Le nom technique de la pyramide de tuiles raster est obligatoire",
+ "zoom_range.lead_text": "Choisissez les niveaux de pyramide à générer",
+ "zoom_range.explanation":
+ "Les niveaux de zoom de la pyramide de tuiles raster sont prédéfinis. Choisissez la borne minimum de votre pyramide de tuiles en vous aidant de la carte de gauche et le zoom maximum en vous aidant de la carte de droite. Tous les niveaux intermédiaires seront générés.",
+ "zoom_range.error": "Les bornes de la pyramide sont obligatoires.",
+ "generate.in_progress": "Génération de pyramide de tuiles raster en cours",
+};
+
+export const PyramidRasterGenerateFormEnTranslations: Translations<"en">["PyramidRasterGenerateForm"] = {
+ title: undefined,
+ "step.title": undefined,
+ "wmsv-service.loading": undefined,
+ "wmsv-service.fetch_failed": undefined,
+ "wmsv-service.bbox_not_found": undefined,
+ back_to_datasheet: undefined,
+ "technical_name.error.mandatory": undefined,
+ "technical_name.lead_text": undefined,
+ "technical_name.label": undefined,
+ "technical_name.explanation": undefined,
+ "zoom_range.lead_text": undefined,
+ "zoom_range.explanation": undefined,
+ "zoom_range.error": undefined,
+ "generate.in_progress": undefined,
+};
diff --git a/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm.tsx b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm/PyramidRasterGenerateForm.tsx
similarity index 69%
rename from assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm.tsx
rename to assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm/PyramidRasterGenerateForm.tsx
index e10a5fc6..e597f0b6 100644
--- a/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm.tsx
+++ b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm/PyramidRasterGenerateForm.tsx
@@ -6,27 +6,26 @@ import Input from "@codegouvfr/react-dsfr/Input";
import Stepper from "@codegouvfr/react-dsfr/Stepper";
import { yupResolver } from "@hookform/resolvers/yup";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { declareComponentKeys } from "i18nifty";
import { FC, useCallback, useState } from "react";
import { useForm } from "react-hook-form";
import * as yup from "yup";
-import type { PyramidRaster, Service } from "../../../../@types/app";
-import type { ConfigurationWmsVectorDetailsContent } from "../../../../@types/entrepot";
-import DatastoreLayout from "../../../../components/Layout/DatastoreLayout";
-import LoadingIcon from "../../../../components/Utils/LoadingIcon";
-import LoadingText from "../../../../components/Utils/LoadingText";
-import Wait from "../../../../components/Utils/Wait";
-import ZoomRange from "../../../../components/Utils/ZoomRange";
-import olDefaults from "../../../../data/ol-defaults.json";
-import useScrollToTopEffect from "../../../../hooks/useScrollToTopEffect";
-import { Translations, useTranslation } from "../../../../i18n/i18n";
-import RQKeys from "../../../../modules/entrepot/RQKeys";
-import { CartesApiException } from "../../../../modules/jsonFetch";
-import { routes } from "../../../../router/router";
-import { bboxToWkt } from "../../../../utils";
-import api from "../../../api";
-import { DatasheetViewActiveTabEnum } from "../../datasheet/DatasheetView/DatasheetView";
+import type { PyramidRaster, Service } from "../../../../../@types/app";
+import type { ConfigurationWmsVectorDetailsContent } from "../../../../../@types/entrepot";
+import DatastoreLayout from "../../../../../components/Layout/DatastoreLayout";
+import LoadingIcon from "../../../../../components/Utils/LoadingIcon";
+import LoadingText from "../../../../../components/Utils/LoadingText";
+import Wait from "../../../../../components/Utils/Wait";
+import ZoomRange from "../../../../../components/Utils/ZoomRange";
+import olDefaults from "../../../../../data/ol-defaults.json";
+import useScrollToTopEffect from "../../../../../hooks/useScrollToTopEffect";
+import { useTranslation } from "../../../../../i18n/i18n";
+import RQKeys from "../../../../../modules/entrepot/RQKeys";
+import { CartesApiException } from "../../../../../modules/jsonFetch";
+import { routes } from "../../../../../router/router";
+import { bboxToWkt } from "../../../../../utils";
+import api from "../../../../api";
+import { DatasheetViewActiveTabEnum } from "../../../datasheet/DatasheetView/DatasheetView/DatasheetView";
const STEPS = {
TECHNICAL_NAME: 1,
@@ -242,68 +241,3 @@ const PyramidRasterGenerateForm: FC = ({ datasto
};
export default PyramidRasterGenerateForm;
-
-export const { i18n } = declareComponentKeys<
- | "title"
- | { K: "step.title"; P: { stepNumber: number }; R: string }
- | "wmsv-service.loading"
- | "wmsv-service.fetch_failed"
- | "wmsv-service.bbox_not_found"
- | "back_to_datasheet"
- | "technical_name.lead_text"
- | "technical_name.label"
- | "technical_name.explanation"
- | "technical_name.error.mandatory"
- | "zoom_range.lead_text"
- | "zoom_range.explanation"
- | "zoom_range.error"
- | "generate.in_progress"
->()({
- PyramidRasterGenerateForm,
-});
-
-export const PyramidRasterGenerateFormFrTranslations: Translations<"fr">["PyramidRasterGenerateForm"] = {
- // title: "Créer un service raster WMS/WMTS",
- title: "Générer une pyramide de tuiles raster",
- "step.title": ({ stepNumber }) => {
- switch (stepNumber) {
- case 1:
- return "Nom de la pyramide de tuiles raster";
- case 2:
- return "Niveaux de pyramide";
- default:
- return "";
- }
- },
- "wmsv-service.loading": "Chargement du service WMS-Vecteur...",
- "wmsv-service.fetch_failed": "Récupération des informations sur le service WMS-Vecteur a échoué",
- "wmsv-service.bbox_not_found": "La bbox du service WMS-Vecteur n'a pas été trouvée, veuillez vérifier le service et la donnée stockée utilisée",
- back_to_datasheet: "Retour à la fiche de données",
- "technical_name.lead_text": "Choisissez le nom technique de la pyramide de tuiles raster",
- "technical_name.label": "Nom technique de la pyramide de tuiles raster",
- "technical_name.explanation":
- "II s'agit du nom technique du service qui apparaitra dans votre espace de travail, il ne sera pas publié en ligne. Si vous le renommez, choisissez un nom explicite.",
- "technical_name.error.mandatory": "Le nom technique de la pyramide de tuiles raster est obligatoire",
- "zoom_range.lead_text": "Choisissez les niveaux de pyramide à générer",
- "zoom_range.explanation":
- "Les niveaux de zoom de la pyramide de tuiles raster sont prédéfinis. Choisissez la borne minimum de votre pyramide de tuiles en vous aidant de la carte de gauche et le zoom maximum en vous aidant de la carte de droite. Tous les niveaux intermédiaires seront générés.",
- "zoom_range.error": "Les bornes de la pyramide sont obligatoires.",
- "generate.in_progress": "Génération de pyramide de tuiles raster en cours",
-};
-
-export const PyramidRasterGenerateFormEnTranslations: Translations<"en">["PyramidRasterGenerateForm"] = {
- title: undefined,
- "step.title": undefined,
- "wmsv-service.loading": undefined,
- "wmsv-service.fetch_failed": undefined,
- "wmsv-service.bbox_not_found": undefined,
- back_to_datasheet: undefined,
- "technical_name.error.mandatory": undefined,
- "technical_name.lead_text": undefined,
- "technical_name.label": undefined,
- "technical_name.explanation": undefined,
- "zoom_range.lead_text": undefined,
- "zoom_range.explanation": undefined,
- "zoom_range.error": undefined,
- "generate.in_progress": undefined,
-};
diff --git a/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmsRasterServiceForm/PyramidRasterWmsRasterServiceForm.locale.tsx b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmsRasterServiceForm/PyramidRasterWmsRasterServiceForm.locale.tsx
new file mode 100644
index 00000000..6efb4b1e
--- /dev/null
+++ b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmsRasterServiceForm/PyramidRasterWmsRasterServiceForm.locale.tsx
@@ -0,0 +1,57 @@
+import { declareComponentKeys } from "i18nifty";
+
+import { Translations } from "../../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | { K: "title"; P: { editMode: boolean }; R: string }
+ | "stored_data.loading"
+ | "stored_data_and_offering.loading"
+ | "stored_data.fetch_failed"
+ | "offering.fetch_failed"
+ | { K: "step.title"; P: { stepNumber: number }; R: string }
+ | "publish"
+ | "publish.in_progress"
+ | "modify.in_progress"
+ | "back_to_data_list"
+>()("PyramidRasterWmsRasterServiceForm");
+export type I18n = typeof i18n;
+
+export const PyramidRasterWmsRasterServiceFormFrTranslations: Translations<"fr">["PyramidRasterWmsRasterServiceForm"] = {
+ title: ({ editMode }) => (editMode ? "Modifier le service WMS-Raster" : "Publier un service WMS-Raster"),
+ "stored_data.loading": "Chargement de la donnée stockée",
+ "stored_data_and_offering.loading": "Chargement de la donnée stockée et du service à modifier",
+ "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué",
+ "offering.fetch_failed": "Récupération des informations sur le service à modifier a échoué",
+ "step.title": ({ stepNumber }) => {
+ switch (stepNumber) {
+ case 1:
+ return "Source des métadonnées";
+ case 2:
+ return "Description de la ressource";
+ case 3:
+ return "Informations supplémentaires";
+ case 4:
+ return "Restrictions d’accès";
+
+ default:
+ return "";
+ }
+ },
+ publish: "Publier le service maintenant",
+ "publish.in_progress": "Création du service WMS-Raster en cours",
+ "modify.in_progress": "Modification des informations du service WMS-Raster en cours",
+ back_to_data_list: "Retour à mes données",
+};
+
+export const PyramidRasterWmsRasterServiceFormEnTranslations: Translations<"en">["PyramidRasterWmsRasterServiceForm"] = {
+ title: undefined,
+ "stored_data.loading": undefined,
+ "stored_data_and_offering.loading": undefined,
+ "stored_data.fetch_failed": undefined,
+ "offering.fetch_failed": undefined,
+ "step.title": undefined,
+ publish: undefined,
+ "publish.in_progress": undefined,
+ "modify.in_progress": undefined,
+ back_to_data_list: undefined,
+};
diff --git a/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmsRasterServiceForm.tsx b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmsRasterServiceForm/PyramidRasterWmsRasterServiceForm.tsx
similarity index 77%
rename from assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmsRasterServiceForm.tsx
rename to assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmsRasterServiceForm/PyramidRasterWmsRasterServiceForm.tsx
index 167ae424..6862d91e 100644
--- a/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmsRasterServiceForm.tsx
+++ b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmsRasterServiceForm/PyramidRasterWmsRasterServiceForm.tsx
@@ -5,28 +5,27 @@ import ButtonsGroup from "@codegouvfr/react-dsfr/ButtonsGroup";
import Stepper from "@codegouvfr/react-dsfr/Stepper";
import { yupResolver } from "@hookform/resolvers/yup";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { declareComponentKeys } from "i18nifty";
import { FC, useCallback, useMemo, useState } from "react";
import { useForm } from "react-hook-form";
import { symToStr } from "tsafe/symToStr";
-import { ConfigurationTypeEnum, EndpointTypeEnum, PyramidRaster, Service, ServiceFormValuesBaseType } from "../../../../@types/app";
-import DatastoreLayout from "../../../../components/Layout/DatastoreLayout";
-import LoadingIcon from "../../../../components/Utils/LoadingIcon";
-import LoadingText from "../../../../components/Utils/LoadingText";
-import Wait from "../../../../components/Utils/Wait";
-import useScrollToTopEffect from "../../../../hooks/useScrollToTopEffect";
-import { Translations, useTranslation } from "../../../../i18n/i18n";
-import RQKeys from "../../../../modules/entrepot/RQKeys";
-import { CartesApiException } from "../../../../modules/jsonFetch";
-import { routes } from "../../../../router/router";
-import api from "../../../api";
-import AccessRestrictions from "../AccessRestrictions";
-import { CommonSchemasValidation } from "../common-schemas-validation";
-import { getPyramidRasterWmsRasterServiceFormDefaultValues } from "../default-values";
-import AdditionalInfo from "../metadatas/AdditionalInfo";
-import Description from "../metadatas/Description";
-import UploadMDFile from "../metadatas/UploadMDFile";
+import { ConfigurationTypeEnum, EndpointTypeEnum, PyramidRaster, Service, ServiceFormValuesBaseType } from "../../../../../@types/app";
+import DatastoreLayout from "../../../../../components/Layout/DatastoreLayout";
+import LoadingIcon from "../../../../../components/Utils/LoadingIcon";
+import LoadingText from "../../../../../components/Utils/LoadingText";
+import Wait from "../../../../../components/Utils/Wait";
+import useScrollToTopEffect from "../../../../../hooks/useScrollToTopEffect";
+import { useTranslation } from "../../../../../i18n/i18n";
+import RQKeys from "../../../../../modules/entrepot/RQKeys";
+import { CartesApiException } from "../../../../../modules/jsonFetch";
+import { routes } from "../../../../../router/router";
+import api from "../../../../api";
+import AccessRestrictions from "../../common/AccessRestrictions/AccessRestrictions";
+import { CommonSchemasValidation } from "../../common/common-schemas-validation";
+import { getPyramidRasterWmsRasterServiceFormDefaultValues } from "../../common/default-values";
+import AdditionalInfo from "../../metadata/AdditionalInfo";
+import Description from "../../metadata/Description";
+import UploadMDFile from "../../metadata/UploadMDFile";
const STEPS = {
METADATA_UPLOAD: 1,
@@ -263,58 +262,3 @@ const PyramidRasterWmsRasterServiceForm: FC()({
- PyramidRasterWmsRasterServiceForm,
-});
-
-export const PyramidRasterWmsRasterServiceFormFrTranslations: Translations<"fr">["PyramidRasterWmsRasterServiceForm"] = {
- title: ({ editMode }) => (editMode ? "Modifier le service WMS-Raster" : "Publier un service WMS-Raster"),
- "stored_data.loading": "Chargement de la donnée stockée",
- "stored_data_and_offering.loading": "Chargement de la donnée stockée et du service à modifier",
- "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué",
- "offering.fetch_failed": "Récupération des informations sur le service à modifier a échoué",
- "step.title": ({ stepNumber }) => {
- switch (stepNumber) {
- case 1:
- return "Source des métadonnées";
- case 2:
- return "Description de la ressource";
- case 3:
- return "Informations supplémentaires";
- case 4:
- return "Restrictions d’accès";
-
- default:
- return "";
- }
- },
- publish: "Publier le service maintenant",
- "publish.in_progress": "Création du service WMS-Raster en cours",
- "modify.in_progress": "Modification des informations du service WMS-Raster en cours",
- back_to_data_list: "Retour à mes données",
-};
-
-export const PyramidRasterWmsRasterServiceFormEnTranslations: Translations<"en">["PyramidRasterWmsRasterServiceForm"] = {
- title: undefined,
- "stored_data.loading": undefined,
- "stored_data_and_offering.loading": undefined,
- "stored_data.fetch_failed": undefined,
- "offering.fetch_failed": undefined,
- "step.title": undefined,
- publish: undefined,
- "publish.in_progress": undefined,
- "modify.in_progress": undefined,
- back_to_data_list: undefined,
-};
diff --git a/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmtsServiceForm/PyramidRasterWmtsServiceForm.locale.tsx b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmtsServiceForm/PyramidRasterWmtsServiceForm.locale.tsx
new file mode 100644
index 00000000..f9cca77c
--- /dev/null
+++ b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmtsServiceForm/PyramidRasterWmtsServiceForm.locale.tsx
@@ -0,0 +1,57 @@
+import { declareComponentKeys } from "i18nifty";
+
+import { Translations } from "../../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | { K: "title"; P: { editMode: boolean }; R: string }
+ | "stored_data.loading"
+ | "stored_data_and_offering.loading"
+ | "stored_data.fetch_failed"
+ | "offering.fetch_failed"
+ | { K: "step.title"; P: { stepNumber: number }; R: string }
+ | "publish"
+ | "publish.in_progress"
+ | "modify.in_progress"
+ | "back_to_data_list"
+>()("PyramidRasterWmtsServiceForm");
+export type I18n = typeof i18n;
+
+export const PyramidRasterWmtsServiceFormFrTranslations: Translations<"fr">["PyramidRasterWmtsServiceForm"] = {
+ title: ({ editMode }) => (editMode ? "Modifier le service WMTS" : "Publier un service WMTS"),
+ "stored_data.loading": "Chargement de la donnée stockée",
+ "stored_data_and_offering.loading": "Chargement de la donnée stockée et du service à modifier",
+ "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué",
+ "offering.fetch_failed": "Récupération des informations sur le service à modifier a échoué",
+ "step.title": ({ stepNumber }) => {
+ switch (stepNumber) {
+ case 1:
+ return "Source des métadonnées";
+ case 2:
+ return "Description de la ressource";
+ case 3:
+ return "Informations supplémentaires";
+ case 4:
+ return "Restrictions d’accès";
+
+ default:
+ return "";
+ }
+ },
+ publish: "Publier le service maintenant",
+ "publish.in_progress": "Création du service WMTS en cours",
+ "modify.in_progress": "Modification des informations du service WMTS en cours",
+ back_to_data_list: "Retour à mes données",
+};
+
+export const PyramidRasterWmtsServiceFormEnTranslations: Translations<"en">["PyramidRasterWmtsServiceForm"] = {
+ title: undefined,
+ "stored_data.loading": undefined,
+ "stored_data_and_offering.loading": undefined,
+ "stored_data.fetch_failed": undefined,
+ "offering.fetch_failed": undefined,
+ "step.title": undefined,
+ publish: undefined,
+ "publish.in_progress": undefined,
+ "modify.in_progress": undefined,
+ back_to_data_list: undefined,
+};
diff --git a/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmtsServiceForm.tsx b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmtsServiceForm/PyramidRasterWmtsServiceForm.tsx
similarity index 78%
rename from assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmtsServiceForm.tsx
rename to assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmtsServiceForm/PyramidRasterWmtsServiceForm.tsx
index 5db6c2f6..fbb71439 100644
--- a/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmtsServiceForm.tsx
+++ b/assets/entrepot/pages/service/wms-raster-wmts/PyramidRasterWmtsServiceForm/PyramidRasterWmtsServiceForm.tsx
@@ -5,28 +5,27 @@ import ButtonsGroup from "@codegouvfr/react-dsfr/ButtonsGroup";
import Stepper from "@codegouvfr/react-dsfr/Stepper";
import { yupResolver } from "@hookform/resolvers/yup";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { declareComponentKeys } from "i18nifty";
import { FC, useCallback, useMemo, useState } from "react";
import { useForm } from "react-hook-form";
import { symToStr } from "tsafe/symToStr";
-import { ConfigurationTypeEnum, EndpointTypeEnum, PyramidRaster, Service, ServiceFormValuesBaseType } from "../../../../@types/app";
-import DatastoreLayout from "../../../../components/Layout/DatastoreLayout";
-import LoadingIcon from "../../../../components/Utils/LoadingIcon";
-import LoadingText from "../../../../components/Utils/LoadingText";
-import Wait from "../../../../components/Utils/Wait";
-import useScrollToTopEffect from "../../../../hooks/useScrollToTopEffect";
-import { Translations, useTranslation } from "../../../../i18n/i18n";
-import RQKeys from "../../../../modules/entrepot/RQKeys";
-import { CartesApiException } from "../../../../modules/jsonFetch";
-import { routes } from "../../../../router/router";
-import api from "../../../api";
-import AccessRestrictions from "../AccessRestrictions";
-import { CommonSchemasValidation } from "../common-schemas-validation";
-import { getPyramidRasterWmtsServiceFormDefaultValues } from "../default-values";
-import AdditionalInfo from "../metadatas/AdditionalInfo";
-import Description from "../metadatas/Description";
-import UploadMDFile from "../metadatas/UploadMDFile";
+import { ConfigurationTypeEnum, EndpointTypeEnum, PyramidRaster, Service, ServiceFormValuesBaseType } from "../../../../../@types/app";
+import DatastoreLayout from "../../../../../components/Layout/DatastoreLayout";
+import LoadingIcon from "../../../../../components/Utils/LoadingIcon";
+import LoadingText from "../../../../../components/Utils/LoadingText";
+import Wait from "../../../../../components/Utils/Wait";
+import useScrollToTopEffect from "../../../../../hooks/useScrollToTopEffect";
+import { useTranslation } from "../../../../../i18n/i18n";
+import RQKeys from "../../../../../modules/entrepot/RQKeys";
+import { CartesApiException } from "../../../../../modules/jsonFetch";
+import { routes } from "../../../../../router/router";
+import api from "../../../../api";
+import AccessRestrictions from "../../common/AccessRestrictions/AccessRestrictions";
+import { CommonSchemasValidation } from "../../common/common-schemas-validation";
+import { getPyramidRasterWmtsServiceFormDefaultValues } from "../../common/default-values";
+import AdditionalInfo from "../../metadata/AdditionalInfo";
+import Description from "../../metadata/Description";
+import UploadMDFile from "../../metadata/UploadMDFile";
const STEPS = {
METADATA_UPLOAD: 1,
@@ -263,58 +262,3 @@ const PyramidRasterWmtsServiceForm: FC = ({ d
PyramidRasterWmtsServiceForm.displayName = symToStr({ PyramidRasterWmtsServiceForm });
export default PyramidRasterWmtsServiceForm;
-
-export const { i18n } = declareComponentKeys<
- | { K: "title"; P: { editMode: boolean }; R: string }
- | "stored_data.loading"
- | "stored_data_and_offering.loading"
- | "stored_data.fetch_failed"
- | "offering.fetch_failed"
- | { K: "step.title"; P: { stepNumber: number }; R: string }
- | "publish"
- | "publish.in_progress"
- | "modify.in_progress"
- | "back_to_data_list"
->()({
- PyramidRasterWmtsServiceForm,
-});
-
-export const PyramidRasterWmtsServiceFormFrTranslations: Translations<"fr">["PyramidRasterWmtsServiceForm"] = {
- title: ({ editMode }) => (editMode ? "Modifier le service WMTS" : "Publier un service WMTS"),
- "stored_data.loading": "Chargement de la donnée stockée",
- "stored_data_and_offering.loading": "Chargement de la donnée stockée et du service à modifier",
- "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué",
- "offering.fetch_failed": "Récupération des informations sur le service à modifier a échoué",
- "step.title": ({ stepNumber }) => {
- switch (stepNumber) {
- case 1:
- return "Source des métadonnées";
- case 2:
- return "Description de la ressource";
- case 3:
- return "Informations supplémentaires";
- case 4:
- return "Restrictions d’accès";
-
- default:
- return "";
- }
- },
- publish: "Publier le service maintenant",
- "publish.in_progress": "Création du service WMTS en cours",
- "modify.in_progress": "Modification des informations du service WMTS en cours",
- back_to_data_list: "Retour à mes données",
-};
-
-export const PyramidRasterWmtsServiceFormEnTranslations: Translations<"en">["PyramidRasterWmtsServiceForm"] = {
- title: undefined,
- "stored_data.loading": undefined,
- "stored_data_and_offering.loading": undefined,
- "stored_data.fetch_failed": undefined,
- "offering.fetch_failed": undefined,
- "step.title": undefined,
- publish: undefined,
- "publish.in_progress": undefined,
- "modify.in_progress": undefined,
- back_to_data_list: undefined,
-};
diff --git a/assets/entrepot/pages/service/wms-vector/UploadStyleFile.locale.tsx b/assets/entrepot/pages/service/wms-vector/UploadStyleFile.locale.tsx
new file mode 100644
index 00000000..eb122f84
--- /dev/null
+++ b/assets/entrepot/pages/service/wms-vector/UploadStyleFile.locale.tsx
@@ -0,0 +1,16 @@
+import { declareComponentKeys } from "i18nifty";
+
+import { Translations } from "../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<"title" | "file_input_hint">()("UploadStyleFile");
+export type I18n = typeof i18n;
+
+export const UploadStyleFileFrTranslations: Translations<"fr">["UploadStyleFile"] = {
+ title: "Déposez vos fichiers de style SLD",
+ file_input_hint: "Glissez-déposez votre fichier SLD ici. Formats de fichiers autorisés : .sld",
+};
+
+export const UploadStyleFileEnTranslations: Translations<"en">["UploadStyleFile"] = {
+ title: undefined,
+ file_input_hint: undefined,
+};
diff --git a/assets/entrepot/pages/service/wms-vector/UploadStyleFile.tsx b/assets/entrepot/pages/service/wms-vector/UploadStyleFile.tsx
index a3993b1c..7c843545 100644
--- a/assets/entrepot/pages/service/wms-vector/UploadStyleFile.tsx
+++ b/assets/entrepot/pages/service/wms-vector/UploadStyleFile.tsx
@@ -3,8 +3,8 @@ import { Upload } from "@codegouvfr/react-dsfr/Upload";
import { FC } from "react";
import { type UseFormReturn } from "react-hook-form";
-import { Translations, declareComponentKeys, useTranslation } from "../../../../i18n/i18n";
import { type StoredDataRelation } from "../../../../@types/app";
+import { useTranslation } from "../../../../i18n/i18n";
import { WmsVectorServiceFormValuesType } from "./WmsVectorServiceForm";
type UploadStyleFileProps = {
@@ -46,17 +46,3 @@ const UploadStyleFile: FC = ({ visible, selectedTables = [
};
export default UploadStyleFile;
-
-export const { i18n } = declareComponentKeys<"title" | "file_input_hint">()({
- UploadStyleFile,
-});
-
-export const UploadStyleFileFrTranslations: Translations<"fr">["UploadStyleFile"] = {
- title: "Déposez vos fichiers de style SLD",
- file_input_hint: "Glissez-déposez votre fichier SLD ici. Formats de fichiers autorisés : .sld",
-};
-
-export const UploadStyleFileEnTranslations: Translations<"en">["UploadStyleFile"] = {
- title: undefined,
- file_input_hint: undefined,
-};
diff --git a/assets/entrepot/pages/service/wms-vector/WmsVectorServiceForm.locale.tsx b/assets/entrepot/pages/service/wms-vector/WmsVectorServiceForm.locale.tsx
new file mode 100644
index 00000000..38fc71b0
--- /dev/null
+++ b/assets/entrepot/pages/service/wms-vector/WmsVectorServiceForm.locale.tsx
@@ -0,0 +1,65 @@
+import { declareComponentKeys } from "i18nifty";
+import { Translations } from "../../../../i18n/types";
+
+const { i18n } = declareComponentKeys<
+ | { K: "title"; P: { editMode: boolean }; R: string }
+ | "stored_data.loading"
+ | "stored_data_and_offering.loading"
+ | "stored_data.fetch_failed"
+ | "offering.fetch_failed"
+ | { K: "step.title"; P: { stepNumber: number }; R: string }
+ | "previous_step"
+ | "continue"
+ | "publish"
+ | "publish.in_progress"
+ | "modify.in_progress"
+ | "back_to_data_list"
+>()("WmsVectorServiceForm");
+export type I18n = typeof i18n;
+
+export const WmsVectorServiceFormFrTranslations: Translations<"fr">["WmsVectorServiceForm"] = {
+ title: ({ editMode }) => (editMode ? "Modifier le service WMS-Vecteur" : "Créer et publier un service WMS-Vecteur"),
+ "stored_data.loading": "Chargement de la donnée stockée...",
+ "stored_data_and_offering.loading": "Chargement de la donnée stockée et du service à modifier...",
+ "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué",
+ "offering.fetch_failed": "Récupération des informations sur le service à modifier a échoué",
+ "step.title": ({ stepNumber }) => {
+ switch (stepNumber) {
+ case 1:
+ return "Tables";
+ case 2:
+ return "Fichier de style SLD";
+ case 3:
+ return "Source des métadonnées";
+ case 4:
+ return "Description de la ressource";
+ case 5:
+ return "Informations supplémentaires";
+ case 6:
+ return "Restrictions d'accès";
+ default:
+ return "";
+ }
+ },
+ previous_step: "Étape précédente",
+ continue: "Continuer",
+ publish: "Publier le service maintenant",
+ "publish.in_progress": "Création du service WMS-Vecteur en cours",
+ "modify.in_progress": "Modification des informations du service WMS-Vecteur en cours",
+ back_to_data_list: "Retour à mes données",
+};
+
+export const WmsVectorServiceFormEnTranslations: Translations<"en">["WmsVectorServiceForm"] = {
+ title: undefined,
+ "stored_data.loading": undefined,
+ "stored_data_and_offering.loading": undefined,
+ "stored_data.fetch_failed": undefined,
+ "offering.fetch_failed": undefined,
+ "step.title": undefined,
+ previous_step: undefined,
+ continue: undefined,
+ publish: undefined,
+ "publish.in_progress": undefined,
+ "modify.in_progress": undefined,
+ back_to_data_list: undefined,
+};
diff --git a/assets/entrepot/pages/service/wms-vector/WmsVectorServiceForm.tsx b/assets/entrepot/pages/service/wms-vector/WmsVectorServiceForm.tsx
index fb7504e5..a2f61f76 100644
--- a/assets/entrepot/pages/service/wms-vector/WmsVectorServiceForm.tsx
+++ b/assets/entrepot/pages/service/wms-vector/WmsVectorServiceForm.tsx
@@ -6,7 +6,6 @@ import Stepper from "@codegouvfr/react-dsfr/Stepper";
import { yupResolver } from "@hookform/resolvers/yup";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import SldStyleParser from "geostyler-sld-parser";
-import { declareComponentKeys } from "i18nifty";
import { FC, useCallback, useMemo, useState } from "react";
import { useForm, useWatch } from "react-hook-form";
import { symToStr } from "tsafe/symToStr";
@@ -25,19 +24,19 @@ import LoadingIcon from "../../../../components/Utils/LoadingIcon";
import LoadingText from "../../../../components/Utils/LoadingText";
import Wait from "../../../../components/Utils/Wait";
import useScrollToTopEffect from "../../../../hooks/useScrollToTopEffect";
-import { Translations, useTranslation } from "../../../../i18n/i18n";
+import { useTranslation } from "../../../../i18n/i18n";
import RQKeys from "../../../../modules/entrepot/RQKeys";
import { CartesApiException } from "../../../../modules/jsonFetch";
import { routes } from "../../../../router/router";
-import SldStyleWmsVectorValidator from "../../../../validations/sldStyle";
+import SldStyleWmsVectorValidator from "../../../../validations/sld/sldStyle";
import api from "../../../api";
-import AccessRestrictions from "../AccessRestrictions";
-import TableSelection from "../TableSelection";
-import { CommonSchemasValidation } from "../common-schemas-validation";
-import { getWmsVectorServiceFormDefaultValues } from "../default-values";
-import AdditionalInfo from "../metadatas/AdditionalInfo";
-import Description from "../metadatas/Description";
-import UploadMDFile from "../metadatas/UploadMDFile";
+import AccessRestrictions from "../common/AccessRestrictions/AccessRestrictions";
+import TableSelection from "../common/TableSelection/TableSelection";
+import { CommonSchemasValidation } from "../common/common-schemas-validation";
+import { getWmsVectorServiceFormDefaultValues } from "../common/default-values";
+import AdditionalInfo from "../metadata/AdditionalInfo";
+import Description from "../metadata/Description";
+import UploadMDFile from "../metadata/UploadMDFile";
import UploadStyleFile from "./UploadStyleFile";
/**
@@ -399,67 +398,3 @@ const WmsVectorServiceForm: FC = ({ datastoreId, vect
WmsVectorServiceForm.displayName = symToStr({ WmsVectorServiceForm });
export default WmsVectorServiceForm;
-
-export const { i18n } = declareComponentKeys<
- | { K: "title"; P: { editMode: boolean }; R: string }
- | "stored_data.loading"
- | "stored_data_and_offering.loading"
- | "stored_data.fetch_failed"
- | "offering.fetch_failed"
- | { K: "step.title"; P: { stepNumber: number }; R: string }
- | "previous_step"
- | "continue"
- | "publish"
- | "publish.in_progress"
- | "modify.in_progress"
- | "back_to_data_list"
->()({
- WmsVectorServiceForm,
-});
-
-export const WmsVectorServiceFormFrTranslations: Translations<"fr">["WmsVectorServiceForm"] = {
- title: ({ editMode }) => (editMode ? "Modifier le service WMS-Vecteur" : "Créer et publier un service WMS-Vecteur"),
- "stored_data.loading": "Chargement de la donnée stockée...",
- "stored_data_and_offering.loading": "Chargement de la donnée stockée et du service à modifier...",
- "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué",
- "offering.fetch_failed": "Récupération des informations sur le service à modifier a échoué",
- "step.title": ({ stepNumber }) => {
- switch (stepNumber) {
- case 1:
- return "Tables";
- case 2:
- return "Fichier de style SLD";
- case 3:
- return "Source des métadonnées";
- case 4:
- return "Description de la ressource";
- case 5:
- return "Informations supplémentaires";
- case 6:
- return "Restrictions d'accès";
- default:
- return "";
- }
- },
- previous_step: "Étape précédente",
- continue: "Continuer",
- publish: "Publier le service maintenant",
- "publish.in_progress": "Création du service WMS-Vecteur en cours",
- "modify.in_progress": "Modification des informations du service WMS-Vecteur en cours",
- back_to_data_list: "Retour à mes données",
-};
-
-export const WmsVectorServiceFormEnTranslations: Translations<"en">["WmsVectorServiceForm"] = {
- title: undefined,
- "stored_data.loading": undefined,
- "stored_data_and_offering.loading": undefined,
- "stored_data.fetch_failed": undefined,
- "offering.fetch_failed": undefined,
- "step.title": undefined,
- previous_step: undefined,
- continue: undefined,
- publish: undefined,
- "publish.in_progress": undefined,
- "modify.in_progress": undefined,
- back_to_data_list: undefined,
-};
diff --git a/assets/entrepot/pages/users/Me.tsx b/assets/entrepot/pages/users/Me.tsx
deleted file mode 100644
index 24e3c7ce..00000000
--- a/assets/entrepot/pages/users/Me.tsx
+++ /dev/null
@@ -1,148 +0,0 @@
-import { fr } from "@codegouvfr/react-dsfr";
-import Button from "@codegouvfr/react-dsfr/Button";
-import { useMemo } from "react";
-
-import AppLayout from "../../../components/Layout/AppLayout";
-import { datastoreNavItems } from "../../../config/datastoreNavItems";
-import { Translations, declareComponentKeys, getTranslation, useTranslation } from "../../../i18n/i18n";
-import SymfonyRouting from "../../../modules/Routing";
-import { useAuthStore } from "../../../stores/AuthStore";
-import { useSnackbarStore } from "../../../stores/SnackbarStore";
-import { formatDateFromISO } from "../../../utils";
-
-const Me = () => {
- const { t: tCommon } = getTranslation("Common");
- const { t } = useTranslation({ Me });
- const user = useAuthStore((state) => state.user);
- const navItems = useMemo(() => datastoreNavItems(), []);
-
- const setMessage = useSnackbarStore((state) => state.setMessage);
-
- return (
-
-