diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 000000000..e57c4b5eb --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn pre-push diff --git a/.storybook/addons.js b/.storybook/addons.js deleted file mode 100644 index bc646c943..000000000 --- a/.storybook/addons.js +++ /dev/null @@ -1,3 +0,0 @@ -import '@storybook/addon-actions/register'; -import '@storybook/addon-links/register'; -import '@storybook/addon-knobs/register'; diff --git a/.storybook/config.js b/.storybook/config.js deleted file mode 100644 index e2c819e10..000000000 --- a/.storybook/config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { configure } from "@storybook/react"; -import "bootstrap/dist/css/bootstrap.css"; -import "app.scss"; - -const requireAll = requireContext => requireContext.keys().map(requireContext); - -const loadStories = () => - requireAll(require.context("js/components", true, /stories\.jsx?$/)); - -configure(loadStories, module); diff --git a/app/.storybook/addons.js b/app/.storybook/addons.js deleted file mode 100644 index bc646c943..000000000 --- a/app/.storybook/addons.js +++ /dev/null @@ -1,3 +0,0 @@ -import '@storybook/addon-actions/register'; -import '@storybook/addon-links/register'; -import '@storybook/addon-knobs/register'; diff --git a/app/.storybook/config.js b/app/.storybook/config.js deleted file mode 100644 index 048c564f5..000000000 --- a/app/.storybook/config.js +++ /dev/null @@ -1,9 +0,0 @@ -import { configure } from '@storybook/react'; -import 'bootstrap/dist/css/bootstrap.css'; - -const requireAll = requireContext => requireContext.keys().map(requireContext); - -const loadStories = () => - requireAll(require.context('js/applications', true, /stories\.jsx?$/)); - -configure(loadStories, module); diff --git a/app/cypress/fixtures/families.json b/app/cypress/fixtures/families.json deleted file mode 100644 index 1ed3479e1..000000000 --- a/app/cypress/fixtures/families.json +++ /dev/null @@ -1,68 +0,0 @@ -[ - { "id": "s82", "label": "Activité, production et chiffre d'affaires" }, - { "id": "s80", "label": "Agents des services publics" }, - { "id": "s8", "label": "Associations" }, - { "id": "s14", "label": "Budget de famille" }, - { "id": "s39", "label": "Cadre de vie et sécurité" }, - { "id": "s30", "label": "Comptes nationaux annuels" }, - { "id": "s32", "label": "Comptes régionaux" }, - { "id": "s31", "label": "Comptes trimestriels" }, - { "id": "s79", "label": "Conditions de vie des seniors" }, - { "id": "s25", "label": "Conjoncture" }, - { "id": "s28", "label": "Conjoncture emploi" }, - { "id": "s33", "label": "Connaissance locale de l'appareil productif" }, - { "id": "s5", "label": "Contour des groupes" }, - { "id": "s17", "label": "Création d'entreprises" }, - { "id": "s19", "label": "Données démographiques longitudinales" }, - { - "id": "s77", - "label": "Données fiscales et sociales sur les logements et les individus" - }, - { "id": "s62", "label": "Déplacements" }, - { "id": "s54", "label": "Emploi du temps" }, - { "id": "s12", "label": "Employeurs et salariés" }, - { "id": "s23", "label": "Enquête Emploi" }, - { "id": "s51", "label": "Entreprises et développement durable" }, - { "id": "s26", "label": "Estimations d'emploi" }, - { "id": "s6", "label": "Filières industrielles régionales" }, - { "id": "s3", "label": "Financement des PME" }, - { "id": "s2", "label": "Flux touristiques dans les DOM" }, - { "id": "s16", "label": "Formation des adultes" }, - { "id": "s55", "label": "Formation des adultes" }, - { "id": "s24", "label": "Fréquentation touristique" }, - { "id": "s78", "label": "Handicap santé" }, - { "id": "s83", "label": "Indices de référence des loyers" }, - { "id": "s15", "label": "Innovation" }, - { "id": "s86", "label": "Insertion professionnelle" }, - { "id": "s60", "label": "Logement" }, - { "id": "s9", "label": "Mondialisation" }, - { "id": "s34", "label": "Mouvements de main d'oeuvre" }, - { "id": "s67", "label": "Participation électorale" }, - { "id": "s64", "label": "Patrimoine" }, - { - "id": "s29", - "label": "Prix dans l'industrie, la construction et les services" - }, - { "id": "s37", "label": "Prix à la consommation" }, - { "id": "s22", "label": "Projections démographiques" }, - { "id": "s63", "label": "Qualité de vie" }, - { "id": "s21", "label": "Recensement de la population" }, - { "id": "s1", "label": "Recensement des équipements" }, - { "id": "s56", "label": "Relations familiales" }, - { "id": "s11", "label": "Ressources et conditions de vie" }, - { "id": "s65", "label": "Revenus fiscaux et sociaux" }, - { "id": "s66", "label": "Revenus localisés" }, - { "id": "s35", "label": "Répertoire d'entreprises" }, - { "id": "s53", "label": "Réseaux d'entreprises" }, - { "id": "s13", "label": "Salaires, coût du travail" }, - { "id": "s84", "label": "Santé" }, - { "id": "s85", "label": "Services pour l'industrie" }, - { "id": "s36", "label": "Statistique annuelle d'entreprises" }, - { - "id": "s10", - "label": "Technologies de l'information et de la communication" - }, - { "id": "s59", "label": "Trajectoires et origines" }, - { "id": "s58", "label": "Vie quotidienne" }, - { "id": "s18", "label": "Échantillons démographiques" } -] diff --git a/app/cypress/fixtures/metaDataAttribute.json b/app/cypress/fixtures/metaDataAttribute.json deleted file mode 100644 index cab069aa5..000000000 --- a/app/cypress/fixtures/metaDataAttribute.json +++ /dev/null @@ -1,598 +0,0 @@ -[ - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Comitologie", - "masLabelLg2": "Steering organisation", - "id": "C.11.1.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Instances de concertation", - "masLabelLg2": "Users consultation organisation", - "id": "C.12.1.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Faits marquants", - "masLabelLg2": "Highlights", - "id": "C.3.10" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Extensions régionales", - "masLabelLg2": "Regional extensions", - "id": "C.3.7.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Plan de sondage", - "masLabelLg2": "Sampling method", - "id": "I.18.10" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Taille de l'échantillon", - "masLabelLg2": "Sample size", - "id": "I.18.11" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Documents de collecte", - "masLabelLg2": "Data collection documents", - "id": "I.18.12" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Période de collecte", - "masLabelLg2": "Data collection period", - "id": "I.18.7" - }, - { - "rangeType": "CODE_LIST", - "masLabelLg1": "Mode de collecte", - "masLabelLg2": "Collection mode", - "id": "I.18.8", - "codeList": "CL_COLLECTION_MODE" - }, - { - "rangeType": "CODE_LIST", - "masLabelLg1": "Unité(s) enquêtée(s)", - "masLabelLg2": "Survey unit", - "id": "I.18.9", - "codeList": "CL_SURVEY_UNIT" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Voir aussi", - "masLabelLg2": "See Also", - "id": "I.20" - }, - { - "rangeType": "CODE_LIST", - "masLabelLg1": "Statut de l'enquête", - "masLabelLg2": "Survey status", - "id": "I.6.3", - "codeList": "CL_SURVEY_STATUS" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "n° de visa", - "masLabelLg2": "n° visa", - "id": "I.6.4" - }, - { - "rangeType": "ORGANIZATION", - "masLabelLg1": "Organisme de contact", - "masLabelLg2": "Contact organisation", - "id": "S.1.1" - }, - { - "rangeType": "ORGANIZATION", - "masLabelLg1": "Unité d'appartenance du contact dans l'organisme", - "masLabelLg2": "Contact organisation unit", - "id": "S.1.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Communiqué de presse", - "masLabelLg2": "News release", - "id": "S.10.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Publications", - "masLabelLg2": "Publications", - "id": "S.10.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Base de données en ligne", - "masLabelLg2": "On-line database", - "id": "S.10.3" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Accès aux micro-données", - "masLabelLg2": "Micro-data access", - "id": "S.10.4" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Autres", - "masLabelLg2": "Other", - "id": "S.10.5" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Documentation sur la méthodologie", - "masLabelLg2": "Documentation on methodology", - "id": "S.10.6" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Documentation sur la qualité", - "masLabelLg2": "Quality documentation", - "id": "S.10.7" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Cadre d'assurance qualité", - "masLabelLg2": "Quality assurance", - "id": "S.11.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Évaluation de la qualité", - "masLabelLg2": "Quality assessment", - "id": "S.11.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Besoins des utilisateurs", - "masLabelLg2": "User needs", - "id": "S.12.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Satisfaction des utilisateurs", - "masLabelLg2": "User satisfaction", - "id": "S.12.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Précision globale", - "masLabelLg2": "Overall accuracy", - "id": "S.13.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Erreur aléatoire", - "masLabelLg2": "Sampling error and A1. Sampling errors \u2013 indicators for U", - "id": "S.13.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Erreur non aléatoire", - "masLabelLg2": "Non-sampling error and A4. Unit non-response - rate for U and A5. Item non-response - rate for U", - "id": "S.13.3" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Erreur de couverture", - "masLabelLg2": "Coverage error", - "id": "S.13.3.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Erreur de mesure", - "masLabelLg2": "Measurement error", - "id": "S.13.3.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Erreur de non-réponse", - "masLabelLg2": "Non response error", - "id": "S.13.3.3" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Erreur de de traitement", - "masLabelLg2": "Processing error", - "id": "S.13.3.4" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Erreur dues aux hypothèses au modèle", - "masLabelLg2": "Model assumption error", - "id": "S.13.3.5" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Actualité", - "masLabelLg2": "Timeliness", - "id": "S.14.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Ponctualité", - "masLabelLg2": "Punctuality", - "id": "S.14.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Comparabilité \u2014 géographique", - "masLabelLg2": "Comparability - geographical", - "id": "S.15.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Comparabilité dans le temps", - "masLabelLg2": "Comparability - over time and CC2. Length of comparable time series for U", - "id": "S.15.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Cohérence \u2014 entre domaines", - "masLabelLg2": "Coherence - cross domain", - "id": "S.15.3" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Cohérence \u2013 Statistiques annuelles et infra-annuelles", - "masLabelLg2": "Coherence - sub annual and annual statistics", - "id": "S.15.3.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Cohérence \u2013 Comptes nationaux", - "masLabelLg2": "Coherence - National Accounts", - "id": "S.15.3.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Cohérence \u2014 interne", - "masLabelLg2": "Coherence - internal", - "id": "S.15.4" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Coûts et charge", - "masLabelLg2": "Cost and burden", - "id": "S.16" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Révision des données \u2014 politique", - "masLabelLg2": "Data revision - policy", - "id": "S.17.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Révision des données \u2014 pratiques", - "masLabelLg2": "Data revision - practice", - "id": "S.17.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Données sources", - "masLabelLg2": "Source data", - "id": "S.18.1" - }, - { - "rangeType": "CODE_LIST", - "masLabelLg1": "Fréquence de collecte des données", - "masLabelLg2": "Frequency of data collection", - "id": "S.18.2", - "codeList": "CL_FREQ" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Collecte des données", - "masLabelLg2": "Data collection", - "id": "S.18.3" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Validation des données", - "masLabelLg2": "Data validation", - "id": "S.18.4" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Élaboration des données", - "masLabelLg2": "Data compilation", - "id": "S.18.5" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Ajustement", - "masLabelLg2": "Adjustment", - "id": "S.18.6" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Correction des variations saisonnières", - "masLabelLg2": "Seasonal adjustment", - "id": "S.18.6.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Commentaire", - "masLabelLg2": "Comment", - "id": "S.19" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Description des données", - "masLabelLg2": "Data description", - "id": "S.3.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Nomenclature", - "masLabelLg2": "Classification system", - "id": "S.3.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Couverture sectorielle", - "masLabelLg2": "Sector coverage", - "id": "S.3.3" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Concepts et définitions statistiques", - "masLabelLg2": "Statistical concepts and definitions", - "id": "S.3.4" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Population statistique", - "masLabelLg2": "Statistical population", - "id": "S.3.6" - }, - { - "rangeType": "CODE_LIST", - "masLabelLg1": "Zone géographique de référence", - "masLabelLg2": "Reference area", - "id": "S.3.7", - "codeList": "CL_AREA" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Actes juridiques et autres accords", - "masLabelLg2": "Legal acts and other agreements", - "id": "S.6.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Partage des données", - "masLabelLg2": "Data sharing", - "id": "S.6.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Politique de confidentialité", - "masLabelLg2": "Confidentiality - policy", - "id": "S.7.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Confidentialité \u2014 traitement des données", - "masLabelLg2": "Confidentiality - data treatment", - "id": "S.7.2" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Calendrier de diffusion", - "masLabelLg2": "Release calendar", - "id": "S.8.1" - }, - { - "rangeType": "RICH_TEXT", - "masLabelLg1": "Accès au calendrier de diffusion", - "masLabelLg2": "Release calendar access", - "id": "S.8.2" - }, - { - "rangeType": "CODE_LIST", - "masLabelLg1": "Fréquence de diffusion", - "masLabelLg2": "Frequency of dissemination", - "id": "S.9", - "codeList": "CL_FREQ" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Contact", - "masLabelLg2": "Contact", - "id": "S.1", - "isPresentational": "true" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Nom du contact", - "masLabelLg2": "Contact name", - "id": "S.1.3" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Fonction de la personne contact", - "masLabelLg2": "Contact person function", - "id": "S.1.4" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Adresse postale du contact", - "masLabelLg2": "Contact mail address", - "id": "S.1.5" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Adresse électronique du contact", - "masLabelLg2": "Contact email address", - "id": "S.1.6" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Numéro de téléphone du contact", - "masLabelLg2": "Contact phone number", - "id": "S.1.7" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Numéro de télécopieur du contact", - "masLabelLg2": "Contact fax number", - "id": "S.1.8" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Accessibilité et clarté", - "masLabelLg2": "Acessibility and clarity", - "id": "S.10", - "isPresentational": "true" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Gestion de la qualité", - "masLabelLg2": "Quality management", - "id": "S.11", - "isPresentational": "true" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Pertinence", - "masLabelLg2": "Relevance", - "id": "S.12", - "isPresentational": "true" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Exhaustivité", - "masLabelLg2": "Completeness and R1. Data completeness \u2013 rate for U", - "id": "S.12.3" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Précision et fiabilité", - "masLabelLg2": "Accuracy and reliability", - "id": "S.13", - "isPresentational": "true" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Actualité et ponctualité", - "masLabelLg2": "Timeliness and punctuality", - "id": "S.14", - "isPresentational": "true" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Cohérence et comparabilité", - "masLabelLg2": "Coherence and comparability", - "id": "S.15", - "isPresentational": "true" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Révision des données", - "masLabelLg2": "Data revision", - "id": "S.17", - "isPresentational": "true" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Traitement statistique", - "masLabelLg2": "Statistical processing", - "id": "S.18", - "isPresentational": "true" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Mise à jour des métadonnées", - "masLabelLg2": "Metadata update", - "id": "S.2", - "isPresentational": "true" - }, - { - "rangeType": "DATE", - "masLabelLg1": "Dernières métadonnées certifiées", - "masLabelLg2": "Metadata last certified", - "id": "S.2.1" - }, - { - "rangeType": "DATE", - "masLabelLg1": "Dernières métadonnées envoyées", - "masLabelLg2": "Metadata last posted", - "id": "S.2.2" - }, - { - "rangeType": "DATE", - "masLabelLg1": "Dernière mise à jour des métadonnées", - "masLabelLg2": "Metadata last update", - "id": "S.2.3" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Présentation statistique", - "masLabelLg2": "Statistical presentation", - "id": "S.3", - "isPresentational": "true" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Unité statistique", - "masLabelLg2": "Statistical unit", - "id": "S.3.5" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Couverture temporelle", - "masLabelLg2": "Time coverage", - "id": "S.3.8" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Période de base", - "masLabelLg2": "Base period", - "id": "S.3.9" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Unité de mesure", - "masLabelLg2": "Unit of measure", - "id": "S.4" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Période de référence", - "masLabelLg2": "Reference period", - "id": "S.5" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Mandat institutionnel", - "masLabelLg2": "Institutional mandate", - "id": "S.6", - "isPresentational": "true" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Confidentialité", - "masLabelLg2": "Confidentiality", - "id": "S.7", - "isPresentational": "true" - }, - { - "rangeType": "REPORTED_ATTRIBUTE", - "masLabelLg1": "Politique de diffusion", - "masLabelLg2": "Release policy", - "id": "S.8", - "isPresentational": "true" - }, - { - "rangeType": "TEXT", - "masLabelLg1": "Accès par l\u2019utilisateur", - "masLabelLg2": "User access", - "id": "S.8.3" - } -] diff --git a/app/cypress/fixtures/operation-with-sims.json b/app/cypress/fixtures/operation-with-sims.json deleted file mode 100644 index 85022b2f9..000000000 --- a/app/cypress/fixtures/operation-with-sims.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "idSims": "1512", - "prefLabelLg1": "Enquête annuelle de production 2013", - "prefLabelLg2": "Annual production survey 2013", - "series": { - "labelLg2": "Annual production survey", - "labelLg1": "Enquête annuelle de production", - "id": "s1193" - }, - "id": "1" -} diff --git a/app/cypress/fixtures/operation-without-sims.json b/app/cypress/fixtures/operation-without-sims.json deleted file mode 100644 index 9b9262c61..000000000 --- a/app/cypress/fixtures/operation-without-sims.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "idSims": "", - "prefLabelLg1": "Enquête annuelle de production 2013", - "prefLabelLg2": "Annual production survey 2013", - "series": { - "labelLg2": "Annual production survey", - "labelLg1": "Enquête annuelle de production", - "id": "s1193" - }, - "id": "1" -} diff --git a/app/cypress/fixtures/series.json b/app/cypress/fixtures/series.json deleted file mode 100644 index 0ae37a731..000000000 --- a/app/cypress/fixtures/series.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "creator": "ONISR", - "prefLabelLg1": "Base permanente des équipements", - "prefLabelLg2": "Permanent database of facilities", - "dataCollector": [ - { - "labelLg2": "Epidemiology Centre on medical causes of Deaths", - "labelLg1": "Centre d'épidémiologie sur les causes médicales de Décès", - "id": "CépiDc", - "type": "organization" - }, - { - "labelLg2": "Statistical Studies on Tax Matters Section", - "labelLg1": "Bureau des Études statistiques en matière fiscale", - "id": "GF3C", - "type": "organization" - } - ], - "seeAlso": [ - { - "labelLg2": "Enterprise bankruptcy", - "labelLg1": "Défaillances d'entreprises", - "id": "p1631", - "type": "indicator" - }, - { - "labelLg2": "Household budget survey", - "labelLg1": "Enquête Budget de famille", - "id": "s1194", - "type": "series" - }, - { - "labelLg2": "Continuous Labour Force Survey", - "labelLg1": "Enquête emploi en continu", - "id": "s1223", - "type": "series" - }, - { - "labelLg2": "demey", - "labelLg1": "demey", - "id": "p1684", - "type": "indicator" - } - ], - "typeCode": "I", - "abstractLg1": "La base permanente des équipements (BPE) est destinée à fournir le niveau d'équipements et de services rendus par un territoire à la population.\n\nCette base permet de produire différentes données, comme la présence ou l'absence d'un équipement, la densité d'un équipement, ou un indicateur de disponibilité d'un équipement du point de vue des habitants ; toutes ces données étant rapportées à une zone géographique qui peut être infra-communale (Iris).\n\nLa localisation fine des équipements et de la population permet de calculer des distances entre communes équipées et non équipées par exemple, d'étudier la concentration spatiale des équipements, de mettre en rapport les équipements et leurs utilisateurs potentiels.", - "typeList": "CL_SOURCE_CATEGORY", - "abstractLg2": "The purpose of the permanent database of facilities (BPE) is to provide information on the level of facilities and services a territory provides for its population.\n\nVarious types of data can be produced from this database, such as the presence or absence of a facility, the density of a facility, or an availability indicator of a facility from the point of view of the inhabitants; all these data can be provided for a geographical area that may be at infra-municipality level (statistical block groups).\n\nBy providing detailed information about the location of facilities and population, distances can be calculated between areas municipalities that do or do not provide certain facilities, for example, the spatial concentration of facilities can be studied, and facilities and their potential users can be brought together.", - "historyNoteLg2": "The first BPE covered data for 2007.\nThe permanent database of facilities (BPE) partly replaces the municipality inventory, last carried out in 1998. Although they are similar, the information in the BPE is updated every year and lists a much wider range of facilities (186 instead of 36) with the location of these facilities given much more precisely and the precise geographical coordinates are provided for some of them.", - "historyNoteLg1": "La première BPE porte sur les données de l'année 2007. \nLa base permanente des équipements (BPE) se substitue en partie à l'inventaire communal, dont le dernier a été réalisé en 1998. Comparables sur le volet présence/absence des équipements, les données de la BPE sont actualisées chaque année, au lieu de tous les 7-8 ans pour l'inventaire communal. De plus, la BPE répertorie une plus grande variété d'équipements (186 au lieu de 36) ; leur localisation est également plus affinée (IRIS) et les coordonnées géographiques précises sont fournies pour certains d'entre eux.", - "id": "s1161", - "family": { - "labelLg2": "Facilities census", - "labelLg1": "Recensement des équipements", - "id": "s1" - }, - "proprietaires": ["GF3C"], - "generate": [ - { - "labelLg2": "alice 2", - "labelLg1": "ALICE", - "id": "p1671", - "type": "indicator" - } - ] -} diff --git a/app/cypress/fixtures/sims.json b/app/cypress/fixtures/sims.json deleted file mode 100644 index 5deba54ba..000000000 --- a/app/cypress/fixtures/sims.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "rubrics": [ - { - "rangeType": "DATE", - "idAttribute": "S.2.1", - "value": "2019-01-02T11:00:00.000Z" - }, - { - "rangeType": "DATE", - "idAttribute": "S.2.2", - "value": "2019-01-01T11:00:00.000Z" - }, - { - "rangeType": "RICH_TEXT", - "idAttribute": "S.3.1", - "documents": [ - { - "uri": "uri1-bis", - "url": "http://google.fr?q=url-1", - "updatedDate": "01/01/2019", - "labelLg1": "labelLg1-0", - "labelLg2": "labelLg2-0", - "lang": "fr", - "descriptionLg1": "descriptionLg1", - "descriptionLg2": "descriptionLg2" - }, - { - "uri": "uri2-bis", - "url": "http://google.fr?q=url-2", - "updatedDate": "01/02/2019", - "labelLg1": "labelLg1-1", - "labelLg2": "labelLg2-1", - "descriptionLg1": "descriptionLg1-2", - "descriptionLg2": "descriptionLg2-2" - }, - { - "uri": "uri3-bis", - "url": "http://google.fr?q=url-2", - "labelLg1": "labelLg1-2", - "labelLg2": "labelLg2-2", - "lang": "fr", - "descriptionLg1": "descriptionLg1-2", - "descriptionLg2": "descriptionLg2-2" - } - ] - }, - { - "rangeType": "RICH_TEXT", - "idAttribute": "S.3.2" - } - ], - "labelLg2": "Annual production survey 2012 SIMS", - "labelLg1": "SIMS de l'opération Enquête annuelle de production 2012", - "idOperation": "1", - "id": "1512" -} diff --git a/app/cypress/fixtures/stamps.json b/app/cypress/fixtures/stamps.json deleted file mode 100644 index 9e67119b4..000000000 --- a/app/cypress/fixtures/stamps.json +++ /dev/null @@ -1 +0,0 @@ -["DG33-C990", "DG57-C003"] diff --git a/app/cypress/integration/home.spec.js b/app/cypress/integration/home.spec.js deleted file mode 100644 index 5b5d138d4..000000000 --- a/app/cypress/integration/home.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -describe('Home Page', function() { - it(`Should go to the Concepts page and come back`, function() { - cy.server().visit(`/`); - - cy.get('div.concepts a').click(); - - cy.url().should('match', /\/concepts$/); - cy.get('title').contains('Bauhaus - Concepts'); - cy.go('back'); - cy.get('h1').contains( - 'Application de gestion des métadonnées de référence' - ); - }); - - it(`Should go to the Nomenclatures page and come back`, function() { - cy.server().visit(`/`); - cy.get('div.classifications a').click(); - cy.url().should('match', /\/classifications$/); - cy.get('title').contains('Bauhaus - Nomenclatures'); - cy.go('back'); - cy.get('h1').contains( - 'Application de gestion des métadonnées de référence' - ); - }); - it(`Should go to the Operations page and come back`, function() { - cy.server().visit(`/`); - cy.get('div.operations a').click(); - cy.url().should('match', /\/operations\/series$/); - cy.get('title').contains('Bauhaus - Opérations'); - cy.go('back'); - cy.get('h1').contains( - 'Application de gestion des métadonnées de référence' - ); - }); - it(`Should contain a footer`, function() { - cy.server().visit(`/`); - cy.get('footer').should('exist'); - }); -}); diff --git a/app/cypress/plugins/index.js b/app/cypress/plugins/index.js deleted file mode 100644 index eee8366dd..000000000 --- a/app/cypress/plugins/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -module.exports = (on, config) => { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -}; diff --git a/app/cypress/support/commands.js b/app/cypress/support/commands.js deleted file mode 100644 index c1f5a772e..000000000 --- a/app/cypress/support/commands.js +++ /dev/null @@ -1,25 +0,0 @@ -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add("login", (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This is will overwrite an existing command -- -// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/app/cypress/support/index.js b/app/cypress/support/index.js deleted file mode 100644 index cb24d127a..000000000 --- a/app/cypress/support/index.js +++ /dev/null @@ -1,22 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands') - -import 'cypress-axe'; diff --git a/app/package.json b/app/package.json index 1778fa05e..0f5661644 100755 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "Bauhaus", - "version": "3.0.13", + "version": "3.0.15", "description": "Web application for the management of concepts, classifications and other statistical objects", "repository": { "type": "git", @@ -12,16 +12,11 @@ "build": "cross-env REACT_APP_VERSION=$npm_package_version REACT_APP_NAME=$npm_package_name react-scripts build", "build-insee": "cross-env REACT_APP_VERSION=$npm_package_version REACT_APP_NAME=$npm_package_name REACT_APP_INSEE=true react-scripts build && npm run create-zip", "create-zip": "cd build && bestzip build.zip *", - "cypress:open": "cypress open", - "cypress:run": "cypress run", - "e2e": "start-server-and-test start http://localhost:3000 cypress:run", "eject": "react-scripts eject", "lint": "eslint src", "start": "cross-env REACT_APP_NAME=$npm_package_name REACT_APP_VERSION=$npm_package_version react-scripts start", "start-https": "cross-env HTTPS=true REACT_APP_VERSION=$npm_package_version REACT_APP_NAME=$npm_package_name react-scripts start", "test": "react-scripts test", - "build-storybook": "cross-env NODE_PATH=src/ build-storybook -o built-storybook/storybook", - "start-storybook": "cross-env NODE_PATH=src/ start-storybook -p 9999", "test:coverage": "cross-env CI=true react-scripts test --coverage --collectCoverageFrom=src/**/*.js --collectCoverageFrom=!src/**/*.spec.js --collectCoverageFrom=!src/**/*.stories.js --collectCoverageFrom=!src/types/*.js" }, "dependencies": { @@ -33,7 +28,6 @@ "create-react-class": "^15.6.3", "dompurify": "2.2.9", "file-saver": "1.3.3", - "jwt-decode": "2.2.0", "keycloak": "1.2.0", "lodash.deburr": "4.1.0", "lodash.difference": "4.5.0", @@ -42,25 +36,21 @@ "react-d3-tree": "1.10.3", "react-draft-wysiwyg": "1.14.6", "react-dropzone": "11.0.1", - "react-modal": "3.11.2", + "react-modal": "^3.14.4", "react-router-hash-link": "1.2.0", - "react-scripts": "3.4.1", + "react-scripts": "4.0.3", "react-select": "1.1.0", "react-sortable-tree": "2.1.0", "redux-logger": "3.0.6", - "redux-thunk": "2.3.0" + "redux-thunk": "^2.4.1" }, "devDependencies": { - "axe-core": "3.5.5", "bestzip": "^2.1.2", "coveralls": "3.1.0", "cross-env": "7.0.2", - "cypress": "4.11.0", - "cypress-axe": "0.8.1", "lcov-result-merger": "^3.1.0", - "node-sass": "4.14.1", + "node-sass": "^7.0.1", "redux-mock-store": "^1.5.4", - "start-server-and-test": "1.11.0", "term-size": "^1.2.0" }, "browserslist": [ diff --git a/app/src/js/app.js b/app/src/js/app.js index 0d1c37256..267557399 100755 --- a/app/src/js/app.js +++ b/app/src/js/app.js @@ -22,7 +22,7 @@ function App() {

{D[app + 'Title']}

- {app} + {app} ); diff --git a/app/src/js/applications/classifications/families/visualization/members.js b/app/src/js/applications/classifications/families/visualization/members.js index dad9a423f..281b0fcaa 100644 --- a/app/src/js/applications/classifications/families/visualization/members.js +++ b/app/src/js/applications/classifications/families/visualization/members.js @@ -1,6 +1,6 @@ import React from 'react'; import { Link } from 'react-router-dom'; -import { Panel } from '@inseefr/wilco'; +import { Note } from '@inseefr/wilco'; import { D1, D2 } from 'js/i18n'; export default ({ members, secondLang }) => { @@ -21,17 +21,9 @@ export default ({ members, secondLang }) => { const isMembersLg2 = membersLg2.filter(m => m !== null).length !== 0; return (
-
- -
    {membersLg1}
-
-
+ {membersLg1}} alone={!secondLang}/> {secondLang && isMembersLg2 && ( -
- -
    {membersLg2}
-
-
+ {membersLg2}} alone={false} /> )}
); diff --git a/app/src/js/applications/classifications/series/visualization/general.js b/app/src/js/applications/classifications/series/visualization/general.js index 397d5dd67..2e7c51bb0 100644 --- a/app/src/js/applications/classifications/series/visualization/general.js +++ b/app/src/js/applications/classifications/series/visualization/general.js @@ -1,7 +1,7 @@ import React from 'react'; import { Link } from 'react-router-dom'; import D from 'js/i18n'; -import { Panel } from '@inseefr/wilco'; +import { Note } from '@inseefr/wilco'; export default ({ general, secondLang, langs }) => { const { lg1, lg2 } = langs; @@ -43,60 +43,60 @@ export default ({ general, secondLang, langs }) => { }; } - return ( -
-
- -
    - {Object.keys(mapping).map(fieldName => { - if (general.hasOwnProperty(fieldName)) { - if (fieldName === 'familyLg1') { - return ( -
  • - {mapping[fieldName]} :{' '} - - {general[fieldName]} - - {secondLang && general.familyLg2 && ( - + const lis = Object.keys(mapping).map(fieldName => { + if (general.hasOwnProperty(fieldName)) { + if (fieldName === 'familyLg1') { + return ( +
  • + {mapping[fieldName]} :{' '} + + {general[fieldName]} + + {secondLang && general.familyLg2 && ( + {' ('} - + {general.familyLg2} - {')'} + {')'} - )} -
  • - ); - } - if (fieldName === 'altLabelLg2' && !secondLang) { - return null; - } - if (fieldName === 'altLabelLg2' && !secondLang) { - return null; - } - if (fieldName.includes('altLabel')) { - return ( -
  • - {`${mapping[fieldName]} : ${general[fieldName] - .split(' || ') - .join(' - ')}`} -
  • - ); - } else { - return ( -
  • {`${mapping[fieldName]} : ${general[fieldName]}`}
  • - ); - } - } else return null; - })} + )} + + ); + } + if (fieldName === 'altLabelLg2' && !secondLang) { + return null; + } + if (fieldName === 'altLabelLg2' && !secondLang) { + return null; + } + if (fieldName.includes('altLabel')) { + return ( +
  • + {`${mapping[fieldName]} : ${general[fieldName] + .split(' || ') + .join(' - ')}`} +
  • + ); + } else { + return ( +
  • {`${mapping[fieldName]} : ${general[fieldName]}`}
  • + ); + } + } else return null; + }) + return ( +
    + + {lis}
-
-
+ }> +
); }; diff --git a/app/src/js/applications/collections/edition-creation/members.js b/app/src/js/applications/collections/edition-creation/members.js index 43fe383db..819b0b35e 100644 --- a/app/src/js/applications/collections/edition-creation/members.js +++ b/app/src/js/applications/collections/edition-creation/members.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import { Panel, Pagination, - LogoAdd, - LogoDel, + AddLogo, + DelLogo, PickerItem, filterDeburr, arrayDifferenceByID, @@ -109,7 +109,7 @@ class CollectionMembersEdition extends Component { key={id} id={id} label={label} - logo={LogoAdd} + logo={AddLogo} handleClick={this.addConcept} /> )); @@ -119,7 +119,7 @@ class CollectionMembersEdition extends Component { key={id} id={id} label={label} - logo={LogoDel} + logo={DelLogo} handleClick={this.removeConcept} /> )); diff --git a/app/src/js/applications/concepts/edition-creation/home.js b/app/src/js/applications/concepts/edition-creation/home.js index 0c91870a9..904e691d7 100644 --- a/app/src/js/applications/concepts/edition-creation/home.js +++ b/app/src/js/applications/concepts/edition-creation/home.js @@ -16,7 +16,7 @@ import { propTypes as conceptsWithLinksPropTypes } from 'js/utils/concepts/links import D from 'js/i18n'; import isVersioningPossible from 'js/utils/concepts/is-versioning-possible'; import { VERSIONING, NO_VERSIONING } from 'js/constants'; -import { withRouter } from 'react-router'; +import { withRouter } from 'react-router-dom'; import { withTitle } from 'bauhaus-utilities'; class ConceptEditionCreation extends Component { diff --git a/app/src/js/applications/concepts/edition-creation/links/index.js b/app/src/js/applications/concepts/edition-creation/links/index.js index fedc83950..af4c8aacf 100644 --- a/app/src/js/applications/concepts/edition-creation/links/index.js +++ b/app/src/js/applications/concepts/edition-creation/links/index.js @@ -5,7 +5,7 @@ import { D1 } from 'js/i18n'; import ConceptToLink from './concept-to-link'; import SearchConceptsByLabel from './search-concepts-by-label'; import { propTypes as conceptsWithLinksPropTypes } from 'js/utils/concepts/links'; -import { LogoAdd, LogoDel, PickerItem, filterDeburr } from '@inseefr/wilco'; +import { AddLogo, DelLogo, PickerItem, filterDeburr } from '@inseefr/wilco'; import { BROADER, @@ -134,7 +134,7 @@ class LinksEdition extends Component { key={id} id={id} label={label} - logo={LogoDel} + logo={DelLogo} handleClick={removeMember} /> )); @@ -143,7 +143,7 @@ class LinksEdition extends Component { key={id} id={id} label={label} - logo={LogoAdd} + logo={AddLogo} handleClick={addMember} /> )); diff --git a/app/src/js/applications/concepts/validation/home-container.js b/app/src/js/applications/concepts/validation/home-container.js index 37893fa1f..ead9e7ba0 100644 --- a/app/src/js/applications/concepts/validation/home-container.js +++ b/app/src/js/applications/concepts/validation/home-container.js @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; -import { Redirect } from 'react-router'; +import { Redirect } from 'react-router-dom'; import ConceptsToValidate from './home'; import { Loading } from '@inseefr/wilco'; import { OK, PENDING } from 'js/constants'; diff --git a/app/src/js/applications/concepts/visualization/home-container.js b/app/src/js/applications/concepts/visualization/home-container.js index 60106f6f2..e90059833 100644 --- a/app/src/js/applications/concepts/visualization/home-container.js +++ b/app/src/js/applications/concepts/visualization/home-container.js @@ -6,7 +6,7 @@ import check from 'js/utils/auth'; import { Loading } from '@inseefr/wilco'; import ConceptVisualization from './home'; import ConceptVisualizationStandBy from './stand-by'; -import { ArrayUtils, Auth, HTMLUtils, Stores } from 'bauhaus-utilities'; +import { Auth, HTMLUtils, Stores } from 'bauhaus-utilities'; import api from '../../../remote-api/concepts-api'; import { emptyNotes } from '../../../utils/concepts/notes'; @@ -35,13 +35,12 @@ const ConceptVisualizationContainer = () => { const [deleting, setDeleting] = useState(false); const [concept, setConcept] = useState({}); - const [allNotes, setAllNotes] = useState({}); const [error, setError] = useState(); const fetchConcept = (id) => { - api.getConceptGeneral(id).then(general => { + return api.getConceptGeneral(id).then(general => { const { conceptVersion } = general; - const concept$ = Promise.all([ + return Promise.all([ api.getNoteVersionList(id, conceptVersion), api.getConceptLinkList(id) ]).then(([notes, links]) => { @@ -51,22 +50,7 @@ const ConceptVisualizationContainer = () => { links, }) }) - - const notes$ = Promise.all( - ArrayUtils.range(1, +conceptVersion + 1).map(version => { - return api.getNoteVersionList(id, version).then((notes) => ([ version, formatNotes(notes) ])) - }) - ).then(versionsAndNotes => { - setAllNotes(versionsAndNotes.reduce((acc, versionAndNotes) => { - return { - ...acc, - [versionAndNotes[0]]: versionAndNotes[1] - } - }, {})) - }) - - Promise.all([concept$, notes$]).finally(() => setLoading(false)); - }) + }).finally(() => setLoading(false)); } useEffect(() => { fetchConcept(id) @@ -118,18 +102,6 @@ const ConceptVisualizationContainer = () => { ) return ; - if ( - conceptVersion !== '1' && - isValidated === 'false' && - !adminOrContributorOrConceptCreator - ) { - general.isValidated = 'true'; - general.conceptVersion = (general.conceptVersion - 1).toString(); - notes = allNotes[general.conceptVersion]; - } - - - return ( { - this.handleCancelValidation(); + handleCancelValidation(); validateConcept(id); - }, [id, validateConcept]); + }, [id, validateConcept, handleCancelValidation]); const handleClickDeletion = useCallback(() => { deleteConcept(id); }, [id, deleteConcept]); diff --git a/app/src/js/applications/operations/document/home.spec.js b/app/src/js/applications/operations/document/home.spec.js index a400c1341..243936377 100644 --- a/app/src/js/applications/operations/document/home.spec.js +++ b/app/src/js/applications/operations/document/home.spec.js @@ -1,5 +1,5 @@ import React from 'react'; -import { render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import DocumentHome from './home'; import { MemoryRouter } from 'react-router-dom'; import { Provider } from 'react-redux'; @@ -34,10 +34,10 @@ describe('DocumentHome', () => { expect(container.querySelectorAll('ul')).toHaveLength(1); }); - [ADMIN, INDICATOR_CONTRIBUTOR, SERIES_CONTRIBUTOR].forEach(right => { - it('should display two Add buttons if the user is an ' + right, () => { + for(let right of [ADMIN, INDICATOR_CONTRIBUTOR, SERIES_CONTRIBUTOR]){ + it('should display two Add buttons if the user is an ' + right, async () => { const store = mockStore({ users: { results: {stamp: 'stamp'}}, app: { auth: { user: { roles: [right] } } } }); - const { getByText } = render( + render( , @@ -45,14 +45,14 @@ describe('DocumentHome', () => { wrapper: MemoryRouter, } ); - expect(getByText("New Document")).toBeDefined(); - expect(getByText("New Link")).toBeDefined(); + await screen.findByText("New Document") + await screen.findByText("New Link") }) - }) + } it('should not display any Add button if the user is an the right role,', () => { const store = mockStore({ users: { results: {stamp: 'stamp'}}, app: { auth: { user: { roles: ["other"] } } } }); - const { queryByText } = render( + render( , @@ -60,7 +60,9 @@ describe('DocumentHome', () => { wrapper: MemoryRouter, } ); - expect(queryByText("New Document")).toBeNull(); - expect(queryByText("New Link")).toBeNull(); + // eslint-disable-next-line jest-dom/prefer-in-document + expect(screen.queryByText("New Document")).toBeNull(); + // eslint-disable-next-line jest-dom/prefer-in-document + expect(screen.queryByText("New Link")).toBeNull(); }) }); diff --git a/app/src/js/applications/operations/indicators/edition/edition.js b/app/src/js/applications/operations/indicators/edition/edition.js index fa1ea29df..e495c5e93 100644 --- a/app/src/js/applications/operations/indicators/edition/edition.js +++ b/app/src/js/applications/operations/indicators/edition/edition.js @@ -4,13 +4,12 @@ import PropTypes from 'prop-types'; import { EditorMarkdown, ItemToSelectModel, - PageTitleBlock, withTitle, + PageTitleBlock, withTitle, SelectRmes } from 'bauhaus-utilities'; import { PublishersInput, CreatorsInput } from 'bauhaus-operations'; import { CL_FREQ } from 'js/actions/constants/codeList'; import InputRmes from 'js/applications/shared/input-rmes'; import Control from 'js/applications/operations/indicators/edition/control'; -import SelectRmes from 'js/applications/shared/select-rmes'; import { validate } from 'js/applications/operations/indicators/edition/validation'; import { Loading, goBackOrReplace } from '@inseefr/wilco'; import api from '../../../../remote-api/operations-api'; diff --git a/app/src/js/applications/operations/indicators/index.js b/app/src/js/applications/operations/indicators/index.js index 2005c65aa..b5e1fa060 100644 --- a/app/src/js/applications/operations/indicators/index.js +++ b/app/src/js/applications/operations/indicators/index.js @@ -37,7 +37,6 @@ function IndicatorsHome() { childPath="operations/indicator" label="label" advancedSearch={false} - searchUrl="/operations/indicators/search" autoFocus={true} /> diff --git a/app/src/js/applications/operations/indicators/search.js b/app/src/js/applications/operations/indicators/search.js deleted file mode 100644 index bb639d804..000000000 --- a/app/src/js/applications/operations/indicators/search.js +++ /dev/null @@ -1,159 +0,0 @@ -import D from 'js/i18n'; -import { Link, Redirect } from 'react-router-dom'; -import React, { Component } from 'react'; -import { Loading, Select } from '@inseefr/wilco'; -import api from 'js/remote-api/operations-api'; -import { connect } from 'react-redux'; -import { - ArrayUtils, - AbstractAdvancedSearchComponent, - AdvancedSearchList, - ItemToSelectModel, - Stores, -} from 'bauhaus-utilities'; - -const filterLabel = ArrayUtils.filterKeyDeburr(['prefLabelLg1']); - -const fields = ['prefLabelLg1', 'creator', 'publisher']; -const sortByLabel = ArrayUtils.sortArray('prefLabelLg1'); - -export class SearchFormList extends AbstractAdvancedSearchComponent { - static defaultState = { - prefLabelLg1: '', - creator: '', - publisher: '', - }; - - constructor(props) { - super(props, SearchFormList.defaultState); - } - - handlers = this.handleChange(fields, (newState) => { - const { prefLabelLg1, creator, publisher } = newState; - return this.props.data - - .filter(filterLabel(prefLabelLg1)) - .filter((series) => { - const creators = series.creators || []; - const formattedCreators = Array.isArray(creators) - ? creators - : [creators]; - return !creator || formattedCreators.includes(creator); - }) - .filter((series) => { - const publishers = series.publishers || []; - const formattedPublishers = Array.isArray(publishers) - ? publishers - : [publishers]; - return !publisher || formattedPublishers.map(({id}) => id).includes(publisher); - }); - }); - - render() { - const { data, prefLabelLg1, creator, publisher } = this.state; - const { organisations, stamps } = this.props; - - const organisationsOptions = ItemToSelectModel.toSelectModel(organisations); - const stampsOptions = stamps.map((stamp) => ({ - value: stamp, - label: stamp, - })); - const dataLinks = data.map(({ id, prefLabelLg1 }) => ( -
  • - {prefLabelLg1} -
  • - )); - return ( - } - > -
    -
    - -
    -
    -
    -
    - -
    -
    -
    - ); - } -} -class SearchListContainer extends Component { - constructor(props) { - super(props); - this.state = {}; - } - componentDidMount() { - api.getIndicatorsSearchList().then((data) => { - this.setState({ data: sortByLabel(data) }); - }); - } - - render() { - const { data } = this.state; - const { organisations, stamps } = this.props; - - if (!data) return ; - return ( - - ); - } -} - -const mapStateToProps = (state) => { - return { - organisations: state.operationsOrganisations.results, - stamps: Stores.Stamps.getStampList(state) || [], - }; -}; - -export default connect(mapStateToProps)(SearchListContainer); diff --git a/app/src/js/applications/operations/indicators/search.spec.js b/app/src/js/applications/operations/indicators/search.spec.js deleted file mode 100644 index d61cded06..000000000 --- a/app/src/js/applications/operations/indicators/search.spec.js +++ /dev/null @@ -1,376 +0,0 @@ -import { SearchFormList } from './search'; -import React from 'react'; -import { render, fireEvent } from '@testing-library/react'; -import { MemoryRouter } from 'react-router'; -const data = [ - { - idSims: '1788', - abstractLg1: - "

    Les indices de production dans les services (IPS) en volume permettent de mesurer mensuellement l'évolution de la production en volume des entreprises relevant des secteurs concernés.

    Du fait du poids croissant des services en France mais également dans l’ensemble des pays européens, l'Insee élabore depuis 2017 un indice de production dans les services. Comme l’indice de la production dans l'industrie (IPI), cet indice est calculé mensuellement. Il est publié 60 jours après la fin du mois, comme les indices de chiffres d’affaires en valeur dont il est issu.

    Les indices de production dans les services relèvent du règlement européen sur les statistiques de court-terme (règlement CE dit \" STS \" n°1165/98 du conseil du 19 mai 1998, modifié par ses amendements ultérieurs).

    ", - prefLabelLg1: 'Indice de production dans les services base 2010', - abstractLg2: - '

    The services production indexes in volume make it possible to measure monthly theevolution of the production in volume of the companies in the sectors concerned.

    Due to the increasing weight of services in France but also in all European countries, INSEE has been developing an index of production in services since 2017. Like the Industrial production index (IPI), this index is calculated monthly. It is published 60 days after the end of the month, as the turnover indexes in value from which it is derived.

    Production indices in services are covered by the European regulation on short-term statistics (Council Regulation (EC) No 1165/98 of 19 May 1998, as amended by its subsequent amendments).

    ', - prefLabelLg2: 'Services Production index base 2010', - historyNoteLg2: - '

    In order to limit the statistical burden on businesses, and because information is collected on a regular basis by DGFiP, INSEE uses the value added tax (VAT) tax returns of companies to build monthly indices of turnover.

    The tax authority provides INSEE with VAT returns every month.

    Until 2015, turnover indices were calculated from a sample of companies reporting VAT on a monthly basis.

    This sample, of some 160,000 companies, was renewed each year. It included an exhaustive stratum (the largest companies in each sector) and was drawn proportionally to turnover on the rest of the field.

    Since 2016, all monthly returns are used to calculate the indices.

    Beginning in 2017, INSEE calculates an index of production in services by deflating turnover indices in value: it traces the evolution of production in services.

    ', - creators: ['DG57-C060', 'DG57-C601', 'DG57-C701'], - historyNoteLg1: - "

    Dans le souci de limiter la charge statistique pesant sur les entreprises, et parce que l'information est collectée de manière régulière par la DGFiP, l'Insee utilise les déclarations de taxe sur la valeur ajoutée (TVA) des entreprises pour bâtir un ensemble d'indices mensuels d'évolution des chiffres d'affaires.

    La DGFiP transmet mensuellement à l'Insee les déclarations TVA des entreprises.

    Jusqu'en 2015, les indices de chiffre d'affaires étaient calculés à partir d'un échantillon d'entreprises déclarant la TVA mensuellement.

    Cet échantillon, de quelque 160 000 entreprises, était renouvelé chaque année. Il comprenait une strate exhaustive (les plus grandes entreprises de chaque secteur) et était tiré proportionnellement au chiffre d'affaires sur le reste du champ.

    Depuis 2016, toutes les déclarations mensuelles sont exploitées pour le calcul des indices.

    À partir de 2017 l'Insee calcule un indice de production dans les services par déflation des indices de chiffres d'affaires en valeur : il retrace l’évolution de la production dans les services.

    ", - publishers: [{ id: 'DG75-L002' }], - id: 'p1647', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1888', - abstractLg1: - "

    Du fait du poids croissant des services en France et dans l’ensemble des pays européens, l'Insee élabore depuis 2017 des indices de production dans les services (IPS). Ils permettent de mesurer mensuellement, et de façon précoce, l’évolution de la production des entreprises relevant de ces secteurs. Ils représentent à ce titre une information essentielle pour le suivi du cycle conjoncturel. Ces indices relèvent également du règlement européen sur les statistiques de court-terme (règlement CE dit « STS » n°1165/98 du conseil du 19 mai 1998, modifié par ses amendements ultérieurs).

    ", - prefLabelLg1: 'Indice de production dans les services base 2015', - abstractLg2: - '

    Due to the increasing weight of services in France but also in all European countries, INSEE has been developing an index of production in services since 2017. The services production indices are used to measure the monthly change in the services production of the companies in the sectors concerned. As such, they are a primary information to monitor the business cycle in France. Production indices in services fall under the European regulation on short-terms statistics – the Council Regulation ‘’STS’’ No 1165/98 of 19 May 1998, modified by subsequent amendments.

    ', - prefLabelLg2: 'Services Production index base 2015', - creators: [], - publishers: [], - id: 'p1671', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1774', - abstractLg1: - "

    Les indices de volume des ventes dans le commerce de détail et les services personnels constituent un indicateur mensuel d'évolution de l'activité des entreprises relevant des secteurs concernés.

    Des indices de chiffre d'affaires (ICA) en valeur sont également publiés pour les mêmes secteurs ; ils sont représentatifs de l'évolution des ventes en valeur.

    Les indices de volume des ventes et de chiffre d'affaires dans le commerce de détail et les services personnels répondent à un impératif national et européen.

    Ils relèvent du règlement européen sur les statistiques de court-terme (règlement CE dit \" STS \" n°1165/98 du conseil du 19 mai 1998, modifié par ses amendements ultérieurs).

    ", - prefLabelLg1: - "Indice de chiffre d'affaires dans le commerce de détail et les services personnels", - abstractLg2: - '

    Sales indices in retail trade and personal services make it possible to measure the monthly developments in the volumes of sales in the sectors concerned. Turnover indices in value in the same sectors are also available.

    Sales indices and turnover indices in retail trade and personal services focus on a national and European need. They relate to the European regulations on short-term statistics ("STS" EC regulation n° 1165/98 of the Council of 19 May 1998, updated by subsequent amendments).

    ', - prefLabelLg2: 'Sales index in retail trade and personal services', - historyNoteLg2: - "

    In order to reduce the statistical burden on businesses and because the data has been collected on a regular basis, Insee obtained the ability to use businesses' value-added tax (VAT) declarations in order to calculate a set of monthly indices showing the developments of turnover.

    The Tax General Directorate transmits to the Insee the declarations of VAT. Until 2015, the index of turnover were calculated from a sample of companies declaring the VAT monthly, selected by INSEE.

    This sample of almost 160 000 companies was renewed on an annual basis. It includes an exhaustive section (the largest businesses in each sector) and is selected in proportion of the turnover over the rest of the field.

    From 2016, all the monthly declarations are exploited for the calculation of the indices.

    ", - creators: [], - historyNoteLg1: - "

    Dans le souci de limiter la charge statistique pesant sur les entreprises, et parce que l'information était collectée de manière régulière, l'Insee a obtenu de pouvoir utiliser les déclarations de taxe sur la valeur ajoutée (TVA) des entreprises pour bâtir un ensemble d'indices mensuels d'évolution des chiffres d'affaires.

    La DGFiP transmet donc à l'Insee les déclarations TVA des entreprises. Jusqu'en 2015, les indices de chiffre d'affaires étaient calculés à partir d'un échantillon d'entreprises déclarant la TVA mensuellement sélectionnées par l'Insee.

    Cet échantillon, de quelque 160 000 entreprises, était renouvelé chaque année. Il comprenait une strate exhaustive (les plus grandes entreprises de chaque secteur) et était tiré proportionnellement au chiffre d'affaires sur le reste du champ.

    À partir de 2016, toutes les déclarations mensuelles sont exploitées pour le calcul des indices.

    ", - publishers: [], - id: 'p1633', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1776', - abstractLg1: - "

    Les indices de chiffres d'affaires (ICA) dans le commerce de gros et divers services aux entreprises permettent de mesurer mensuellement l'évolution des ventes en valeur des entreprises relevant des secteurs concernés.

    Les statistiques des indices de chiffre d'affaires dans le commerce de gros et divers services aux entreprises répondent à un impératif national et européen.

    Ils relèvent du règlement européen sur les statistiques de court-terme (règlement CE dit \" STS \" n°1165/98 du conseil du 19 mai 1998, modifié par ses amendements ultérieurs).

    ", - prefLabelLg1: - "Indice de chiffre d'affaires dans le commerce de gros et divers services aux entreprises", - abstractLg2: - '

    Turnover indices in wholesale trade and business services are used to measure in value the developments of sales on a monthly basis in the sectors concerned.

    Turnover indices of wholesale trade and business services focus on a national and European need. They are subject to the European regulation on short-term statistics (EC "STS" regulation n°1165/98 of the Council of May 19, 1998, updated by subsequent amendments).

    ', - prefLabelLg2: 'Turnover index in the wholesale trade and business services', - historyNoteLg2: - "

    In order to reduce the statistical burden on businesses and because the data has been collected on a regular basis, INSEE obtained the ability to use businesses' value-added tax (VAT) declarations in order to calculate a set of monthly indices showing the evolution of turnover.

    The Tax General Directorate transmits to the Insee the declarations of VAT. Until 2015, the index of turnover were calculated from a sample of companies declaring the VAT monthly, selected by INSEE.

    This sample of almost 160 000 companies was renewed on an annual basis. It includes an exhaustive section (the largest businesses in each sector) and is selected in proportion of the turnover over the rest of the field.

    From 2016, all the monthly declarations are exploited for the calculation of the indices.

    ", - creators: [], - historyNoteLg1: - "

    À compter du 1er avril 2017, la méthodologie change : voir Indice de chiffre d'affaires dans le commerce et Volume des ventes dans le commerce

    Dans le souci de limiter la charge statistique pesant sur les entreprises, et parce que l'information était collectée de manière régulière, l'Insee a obtenu de pouvoir utiliser les déclarations de taxe sur la valeur ajoutée (TVA) des entreprises pour bâtir un ensemble d'indices mensuels d'évolution des chiffres d'affaires.

    La DGFiP transmet donc à l'Insee les déclarations TVA des entreprises. Jusqu'en 2015, les indices de chiffre d'affaires étaient calculés à partir d'un échantillon d'entreprises déclarant la TVA mensuellement sélectionnées par l'Insee.

    Cet échantillon, de quelque 160 000 entreprises, était renouvelé chaque année. Il comprenait une strate exhaustive (les plus grandes entreprises de chaque secteur) et était tiré proportionnellement au chiffre d'affaires sur le reste du champ.

    À partir de 2016, toutes les déclarations mensuelles sont exploitées pour le calcul des indices.

    ", - publishers: [], - id: 'p1635', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1781', - prefLabelLg1: 'Indice des prix à la production des services', - prefLabelLg2: 'Service producer price index', - creators: [], - dataCollector: [], - abstractLg1: - "

    Les indices des prix de production dans les services répondent à un impératif national et européen, voire international, en permettant :

    - aux économistes, d'évaluer et d'analyser les tendances de la conjoncture. De nombreux organismes publics ou privés, français, européens ou mondiaux utilisent ces indices de prix comme indicateurs conjoncturels en tant que tels et comme indicateurs avancés de l'inflation (Banque centrale européenne, Commission européenne, Organisation de coopération et de développement économique (OCDE), Fonds monétaire international (FMI), etc. ). Ces indices permettent un suivi mensuel des prix, sur différents marchés, aux différents stades du processus de production. L'agrégation des indices de prix des États membres permet d'établir l'indice de prix de production des services (vendus aux entreprises, ou à l'ensemble des marchés) pour l'ensemble de l'Union Européenne ;

    - aux comptables nationaux de déflater la production issue des statistiques structurelles d'entreprises et d'effectuer ainsi le partage entre l'évolution de l'activité en volume et l'évolution des prix (\" partage volume-prix \"). In fine, ils peuvent ainsi déterminer l'évolution du volume du produit intérieur brut (PIB) ;

    - aux entreprises d'indexer des contrats (à partir des \" prix de marché\").

    ", - abstractLg2: - '

    Services producer price indices satisfy national, European or even international requirements. Thanks to these indices :

    - Economists can evaluate and analyze economic trends. Many French, European and international public and private organizations use them as economic indicators and as leading indicators for inflation (European Central Bank (ECB), International Monetary Fund (IMF), Organization for Economic Cooperation and Development (OECD), etc). These indices provide a monthly price monitoring, on different markets at all stages of the production process. The aggregation of price indices in the Member States enable to establish the services producer price indices (for services sold to businesses, or to all the markets) in the whole European Union;

    - National accountants can deflate the production that comes from corporate structural statistics and thus to carry out the sharing between the development of the activity in volume and the development of prices ("price-volume" sharing). In fine, they can thus calculate the evolution of Gross Domestic Product in volume and price ;

    - Enterprises can index contracts (using "market price").

    ', - historyNoteLg2: - '

    The construction of the "services to businesses" producer price indices was launched in 1992 and ended in 1994 with a publication of first indices. Collection and dissemination of services prices are quarterly. The " STS-package ", wich is currently being defined, requires an extension of the scope of services to all market services sections H to N excluding K (financial services), with a view all markets ("BtoAll"), therefore beyond services to businesses. This STS-package should be included under "FRIBS" regulation. France added the S95 division in sections H to N.

    SOeS was in charge of the project management of price indices for various freight transport since 2002. At the beginning of 2013, the project management of these indices was transferred to INSEE.

    ', - historyNoteLg1: - '

    Le chantier des indices de prix de production des " services aux entreprises " a été lancé en 1992 et a débouché en 1994 sur la publication des premiers indices. La collecte et la diffusion des prix des services aux entreprises sont trimestrielles. Le " STS-package ", en cours de définition, requiert une extension du champ des services à l\'ensemble des services marchands des sections H à N hors K (services financiers), dans une optique tous marchés (" BtoAll "), donc au-delà des services aux entreprises. Ce STS-package devrait être inclus dans le règlement cadre " FRIBS ". La France a ajouté la division S95 aux sections H à N.

    Le SOeS assurait la maîtrise d\'ouvrage des indices des prix de divers transports de marchandises depuis 2002. Début 2013, la maîtrise d\'ouvrage de ces indices a été transférée à l\'Insee.

    ', - publishers: [], - id: 'p1640', - altLabelLg2: 'SPPI', - altLabelLg1: 'Ipse', - }, - { - idSims: '1778', - abstractLg1: - '

    Les indices de chiffres d\'affaires (ICA) en valeur dans les services permettent de mesurer mensuellement l\'évolution des ventes en valeur des entreprises relevant des secteurs concernés.

    \r\n

    Ils relèvent du règlement européen sur les statistiques de court-terme (règlement CE dit " STS " n°1165/98 du conseil du 19 mai 1998, modifié par ses amendements ultérieurs).

    ', - prefLabelLg1: "Indice de chiffre d'affaires dans les services", - abstractLg2: - '

    Turnover indexes in value for services make it possible to measure monthly changes in sales by value of companies in the sectors concerned.

    They fall under the European regulation on short-term statistics (Council Regulation (EC) No 1165/98 of 19 May 1998, as amended by its subsequent amendments).

    ', - prefLabelLg2: 'Turnover index in services', - historyNoteLg2: - '

    In order to limit the statistical burden on businesses, and because information is collected on a regular basis by DGFiP, INSEE uses the value added tax (VAT) tax returns of companies to build a Monthly indices of turnover.

    The tax authority provides INSEE with VAT returns every month..

    Until 2015, turnover indices were calculated from a sample of companies reporting VAT on a monthly basis.

    This sample, of some 160,000 companies, was renewed each year. It included an exhaustive stratum (the largest companies in each sector) and was drawn proportionally to turnover on the rest of the field.

    Since 2016, all monthly returns are used to calculate the indices.

    ', - creators: [], - historyNoteLg1: - "

    Dans le souci de limiter la charge statistique pesant sur les entreprises, et parce que l'information est collectée de manière régulière par la DGFiP, l'Insee utilise les déclarations de taxe sur la valeur ajoutée (TVA) des entreprises pour bâtir un ensemble d'indices mensuels d'évolution des chiffres d'affaires.

    La DGFiP transmet mensuellement à l'Insee les déclarations TVA des entreprises.

    Jusqu'en 2015, les indices de chiffre d'affaires étaient calculés à partir d'un échantillon d'entreprises déclarant la TVA mensuellement.

    Cet échantillon, de quelque 160 000 entreprises, était renouvelé chaque année. Il comprenait une strate exhaustive (les plus grandes entreprises de chaque secteur) et était tiré proportionnellement au chiffre d'affaires sur le reste du champ.

    Depuis 2016, toutes les déclarations mensuelles sont exploitées pour le calcul des indices.

    ", - publishers: [], - id: 'p1637', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1794', - prefLabelLg1: 'Indice des prix à la consommation', - prefLabelLg2: 'Consumer price index', - creators: [], - dataCollector: [], - abstractLg1: - "

    L'indice des prix à la consommation (IPC) est l'instrument de mesure de l'inflation. Il permet d'estimer, entre deux périodes données, la variation moyenne des prix des produits consommés par les ménages.

    Il est basé sur l'observation d'un panier fixe de biens et services, actualisé chaque année. Chaque produit est pondéré, dans l'indice global, proportionnellement à son poids dans la dépense de consommation des ménages.

    Il est publié chaque mois au Journal Officiel. L'indice des prix hors tabac sert à indexer de nombreux contrats privés, des pensions alimentaires, des rentes viagères et aussi à indexer le SMIC.

    L'indice retenu pour le SMIC est celui des \"ménages du premier quintile de la distribution des niveaux de vie\" (Décret n°2013-123 du 7 février 2013).

    ", - abstractLg2: - '

    The consumer price index (CPI) is the instrument used to measure inflation. It allows the estimation of the average variation between two given periods in the prices of products consumed by households.

    It is based on the observation of a fixed basket of goods updated every year. Each product has a weight in the overall index that is proportional to its weight in household expenditure.

    It is published each month in the Official Journal of French Republic. The price index excluding tobacco is used to index link many private contracts, alimony, annuities and also the minimum wage (SMIC).

    The index used for the SMIC is that of the "Households that belong to the lowest equivalized disposable income quintile" (Decree n° 2013-123, February 7th of 2013).

    ', - historyNoteLg2: - "

    The first generation of indices dates back to 1914. Over time, the IPC's coverage has broadened, both on a geographical level and in terms of the population represented and consumption covered.

    The CPI 2015 base constitutes the 8th generation of indices used. It was brought into service in January 2016.

    ", - historyNoteLg1: - "

    La première génération d'indices date de 1914. Au cours du temps, la couverture de l'IPC s'est élargie tant au plan géographique qu'en termes de population représentée ou de consommation couverte.

    L'IPC base 2015 constitue la 8e génération d'indice. Il est entré en service en janvier 2016.

    ", - publishers: [], - id: 'p1653', - altLabelLg2: 'CPI', - altLabelLg1: 'IPC', - }, - { - idSims: '1770', - prefLabelLg1: 'Indice du coût horaire du travail révisé - tous salariés', - prefLabelLg2: 'Revised Hourly Labour Cost Index - all employees', - creators: [], - dataCollector: [], - abstractLg1: - "

    L'indice du coût horaire du travail révisé - tous salariés (ICHTrev-TS) permet de suivre l'évolution mensuelle du coût horaire du travail (rémunérations, cotisations sociales, taxes nettes de subventions) et sert de référence pour certaines clauses d'indexations contractuelles.

    Le calcul de cet indice répond à un impératif national et européen. Il relève du règlement européen sur les statistiques de court-terme (règlement CE dit \"STS\" n° 1165/98, modifié par le règlement CE n° 1158/2005).

    ", - abstractLg2: - '

    The revised Hourly Labour Cost Index - all Employees (ICHTrev-TS) allows the monitoring of monthly trends in the hourly cost of labour (remunerations, social contributions and taxes inclusive of subsidies) and acts as a reference for certain contractual indexing clauses.

    This index is calculated in response to a national and European requirement. It relates to the European regulations on short-term statistics ("STS" EC regulation no.1165/98, amended by EC regulation no. 1158/2005).

    ', - historyNoteLg2: - '

    This index was calculated for the first time in 2009. It replaces the ICHT-TS, created in 1996, which was calculated on a "structure-constant" basis, i.e. not taking account of any changes to the description of jobs or of their distribution according to gender.

    The old-formula ICHT-TS only covered 4 specific business sectors (Mechanical and Electrical Industries, Textile, Leather and Clothing, and Services provided primarily to enterprises).

    ', - historyNoteLg1: - "

    Cet indice est calculé pour la première fois en 2009. Il remplace l'ICHT-TS, crée en 1996 qui était calculé \"à structure constante\", c'est-à-dire ne prenant pas en compte les changements éventuels de qualification des emplois ou de leur répartition par sexe.

    L'ICHT-TS, ancienne formule, ne couvrait que 4 secteurs d'activité spécifiques (Industries Mécaniques et Électriques, Textile, Habillement-cuir et Services fournis principalement aux entreprises).

    ", - publishers: [], - id: 'p1629', - altLabelLg2: 'ICHTrev-TS', - altLabelLg1: 'ICHTrev-TS', - }, - { - idSims: '1887', - abstractLg1: - '

    Les indices de volume des ventes dans le commerce permettent de mesurer mensuellement, et de façon précoce, l’évolution des ventes des entreprises relevant des secteurs concernés. Ils représentent à ce titre une information essentielle pour le suivi du cycle conjoncturel. Ces indices relèvent du règlement européen sur les statistiques de court-terme (règlement CE dit « STS » n°1165/98 du conseil du 19 mai 1998, modifié par ses amendements ultérieurs).

    ', - prefLabelLg1: 'Volume des ventes dans le commerce base 2015', - abstractLg2: - '

    The sales volume indices are used to measure the monthly change in the sales volume of wholesale trade and retail trade. As such, they are a primary information to monitor the business cycle in France. Sales volume indices fall under the European regulation on short-terms statistics – the Council Regulation ‘’STS’’ No 1165/98 of 19 May 1998, modified by subsequent amendments.

    ', - prefLabelLg2: 'Sales volume index in trade base 2015', - creators: [], - publishers: [], - id: 'p1670', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1775', - abstractLg1: - '

    Les indices de chiffre d\'affaires (ICA) en valeur dans le commerce permettent de mesurer mensuellement l\'évolution des ventes en valeur des entreprises relevant des secteurs concernés.

    \r\n

    Ils relèvent du règlement européen sur les statistiques de court-terme (règlement CE dit " STS " n°1165/98 du conseil du 19 mai 1998, modifié par ses amendements ultérieurs).

    ', - prefLabelLg1: "Indice de chiffre d'affaires dans le commerce", - abstractLg2: - '

    Turnover indices in all trade are monthly indices in value. They make possible to measure monthly the evolution of sales in value of the companies in the sectors concerned.

    They fall under the European regulation on short-term statistics (Council Regulation (EC) No 1165/98 of 19 May 1998, as amended by its subsequent amendments).

    ', - prefLabelLg2: 'Turnover index in trade', - historyNoteLg2: - '

    In order to limit the statistical burden on businesses, and because information is collected on a regular basis by the tax authority, INSEE uses the value added tax (VAT) tax returns of companies to build a Monthly indices of turnover.

    The tax authority transmits the VAT returns of companies to INSEE on a monthly basis.

    Until 2015, turnover indices were calculated from a sample of companies reporting VAT on a monthly basis.

    This sample, of some 160,000 companies, was renewed each year. It included an exhaustive stratum (the largest companies in each sector) and was drawn proportionally to turnover on the rest of the field.

    Since 2016, all monthly returns are used to calculate the indices.

    ', - creators: [], - historyNoteLg1: - "

    Dans le souci de limiter la charge statistique pesant sur les entreprises, et parce que l'information est collectée de manière régulière par la DGFiP, l'Insee utilise les déclarations de taxe sur la valeur ajoutée (TVA) des entreprises pour bâtir un ensemble d'indices mensuels d'évolution des chiffres d'affaires.

    La DGFiP transmet mensuellement à l'Insee les déclarations TVA des entreprises.

    Jusqu'en 2015, les indices de chiffre d'affaires étaient calculés à partir d'un échantillon d'entreprises déclarant la TVA mensuellement.

    Cet échantillon, de quelque 160 000 entreprises, était renouvelé chaque année. Il comprenait une strate exhaustive (les plus grandes entreprises de chaque secteur) et était tiré proportionnellement au chiffre d'affaires sur le reste du champ.

    Depuis 2016, toutes les déclarations mensuelles sont exploitées pour le calcul des indices.

    ", - publishers: [], - id: 'p1634', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1790', - abstractLg1: - '

    Les indices de volume des ventes dans l\'ensemble du commerce permettent de mesurer mensuellement l\'évolution des ventes des entreprises relevant des secteurs concernés.

    Ils relèvent du règlement européen sur les statistiques de court-terme (règlement CE dit " STS " n°1165/98 du conseil du 19 mai 1998, modifié par ses amendements ultérieurs).

    ', - prefLabelLg1: 'Volume des ventes dans le commerce base 2010', - abstractLg2: - '

    Sales volume indices for all trade are monthly indices in volume: they track variations in the volume of sales of the companies in the sectors concerned.

    They fall under the European regulation on short-term statistics (Council Regulation (EC) No 1165/98 of 19 May 1998, as amended by its subsequent amendments).

    ', - prefLabelLg2: 'Sales volume index in trade base 2010', - historyNoteLg2: - '

    In order to limit the statistical burden on businesses, and because information is collected on a regular basis by the tax authority, INSEE uses the value added tax (VAT) tax returns of companies to build a Monthly indices of turnover.

    The tax authority transmits the VAT returns of companies to INSEE on a monthly basis.

    Until 2015, turnover indices were calculated from a sample of companies reporting VAT on a monthly basis.

    This sample, of some 160,000 companies, was renewed each year. It included an exhaustive stratum (the largest companies in each sector) and was drawn proportionally to turnover on the rest of the field.

    Since 2016, all monthly returns are used to calculate the indices.

    Beginning in 2017, INSEE calculates monthly indexes by volume in total trade by deflating the turnover indices in value: they trace the evolution of the volume of sales.

    ', - creators: [], - historyNoteLg1: - "

    Dans le souci de limiter la charge statistique pesant sur les entreprises, et parce que l'information est collectée de manière régulière par la DGFiP, l'Insee utilise les déclarations de taxe sur la valeur ajoutée (TVA) des entreprises pour bâtir un ensemble d'indices mensuels d'évolution des chiffres d'affaires.

    La DGFiP transmet mensuellement à l'Insee les déclarations TVA des entreprises.

    Jusqu'en 2015, les indices de chiffre d'affaires étaient calculés à partir d'un échantillon d'entreprises déclarant la TVA mensuellement.

    Cet échantillon, de quelque 160 000 entreprises, était renouvelé chaque année. Il comprenait une strate exhaustive (les plus grandes entreprises de chaque secteur) et était tiré proportionnellement au chiffre d'affaires sur le reste du champ.

    Depuis 2016, toutes les déclarations mensuelles sont exploitées pour le calcul des indices.

    À partir de 2017 l'Insee calcule des indices mensuels en volume dans l'ensemble du commerce par déflation des indices de chiffres d'affaires en valeur : ils retracent l’évolution du volume des ventes.

    ", - publishers: [], - id: 'p1649', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1795', - prefLabelLg1: 'Indice des prix à la consommation harmonisé', - prefLabelLg2: 'Harmonised index of consumer prices', - creators: [], - dataCollector: [], - abstractLg1: - "

    L'indice des prix à la consommation harmonisé (IPCH) est l'indicateur permettant d'apprécier le respect du critère de convergence portant sur la stabilité des prix, dans le cadre du traité de l'Union européenne (Maastricht).

    Il est conçu expressément à des fins de comparaison internationale. L'IPCH ne remplace pas l'indice national qui reste l'indice de référence pour analyser l'inflation en France, avec l'indice d'inflation sous-jacente.

    ", - abstractLg2: - '

    The harmonised index consumer prices (HICP) is the indicator used to assess compliance with the convergence criterion on price stability established in the European Union Treaty (Maastricht).

    It was designed expressly for purposes of international comparison. The HICP has not replaced the national index, which remains the reference index used to analyse inflation in France, along with the core inflation index.

    ', - historyNoteLg2: - '

    At the request of Eurostat, statistical institutes have supplied harmonised consumer price indices since 1996. Initially, the methods used by the 15 member states of the European Community to calculate their national price indices were distinctly different.

    Bearing in mind the need to determine a threshold as important as inflation in the Economic and Monetary Union, they therefore could not be used to adequately compare inflation in these countries.

    This is why the harmonised consumer price indices are is calculated using methods and content that ensure improved comparability.

    In February 1996, INSEE published an interim consumer price index with a common scope for the 15 member countries, which was replaced in March 1997 by a harmonised price index, known as the HICP, with a common scope and methods.

    This index, which began in January 1996, has been calculated since January 2016 with a base of 100 in 2015.

    ', - historyNoteLg1: - "

    A la demande d'Eurostat, les instituts statistiques fournissent depuis 1996 des indices des prix à la consommation harmonisés. Au départ, les méthodes utilisées par les 15 états membres de la communauté européenne pour calculer leur indice de prix national étaient sensiblement différentes.

    Elles ne permettaient donc pas, compte tenu de la détermination d'un seuil aussi important que celui de l'inflation dans l'Union économique et monétaire, de comparer correctement l'inflation de ces pays.

    C'est pourquoi les indices de prix à la consommation harmonisés ont été calculés avec des méthodes et un contenu assurant une meilleure comparabilité.

    L'Insee a publié en février 1996, un indice intérimaire des prix à la consommation sur un champ commun aux 15 pays membres qui a été remplacé en mars 1997 par un indice des prix harmonisé dit IPCH dont le champ et les méthodes sont communs.

    Cet indice qui commence en janvier 1996 est calculé, depuis janvier 2016, en base 100 en 2015.

    ", - publishers: [], - id: 'p1654', - altLabelLg2: 'HICP', - altLabelLg1: 'IPCH', - }, - { - idSims: '1777', - abstractLg1: - '

    Les indices de chiffre d’affaires (ICA) dans l’industrie et la construction permettent de mesurer mensuellement l’évolution des ventes en valeur, y compris à l’export, des entreprises relevant des secteurs concernés.

    Les indices de chiffre d’affaires dans l’industrie et la construction répondent à un impératif national et européen.

    Ils relèvent du règlement européen sur les statistiques de court-terme (règlement CE dit « STS » n°1165/98 du conseil du 19 mai 1998, modifié par ses amendements ultérieurs).

    ', - prefLabelLg1: - "Indice de chiffre d'affaires dans l'industrie et la construction", - abstractLg2: - '

    The Turnover Indices (ICA) in Industry and Construction allow the monthly measure of evolution in the value of sales in the sectors concerned, including exports.

    The turnover indices in Industry and Construction focus on a national and European need.

    They are subject to the European regulation on short-term statistics (EC "STS" regulation n°1165/98 of the Council of May 19, 1998, modified by subsequent amendments).

    ', - prefLabelLg2: 'Sales Index in Industry and Construction', - historyNoteLg2: - "

    In order to reduce the statistical burden on businesses and because the data has been collected on a regular basis, INSEE obtained the ability to use businesses' value-added tax (VAT) declarations in order to calculate a set of monthly indices showing the evolution of turnover.

    The Tax General Directorate transmits to the INSEE the declarations of VAT. Until 2015, the index of turnover were calculated from a sample of companies declaring the VAT monthly, selected by INSEE.This sample of almost 160 000 companies was renewed on an annual basis. It includes an exhaustive section (the largest businesses in each sector) and is selected in proportion of the turnover over the rest of the field.

    From 2016, all the monthly declarations are exploited for the calculation of the indices.

    ", - creators: [], - historyNoteLg1: - "

    Dans le souci de limiter la charge statistique pesant sur les entreprises, et que l'information était collectée de manière régulière, l'Insee a obtenu de pouvoir utiliser les déclarations de taxe sur la valeur ajoutée (TVA) des entreprises pour bâtir un ensemble d'indices mensuels d'évolution des chiffres d'affaires.

    La DGFiP transmet donc à l'Insee les déclarations TVA des entreprises. Jusqu'en 2015, les indices de chiffre d'affaires étaient calculés à partir d'un échantillon d'entreprises déclarant la TVA mensuellement sélectionnées par l'Insee.Cet échantillon, de quelque 160 000 entreprises, était renouvelé chaque année. Il comprenait une strate exhaustive (les plus grandes entreprises de chaque secteur) et était tiré proportionnellement au chiffre d'affaires sur le reste du champ.

    À partir de 2016, toutes les déclarations mensuelles sont exploitées pour le calcul des indices.

    ", - publishers: [], - id: 'p1636', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1801', - abstractLg1: - "

    Estimer des taux de chômage localisés par région, département et zone d'emploi.

    ", - prefLabelLg1: - "Taux de chômage localisés (par régions, départements et zones d'emploi)", - abstractLg2: - '

    To estimate localised unemployment rates by region, department and employment area.

    ', - prefLabelLg2: - 'Localised unemployment rates (by region, department and employment area)', - historyNoteLg2: - '

    Previously quarterly unemployment rates by region and department were relative to the situation at the end of quarter and estimated from the series of jobseekers at the end of month (DEFM).

    The use of the DEFM at national level was abandoned from 2008 in favour of exclusive use of the Labour Force Survey for the calculation of the unemployment rate in the sense of the ILO.

    The series of regional and departmental unemployment rates are now estimated as quarterly means. Furthermore, the French interpretation of ILO unemployment was abandoned in favour of the European interpretation.

    The localised unemployment rate methodology was therefore adapted at localised level to take account of these changes.

    The name "unemployment in the sense of the ILO" was also abandoned for these series in favour of the new name "localised unemployment rate"; these series in fact synthesise the information from employment estimates, the Labour Force Survey (unemployment in the sense of the ILO) and the DEFM (registered unemployment).

    ', - creators: [], - historyNoteLg1: - "

    Alors qu'auparavant les taux de chômage par région et département produits trimestriellement étaient relatifs à la situation en fin de trimestre et estimés à partir des séries de demandeurs d'emploi en fin de mois (DEFM), l'utilisation des DEFM au niveau national a été abandonnée à partir de 2008 au profit d'une utilisation exclusive de l'enquête Emploi en continu pour le calcul du taux de chômage au sens du BIT.

    Les séries de taux de chômage régionaux et départementaux sont désormais estimées en moyenne trimestrielle. De plus, l'interprétation française du chômage BIT a été abandonnée au profit de l'interprétation européenne.

    La méthodologie des taux de chômage localisés a donc été adaptée au niveau local pour tenir compte de ces changements.

    Par ailleurs, la dénomination \"chômage au sens du BIT\" a été abandonnée pour ces séries au profit de la nouvelle dénomination \"taux de chômage localisés\" ; en effet ces données sont issues d’une synthèse de différentes sources : des données administratives sur l’emploi ; des séries de demandeurs d’emploi inscrits en fin de mois (DEFM) à Pôle emploi ; de l’enquête Emploi.

    ", - publishers: [], - id: 'p1660', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1772', - abstractLg1: - "

    Les statistiques des créations d'entreprises permettent de suivre l'évolution des créations d'entreprises relevant des principaux secteurs d'activité.

    ", - prefLabelLg1: "Créations d'entreprises", - abstractLg2: - '

    Business start-up statistics serve for the monitoring of the business start-up trends in the main sectors.

    ', - prefLabelLg2: 'Business start-ups', - creators: [], - publishers: [], - id: 'p1631', - dataCollector: [], - altLabelLg1: '', - }, - { - idSims: '1789', - abstractLg1: - "

    L'indice de traitement brut - grille indiciaire (ITB-GI) vise à mesurer les évolutions du traitement brut des agents de la Fonction publique de l'État, pour chaque catégorie (A, B et C).

    Le traitement brut d'un agent est le produit de son indice par la valeur du point Fonction publique.

    ", - prefLabelLg1: 'Indice de traitement brut / grille indiciaire', - abstractLg2: - '

    The purpose of the Gross Salary Index - Index-Based Scale (ITB-GI) is to measure the trends in the gross salaries of French civil servants, for each category (A, B and C).

    The gross salary of a civil servant is the product of its index and the Civil Service "point value".

    ', - prefLabelLg2: 'Gross Salary Index / Index-Based Scale', - creators: [], - publishers: [], - id: 'p1648', - altLabelLg2: 'ITB / GI', - dataCollector: [], - altLabelLg1: 'ITB / GI', - }, - { - idSims: '1800', - prefLabelLg1: 'Indice de référence des loyers', - prefLabelLg2: 'Rent Reference Index', - creators: [], - dataCollector: [], - abstractLg1: - "

    L'indice de référence des loyers (IRL) vise à garantir aux locataires des hausses de loyers en rapport avec leur évolution du pouvoir d'achat et aux bailleurs le maintien d'un niveau d'entretien élevé et aussi à ne pas les dissuader d'investir dans le logement locatif.

    ", - abstractLg2: - '

    The purpose of the Rent Reference Index (IRL) is to provide tenants with a guarantee that rents will rise in relation to trends in purchasing power, and to provide lessors with a guarantee of a high level of maintenance and not dissuade them from investing in rental housing.

    ', - historyNoteLg2: - '

    Article 9 of Law no. 2008-111 of 8 February 2008 for purchasing power amended the rent reference created by article 35 of the Law 2005-841 of 26 July 2005 relating to the development of personal services and including a variety of measures to promote social cohesion.

    The Rent Reference Index replaces the rent reference index that was previously calculated as a reference for rent reviews relating to current leases in private housing stock.

    ', - historyNoteLg1: - "

    L'article 9 de la loi n° 2008-111 du 8 février 2008 pour le pouvoir d'achat a modifié l'indice de référence des loyers créé par l'article 35 de la loi 2005-841 du 26 juillet 2005 relative au développement des services à la personne et portant diverses mesures en faveur de la cohésion sociale.

    L'indice de référence des loyers se substitue à l'indice de référence des loyers précédemment calculé comme référence pour la révision des loyers en cours de bail dans le parc locatif privé.

    ", - publishers: [], - id: 'p1659', - altLabelLg2: 'IRL', - altLabelLg1: 'IRL', - }, -]; -const organisations = [{ id: 'DG75-L002', label: 'DG75-L002' }]; -const stamps = ['DG57-C003', 'DG57-C060']; -const categories = { codes: [] }; -describe('', () => { - it('should return all data when the form is empty', () => { - const { container } = render( - - - - ); - expect(container.querySelectorAll('li')).toHaveLength(16); - }); - it('should filter by prefLabelLg1', () => { - const { container } = render( - - - - ); - const input = container.querySelector('input'); - fireEvent.change(input, { target: { value: 'Indice de production' } }); - expect(container.querySelectorAll('li')).toHaveLength(2); - }); - it('should filter by creators', async () => { - const { container, findByText } = render( - - - - ); - - const listOptions = container.querySelector('label[for="creator"] input'); - fireEvent.keyDown(listOptions, { key: 'ArrowDown' }); - const option = await findByText('DG57-C060'); - fireEvent.click(option); - expect(container.querySelectorAll('li')).toHaveLength(1); - }); - it('should filter by publishers', async () => { - const { container, findByText } = render( - - - - ); - - const listOptions = container.querySelector('label[for="publisher"] input'); - fireEvent.keyDown(listOptions, { key: 'ArrowDown' }); - const option = await findByText('DG75-L002'); - fireEvent.click(option); - expect(container.querySelectorAll('li')).toHaveLength(1); - }); -}); diff --git a/app/src/js/applications/operations/routes/indicator.js b/app/src/js/applications/operations/routes/indicator.js index 97725d254..52a77a9b2 100644 --- a/app/src/js/applications/operations/routes/indicator.js +++ b/app/src/js/applications/operations/routes/indicator.js @@ -3,7 +3,6 @@ import { Switch, Route } from 'react-router-dom'; import OperationsIndicatorsContainer from 'js/applications/operations/indicators/'; import OperationIndicatorContainer from 'js/applications/operations/indicators/visualization/'; import OperationsIndicatorEditionContainer from 'js/applications/operations/indicators/edition'; -import OperationsIndicatorsSearchContainer from 'js/applications/operations/indicators/search'; export default () => { return ( @@ -13,11 +12,6 @@ export default () => { path="/operations/indicators" component={OperationsIndicatorsContainer} /> - { api.getSeriesList().then(result => setSeries(result)).finally(() => setLoading(false)) - }) + }, []) if (loading) return ; return ; } diff --git a/app/src/js/applications/operations/series/search.js b/app/src/js/applications/operations/series/search.js index 7b38e0351..6bdfc9e78 100644 --- a/app/src/js/applications/operations/series/search.js +++ b/app/src/js/applications/operations/series/search.js @@ -46,6 +46,7 @@ export class SearchFormList extends AbstractAdvancedSearchComponent { dataCollector, publisher, } = newState; + return this.props.data .filter(filterLabel(prefLabelLg1)) .filter(filterTypeCode(typeCode)) @@ -66,9 +67,13 @@ export class SearchFormList extends AbstractAdvancedSearchComponent { return !publisher || formattedPublishers.map(({id}) => id).includes(publisher); }) .filter((series) => { + const dataCollectors = series.dataCollectors || []; + const formattedDataCollectors = Array.isArray(dataCollectors) + ? dataCollectors + : [dataCollectors]; return ( !dataCollector || - (series.dataCollectors || []).map(({id}) => id).includes(dataCollector) + formattedDataCollectors.map(({id}) => id).includes(dataCollector) ); }); }); diff --git a/app/src/js/applications/operations/series/search.spec.js b/app/src/js/applications/operations/series/search.spec.js index 5c9a46c61..a4ef392f7 100644 --- a/app/src/js/applications/operations/series/search.spec.js +++ b/app/src/js/applications/operations/series/search.spec.js @@ -1,7 +1,7 @@ import { SearchFormList } from './search'; import React from 'react'; import { render, fireEvent } from '@testing-library/react'; -import { MemoryRouter } from 'react-router'; +import { MemoryRouter } from 'react-router-dom'; const data = [ { prefLabelLg1: 'Base non-salariés', diff --git a/app/src/js/applications/operations/shared/list/index.spec.js b/app/src/js/applications/operations/shared/list/index.spec.js index 5341fce18..221536ef0 100644 --- a/app/src/js/applications/operations/shared/list/index.spec.js +++ b/app/src/js/applications/operations/shared/list/index.spec.js @@ -1,5 +1,5 @@ import React from 'react'; -import { render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import OperationsObjectHome from './index'; import { MemoryRouter } from 'react-router-dom'; @@ -45,10 +45,10 @@ describe('Operation Home', () => { expect(container.querySelectorAll('.list-group')).toHaveLength(1); }); - it('should always display the Tree button', () => { + it('should always display the Tree button', async () => { const store = mockStore({ users: { results: { stamp: 'stamp' }}, app: { auth: { user: { roles: [] } } } }); - const { getByText } = render( + render( { , { wrapper: MemoryRouter } ); - expect(getByText("View tree")).toBeDefined(); + await screen.findByText("View tree") }); - it('should display the New button if the user has the right role', () => { + it('should display the New button if the user has the right role', async () => { const store = mockStore({ users: { results: { stamp: 'stamp' }}, app: { auth: { user: { roles: ["role"] } } } }); - const { getByText } = render( + render( { , { wrapper: MemoryRouter } ); - expect(getByText("New")).toBeDefined(); + await screen.findByText("New"); }); it('should not display the New button if the user does not have the right role', () => { const store = mockStore({ users: { results: { stamp: 'stamp' }}, app: { auth: { user: { roles: ["role"] } } } }); @@ -94,6 +94,7 @@ describe('Operation Home', () => { , { wrapper: MemoryRouter } ); + // eslint-disable-next-line expect(queryByText("New")).toBeNull(); }); }); diff --git a/app/src/js/applications/shared/date-picker-rmes/date-picker-rmes.stories.js b/app/src/js/applications/shared/date-picker-rmes/date-picker-rmes.stories.js deleted file mode 100644 index f76d8b8ec..000000000 --- a/app/src/js/applications/shared/date-picker-rmes/date-picker-rmes.stories.js +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import { storiesOf } from '@storybook/react'; -import { action } from '@storybook/addon-actions'; -import DatePickerRmes from './'; - -const stories = storiesOf('DatePickerRmes', module); - -const styleDecorator = storyFn => ( -
    {storyFn()}
    -); -stories.addDecorator(styleDecorator); - -stories.add('Default', () => ( -
    - -
    -)); - -stories.add('Open on right', () => ( -
    - -
    -)); - -stories.add('Open on left', () => ( -
    - -
    -)); - -stories.add('Open on top', () => ( -
    - -
    -)); diff --git a/app/src/js/applications/shared/explanatory-note/explanatory-note.stories.js b/app/src/js/applications/shared/explanatory-note/explanatory-note.stories.js deleted file mode 100644 index 5c79f21aa..000000000 --- a/app/src/js/applications/shared/explanatory-note/explanatory-note.stories.js +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react'; -import { storiesOf } from '@storybook/react'; -import { ExplanatoryNote } from './'; - -import { withKnobs, text, boolean } from '@storybook/addon-knobs'; - -const html = ` -
    -

    ExplanatoryNote body

    -

    -

      -
    • Item 1
    • -
    • Item 2
    • -
    -

    -
    `; - -const stories = storiesOf('ExplanatoryNote', module); -stories.addDecorator(withKnobs); - -const styleDecorator = storyFn =>
    {storyFn()}
    ; -stories.addDecorator(styleDecorator); - -stories.add('Default', () => ( - -)); - -stories.add('With html content', () => ( - -)); - -stories.add('With all props', () => ( - -)); diff --git a/app/src/js/applications/shared/flag/flag.js b/app/src/js/applications/shared/flag/flag.js deleted file mode 100644 index c8155b14f..000000000 --- a/app/src/js/applications/shared/flag/flag.js +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import defaultFlag from 'img/flags/default.png'; -import D from 'js/i18n'; - -export const isFlag = lang => { - try { - require(`img/flags/${lang}.png`); - } catch (e) { - return false; - } - return true; -}; - -export default lang => { - if (!lang) return null; - return ( - {D.langs} - ); -}; diff --git a/app/src/js/applications/shared/flag/flag.spec.js b/app/src/js/applications/shared/flag/flag.spec.js deleted file mode 100644 index 24878bf1d..000000000 --- a/app/src/js/applications/shared/flag/flag.spec.js +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import { render } from '@testing-library/react'; -import Flag, { isFlag } from './flag'; - -describe('isFlag', () => { - it('missing img returns false', () => { - expect(isFlag('de')).toBe(false); - }); - - it('existing img returns true', () => { - expect(isFlag('fr')).toBe(true); - }); -}); - -describe('flag', () => { - it('renders without crashing', () => { - render(); - }); -}); diff --git a/app/src/js/applications/shared/input-multi-rmes/index.js b/app/src/js/applications/shared/input-multi-rmes/index.js index a2659dc47..bc3b2b6e4 100644 --- a/app/src/js/applications/shared/input-multi-rmes/index.js +++ b/app/src/js/applications/shared/input-multi-rmes/index.js @@ -1,7 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Modal from 'js/applications/shared/input-multi-modal-rmes/input-multi-modal-rmes'; -import flag from 'js/applications/shared/flag/flag'; import D, { D1, D2 } from 'js/i18n'; class InputMultiRmes extends Component { @@ -88,7 +87,6 @@ class InputMultiRmes extends Component { render() { const { label, - langs: { lg1, lg2 }, } = this.props; const { arrayLg1, arrayLg2, modalAdd, modalDelete, modalLast } = this.state; @@ -106,14 +104,14 @@ class InputMultiRmes extends Component {
    {altLg1}
    {altLg2} diff --git a/app/src/js/applications/shared/input-multi-rmes/input-multi-rmes.stories.js b/app/src/js/applications/shared/input-multi-rmes/input-multi-rmes.stories.js deleted file mode 100644 index 858e910dd..000000000 --- a/app/src/js/applications/shared/input-multi-rmes/input-multi-rmes.stories.js +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { storiesOf } from '@storybook/react'; -import { action } from '@storybook/addon-actions'; -import InputMulti from './'; - -import { withKnobs, text } from '@storybook/addon-knobs'; - -const stories = storiesOf('Input multi', module); -stories.addDecorator(withKnobs); - -const styleDecorator = storyFn => ( -
    - {storyFn()} -
    -); -stories.addDecorator(styleDecorator); - -stories.add('Default', () => ( - -)); diff --git a/app/src/js/applications/shared/input-rmes/index.js b/app/src/js/applications/shared/input-rmes/index.js index 1934bd762..abb81ff05 100644 --- a/app/src/js/applications/shared/input-rmes/index.js +++ b/app/src/js/applications/shared/input-rmes/index.js @@ -1,12 +1,10 @@ import React from 'react'; import PropTypes from 'prop-types'; -import flag from 'js/applications/shared/flag/flag'; function InputRmes({ colMd, value, label, - lang, star, hiddenStar, disabled, @@ -18,8 +16,7 @@ function InputRmes({ return (