Skip to content

[bug] Multiple UI issues in configuration editor for Device #910

@kkreitmair

Description

@kkreitmair

Describe the bug
There are two bugs in the configuration default editor for a Device in the admin.

  1. 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.
  2. 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:

  1. Go to the change view of an existing Device.
  2. Select the Configuration tab.
  3. Create a new Configuration for the section General.
  4. In the field timezone, set a value other than the default.
  5. Click Save and continue editing.
  6. 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:

  1. Go to the change view of an existing Device.
  2. Select the Configuration tab.
  3. Create a new Configuration for the section Mwan3. (I patched this into netjsonconfig from WIP: Openwrt: Add support for mwan3 netjsonconfig#232 because it has a property in its schema definition with type array and allows only unique items)
  4. Click Save and continue editing.
  5. 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:
openwisp_controller_config_editor_issue_1

GIF for showing the 2. Issue:
openwisp_controller_config_editor_issue_2

System Information:

  • OS: Debian 12
  • Python Version: 3.9.2
  • Django Version: 4.2.15
  • Browser and Browser Version (if applicable): Firefox and Chromium

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions