New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Première passe pour la génération dynamique de components #578
Conversation
Codecov Report
@@ Coverage Diff @@
## manu/parseXMLtoJSON #578 +/- ##
=======================================================
+ Coverage 73.68% 74.71% +1.02%
=======================================================
Files 122 136 +14
Lines 1239 1380 +141
Branches 189 204 +15
=======================================================
+ Hits 913 1031 +118
- Misses 288 309 +21
- Partials 38 40 +2
Continue to review full report at Codecov.
|
un lien vers les definitions qui permet de mieux comprendre comment les contenu sont organisés https://www.data.gouv.fr/fr/datasets/r/d1b0f744-c997-48d2-9ec4-1c64e82202d6 |
bad9fc4
to
7436ade
Compare
😍 Clean code 👍 Je n'ai juste pas compris ce qu'était Pour les variables CSS, ce serait compliqué de les déplacer dans le package css ? |
Ce serait pas plus "idiomatique" d'avoir un composant |
Yes j'ai hésité un petit bout de temps et comme c'était récursif je me suis dit qu'un component récursif c'est pas commun donc je vais juste faire une fonction mais, effectivement, ça fait bizarre au final |
Yes mais je le fais dans une PR à part juste après alors ? |
c225813
to
a33ab20
Compare
e44cd0b
to
da2c573
Compare
a33ab20
to
3a2a5ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
désolé pour le retard, juste des petites remarques
packages/code-du-travail-frontend/src/ficheBuilder/utils/index.js
Outdated
Show resolved
Hide resolved
packages/code-du-travail-frontend/src/ficheBuilder/utils/getText.js
Outdated
Show resolved
Hide resolved
packages/code-du-travail-frontend/pages/fiche-service-public.js
Outdated
Show resolved
Hide resolved
packages/code-du-travail-frontend/src/FicheServicePublic/components/index.js
Outdated
Show resolved
Hide resolved
packages/code-du-travail-frontend/src/FicheServicePublic/utils/index.js
Outdated
Show resolved
Hide resolved
packages/code-du-travail-frontend/src/FicheServicePublic/index.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Désolé pour la revue tardive, pas de grosses modif.
e89ecc3
to
f582bb9
Compare
3a2a5ed
to
b2eedc6
Compare
packages/code-du-travail-frontend/src/FicheServicePublic/components/__tests__/Accordion.test.js
Outdated
Show resolved
Hide resolved
packages/code-du-travail-frontend/src/FicheServicePublic/components/__tests__/Accordion.test.js
Outdated
Show resolved
Hide resolved
case "Tableau": | ||
return <Table data={data} headingLevel={headingLevel} />; | ||
case "Texte": | ||
if (data.$.find(child => child.name === "Chapitre")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Est ce qu'on pourrait pas tester le niveau via headingLevel ?
Les accordéon de chapitre ne sont en général présent qu'au sous niveau 1
@@ -0,0 +1,21 @@ | |||
// beware, this one is recursive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Est ce qu'on pourrait pas bouger le fichier au niveau au dessus et l'appeller utils.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nickel les tests 👍
juste 2 trois remarques, et les 2 premiers commit de la branche sont a virer (on peut le faire ensemble)
2dfc4eb
to
362e6b6
Compare
f582bb9
to
1f01d55
Compare
362e6b6
to
7427731
Compare
* feat: still working on json format of xml * feat: working on json format of xml * feat: finish json format of xml * refactor: remove pretty option on json file * fix: useless node_modules in gitignore * fix: wrong format in raw data, object instead of string * fix: remove useless python file and optimise json output * fix: wrong indent * fix: wrong regexp causing useless fiches to be indexed * fix: update wrong command line * fix: remove legacy file * feat: update format file * feat: update format file * feat: update fiches sp according to new filter * refactor: filters * refactor: change concat to be more readable * refactor: remove useless key in dataset * refactor: apply feedbacks * Première passe pour la génération dynamique de components (#578) * feat: first step in generating recursively react components from json * feat: create new components and add css vars * feat: add some new components * feat: add tabulator component * feat: add more components * refactor: change ficheBuilder into a component * feat: minor css changes * feat: add two more easy components * refactor: apply pr feedback * feat: add comment on special case * feat: add minimal test * test: update snapshot * test: adding more tests * test: add a few more tests * test: update snapshot * tests: remplace js mock file to json mock file * refactor: remove weird heading level * refactor: migrate css folder into ui * tests: add missing test * test: add missing snapshots * test: update snapshots
Vous en pensez quoi ??