Skip to content
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

Feat: Template mapping editor interfaces #94

Draft
wants to merge 256 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
77cf39f
refactor: moving into Shared
Hugo-COLLIN Apr 24, 2024
65ceda4
fix: managing error when unfolding
Hugo-COLLIN Apr 24, 2024
010f7e7
fix: managing error when unfolding
Hugo-COLLIN Apr 24, 2024
b3d5756
refactor: unfolding on WritePlan but error on TemplateMapping
Hugo-COLLIN Apr 24, 2024
9c785e4
refactor: unfolding on WritePlan but not on TemplateMapping
Hugo-COLLIN Apr 24, 2024
d71f187
fix: can unfold section but not displaying question fields
Hugo-COLLIN Apr 25, 2024
3cd7f5b
fix: can unfold section and display fields
Hugo-COLLIN Apr 25, 2024
8515f61
refactor: mode extracted in context
Hugo-COLLIN Apr 26, 2024
95570d7
refactor: improving mode context
Hugo-COLLIN Apr 26, 2024
72219fb
refactor: rename to SectionsMode
Hugo-COLLIN Apr 26, 2024
99518d3
refactor: using useSectionsMode() custom hook
Hugo-COLLIN Apr 26, 2024
db99a08
fix: using SectionsMode in WritePlan
Hugo-COLLIN Apr 26, 2024
740b7c6
fix: using SectionsMode in DynamicForm
Hugo-COLLIN Apr 26, 2024
16540f3
refactor: using const to define sectionsContent mode
Hugo-COLLIN Apr 26, 2024
6123ccf
fix: wrong useSectionMode usage
Hugo-COLLIN Apr 26, 2024
e5bddd0
fix: using SectionsMode Context
Hugo-COLLIN Apr 26, 2024
2dec042
fix: using mode writing
Hugo-COLLIN Apr 26, 2024
20049da
refactor: improving useEffect function
Hugo-COLLIN Apr 26, 2024
e86d17d
refactor: improving handleQuestionCollapse and isQuestionOpened funct…
Hugo-COLLIN Apr 26, 2024
7832aff
docs: updating comments
Hugo-COLLIN Apr 26, 2024
152b27a
refactor: moving modal and infobox logic into ResearchOutput
Hugo-COLLIN Apr 26, 2024
c9b7a92
refactor: improving data fetch function writing
Hugo-COLLIN Apr 26, 2024
6b174bd
fix: adding SectionsModeProvider because of SectionsMode in DynamicForm
Hugo-COLLIN Apr 29, 2024
409b4ce
refactor: moving afterFetchTreatment into WritePlan
Hugo-COLLIN Apr 29, 2024
db0ed38
refactor: fetchAndProcessData function
Hugo-COLLIN Apr 29, 2024
365631f
refactor: cleaning and commenting code
Hugo-COLLIN Apr 29, 2024
73cb4ce
refactor: simplifying functions
Hugo-COLLIN Apr 29, 2024
21b53bf
refactor: cleaning and commenting code
Hugo-COLLIN Apr 29, 2024
63b1ce3
locale needs to be passed from react.jsx
Hugo-COLLIN Apr 29, 2024
3fae6f4
refactor: cleaning code
Hugo-COLLIN Apr 30, 2024
84579ea
refactor: removing MODE_WRITING usage
Hugo-COLLIN Apr 30, 2024
80d7f3a
refactor: simplifying sections unfolding logic
Hugo-COLLIN Apr 30, 2024
0bfef44
refactor: simplifying logic
Hugo-COLLIN Apr 30, 2024
c4b8e93
Merge remote-tracking branch 'origin/dev' into feat/template_mapping
Hugo-COLLIN May 2, 2024
64f0647
fix: SectionsModeProvider
Hugo-COLLIN May 2, 2024
6de0dd4
refactor: splitting render into functions
Hugo-COLLIN May 2, 2024
d1071d5
refactor: cleaning code
Hugo-COLLIN May 2, 2024
af31bc4
refactor: transforming internal functions into exported components
Hugo-COLLIN May 2, 2024
1ab0202
refactor: moving components into separate files
Hugo-COLLIN May 2, 2024
55a2008
fix: handle errors correctly in fetchAndProcesData
Hugo-COLLIN May 3, 2024
1c413cb
refactor: simplifying Question
Hugo-COLLIN May 3, 2024
5f03e30
refactor: separating question modals logic into a context
Hugo-COLLIN May 3, 2024
5255a68
refactor: using question modals context in children to avoid prop dri…
Hugo-COLLIN May 3, 2024
aedc375
refactor: extract shared hook treatment in contextValidation
Hugo-COLLIN May 3, 2024
69651fd
refactor: separating question icons logic into a context
Hugo-COLLIN May 3, 2024
4272068
refactor: using question icons context in children to avoid prop dril…
Hugo-COLLIN May 3, 2024
4d90f2e
refactor: separating question state logic into a context
Hugo-COLLIN May 3, 2024
3a0adee
refactor: using question state context in children to avoid prop dril…
Hugo-COLLIN May 3, 2024
97c2275
refactor: cleaning code
Hugo-COLLIN May 3, 2024
65d2989
fix: fixing errors
Hugo-COLLIN May 3, 2024
73dfcdc
refactor: renaming component
Hugo-COLLIN May 6, 2024
d4f8ab4
feat: opening Edit modal with a button in mapping mode
Hugo-COLLIN May 6, 2024
706588a
feat: no placeholder if mode mapping
Hugo-COLLIN May 6, 2024
6acf018
feat: opening element modal with a button in mapping mode
Hugo-COLLIN May 6, 2024
0fbaeb2
feat: displaying a field for fieldList in mode_mapping
Hugo-COLLIN May 6, 2024
987cd99
refactor: renaming
Hugo-COLLIN May 6, 2024
fa7ce6f
refactor: changing mode into modeMapping property
Hugo-COLLIN May 6, 2024
7873ac7
feat: adding MappingButton near to all fields
Hugo-COLLIN May 6, 2024
619e760
fix: fixing plan deletion bug using researchOutput from service
Hugo-COLLIN May 7, 2024
247a5b8
refactor: simplifying FormBuilder logic
Hugo-COLLIN May 7, 2024
fa79c41
refactor: reformatting and adding jsonPath
Hugo-COLLIN May 7, 2024
ae434a2
feat: passing a kind of JSONPath to the mapping button
Hugo-COLLIN May 7, 2024
fe7f5e5
feat: getting nested JsonPath
Hugo-COLLIN May 7, 2024
d549146
fix: passing JSONPath in SelectMultipleList
Hugo-COLLIN May 13, 2024
dc24444
feat: Adding text area in the mapping left-side pane
Hugo-COLLIN May 13, 2024
b55bd66
feat: Adding text area in the mapping left-side pane
Hugo-COLLIN May 13, 2024
baeb4f6
feat: JsonPath beginning with form name
Hugo-COLLIN May 13, 2024
9ba4965
fix: missing error state
Hugo-COLLIN May 13, 2024
0c0f2ea
chore: passing JsonPath to SubForm and FormBuilder
Hugo-COLLIN May 13, 2024
f7cef72
fix: handling targetting error
Hugo-COLLIN May 13, 2024
75a777d
fix: displaying NestedForm and hiding useless inputs in mapping mode
Hugo-COLLIN May 13, 2024
32a4937
refactor: Renaming SectionsMode into SectionsMapping + adding editor ref
Hugo-COLLIN May 13, 2024
18d166f
fix: targetting the correct TinyArea
Hugo-COLLIN May 13, 2024
ad06c30
feat: adding JsonPath in Editor when clicking on JsonPath button
Hugo-COLLIN May 13, 2024
bc1b0d3
fix: using editorRef to avoid Editor loading error
Hugo-COLLIN May 13, 2024
9303455
fix&refactor: handling JsonPath array props and extracting logic to a…
Hugo-COLLIN May 14, 2024
a557719
fix: solving PlanCreation error by passing SectionsMappingProvider
Hugo-COLLIN May 14, 2024
e12c177
feat: displaying label instead of form_label in mapping mode
Hugo-COLLIN May 14, 2024
5c5b1fd
feat: displaying target form
Hugo-COLLIN May 15, 2024
e54ec60
chore: distinguishing structured to not structured forms from templates
Hugo-COLLIN May 15, 2024
837b1e1
fix: minor changes
Hugo-COLLIN May 15, 2024
c0b23b7
fix: minor changes
Hugo-COLLIN May 15, 2024
abbe04a
refactor: restructuring isStructuredForm into an object and adding pr…
Hugo-COLLIN May 16, 2024
cc2c258
feat: disabling unfolding questions when hiddenQuestionsFields is ena…
Hugo-COLLIN May 16, 2024
981f788
chore: mapping usage property and displaying Set mapping button
Hugo-COLLIN May 16, 2024
51719ce
refactor: fetchAndProcessData with try-catch + minor changes
Hugo-COLLIN May 17, 2024
b81723e
Merge branch 'dev' into feat/template_mapping
Hugo-COLLIN May 17, 2024
636b641
feat: Mapping editor inside questions
Hugo-COLLIN May 17, 2024
7fac933
feat: collapsing all other questions to have only 1 Mapping editor vi…
Hugo-COLLIN May 17, 2024
97fe144
fix: updating editorRef only if it is the target form
Hugo-COLLIN May 17, 2024
97bc3f5
fix: handling when no target editor open
Hugo-COLLIN May 17, 2024
1febf9e
style: separating scrolling of the 2 forms + forms not overflowing th…
Hugo-COLLIN May 17, 2024
930c72b
fix: error structured + unstructured message dans Infos Générales
Hugo-COLLIN May 21, 2024
43922c1
fix: changes from code review
Hugo-COLLIN May 21, 2024
b580c1a
refactor: removing FormProvider and replacing TinyArea with Editor (T…
Hugo-COLLIN May 21, 2024
8deb303
refactor: removing FormProvider and replacing TinyArea with Editor (T…
Hugo-COLLIN May 21, 2024
6faec54
refactor: removing mapping-related logic in TinyArea
Hugo-COLLIN May 21, 2024
5fe7013
chore: removing Add mapping button and using classic arrows
Hugo-COLLIN May 21, 2024
c09c9f6
chore: page formatting
Hugo-COLLIN May 21, 2024
a538813
chore: Adding new form (in anticipation for templates selection)
Hugo-COLLIN May 21, 2024
c656483
chore: using new TemplateSelector component and getting templates fro…
Hugo-COLLIN May 22, 2024
d1aa2b0
refactor: moving props
Hugo-COLLIN May 22, 2024
bb9b60f
feat: load structured and classic templates in SectionsContents using…
Hugo-COLLIN May 22, 2024
ef62e93
fix&refactor: setting default values in dropdowns when page loaded
Hugo-COLLIN May 22, 2024
a292c18
feat: displaying loading spinner each time a template is fetched
Hugo-COLLIN May 22, 2024
0658bd1
refactor: renaming writePlan service to sectionsContent
Hugo-COLLIN May 22, 2024
3f12920
refactor: moving MappingEditor
Hugo-COLLIN May 22, 2024
f20c8a2
refactor: removing useless parameters to collapseOtherQuestions function
Hugo-COLLIN May 22, 2024
390528f
fix: resetting questions opening for all forms, preventing mapping bu…
Hugo-COLLIN May 22, 2024
fdf792f
refactor: moving TemplatesSelectors logic to a separated component
Hugo-COLLIN May 22, 2024
4b4b926
style: removing marginTop
Hugo-COLLIN May 22, 2024
f8934dd
feat: select mapping type structuredToStructured
Hugo-COLLIN May 23, 2024
485681a
refactor: extracting Mapper component
Hugo-COLLIN May 23, 2024
1719682
fix: update form on template change
Hugo-COLLIN May 23, 2024
20677f9
fix: only 1 question open in target form now working again
Hugo-COLLIN May 23, 2024
065f93a
feat: adding mapping type "Form to Json" and integrating Ace JSON editor
Hugo-COLLIN May 24, 2024
2fd6db1
refactor: moving fetchAndProcessData and template fetching methods in…
Hugo-COLLIN May 24, 2024
443a5be
feat: displaying received json inside editor
Hugo-COLLIN May 24, 2024
3f97e40
refactor: renaming component
Hugo-COLLIN May 27, 2024
4382f77
moving initial and target template id to SectionsMappingContext
Hugo-COLLIN May 27, 2024
98eec79
refactor: cleaning code
Hugo-COLLIN May 27, 2024
2806206
chore: building mapping schema
Hugo-COLLIN May 27, 2024
4bb22fe
feat: adding mapping json inside editor
Hugo-COLLIN May 27, 2024
d854bb6
fix: correctly reloading editor when changing template
Hugo-COLLIN May 27, 2024
7a42f7e
chore: forwardRef CodeEditor and passing it the editorRef
Hugo-COLLIN May 27, 2024
cc35aaa
refactor: moving handleInsert in MappingContext
Hugo-COLLIN May 27, 2024
f44ee4c
refactor: editor-depending handleInsert function passed to SectionsMa…
Hugo-COLLIN May 27, 2024
ed9f797
docs: commenting code
Hugo-COLLIN May 27, 2024
d4fd872
feat: Mapping button adding JsonPath to the current cursor position i…
Hugo-COLLIN May 27, 2024
39bb58d
feat: wrapping JsonPath with <samp>
Hugo-COLLIN May 27, 2024
041453a
feat: hiding readonly form fields in mapping mode
Hugo-COLLIN May 28, 2024
7522c52
fix: avoiding inconsistent height between question and button
Hugo-COLLIN May 28, 2024
b6b5f92
fix: disable Expand/collapse all feature in mapping mode
Hugo-COLLIN May 28, 2024
9db35fc
refactor: moving Mapping Button from CustomSelect to its parents
Hugo-COLLIN May 28, 2024
b515489
feat: JsonPath as <samp> attribute and displaying label name instead
Hugo-COLLIN May 28, 2024
7d2563b
feat: styling samp[json-path] inside TinyMCE editor
Hugo-COLLIN May 28, 2024
31f5b2c
fix: correct label name
Hugo-COLLIN May 28, 2024
a37b3e0
feat: removing the entire samp tag when deleting its content
Hugo-COLLIN May 28, 2024
f745c6c
feat: non-editable samp[json-path] tag
Hugo-COLLIN May 28, 2024
8dfdfe0
feat: Save mapping button + formToClassicForm
Hugo-COLLIN May 28, 2024
d55fd62
fix: handling when API error
Hugo-COLLIN May 29, 2024
c1b1fa5
chore: mapping schema without section id
Hugo-COLLIN May 31, 2024
18022d7
feat: saving editor content when clicking on mapping button
Hugo-COLLIN May 31, 2024
d3dbdfc
feat: saving editor content when typing
Hugo-COLLIN May 31, 2024
bb2ed7c
feat: saving editor content when clicking on mapping button
Hugo-COLLIN May 31, 2024
ae8a107
feat: saving editor content when clicking on mapping button
Hugo-COLLIN May 31, 2024
4c35afa
style: bottom-fixed "Save mapping" button
Hugo-COLLIN Jun 3, 2024
0639b6b
feat: creating mapping in database when clicking button
Hugo-COLLIN Jun 3, 2024
8927b3b
feat: mapping creating or updating logic using backend mapping id
Hugo-COLLIN Jun 3, 2024
23400b3
style: button text depending on whether the mapping is created or saved
Hugo-COLLIN Jun 3, 2024
54dc3ee
refactor: minor changes
Hugo-COLLIN Jun 3, 2024
acca63a
feat: SectionsMapping loading state
Hugo-COLLIN Jun 3, 2024
67dd7fb
fix: loading logic
Hugo-COLLIN Jun 3, 2024
74ad44c
fix: updating infos correctly from backend
Hugo-COLLIN Jun 4, 2024
3f7b684
fix: removing mapping schema building logic and effect
Hugo-COLLIN Jun 4, 2024
efbd6db
fix: dropdowns labels correctly updated
Hugo-COLLIN Jun 4, 2024
b07cd63
style: Loading spinner before displaying mapping interface when it's …
Hugo-COLLIN Jun 4, 2024
7db28d1
fix: sync editor with json but writing bug
Hugo-COLLIN Jun 4, 2024
8b78564
fix: sync editor with json but last character typed is not saved
Hugo-COLLIN Jun 4, 2024
c489c19
fix: saving the all and the last typed characters in mapping schema
Hugo-COLLIN Jun 4, 2024
4ec53a6
refactor: reformat
Hugo-COLLIN Jun 4, 2024
1ee5a83
fix: correctly handling loading
Hugo-COLLIN Jun 4, 2024
7563c67
feat: option to delete a mapping
Hugo-COLLIN Jun 4, 2024
4fa6836
feat: displaying mappings table list
Hugo-COLLIN Jun 5, 2024
4a30a8b
feat: first letter capitalized and link to mappings on lines
Hugo-COLLIN Jun 5, 2024
2c04370
feat: sorting on columns
Hugo-COLLIN Jun 5, 2024
6c480f4
fix: defaultly sorting when component loads
Hugo-COLLIN Jun 5, 2024
769d285
docs: update comments
Hugo-COLLIN Jun 5, 2024
9658654
feat: screen reader text
Hugo-COLLIN Jun 5, 2024
2c148d6
refactor: renaming component
Hugo-COLLIN Jun 5, 2024
dc59212
refactor: externalizing table into TableList configurable component
Hugo-COLLIN Jun 5, 2024
dde38b8
style: cursor pointer and label name
Hugo-COLLIN Jun 5, 2024
ce37b9a
refactor: cleaning code
Hugo-COLLIN Jun 5, 2024
6e7669b
feat: adding mapping deletion confirmation modal
Hugo-COLLIN Jun 5, 2024
6c5d293
fix: remove handlescroll logic
Hugo-COLLIN Jun 6, 2024
38bf24a
refactor: moving TableList into Shared
Hugo-COLLIN Jun 6, 2024
492ad65
fix: moving title rendering in React components
Hugo-COLLIN Jun 6, 2024
0f16910
fix: changes according to API modification
Hugo-COLLIN Jun 10, 2024
7cefc2d
feat: New page: only dropdowns ; Edit page: Readonly dropdowns
Hugo-COLLIN Jun 10, 2024
c11062a
style: aligned Mapping type dropdown
Hugo-COLLIN Jun 10, 2024
2602d80
refactor: moving mapping type logic into SectionsMappingContext
Hugo-COLLIN Jun 10, 2024
1063d3e
reafctor: separating properties logics
Hugo-COLLIN Jun 10, 2024
19e3684
refactor: using and setting mapping type
Hugo-COLLIN Jun 10, 2024
67ec649
fix: not loading MappingEditor in aSource template Question to avoid …
Hugo-COLLIN Jun 10, 2024
7b6acdc
style: name field and applying css on labels
Hugo-COLLIN Jun 10, 2024
b1e9d56
feat: define and save mapping name
Hugo-COLLIN Jun 10, 2024
453a013
feat: replacing template ids by their names (generic formatter for Ta…
Hugo-COLLIN Jun 11, 2024
39e430b
feat: adding mapping name and sort by creation date
Hugo-COLLIN Jun 11, 2024
45c8cdb
feat: adding Actions dropdown in each row ; enable to duplicate, edit…
Hugo-COLLIN Jun 11, 2024
2804365
refactor&feat: moving deleting alert logic into context to use it in …
Hugo-COLLIN Jun 11, 2024
d3938d7
fix: correcting action click returning on top of the page
Hugo-COLLIN Jun 11, 2024
ab8d94a
style: improving UX
Hugo-COLLIN Jun 11, 2024
37296fb
feat: Toasts notifications when saving mapping
Hugo-COLLIN Jun 11, 2024
6ef9609
style: improving UX
Hugo-COLLIN Jun 11, 2024
4070932
style: improving UX
Hugo-COLLIN Jun 11, 2024
b998e25
style: revert displaying name in title
Hugo-COLLIN Jun 12, 2024
d25d918
feat: Open/collapse button when text in cell is too long
Hugo-COLLIN Jun 12, 2024
c6d54c4
style: mapping heading changes
Hugo-COLLIN Jun 12, 2024
69bbc07
refactor: extracting heading into a custom component
Hugo-COLLIN Jun 12, 2024
4f79bfc
feat: floating page content heading
Hugo-COLLIN Jun 12, 2024
0a68f63
refactor: extracting heading into a custom component
Hugo-COLLIN Jun 12, 2024
a8b3292
style: minor changes
Hugo-COLLIN Jun 12, 2024
b4bf5cd
feat: click on text to expand
Hugo-COLLIN Jun 12, 2024
40cceb1
refactor: generic ContentHeading component
Hugo-COLLIN Jun 12, 2024
2cb0b3d
fix: manage when no left or right child
Hugo-COLLIN Jun 12, 2024
6a711e9
refactor: use generic heading in mappings list
Hugo-COLLIN Jun 12, 2024
393516b
style: replacing mapping button by a help message when no Target ques…
Hugo-COLLIN Jun 12, 2024
5aebe73
feat: displaying Source form only when a Target question is opened
Hugo-COLLIN Jun 12, 2024
4e47cf5
fix: closing only the newly loaded form questions (avoid closing the …
Hugo-COLLIN Jun 13, 2024
f2c6224
fix: keeping Source form questions opened
Hugo-COLLIN Jun 13, 2024
f19de1b
fix: hiding "open target question" message when not in mapping mode
Hugo-COLLIN Jun 13, 2024
d358d94
fix: Error screen when mapping is not found
Hugo-COLLIN Jun 13, 2024
c36924b
fix: keeping current form position when hiding it
Hugo-COLLIN Jun 13, 2024
bbaa8f2
fix: correcting empty samp tag persistance after deleting a label in …
Hugo-COLLIN Jun 13, 2024
7b7a30b
refactor: label using before
Hugo-COLLIN Jun 13, 2024
6daa5d2
refactor: label from jsonPath
Hugo-COLLIN Jun 13, 2024
d2046f1
fix: correcting mapping schema sync with editor
Hugo-COLLIN Jun 13, 2024
e413830
feat: user-friendly label display
Hugo-COLLIN Jun 13, 2024
7c83b5e
refactor: formatted label as attribute
Hugo-COLLIN Jun 13, 2024
dac6ab4
feat: not storing useless html attributes in database and reapplying …
Hugo-COLLIN Jun 13, 2024
695428a
feat: adding filter list bar
Hugo-COLLIN Jun 17, 2024
e65f6a0
feat: list pagination
Hugo-COLLIN Jun 17, 2024
735334f
style: improving pagination
Hugo-COLLIN Jun 17, 2024
bff47aa
feat: range displayed text
Hugo-COLLIN Jun 17, 2024
71ee898
refactor: renamed dmp_mapping to template_mapping
benjaminfaure Jun 18, 2024
defd3e3
fix: add missing lodash.set
benjaminfaure Jun 18, 2024
b79dfbd
style: moving delete button in the heading
Hugo-COLLIN Jun 18, 2024
e01bacb
feat: add icon to custom button
Hugo-COLLIN Jun 18, 2024
1aba381
fix: API requests headers change
Hugo-COLLIN Jun 18, 2024
bd9fbd7
refactor: moving template requests into sectionsContent service
Hugo-COLLIN Jun 19, 2024
9c8c861
refactor: restoring getPlanData using then/catch/finally
Hugo-COLLIN Jun 19, 2024
dcfab06
refactor: moving SectionsMappingContext Axios requests into templateM…
Hugo-COLLIN Jun 19, 2024
a93eda3
fix: empy string instead of undefined as templateId default value in …
Hugo-COLLIN Jun 19, 2024
9f34687
fix: destroyMapping
Hugo-COLLIN Jun 19, 2024
52e43fd
fix: avoid double object imbrication in data sent to the API
Hugo-COLLIN Jun 19, 2024
63d92a9
feat: translating mappings list
Hugo-COLLIN Jun 19, 2024
5722168
feat: translating mapping editor
Hugo-COLLIN Jun 19, 2024
861f7de
fix: translation
Hugo-COLLIN Jun 19, 2024
df8ea34
refactor: extracting pagination and filter bar into TableOptionsBar c…
Hugo-COLLIN Jun 19, 2024
6a4e486
fix: infinite pagination when list is empty
Hugo-COLLIN Jun 19, 2024
374df63
feat: No data found message
Hugo-COLLIN Jun 19, 2024
46bc8aa
fix: 0-0 when no elements
Hugo-COLLIN Jun 19, 2024
4bea596
feat: auto-scrolling to main content using anchor
Hugo-COLLIN Jun 19, 2024
0e262bd
feat: mapping title in the floating heading when editing
Hugo-COLLIN Jun 19, 2024
9147c51
chore: update translation
Hugo-COLLIN Jun 19, 2024
b6d1f87
fic&refactor: using createHeaders function to include CSRF token
Hugo-COLLIN Jun 21, 2024
296231b
feat: french translations for mapping interface
Hugo-COLLIN Jun 21, 2024
d7c7777
refactor: mapping now uses madmp_schema property_name instead of name
benjaminfaure Jun 25, 2024
3361d40
fix: mapping editor formatting
benjaminfaure Jul 2, 2024
e14891a
fix: url change
Hugo-COLLIN Jul 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
"i18next-http-backend": "^2.2.0",
"lodash.chunk": "^4.2.0",
"lodash.get": "^4.4.2",
"lodash.set": "^4.3.2",
"lodash.unionby": "^4.8.0",
"lodash.uniqueid": "^4.0.1",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-ace-builds": "^7.4.1",
"react-bootstrap": "^0.33.1",
"react-dom": "^18.2.0",
"react-form-stepper": "^2.0.3",
Expand Down
43 changes: 30 additions & 13 deletions public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
"formerly": "auparavant",
"on": "le",
"Begin typing to see a list of suggestions": "Commencez à saisir pour voir une liste de suggestions",
"Select the context in which you are developing your data management plan" : "Sélectionnez le contexte dans lequel vous élaborez votre plan de gestion de données",
"For a research project" : "Pour un projet de recherche",
"For a research entity" : "Pour une entité de recherche",
"Confirm my choice" : "Valider mon choix",
"Select the context in which you are developing your data management plan": "Sélectionnez le contexte dans lequel vous élaborez votre plan de gestion de données",
"For a research project": "Pour un projet de recherche",
"For a research entity": "Pour une entité de recherche",
"Confirm my choice": "Valider mon choix",
"Default template": "Modèle par défaut",
"Your organisation": "Votre organisme",
"Other organisation": "Autre organisme",
Expand All @@ -73,7 +73,7 @@
"Research Entity Details": "Renseignements sur l'entité de recherche",
"Test Plan (e.g. as part of a training course)": "Plan test (par ex, dans le cadre d'une formation)",
"Click here if you have a funded project": "Cliquez ici si vous avez un projet financé",
"Click here to select the guidance of your plan":"Cliquez ici pour sélectionner les recommandations appliquées à votre plan",
"Click here to select the guidance of your plan": "Cliquez ici pour sélectionner les recommandations appliquées à votre plan",
"If your project is financed by one of the funders on the list, you can automatically retrieve the administrative information you entered when applying for a grant.": "Si votre projet est financé par l’un des financeurs de la liste, vous pouvez récupérer automatiquement les informations administratives que vous avez déjà saisies lors de la demande de subvention.",
"'{{projectTitle}}' project data has successfully been imported": "Données du projet '{{projectTitle}}' ont été importées avec succès.",
"An error occurred during the import of the project information": "Une erreur s'est produite lors de l'import des données projet",
Expand Down Expand Up @@ -128,7 +128,7 @@
"Attributed roles (Associated research outputs)": "Rôles attribués (Produits de recherche associés)",
"Add: person or organisation": "Ajouter : personne ou organisation",
"Edit: person or organisation": "Modifier : personne ou organisation",
"A problem has occurred while deleting the {{record}}" : "Un problème s'est produit lors de la suppression du {{record}}",
"A problem has occurred while deleting the {{record}}": "Un problème s'est produit lors de la suppression du {{record}}",
"comment": "commentaire",
"contributor": "contributeur",
"You are leading or participating in a research project, you are carrying out a research activity, you are preparing a doctorate.": "Vous dirigez ou participez à un projet de recherche, vous menez une activité de recherche, vous préparez un doctorat.",
Expand Down Expand Up @@ -158,12 +158,12 @@
"Select plan language": "Sélectionnez la langue du plan",
"Create your plan in 3 steps": "Créez votre plan en 3 étapes",
"Read article": "Lire l'article",
"Registration was successful !" :"L’enregistrement a été effectué avec succès !",
"List of customized forms" : "Liste de formulaires personnalisés",
"Cancel" : "Annuler",
"Registration was successful !": "L’enregistrement a été effectué avec succès !",
"List of customized forms": "Liste de formulaires personnalisés",
"Cancel": "Annuler",
"Templates from others organizations (<organizationsIcon />) or funders (<fundersIcon />)": "Autres modèles: financeurs (<fundersIcon />) ou organismes de recherche (<organizationsIcon />)",
"The template will be in English" : "Le modèle sera en anglais",
"The template will be in French":"Le modèle sera en français",
"The template will be in English": "Le modèle sera en anglais",
"The template will be in French": "Le modèle sera en français",
"Français": "Français",
"English (GB)": "English (GB)",
"Finish": "Terminer",
Expand Down Expand Up @@ -201,5 +201,22 @@
"Search...": "Rechercher...",
"Your plan does not yet include any research output": "Votre plan ne comporte encore aucun produit de recherche",
"Create a research output": "Créer un produit de recherche",
"A ‘type’ is required to create a search product.": "Un \"type\" est nécessaire pour créer un produit de recherche."
}
"A ‘type’ is required to create a search product.": "Un \"type\" est nécessaire pour créer un produit de recherche.",
"Template Mappings": "Correspondances de modèles",
"of": "sur",
"elements": "éléments",
"Filter": "Filtrer",
"Here you can map the sections of a structured template to the sections of a classic template.": "Ici, vous pouvez faire correspondre les sections d'un modèle structuré aux sections d'un modèle classique.",
"Target": "Cible",
"Target Template": "Modèle cible",
"Source Template": "Modèle source",
"Created At": "Créé le",
"Updated At": "Mis à jour le",
"No template mappings found": "Aucune correspondance de modèle trouvée",
"New Mapping": "Nouvelle correspondance",
"All Mappings": "Toutes les correspondances",
"Create Mapping": "Créer",
"Save mapping": "Enregistrer",
"Open a question in the target template to get started.": "Ouvrez une question dans le modèle cible pour commencer.",
"Edit Export Template": "Modifier le modèle d'export"
}
4 changes: 2 additions & 2 deletions src/__tests__/SectionsContent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, act } from "@testing-library/react";
import { BrowserRouter as Router } from "react-router-dom";
import "@testing-library/jest-dom/extend-expect";
import WritePlan from "../components/WritePlan/WritePlan";
import { writePlan } from "../services";
import { sectionsContent } from "../services";
import Global from "../components/context/Global";

jest.mock("../services/DmpWritePlanApi.js");
Expand Down Expand Up @@ -259,7 +259,7 @@ const mockSectionsData = {
};
describe("Redaction component", () => {
beforeEach(() => {
writePlan.getPlanData.mockResolvedValue(mockSectionsData);
sectionsContent.getPlanData.mockResolvedValue(mockSectionsData);
});

afterEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/WritePlan.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { render, fireEvent, screen, act } from "@testing-library/react";
import WritePlan from "../components/WritePlan/WritePlan";
import { writePlan } from "../services";
import { sectionsContent } from "../services";
import { GlobalContext } from "../components/context/Global";
import "@testing-library/jest-dom";
import { BrowserRouter as Router } from "react-router-dom";
Expand All @@ -26,7 +26,7 @@ const globalState = {

describe("WritePlan", () => {
beforeEach(() => {
writePlan.getPlanData.mockResolvedValue({
sectionsContent.getPlanData.mockResolvedValue({
data: {
plan: {
id: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { GlobalContext } from '../context/Global.jsx';
import {
createOptions,
createRegistryPlaceholder,
} from '../../utils/GeneratorUtils';
import { service } from '../../services';
} from '../../utils/GeneratorUtils.js';
import { service } from '../../services/index.js';
import * as styles from '../assets/css/form.module.css';
import CustomSelect from '../Shared/CustomSelect.jsx';
import FragmentList from './FragmentList.jsx';
Expand All @@ -21,8 +21,11 @@ import ModalForm from '../Forms/ModalForm.jsx';
import swalUtils from '../../utils/swalUtils.js';
import { getErrorMessage } from '../../utils/utils.js';
import { checkFragmentExists } from '../../utils/JsonFragmentsUtils.js';
import useSectionsMapping from '../../hooks/useSectionsMapping.js';
import CustomButton from '../Styled/CustomButton.jsx';
import MappingButton from './MappingButton.jsx';

function SelectWithCreate({
function DropdownsToEntryTable({
label,
formLabel,
propName,
Expand All @@ -32,13 +35,17 @@ function SelectWithCreate({
registries,
overridable = false,
readonly = false,
jsonPath = null
}) {
const { t } = useTranslation();
const {
locale,
loadedRegistries, setLoadedRegistries,
loadedTemplates, setLoadedTemplates,
} = useContext(GlobalContext);

const { mapping } = useSectionsMapping();

const { control } = useFormContext();
const { field } = useController({ control, name: propName });
const [show, setShow] = useState(false);
Expand Down Expand Up @@ -208,66 +215,77 @@ function SelectWithCreate({
</div>
<span className={styles.errorMessage}>{error}</span>
{/* ************Select ref************** */}
<div className="row">
{registries && registries.length > 1 && (
<div className="col-md-6">
<div className="row">
<div className={`col-md-11 ${styles.select_wrapper}`}>
<CustomSelect
onSelectChange={handleSelectRegistry}
options={registries.map((registry) => ({
value: registry,
label: registry,
}))}
name={propName}
selectedOption={
selectedRegistry ? { value: selectedRegistry, label: selectedRegistry } : null
}
isDisabled={readonly}
placeholder={t("Select a registry")}
/>
{mapping
? <CustomButton
title={t("Open element modal")}
handleClick={handleEdit}
buttonColor="rust"
/>
: <div className="row">
{registries && registries.length > 1 && (
<div className="col-md-6">
<div className="row">
<div className={`col-md-11 ${styles.select_wrapper}`}>
<CustomSelect
onSelectChange={handleSelectRegistry}
options={registries.map((registry) => ({
value: registry,
label: registry,
}))}
name={propName}
selectedOption={
selectedRegistry ? { value: selectedRegistry, label: selectedRegistry } : null
}
isDisabled={readonly}
placeholder={t("Select a registry")}
/>
<MappingButton path={jsonPath} label={label}/>
</div>
</div>
</div>
</div>
)}
)}

<div className={registries && registries.length > 1 ? "col-md-6" : "col-md-12"}>
<div className="row">
<div className={`col-md-11 ${styles.select_wrapper}`}>
{options && (
<CustomSelect
onSelectChange={handleSelectRegistryValue}
options={options}
name={propName}
isDisabled={readonly || !selectedRegistry}
async={options.length > ASYNC_SELECT_OPTION_THRESHOLD}
placeholder={createRegistryPlaceholder(registries, overridable, 'complex', t)}
overridable={false}
/>
<div className={registries && registries.length > 1 ? "col-md-6" : "col-md-12"}>
<div className="row">
<div className={`col-md-11 ${styles.select_wrapper}`}>
{options && (
<>
<CustomSelect
onSelectChange={handleSelectRegistryValue}
options={options}
name={propName}
isDisabled={readonly || !selectedRegistry}
async={options.length > ASYNC_SELECT_OPTION_THRESHOLD}
placeholder={createRegistryPlaceholder(registries, overridable, 'complex', t)}
overridable={false}
/>
<MappingButton path={jsonPath} label={label} />
</>
)}
</div>
{!readonly && overridable && (
<div className="col-md-1">
<ReactTooltip
id="select-with-create-add-button"
place="bottom"
effect="solid"
variant="info"
content={t('Add')}
/>
<FaPlus
data-tooltip-id="select-with-create-add-button"
onClick={() => {
setShow(true);
setIndex(null);
}}
className={styles.icon}
/>
</div>
)}
</div>
{!readonly && overridable && (
<div className="col-md-1">
<ReactTooltip
id="select-with-create-add-button"
place="bottom"
effect="solid"
variant="info"
content={t('Add')}
/>
<FaPlus
data-tooltip-id="select-with-create-add-button"
onClick={() => {
setShow(true);
setIndex(null);
}}
className={styles.icon}
/>
</div>
)}
</div>
</div>
</div>
}
<span className={styles.errorMessage}>{error}</span>
{template && (
<FragmentList
Expand All @@ -290,10 +308,11 @@ function SelectWithCreate({
show={show}
handleSave={handleSave}
handleClose={handleClose}
jsonPath={jsonPath}
/>
)}
</div>
);
}

export default SelectWithCreate;
export default DropdownsToEntryTable;
Loading