Repository navigation
fix: do not suggest joining the parent's group to an asset that has joined it - #2959
Conversation
…oined it The properties page hinted that an asset should set `group` to its parent whenever the parent defines a power-capacity, also when the asset's flex-model already references the parent as its group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v43ZLVBreH3X7JVufb Signed-off-by: F.N. Claessen <claessen@seita.nl>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v43ZLVBreH3X7JVufb Signed-off-by: F.N. Claessen <claessen@seita.nl>
|
📖 2 files modified Preview · build overview · flexmeasures · built Dec. 5, 2026, 10:51 a.m. UTC |
…its parent's group Keep parent_has_power_capacity a fact about the parent and pass joined_parent_group on its own, so the group field's info panel no longer drops the parent's power-capacity for a grouped child, and says the device is in the parent's group (without the 'use parent as group' button). It reads the group as it stands in the editor. A group id written as a string counts too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: F.N. Claessen <claessen@seita.nl>
Flix6x
left a comment
There was a problem hiding this comment.
Self-review. The alert is gone on a child whose group is its parent, and the test covers it (it fails without the fix). A nice side effect: a grouped child that has its own power-capacity and children (a transformer under a site) now gets the "Child assets can reference this asset as their group" hint, which the old alert used to hide.
One thing the PR missed: parent_has_power_capacity also feeds the page's JS, in the group field's own info panel. On a grouped child that panel now drops the parent's power-capacity and says "Consider using the parent asset … as the group", with the "Use parent asset … as group" button: still a suggestion to do what is done.
I'm pushing a fix to this branch: parent_has_power_capacity stays a fact about the parent and joined_parent_group goes to the template on its own. The panel reads the group as it stands in the editor and says "This device's group is the parent asset …, so it counts toward the parent's power-capacity", without the button. Ids are compared as strings, so a group stored as {"asset": "5"} counts too. The test also checks the page still tells its JS the parent has a power-capacity.
|
Follow-ups of the review:
|
Keep both sides in the changelog's New features and Bugfixes lists (this PR's entries and main's #2713 and #2959 entries); the API changelog entry stays in main's open section, v3.0-38, and the v1.1.0 section is there once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: F.N. Claessen <claessen@seita.nl>
Description
An asset's properties page shows a hint in its flex-model editor when the parent asset defines a
power-capacity:"Consider setting
group: {"asset": <parent id>}so this device counts toward the parent's limit."It showed that hint also on assets whose flex-model already sets
groupto that parent, which suggests to the user that something is missing when the setup is complete.The view now leaves the hint out when the asset's
groupalready references its parent.flexmeasures/ui/views/assets/views.pytest_group_field_hints_on_properties_pagewith a child that has joined its parent's group (fails without the fix)How to test
Or in the UI: give a parent asset a flex-model with
power-capacity, give a child asset a flex-model with"group": {"asset": <parent id>}, and open the child's properties page: no hint to setgroup. A child withoutgroupstill gets the hint.Related Items
Found while configuring transformers (with a
power-capacity) and the devices behind them as groups.🤖 Generated with Claude Code
https://claude.ai/code/session_01DWv6v43ZLVBreH3X7JVufb