Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kkreitmair opened this issue Aug 21, 2024 · 2 comments · Fixed by #913
Closed

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

kkreitmair opened this issue Aug 21, 2024 · 2 comments · Fixed by #913
Labels

Comments

@kkreitmair
Copy link
Contributor

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
@kkreitmair kkreitmair added the bug label Aug 21, 2024
@kkreitmair
Copy link
Contributor Author

I will open a PR for the bug fix in the next days.

@nemesifier
Copy link
Member

Thank you very much for reporting this @okraits @kkreitmair, I didn't notice this yet.

kkreitmair added a commit that referenced this issue Aug 23, 2024
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 in the Device config editor. This happens only,
in combination of the lib select2.  The cause of the issue is, that
the jsonschema-ui.js version does use a deprecated way to initialize
select2 inputs. This commit will fix this issue by updating the way of
initializing the inputs.

Fixes #910

Signed-off-by: Konrad Kreitmair <[email protected]>
kkreitmair added a commit that referenced this issue Aug 23, 2024
…910

This addresses the problem, that the drop-down for Configuration Menu
and Object Properties are not shown anymore in the device config
editor, if a configuration section is saved, which has in its JSON
schema definition a property with type array and should have unique
items. The cause of the problem is a call to super, when there is no
super. This commit will fix this issue by removing the call to super,
because it is not needed in this special case neither in all other
cases.

Fixes #910

Signed-off-by: Konrad Kreitmair <[email protected]>
nemesifier pushed a commit that referenced this issue Sep 5, 2024
…910

This addresses the problem, that the drop-down for Configuration Menu
and Object Properties are not shown anymore in the device config
editor, if a configuration section is saved, which has in its JSON
schema definition a property with type array and should have unique
items. The cause of the problem is a call to super, when there is no
super. This commit will fix this issue by removing the call to super,
because it is not needed in this special case neither in all other
cases.

Fixes #910

Signed-off-by: Konrad Kreitmair <[email protected]>
praptisharma28 pushed a commit that referenced this issue Sep 9, 2024
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 in the Device config editor. This happens only,
in combination of the lib select2.  The cause of the issue is, that
the jsonschema-ui.js version does use a deprecated way to initialize
select2 inputs. This commit will fix this issue by updating the way of
initializing the inputs.

Fixes #910

Signed-off-by: Konrad Kreitmair <[email protected]>
praptisharma28 pushed a commit that referenced this issue Sep 9, 2024
…910

This addresses the problem, that the drop-down for Configuration Menu
and Object Properties are not shown anymore in the device config
editor, if a configuration section is saved, which has in its JSON
schema definition a property with type array and should have unique
items. The cause of the problem is a call to super, when there is no
super. This commit will fix this issue by removing the call to super,
because it is not needed in this special case neither in all other
cases.

Fixes #910

Signed-off-by: Konrad Kreitmair <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants