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

Settings hierarchy should be returned. #171

Open
caspiano opened this issue Aug 16, 2021 · 1 comment
Open

Settings hierarchy should be returned. #171

caspiano opened this issue Aug 16, 2021 · 1 comment
Labels
priority: medium type: bug something isn't working type: discussion Issue that can be resolved with discussion

Comments

@caspiano
Copy link
Contributor

caspiano commented Aug 16, 2021

Describe the bug

A ControlSystem associated with a Zone will not render the inherited settings from the Zone.

To reproduce

  1. Place a ControlSystem in a Zone
  2. Add settings to Zone
  3. Attempt to view settings of ControlSystem

Expected behaviour

Zone's settings should be propagated to child systems/zones when rendered in backoffice.

Suggested fix

Currently, the settings for a model are only those that apply.
An additional route parameter include_hierarchy should be added to encapsulate the desired behaviour.

Additional context

PlaceOS/backoffice#216

@caspiano caspiano added the type: bug something isn't working label Aug 16, 2021
@caspiano caspiano self-assigned this Aug 16, 2021
@stakach
Copy link
Member

stakach commented Aug 29, 2021

following the discussion, potentially have two lists:

  • explicit_zones: [level_3, system_type_2]
  • zones: [org, building, level_3, build_2020, system_type_2]

where the zones list is generated by the api in API responses? (keeps the model logic simple as people change zone parents etc)

The driver logic in core relies on having the complete zones list, but could be a reasonably simple update by making def zones perform the lookups based on the explicit zones

Things to consider:

  1. ordering is quite important when generating the zone list
  2. updates to parent zones will need to trigger driver update logic for any children

@caspiano caspiano added type: discussion Issue that can be resolved with discussion priority: medium labels May 3, 2022
@caspiano caspiano removed their assignment Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium type: bug something isn't working type: discussion Issue that can be resolved with discussion
Projects
None yet
Development

No branches or pull requests

2 participants