openwisp/openwisp-network-topology

[change] Add set of properties meant to be manipulated by the user in Node and Link

Closed this issue · 0 comments

Right now, properties of nodes and links are editable by users, but get mixed with properties which are automatically determined from the topology data, which is confusing for the user.

Here's what I think it would be best:

  • add a user_properties field on Node and Link, ensure this field uses the django-flat-json-widget in the admin, place the new field after properties, label it something like user defined properties, the help_text could be "If you need to add additional data to this node | link (word depends on model) use this field"
  • make the old properties field readonly, and show it in the UI as a list of keys and values
  • in the model, make sure the new user properties are added to the other properties when generating the json data, but make sure these user generated properties are not shown when the original argument is passed as True
  • ensure there's a test which checks the user properties are displayed in the json data, one test for node and one test for link