From 61b42d6dfaf9c7e80666733da68b2c88834db315 Mon Sep 17 00:00:00 2001 From: Andria Capai Date: Thu, 20 Apr 2023 10:40:36 +0200 Subject: [PATCH] feat: change order to emit event bEdit - Change order between change formService.changeData and bEditChange - Preprocess for types_site seems to be useless (see todo) Reviewed-by: andriac [Refs_ticket]: : #5 , #6 , #54 --- backend/gn_module_monitoring/monitoring/objects.py | 4 ++-- .../monitoring-properties-g.component.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/gn_module_monitoring/monitoring/objects.py b/backend/gn_module_monitoring/monitoring/objects.py index 3c334e28c..5217fd7e1 100644 --- a/backend/gn_module_monitoring/monitoring/objects.py +++ b/backend/gn_module_monitoring/monitoring/objects.py @@ -39,5 +39,5 @@ def preprocess_data(self, data): data["id_nomenclature_type_site"]=data["types_site"][0]['id_nomenclature_type_site'] #TODO: A enlever une fois qu'on aura enelever le champ "id_nomenclature_type_site" du model et de la bdd - - data['types_site'] = type_site_ids + # TODO: voir si nécessaire de faire tout se preprocess. Voici le comportement , si une relation existe déjà alors il le garde en bdd même si coté frontend on ne l'a pas + # data['types_site'] = type_site_ids diff --git a/frontend/app/components/monitoring-properties-g/monitoring-properties-g.component.ts b/frontend/app/components/monitoring-properties-g/monitoring-properties-g.component.ts index ec93302e3..d534aeee1 100644 --- a/frontend/app/components/monitoring-properties-g/monitoring-properties-g.component.ts +++ b/frontend/app/components/monitoring-properties-g/monitoring-properties-g.component.ts @@ -46,13 +46,13 @@ export class MonitoringPropertiesGComponent implements OnInit { } onEditClick() { - this.bEditChange.emit(true); this.selectedObj['id'] = this.selectedObj[this.selectedObj.pk]; this._formService.changeDataSub( this.selectedObj, this.objectType.objectType, this.objectType.endPoint ); + this.bEditChange.emit(true); } ngOnChanges(changes: SimpleChanges): void {