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/refact form #349

Merged
merged 57 commits into from
Jul 23, 2024
Merged

Feat/refact form #349

merged 57 commits into from
Jul 23, 2024

Conversation

amandine-sahl
Copy link
Contributor

No description provided.

@amandine-sahl
Copy link
Contributor Author

suite de #332 et #347

Base automatically changed from feat/config_with_bib_type_site to dev-suivi-eolien July 2, 2024 13:11
amandine-sahl and others added 27 commits July 2, 2024 15:27
Change return observable EMPTY by of(null)
in order to keep chained observable

Reviewed-by: andriacap
Remove old methods
Use loop on dynamicForm

WIP: problem on initialize formControl (see
geonature/frontend/src/app/GN2CommonModule/form/dynamic-form-generator/dynamic-form-generator.component.ts)

Reviewed-by: andriacap
Remove dataComplement on form component
Remove dataComplement in backend on create_or_update
(called and used in pre_process) --> Check if
"TODO" code if is still necessary

Reviewed-by: andriacap
On CREATION SITE
- Create objFormsDynamic
- Loop on these objFormsDynamic and display name for each group
- Update values for theses objFormsDynamic and link to objForm

TODO: Check if  EDITION SITE and other object type works

Reviewed-by: andriacap
Reviewed-by: andriacap
- Change condition to initFormDynamic
- Change condition to change typeSite on formValue

Reviewed-by: andriacap
- Remove place where variable called
- Centralize on subscribe of length of dynamicForm Array

Reviewed-by: andriacap
- Need to filtered on types_site link to obj.properties['types_site']
- Add method to filtered (TODO: check if exist everywhere in utils ?)

