From c3aa4f9ab3f00de406b65e0d23f1c37163b11329 Mon Sep 17 00:00:00 2001 From: Orka Arnest CRUZE Date: Fri, 13 Sep 2024 16:03:49 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20d=C3=A9but=20licence=20dans=20les=20m?= =?UTF-8?q?=C3=A9tdonn=C3=A9es=20#286?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Input/AutocompleteSelect.tsx | 2 +- .../pages/service/metadatas/Description.tsx | 26 ++++++++++++++----- .../service/metadatas/metadatas-form-tr.ts | 9 +++++++ .../pages/service/wfs/WfsServiceForm.tsx | 2 +- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/assets/components/Input/AutocompleteSelect.tsx b/assets/components/Input/AutocompleteSelect.tsx index a88cd8e4..45cd3503 100644 --- a/assets/components/Input/AutocompleteSelect.tsx +++ b/assets/components/Input/AutocompleteSelect.tsx @@ -8,7 +8,7 @@ import { symToStr } from "tsafe/symToStr"; interface AutocompleteSelectProps { id?: string; label: string; - hintText: string; + hintText?: string; state?: "default" | "error" | "success"; stateRelatedMessage?: string; defaultValue?: T[]; diff --git a/assets/entrepot/pages/service/metadatas/Description.tsx b/assets/entrepot/pages/service/metadatas/Description.tsx index b62e0827..3ce06a22 100644 --- a/assets/entrepot/pages/service/metadatas/Description.tsx +++ b/assets/entrepot/pages/service/metadatas/Description.tsx @@ -5,13 +5,13 @@ import { XMLParser } from "fast-xml-parser"; import { FC, useEffect } from "react"; import { Controller, UseFormReturn } from "react-hook-form"; +import { EndpointTypeEnum, ServiceFormValuesBaseType } from "../../../../@types/app"; import AutocompleteSelect from "../../../../components/Input/AutocompleteSelect"; import MarkdownEditor from "../../../../components/Input/MarkdownEditor"; -import { getTranslation } from "../../../../i18n/i18n"; -import { EndpointTypeEnum, ServiceFormValuesBaseType } from "../../../../@types/app"; -import { getInspireKeywords, regex } from "../../../../utils"; -import categories from "../../../../data/topic_categories.json"; import frequencyCodes from "../../../../data/maintenance_frequency.json"; +import categories from "../../../../data/topic_categories.json"; +import { useTranslation } from "../../../../i18n/i18n"; +import { getInspireKeywords, regex } from "../../../../utils"; const keywords = getInspireKeywords(); @@ -35,8 +35,8 @@ type DescriptionProps = { }; const Description: FC = ({ visible, form, editMode }) => { - const { t: tCommon } = getTranslation("Common"); - const { t } = getTranslation("MetadatasForm"); + const { t: tCommon } = useTranslation("Common"); + const { t } = useTranslation("MetadatasForm"); const { register, @@ -235,6 +235,20 @@ const Description: FC = ({ visible, form, editMode }) => { ...register("organization_email"), }} /> + +

{t("metadata.description_form.public_access_limits_title")}

+ String(option)} + /> + ); }; diff --git a/assets/entrepot/pages/service/metadatas/metadatas-form-tr.ts b/assets/entrepot/pages/service/metadatas/metadatas-form-tr.ts index 7f4d4d4e..d9d65000 100644 --- a/assets/entrepot/pages/service/metadatas/metadatas-form-tr.ts +++ b/assets/entrepot/pages/service/metadatas/metadatas-form-tr.ts @@ -31,6 +31,9 @@ export const { i18n } = declareComponentKeys< | "metadata.description_form.hint_organization" | "metadata.description_form.organization_email" | "metadata.description_form.hint_organization_email" + | "metadata.description_form.public_access_limits_title" + | "metadata.description_form.access_and_use_conditions" + | "metadata.description_form.public_access_restrictions" | "attribution.title" | "attribution.explain" | "attribution_form.text" @@ -94,6 +97,9 @@ export const MetadatasFormFrTranslations: Translations<"fr">["MetadatasForm"] = "attribution_form.url": "URL de l’attribution (optionnel)", "attribution_form.hint_url": "Adresse de la page web vers laquelle doit pointer l’attribution. Il peut s'agir du site web de l’organisme producteur, d’une page de conditions d’utilisation des données ou de toute autre URL valide en lien avec les données représentées.", + "metadata.description_form.public_access_limits_title": "Limitations d'accès public", + "metadata.description_form.access_and_use_conditions": "Condition d'accès et d'utilisation", + "metadata.description_form.public_access_restrictions": "Restriction d'accès public", "metadata.additionnal_infos_form.language": "Langue des métadonnées", "metadata.additionnal_infos_form.hint_language": "La ou les langues utilisées pour décrire les métadonnées", "metadata.additionnal_infos_form.charset": "Jeu de caractères de la ressource", @@ -149,6 +155,9 @@ export const MetadatasFormEnTranslations: Translations<"en">["MetadatasForm"] = "attribution_form.url": "Attribution URL", "attribution_form.hint_url": "Address of the web page to which the attribution should point. This may be the producing organization's website, a data use conditions page, or any other valid URL related to the data represented.", + "metadata.description_form.public_access_limits_title": undefined, + "metadata.description_form.access_and_use_conditions": undefined, + "metadata.description_form.public_access_restrictions": undefined, "metadata.additionnal_infos_form.language": "Metadata language", "metadata.additionnal_infos_form.hint_language": "The language(s) used to describe the metadata", "metadata.additionnal_infos_form.charset": "Resource charset", diff --git a/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx b/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx index 1c73873b..cb11c5c7 100644 --- a/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx +++ b/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx @@ -106,7 +106,7 @@ const WfsServiceForm: FC = ({ datastoreId, vectorDbId, offe const { t: tCommon } = useTranslation("Common"); /* l'etape courante */ - const [currentStep, setCurrentStep] = useState(STEPS.TABLES_INFOS); + const [currentStep, setCurrentStep] = useState(STEPS.METADATAS_DESCRIPTION); // TODO, A ENLEVER const editMode = useMemo(() => !!offeringId, [offeringId]); const queryClient = useQueryClient();