Closed nemesifier closed 6 years ago
When trying to make the hardware ID/serial number field readonly only for the change device page, I noticed that the following fields are not readonly in the change device page:
I would think that the values of these fields should not change for a specific device. On the other hand, there's the recurring usecase that a device is defective and needs to be replaced by a new one. Then it would be handy to use the existing device entry and just update the relevant fields, like serial number and mac address.
Thus I would suggest to not make the serial number field readonly. @nemesisdesign What do you think?
Another question: device context: do you mean #21?
@okraits makes sense allowing to change it, it's more flexible. In the future we may make a widget that shows it as readonly but allows changing it with a button if needed.
Regarding the device context I mean:
Follow up to mailing list discussion: https://groups.google.com/d/msg/openwisp/CGJKYfIregU/yd3-ma9GAAAJ
We should add a dedicated field in django-netjsonconfig with a generic name which can be used for any type of hardware ID. Since it's generic, we should be flexible in defining this field, but we know for sure it's going to be a unique alphanumeric string with a generous length, the database field can be NULL (and if an empty string is supplied it should be converted to None to avoid triggering the unique DB constraint error).
The field may or may not be required depending on a configuration (django setting), which makes it not required by default, which maintains backward compatibility.
The human readable label and the help text of the field should be configurable, by default we could use something like "Serial number", but it can be modified to use a different term depending on the context where it is used.
In my opinion this feature should be deactivated by by default and shown only when a specific setting is turned on.
When the feature is enabled, the following things should happen: