OpenEnergyDashboard / OED

Open Energy Dashboard (OED)
Mozilla Public License 2.0
82 stars 307 forks source link

meter unit change #1042

Closed huss closed 8 months ago

huss commented 1 year ago

Is your feature request related to a problem? Please describe.

Changing the unit (not the default graphic unit) associated with a meter can have a ripple effect if it is used in a group. It is desirable to let the admin know this is the case and stop the change.

Describe the solution you'd like

The meter edit page will sweep Redux state to see if the meter is included in any group (via deep meters). If so, the admin will be told via a popup and the change of meter unit will not be allowed by resetting the menu back to the original value.

Describe alternatives you've considered

OED could put in the complex logic to see if the change is okay and fix up some issues. This is done in groups now so not redoing in meters seems much easier. This seems fine since changing a meter unit should not be common after adding to a group.

Additional context

If an admin wants to change the meter unit then they will need to:

  1. Remove the meter from all groups that include it.
  2. Change the meter unit.
  3. Add the meter back to the group(s) if that is permissible.
sparakala21 commented 1 year ago

I'm working on this! pretty close to being done!