Reviewed-by: andriacap
- Fix Problem on specific operator (the forkjoin didn't work)
- No more used of forkjoin and use defer in order to wait for specificValues$
is well completed before to subscribe and apply formValue

Reviewed-by: andriacap
- Fix: Problem on delete type site in dynamic form (keep changes and
re initialize values same as begining of edition)
- Refact(wip) : code on onInit to be more readable

Reviewed-by: andriacap
- Move outside initialize typeSiteConfig to generate objFomDynamic
- Add doc for all methods added

Reviewed-by: andriacap
Add check if dynamicFormArray exist in objForm

Reviewed-by: andriac
Reviewed-by: andriacap
- Remove return observable and remove pipe operator

Reviewed-by: andriac
- FIXME : need to send only ids of types site
and not types site as string (fix in backend)

Reviewed-by: andriac
@TheoLechemia TheoLechemia force-pushed the feat/refact-form branch 2 times, most recently from 15b033a to 4aca99b Compare July 18, 2024 12:05
@amandine-sahl amandine-sahl merged commit a738231 into dev-suivi-eolien Jul 23, 2024
1 of 5 checks passed
@amandine-sahl amandine-sahl deleted the feat/refact-form branch July 23, 2024 09:27
amandine-sahl added a commit that referenced this pull request Jul 29, 2024
* Remove customSpecConfig

* Limitation de l'appel à get_config

* Add test module config

* refact(wip): type site config with obj

Reviewed-by: andriacap

* refact(wip): init typeSite, generic and specific conf

Reviewed: andriaca

* refact(wip): make observable to init form componen

Reviewed-by: andriacap

* fix: change EMPTY to of(null)

Change return observable EMPTY by of(null)
in order to keep chained observable

Reviewed-by: andriacap

* refact(wip) : refact form component

Remove old methods
Use loop on dynamicForm

WIP: problem on initialize formControl (see
geonature/frontend/src/app/GN2CommonModule/form/dynamic-form-generator/dynamic-form-generator.component.ts)

Reviewed-by: andriacap

* refact: delete "dataComplement"

Remove dataComplement on form component
Remove dataComplement in backend on create_or_update
(called and used in pre_process) --> Check if
"TODO" code if is still necessary

Reviewed-by: andriacap

* refact:add extra dynamic form

On CREATION SITE
- Create objFormsDynamic
- Loop on these objFormsDynamic and display name for each group
- Update values for theses objFormsDynamic and link to objForm

TODO: Check if  EDITION SITE and other object type works

Reviewed-by: andriacap

* style: apply linter prettier

Reviewed-by: andriacap

* fix: unused code and fix condition

- Change condition to initFormDynamic
- Change condition to change typeSite on formValue

Reviewed-by: andriacap

* refact: changed way to subscribe to dynamicForm

- Remove place where variable called
- Centralize on subscribe of length of dynamicForm Array

Reviewed-by: andriacap

* fix: problem on init objFormDynamic on Edit object

- Need to filtered on types_site link to obj.properties['types_site']
- Add method to filtered (TODO: check if exist everywhere in utils ?)

Reviewed-by: andriacap

* fix/refact: change the way to initialize objForm

- Fix Problem on specific operator (the forkjoin didn't work)
- No more used of forkjoin and use defer in order to wait for specificValues$
is well completed before to subscribe and apply formValue

Reviewed-by: andriacap

* refact: remove unused code and use JSonData type

Reviewed-by: andriacap

* refact/fix: code bloc onInit and fix keep changes

- Fix: Problem on delete type site in dynamic form (keep changes and
re initialize values same as begining of edition)
- Refact(wip) : code on onInit to be more readable

Reviewed-by: andriacap

* refact(wip): more readable by separate concerns

Reviewed-by: andriacap

* refact(wip): move method to formService and utils

Reviewed-by: andriacap

* refact/doc: add docs and move dynamicForm$

- Move outside initialize typeSiteConfig to generate objFomDynamic
- Add doc for all methods added

Reviewed-by: andriacap

* fix: error for object without dynamicFormArray

Add check if dynamicFormArray exist in objForm

Reviewed-by: andriac

* refact: remove unused/useless code/commençant

Reviewed-by: andriacap

* style: lint frontend

Reviewed-by: andriacap

* Simplification code

* fix: remove return observable for objFormdefintion

- Remove return observable and remove pipe operator

Reviewed-by: andriac

* fix: check if list of types_site are integer

- FIXME : need to send only ids of types site
and not types site as string (fix in backend)

Reviewed-by: andriac

* fix: get all properties of additional data

Reviewed-by: andriacap

* fix: keep types sites prop from other modules

Backend :Need to add some code in backend to store extra
properties in order to find them in frontend

Frontend (form-component) : Get extra properties
stores in "additional_keys" in order to target them
when properties are filtered in post/patch method.

Reviewed-by: andriacp

* fix: use ids type site update when submit

Reviewed-by: andriacap

* Remove form-g and change route names

* Black

* refactor additionnal fields type site

* format

* fix update

* fix routing errors

* fix routing

* Use form component for site creation

* Rename component

* fix display properties in site manager

* Ne pas tenir compte du module lors de la récupération des sites parents

* Remove form-g + Routing

* Add child from datatable-g

* Prettier

* Navigation depuis le groupe de site

* Bloquer l'ajout de visite depuis generic site create

* Add parent path

* Popup

* Prettier

* Breadcrumb

* Correction pytest

* Router

* change permission order

* do not filter by module if generic module

* add missing grp_site object to monitoring module

* don't call group site group if no grp site

* fix routing

---------

Co-authored-by: Andria Capai <[email protected]>
Co-authored-by: TheoLechemia <[email protected]>
Co-authored-by: Théo Lechémia <[email protected]>
amandine-sahl added a commit that referenced this pull request Oct 4, 2024
* Remove customSpecConfig

* Limitation de l'appel à get_config

* Add test module config

* refact(wip): type site config with obj

Reviewed-by: andriacap

* refact(wip): init typeSite, generic and specific conf

Reviewed: andriaca

* refact(wip): make observable to init form componen

Reviewed-by: andriacap

* fix: change EMPTY to of(null)

Change return observable EMPTY by of(null)
in order to keep chained observable

Reviewed-by: andriacap

* refact(wip) : refact form component

Remove old methods
Use loop on dynamicForm

WIP: problem on initialize formControl (see
geonature/frontend/src/app/GN2CommonModule/form/dynamic-form-generator/dynamic-form-generator.component.ts)

Reviewed-by: andriacap

* refact: delete "dataComplement"

Remove dataComplement on form component
Remove dataComplement in backend on create_or_update
(called and used in pre_process) --> Check if
"TODO" code if is still necessary

Reviewed-by: andriacap

* refact:add extra dynamic form

On CREATION SITE
- Create objFormsDynamic
- Loop on these objFormsDynamic and display name for each group
- Update values for theses objFormsDynamic and link to objForm

TODO: Check if  EDITION SITE and other object type works

Reviewed-by: andriacap

* style: apply linter prettier

Reviewed-by: andriacap

* fix: unused code and fix condition

- Change condition to initFormDynamic
- Change condition to change typeSite on formValue

Reviewed-by: andriacap

* refact: changed way to subscribe to dynamicForm

- Remove place where variable called
- Centralize on subscribe of length of dynamicForm Array

Reviewed-by: andriacap

* fix: problem on init objFormDynamic on Edit object

- Need to filtered on types_site link to obj.properties['types_site']
- Add method to filtered (TODO: check if exist everywhere in utils ?)

Reviewed-by: andriacap

* fix/refact: change the way to initialize objForm

- Fix Problem on specific operator (the forkjoin didn't work)
- No more used of forkjoin and use defer in order to wait for specificValues$
is well completed before to subscribe and apply formValue

Reviewed-by: andriacap

* refact: remove unused code and use JSonData type

Reviewed-by: andriacap

* refact/fix: code bloc onInit and fix keep changes

- Fix: Problem on delete type site in dynamic form (keep changes and
re initialize values same as begining of edition)
- Refact(wip) : code on onInit to be more readable

Reviewed-by: andriacap

* refact(wip): more readable by separate concerns

Reviewed-by: andriacap

* refact(wip): move method to formService and utils

Reviewed-by: andriacap

* refact/doc: add docs and move dynamicForm$

- Move outside initialize typeSiteConfig to generate objFomDynamic
- Add doc for all methods added

Reviewed-by: andriacap

* fix: error for object without dynamicFormArray

Add check if dynamicFormArray exist in objForm

Reviewed-by: andriac

* refact: remove unused/useless code/commençant

Reviewed-by: andriacap

* style: lint frontend

Reviewed-by: andriacap

* Simplification code

* fix: remove return observable for objFormdefintion

- Remove return observable and remove pipe operator

Reviewed-by: andriac

* fix: check if list of types_site are integer

- FIXME : need to send only ids of types site
and not types site as string (fix in backend)

Reviewed-by: andriac

* fix: get all properties of additional data

Reviewed-by: andriacap

* fix: keep types sites prop from other modules

Backend :Need to add some code in backend to store extra
properties in order to find them in frontend

Frontend (form-component) : Get extra properties
stores in "additional_keys" in order to target them
when properties are filtered in post/patch method.

Reviewed-by: andriacp

* fix: use ids type site update when submit

Reviewed-by: andriacap

* Remove form-g and change route names

* Black

* refactor additionnal fields type site

* format

* fix update

* fix routing errors

* fix routing

* Use form component for site creation

* Rename component

* fix display properties in site manager

* Ne pas tenir compte du module lors de la récupération des sites parents

* Remove form-g + Routing

* Add child from datatable-g

* Prettier

* Navigation depuis le groupe de site

* Bloquer l'ajout de visite depuis generic site create

* Add parent path

* Popup

* Prettier

* Breadcrumb

* Correction pytest

* Router

* change permission order

* do not filter by module if generic module

* add missing grp_site object to monitoring module

* don't call group site group if no grp site

* fix routing

---------

Co-authored-by: Andria Capai <[email protected]>
Co-authored-by: TheoLechemia <[email protected]>
Co-authored-by: Théo Lechémia <[email protected]>
amandine-sahl added a commit that referenced this pull request Oct 4, 2024
* Remove customSpecConfig

* Limitation de l'appel à get_config

* Add test module config

* refact(wip): type site config with obj

Reviewed-by: andriacap

* refact(wip): init typeSite, generic and specific conf

Reviewed: andriaca

* refact(wip): make observable to init form componen

Reviewed-by: andriacap

* fix: change EMPTY to of(null)

Change return observable EMPTY by of(null)
in order to keep chained observable

Reviewed-by: andriacap

* refact(wip) : refact form component

Remove old methods
Use loop on dynamicForm

WIP: problem on initialize formControl (see
geonature/frontend/src/app/GN2CommonModule/form/dynamic-form-generator/dynamic-form-generator.component.ts)

Reviewed-by: andriacap

* refact: delete "dataComplement"

Remove dataComplement on form component
Remove dataComplement in backend on create_or_update
(called and used in pre_process) --> Check if
"TODO" code if is still necessary

Reviewed-by: andriacap

* refact:add extra dynamic form

On CREATION SITE
- Create objFormsDynamic
- Loop on these objFormsDynamic and display name for each group
- Update values for theses objFormsDynamic and link to objForm

TODO: Check if  EDITION SITE and other object type works

Reviewed-by: andriacap

* style: apply linter prettier

Reviewed-by: andriacap

* fix: unused code and fix condition

- Change condition to initFormDynamic
- Change condition to change typeSite on formValue

Reviewed-by: andriacap

* refact: changed way to subscribe to dynamicForm

- Remove place where variable called
- Centralize on subscribe of length of dynamicForm Array

Reviewed-by: andriacap

* fix: problem on init objFormDynamic on Edit object

- Need to filtered on types_site link to obj.properties['types_site']
- Add method to filtered (TODO: check if exist everywhere in utils ?)

Reviewed-by: andriacap

* fix/refact: change the way to initialize objForm

- Fix Problem on specific operator (the forkjoin didn't work)
- No more used of forkjoin and use defer in order to wait for specificValues$
is well completed before to subscribe and apply formValue

Reviewed-by: andriacap

* refact: remove unused code and use JSonData type

Reviewed-by: andriacap

* refact/fix: code bloc onInit and fix keep changes

- Fix: Problem on delete type site in dynamic form (keep changes and
re initialize values same as begining of edition)
- Refact(wip) : code on onInit to be more readable

Reviewed-by: andriacap

* refact(wip): more readable by separate concerns

Reviewed-by: andriacap

* refact(wip): move method to formService and utils

Reviewed-by: andriacap

* refact/doc: add docs and move dynamicForm$

- Move outside initialize typeSiteConfig to generate objFomDynamic
- Add doc for all methods added

Reviewed-by: andriacap

* fix: error for object without dynamicFormArray

Add check if dynamicFormArray exist in objForm

Reviewed-by: andriac

* refact: remove unused/useless code/commençant

Reviewed-by: andriacap

* style: lint frontend

Reviewed-by: andriacap

* Simplification code

* fix: remove return observable for objFormdefintion

- Remove return observable and remove pipe operator

Reviewed-by: andriac

* fix: check if list of types_site are integer

- FIXME : need to send only ids of types site
and not types site as string (fix in backend)

Reviewed-by: andriac

* fix: get all properties of additional data

Reviewed-by: andriacap

* fix: keep types sites prop from other modules

Backend :Need to add some code in backend to store extra
properties in order to find them in frontend

Frontend (form-component) : Get extra properties
stores in "additional_keys" in order to target them
when properties are filtered in post/patch method.

Reviewed-by: andriacp

* fix: use ids type site update when submit

Reviewed-by: andriacap

* Remove form-g and change route names

* Black

* refactor additionnal fields type site

* format

* fix update

* fix routing errors

* fix routing

* Use form component for site creation

* Rename component

* fix display properties in site manager

* Ne pas tenir compte du module lors de la récupération des sites parents

* Remove form-g + Routing

* Add child from datatable-g

* Prettier

* Navigation depuis le groupe de site

* Bloquer l'ajout de visite depuis generic site create

* Add parent path

* Popup

* Prettier

* Breadcrumb

* Correction pytest

* Router

* change permission order

* do not filter by module if generic module

* add missing grp_site object to monitoring module

* don't call group site group if no grp site

* fix routing

---------

Co-authored-by: Andria Capai <[email protected]>
Co-authored-by: TheoLechemia <[email protected]>
Co-authored-by: Théo Lechémia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants