Skip to content

Commit

Permalink
fix: corrections suite rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ocruze committed Dec 13, 2024
1 parent 09eb43a commit 5d544b8
Show file tree
Hide file tree
Showing 14 changed files with 311 additions and 304 deletions.
Original file line number Diff line number Diff line change
@@ -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`,
};
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -48,7 +48,7 @@ type PyramidRasterListItemProps = {
};

const PyramidRasterListItem: FC<PyramidRasterListItemProps> = ({ datasheetName, datastoreId, pyramid }) => {
const { t } = useTranslation({ PyramidRasterListItem });
const { t } = useTranslation("PyramidRasterList");
const { t: tCommon } = useTranslation("Common");

const [showDescription, toggleShowDescription] = useToggle(false);
Expand Down Expand Up @@ -263,52 +263,3 @@ const PyramidRasterListItem: FC<PyramidRasterListItemProps> = ({ 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`,
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const { i18n } = declareComponentKeys<
| { K: "confirm_delete_modal.title"; P: { pyramidName: string }; R: string }
| "following_services_deleted"
| { K: "error_deleting"; P: { pyramidName: string }; R: string }
>()("PyramidList");
>()("PyramidVectorList");
export type I18n = typeof i18n;

export const PyramidListFrTranslations: Translations<"fr">["PyramidList"] = {
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",
Expand All @@ -23,7 +23,7 @@ export const PyramidListFrTranslations: Translations<"fr">["PyramidList"] = {
error_deleting: ({ pyramidName }) => `La suppression de la pyramide ${pyramidName} a échoué`,
};

export const PyramidListEnTranslations: Translations<"en">["PyramidList"] = {
export const PyramidVectorListEnTranslations: Translations<"en">["PyramidVectorList"] = {
show_linked_datas: "Show linked datas",
other_actions: "Other actions",
show_details: "Show details",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type PyramidVectorListItemProps = {
const { t: tCommon } = getTranslation("Common");

const PyramidVectorListItem: FC<PyramidVectorListItemProps> = ({ datasheetName, datastoreId, pyramid }) => {
const { t } = useTranslation({ PyramidVectorListItem });
const { t } = useTranslation("PyramidVectorList");

const [showDescription, toggleShowDescription] = useToggle(false);

Expand Down
Original file line number Diff line number Diff line change
@@ -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,
};
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -242,68 +241,3 @@ const PyramidRasterGenerateForm: FC<PyramidRasterGenerateFormProps> = ({ 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,
};
Original file line number Diff line number Diff line change
@@ -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,
};
Loading

0 comments on commit 5d544b8

Please sign in to comment.