Fix Jauge always reading the object's most recent row
A Jauge could only target a whole object, not a specific record — three gauges pointing at the same "value" field (e.g. Réputation/ Trésorerie/Confiance in one "jauge" object) all silently showed the most recent row's value, with no way to tell them apart. Add "Enregistrement (ligne) à suivre" (row_id) so a Jauge targets one specific row, and "Champ contenant le nom" (champ_nom) to show a label above the bar — both as dropdowns populated from the object's actual fields/rows (previously "Champ numérique à afficher" was free text the user had to type correctly by hand). No regression: without row_id the widget still falls back to the latest row, exactly as before. Extract data_definition_options() (rows+fields for a definition) out of routes/screens/screen_edit.py so controls_with_values.py can reuse it server-side for the initial render; a small client-side handler (bindJaugeDefinitionSelect) repopulates the same selects live when the tracked object is changed without leaving the panel. Verified live with Playwright: picking "jauge" then "Confiance" then "value"/"name" in the panel renders an 80%-filled, green-leaning bar labelled "Confiance" on /play — not the 20%/50% of the other rows.
This commit is contained in:
@@ -43,6 +43,7 @@ from .widgets.layout_capable_widgets import LAYOUT_CAPABLE_WIDGETS
|
||||
from .widgets.font_options import GOOGLE_FONTS_LINK
|
||||
from .widgets.widget_meta import widget_meta
|
||||
from .widgets.controls_with_values import controls_with_values
|
||||
from .widgets.data_definition_options import data_definition_options
|
||||
|
||||
from .labels.trigger_labels import TRIGGER_LABELS
|
||||
from .labels.action_type_labels import ACTION_TYPE_LABELS
|
||||
|
||||
Reference in New Issue
Block a user