Network and WiFi controller: provisioning, configuration management and updates, (pull via openwisp-config or push via SSH), x509 PKI management and more. Mainly OpenWRT, but designed to work also on other systems.
Describe the bug
There are two bugs in the configuration default editor for a Device in the admin.
For select fields, with predefined values in the corresponding JSON schema, when a value is saved other than the default, the field will be empty after saving. The saved value is though present in the advanced mode editor. This happens only, in combination of the lib select2. See also corresponding GIF below.
The dropdown for Configuration Menu and Object Properties are not shown anymore, if a configuration section is saved, which has in its JSON schema definition a property with type array and should have unique items (such as Mwan3) . See also corresponding GIF below.
Steps To Reproduce
Steps to reproduce the behavior for the 1. Issue:
Go to the change view of an existing Device.
Select the Configuration tab.
Create a new Configuration for the section General.
In the field timezone, set a value other than the default.
Click Save and continue editing.
Scroll down to the configuration section General. The previous selected and saved value is not shown.
Steps to reproduce the behavior for the 2. Issue:
Go to the change view of an existing Device.
Select the Configuration tab.
Create a new Configuration for the section Mwan3. (I patched this into netjsonconfig from https://github.com/openwisp/netjsonconfig/pull/232 because it has a property in its schema definition with type array and allows only unique items)
Click Save and continue editing.
Scroll down to the configuration section and click Configuration Menu. The menu dropdown will not show up, but all configuration fields will be disabled.
Expected behavior
Expected behavior for the 1. Issue:
The saved value, should always be displayed.
Expected behavior for the 2. Issue:
The dropdown menu of the Configuration Menu and the Object Properties should be always displayed.
Screenshots
GIF for showing the 1. Issue:
GIF for showing the 2. Issue:
System Information:
OS: Debian 12
Python Version: 3.9.2
Django Version: 4.2.15
Browser and Browser Version (if applicable): Firefox and Chromium
Describe the bug There are two bugs in the configuration default editor for a Device in the admin.
select2
. See also corresponding GIF below.Configuration Menu
andObject Properties
are not shown anymore, if a configuration section is saved, which has in its JSON schema definition a property with type array and should have unique items (such as Mwan3) . See also corresponding GIF below.Steps To Reproduce Steps to reproduce the behavior for the 1. Issue:
General
.Save and continue editing
.General
. The previous selected and saved value is not shown.Steps to reproduce the behavior for the 2. Issue:
Mwan3
. (I patched this into netjsonconfig from https://github.com/openwisp/netjsonconfig/pull/232 because it has a property in its schema definition with type array and allows only unique items)Save and continue editing
.Configuration Menu
. The menu dropdown will not show up, but all configuration fields will be disabled.Expected behavior Expected behavior for the 1. Issue: The saved value, should always be displayed.
Expected behavior for the 2. Issue: The dropdown menu of the
Configuration Menu
and theObject Properties
should be always displayed.Screenshots GIF for showing the 1. Issue:
GIF for showing the 2. Issue:
System Information: