From a51aab4f1873203a161f6aab39ac42a4ba41b4bb Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Fri, 29 Nov 2024 16:00:28 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20traductions=20et=20am=C3=A9liore=20le?= =?UTF-8?q?=20rendu=20du=20formulaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/components/Form.jsx | 24 ++-- front/src/components/form.module.scss | 17 ++- front/src/locales/en/translation.json | 11 ++ front/src/locales/fr/translation.json | 19 ++- front/src/schemas/article-ui-schema.json | 167 ++++++++++++++--------- 5 files changed, 154 insertions(+), 84 deletions(-) diff --git a/front/src/components/Form.jsx b/front/src/components/Form.jsx index 43c696aa8..f8108eb45 100644 --- a/front/src/components/Form.jsx +++ b/front/src/components/Form.jsx @@ -100,8 +100,7 @@ function ArrayFieldTemplate (properties) { const inlineRemoveButton = properties.schema?.items?.type === 'string' || !removeItemTitle return ( -
-
+
{title && {(t) => {t(title)}} } @@ -120,7 +119,6 @@ function ArrayFieldTemplate (properties) { )} {properties.items && properties.items.map((element) => { - console.log({ element }) return (
-
) } @@ -156,6 +153,7 @@ function FieldTemplate (properties) { const label = properties.schema.$id ? properties.label[properties.schema.$id] : properties.label + console.log('FieldTemplate', {id, properties, children}) return (
{displayLabel &&
) } diff --git a/front/src/components/form.module.scss b/front/src/components/form.module.scss index ffe8bacc4..5ee52baf7 100644 --- a/front/src/components/form.module.scss +++ b/front/src/components/form.module.scss @@ -217,14 +217,23 @@ gap: 0.5rem; padding: 0 0 1.5rem; margin: 0; + font-size: 1em; legend { @include legend; padding: 0 0 0.5rem; - font-size: 1.25rem; + font-size: 1.15em; + } + + fieldset { + font-size: 0.8em; } } +.array { + gap: 1.5rem; +} + .comboboxReadonlyField { margin-right: .5em; } @@ -234,11 +243,13 @@ .addButton, .removeButton { - font-size: .7em; + font-size: 1em; + margin-top: .25rem; } .inlineRemoveButton { - font-size: 1em; + font-size: 1rem; + margin-top: 0; } .output { diff --git a/front/src/locales/en/translation.json b/front/src/locales/en/translation.json index 50f3e9c1b..0993866fb 100644 --- a/front/src/locales/en/translation.json +++ b/front/src/locales/en/translation.json @@ -264,8 +264,19 @@ "article.metadata.type.dossierSummary": "Issue summary", "article.metadata.type.interview": "Interview", "article.metadata.type.editorialColumn": "Editorial column", + "article.metadata.production": "Production", + "article.metadata.issue": "Issue", + "article.metadata.headerTitle": "Article", + "article.metadata.titleAndAbstract": "Title and abstract", + "article.metadata.localizedContent": "Localized content", + "article.metadata.funder": "Funder", + "article.metadata.journalDirectors": "Journal directors", + "article.metadata.production.entities": "Production entities", + "article.metadata.production.entities.addItem": "Add a production entity", "form.addItem.title": "Add", + "form.addPerson.title": "Add a person", "form.removeItem.title": "Remove", + "form.removePerson.title": "Remove this person", "corpus.metadata.form.name": "Name", "corpus.metadata.form.issue": "Issue", "corpus.metadata.form.issue.title": "Title", diff --git a/front/src/locales/fr/translation.json b/front/src/locales/fr/translation.json index 871075ff4..184a2a1ec 100644 --- a/front/src/locales/fr/translation.json +++ b/front/src/locales/fr/translation.json @@ -220,7 +220,10 @@ "article.metadata.translationOf.lang": "Langue", "article.metadata.publisher": "Éditeur·ice", "article.metadata.journal": "Revue", - "article.metadata.journalEmail": "Courriel de la revue", + "article.metadata.journal.name": "Nom de la revue", + "article.metadata.journal.email": "Courriel de la revue", + "article.metadata.journal.publisher": "Diffuseur", + "article.metadata.journal.url": "URL", "article.metadata.abstract": "Résumé", "article.metadata.abstract.addItem": "Ajouter un résumé dans une autre langue", "article.metadata.abstract.text": "Résumé", @@ -263,9 +266,23 @@ "article.metadata.type.dossierSummary": "Sommaire dossier", "article.metadata.type.interview": "Entretien", "article.metadata.type.editorialColumn": "Chronique", + "article.metadata.production": "Production", + "article.metadata.headerTitle": "Article", + "article.metadata.titleAndAbstract": "Titre et résumé", + "article.metadata.localizedContent": "Contenu traduit", + "article.metadata.funder": "Financeur", + "article.metadata.journalDirectors": "Directeur·ices de la revue", + "article.metadata.production.entities": "Responsable de la production", + "article.metadata.production.entities.addItem": "Ajouter un·e responsable", "form.addItem.title": "Ajouter", + "form.addPerson.title": "Ajouter une personne", "form.removeItem.title": "Supprimer", + "form.removePerson.title": "Supprimer cette personne", "corpus.metadata.form.name": "Nom", + "article.metadata.issue": "Numéro de revue", + "article.metadata.issue.title": "Titre", + "article.metadata.issue.number": "N°", + "article.metadata.issue.identifier": "Identifiant", "corpus.metadata.form.issue": "Numéro de revue", "corpus.metadata.form.issue.title": "Titre", "corpus.metadata.form.issue.number": "N°", diff --git a/front/src/schemas/article-ui-schema.json b/front/src/schemas/article-ui-schema.json index e53141f6e..38b15893b 100644 --- a/front/src/schemas/article-ui-schema.json +++ b/front/src/schemas/article-ui-schema.json @@ -1,7 +1,7 @@ { "ui:groups": [ { - "title": "Article", + "title": "article.metadata.headerTitle", "fields": [ "id", "publicationDate", @@ -11,7 +11,7 @@ ] }, { - "title": "Titre et résumé", + "title": "article.metadata.titleAndAbstract", "fields": [ "lang", "title", @@ -20,19 +20,19 @@ ] }, { - "title": "Mots-clés", + "title": "article.metadata.keywords", "fields": [ "keywords" ] }, { - "title": "Mots-clés contrôlés", + "title": "article.metadata.controlledKeywords", "fields": [ "controlledKeywords" ] }, { - "title": "Titre, résumé et mots-clés traduits", + "title": "article.metadata.localizedContent", "fields": [ "localizedContent" ] @@ -108,48 +108,12 @@ "ui:title": "ID", "ui:placeholder": "XXXX" }, - "surtitle": { - "ui:title": "article.metadata.surtitle" - }, - "link-citations": { - "ui:widget": "select", - "ui:emptyValue": "", - "ui:title": "article.metadata.citationsLink", - "ui:enumNames": [ - "article.metadata.citationsLink.yes", - "article.metadata.citationsLink.no" - ] - }, - "nocite": { - "ui:title": "article.metadata.bibliographyDisplay", - "ui:widget": "select", - "ui:emptyValue": "", - "ui:enumNames": [ - "article.metadata.bibliographyDisplay.all", - "article.metadata.bibliographyDisplay.onlyUsed" - ] - }, - "date": { - "ui:title": "Date", - "ui:widget": "date" - }, "lang": { "ui:title": "article.metadata.language", "ui:placeholder": "article.metadata.language.placeholder" }, - "rights": { - "ui:title": "article.metadata.license", - "ui:placeholder": "article.metadata.license.placeholder" - }, - "journal_issue": { - "ui:title": "article.metadata.journalIssue", - "ui:placeholder": "article.metadata.journalIssue.placeholder" - }, - "biography": { - "ui:widget": "textarea" - }, "authors": { - "ui:add-item-title": "article.metadata.authors.addItem", + "ui:add-item-title": "form.addPerson.title", "items": { "ui:autocomplete": "IsidoreAuthorSearch", "surname": { @@ -202,8 +166,39 @@ "publisher": { "ui:title": "article.metadata.publisher" }, + "issue.title": { + "label": "article.metadata.issue.title5", + "ui:label": "article.metadata.issue.title6", + "ui:title": "article.metadata.issue.title7" + }, + "issue": { + "title": { + "ui:title": "article.metadata.issue.title" + }, + "identifier": { + "ui:title": "article.metadata.issue.identifier" + }, + "number": { + "ui:title": "article.metadata.issue.number" + }, + "ui:title": { + "title": "article.metadata.issue" + } + }, "journal": { - "ui:title": "article.metadata.journal" + "ui:title": "article.metadata.journal", + "name": { + "ui:title": "article.metadata.journal.name" + }, + "publisher": { + "ui:title": "article.metadata.journal.publisher" + }, + "email": { + "ui:title": "article.metadata.journal.email" + }, + "url": { + "ui:title": "article.metadata.journal.url" + } }, "journal_email": { "ui:title": "article.metadata.journalEmail" @@ -225,7 +220,8 @@ "ui:title": "article.metadata.url" }, "publicationDate": { - "ui:title": "article.metadata.publicationDate" + "ui:title": "article.metadata.publicationDate", + "ui:widget": "date" }, "keywords": { "ui:add-item-title": "article.metadata.keywords.addItem", @@ -272,6 +268,7 @@ } }, "issueDirectors": { + "ui:add-item-title": "form.addPerson.title", "items": { "surname": { "ui:title": "article.metadata.people.surname" @@ -306,7 +303,7 @@ } }, "director": { - "ui:add-item-title": "article.metadata.directors.addItem", + "ui:add-item-title": "form.addPerson.title", "items": { "surname": { "ui:title": "article.metadata.people.surname" @@ -341,6 +338,7 @@ } }, "transcribers": { + "ui:add-item-title": "form.addPerson.title", "items": { "surname": { "ui:title": "article.metadata.people.surname" @@ -386,8 +384,8 @@ } } }, - "translator": { - "ui:title": "article.metadata.translators", + "translators": { + "ui:add-item-title": "form.addPerson.title", "items": { "surname": { "ui:title": "article.metadata.people.surname" @@ -426,12 +424,7 @@ "ui:widget": "textarea" }, "reviewers": { - "ui:edit-item-title": "Éditer", - "ui:item-fields": { - "forename": true, - "surname": true, - "affiliations": true - }, + "ui:add-item-title": "form.addPerson.title", "items": { "surname": { "ui:title": "article.metadata.people.surname" @@ -465,24 +458,12 @@ } } }, - "issnnum": { - "ui:title": "article.metadata.issnnum" - }, - "prod": { - "ui:title": "article.metadata.prod" - }, - "prodnum": { - "ui:title": "article.metadata.prodnum" - }, - "diffnum": { - "ui:title": "article.metadata.diffnum" - }, "funder": { "ui:title": "", - "funder_name": { + "organization": { "ui:title": "article.metadata.funder.name" }, - "funder_id": { + "id": { "ui:title": "article.metadata.funder.id" } }, @@ -504,7 +485,57 @@ }, "keywords": { "ui:title": "article.metadata.keywords", - "ui:add-item-title": "article.metadata.keywords.addItem" + "ui:add-item-title": "article.metadata.keywords.addItem", + "ui:remove-item-title": "article.metadata.keywords.removeItem", + "items": { + "ui:label": false, + "ui:className": "keywords" + } + } + } + }, + "production": { + "issn": { + "ui:title": "ISSN" + }, + "entities": { + "ui:title": "article.metadata.production.entities", + "ui:add-item-title": "article.metadata.production.entities.addItem" + } + }, + "journalDirectors": { + "ui:add-item-title": "form.addPerson.title", + "items": { + "ui:autocomplete": "IsidoreAuthorSearch", + "surname": { + "ui:title": "article.metadata.people.surname" + }, + "forename": { + "ui:title": "article.metadata.people.forename" + }, + "affiliations": { + "ui:title": "article.metadata.people.affiliations" + }, + "biography": { + "ui:title": "article.metadata.people.biography" + }, + "email": { + "ui:title": "article.metadata.people.email" + }, + "orcid": { + "ui:title": "article.metadata.people.orcid" + }, + "viaf": { + "ui:title": "article.metadata.people.viaf" + }, + "foaf": { + "ui:title": "article.metadata.people.foaf" + }, + "isni": { + "ui:title": "article.metadata.people.isni" + }, + "wikidata": { + "ui:title": "article.metadata.people.wikidata" } } }