2p2r / velobs_web

Application web permettant aux cyclistes de signaler les problèmes sur les aménagements cyclables.
GNU General Public License v3.0
22 stars 14 forks source link

category treeview not loaded when a new category/subcategory is created #189

Closed gerald2545 closed 5 years ago

gerald2545 commented 6 years ago

if no observation is linked to one of the newly created subcategory, the treeview is not displayed at all. malformed response : [{'id': '1',text: 'Observations',iconCls: 'iconmarker2',expanded: true,checked: true,leaf: false,children: [{id: '2',text: 'Aménagement mal conçu (35)',iconCls: 'iconmarker2',leaf: true,},{id: '18',text: 'Supports vélo (2)',iconCls: 'iconmarker16',leaf: true,},{id: '3',text: 'Défaut d\'entretien ou détériorations (12)',iconCls: 'iconmarker17',leaf: true,},{id: '19',text: 'Jalonnement (2)',iconCls: 'iconmarker13',leaf: true,},{id: '4',text: 'Absence d\'aménagement (23)',iconCls: 'iconmarker2',leaf: true,},{id: '16',text: 'Stationnement gênant (1)',iconCls: 'iconmarker3',leaf: true,},{id: '14',text: 'Chicanes (6)',iconCls: 'iconmarker18',leaf: true,}]},{'id': '2',text: 'Sas, 2sens, Laisser passage',iconCls: 'iconmarker9',expanded: true,checked: true,leaf: false,children: [{id: '88',text: 'Double Sens manquant (21)',iconCls: 'iconmarker88',leaf: true,},{id: '89',text: 'Sas manquant (6)',iconCls: 'iconmarker87',leaf: true,},{id: '17',text: 'Laissez le passage cyclistes (36)',iconCls: 'iconmarker19',leaf: true,}]}}]

response OK [{'id': '1',text: 'Observations',iconCls: 'iconmarker2',expanded: true,checked: true,leaf: false,children: [{id: '2',text: 'Aménagement mal conçu (35)',iconCls: 'iconmarker2',leaf: true,},{id: '18',text: 'Supports vélo (2)',iconCls: 'iconmarker16',leaf: true,},{id: '3',text: 'Défaut d\'entretien ou détériorations (12)',iconCls: 'iconmarker17',leaf: true,},{id: '19',text: 'Jalonnement (2)',iconCls: 'iconmarker13',leaf: true,},{id: '4',text: 'Absence d\'aménagement (23)',iconCls: 'iconmarker2',leaf: true,},{id: '16',text: 'Stationnement gênant (1)',iconCls: 'iconmarker3',leaf: true,},{id: '14',text: 'Chicanes (6)',iconCls: 'iconmarker18',leaf: true,}]},{'id': '2',text: 'Sas, 2sens, Laisser passage',iconCls: 'iconmarker9',expanded: true,checked: true,leaf: false,children: [{id: '88',text: 'Double Sens manquant (21)',iconCls: 'iconmarker88',leaf: true,},{id: '89',text: 'Sas manquant (6)',iconCls: 'iconmarker87',leaf: true,},{id: '17',text: 'Laissez le passage cyclistes (36)',iconCls: 'iconmarker19',leaf: true,}]},{'id_': '4',text: 'Piétons',iconCls: 'iconmarker205',expanded: true,checked: true,leaf: false,children: [{id: '90',text: 'Piétons détériorations (1)',iconCls: 'iconmarker205',leaf: true,}]}]

returns all category/subcategory, event if there is no rexord associated?