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

Custom branding: add validation to the plugin's settings #4446

Closed
11 tasks done
Tracked by #4392
Desvelao opened this issue Sep 6, 2022 · 6 comments · Fixed by #4503, #4768 or #4769
Closed
11 tasks done
Tracked by #4392

Custom branding: add validation to the plugin's settings #4446

Desvelao opened this issue Sep 6, 2022 · 6 comments · Fixed by #4503, #4768 or #4769
Assignees
Labels
type/enhancement Enhancement issue

Comments

@Desvelao
Copy link
Member

Desvelao commented Sep 6, 2022

Description

We'll add validation to the settings of the plugin, so no invalid values can be set in the Settings / Configuration section.

Objective

  • Display errors when the input is invalid.
  • Highlight the settings which contain errors.
  • Disable configuration saving when there are errors.

Tasks

  • Frontend
    • Add validation to each type of input component when its value changes.
    • Highlight the errors of each input.
      • Display the cause of error.
      • Add warning icon to the setting with the errors.
    • Disable the save button when there are errors due to invalid values.
    • Add unit tests
    • Add unit tests for InputForm of each setting.
  • Backend
    • Validate route and body parameters of the following endpoints:
      • PUT /utils/configuration
      • PUT /utils/configuration/files/{key}
    • Tests

Depends on: #4443

@Desvelao Desvelao added the type/bug Bug issue label Sep 6, 2022
@Desvelao Desvelao self-assigned this Sep 6, 2022
@Desvelao Desvelao added type/enhancement Enhancement issue and removed type/bug Bug issue labels Sep 6, 2022
@Desvelao
Copy link
Member Author

Desvelao commented Sep 7, 2022

Add feedback to the form's input

The management of the inputs for the plugin's settings has been improved. The following features have been added:

  • An error message is added to the input when its value is invalid.
  • The invalid settings are now highlighted in red.
  • A warning icon is appended to the invalid settings.
  • The total count of invalid settings is now shown in the bottom status bar.
  • The button to save the configuration is disabled when there are invalid values.

Screenshots

  • Input's validation, invalid settings highlight, error count display and disabled of the save button.
    image

  • Warning icon added to the invalid settings, reason displayed on mouse over.
    image

@Desvelao
Copy link
Member Author

Desvelao commented Sep 8, 2022

  • Added validation to each setting of the plugin in the frontend and the backend.

@AlexRuiz7 AlexRuiz7 mentioned this issue Sep 12, 2022
13 tasks
@Desvelao Desvelao linked a pull request Sep 13, 2022 that will close this issue
@AlexRuiz7 AlexRuiz7 changed the title Add validation to the plugin settings Custom branding: add validation to the plugin's settings Sep 14, 2022
@Desvelao
Copy link
Member Author

Desvelao commented Sep 19, 2022

  • Fixed some settings validation errors
  • Updated the development branch with the last changes of the base branch

@Desvelao
Copy link
Member Author

Desvelao commented Sep 21, 2022

  • Added tests to validate the updating of plugin settings using the API endpoint PUT /utils/configuration. (WIP)

@vikman90 vikman90 added this to the Release 4.4.0 milestone Sep 26, 2022
@Desvelao
Copy link
Member Author

Desvelao commented Oct 7, 2022

In the validation, we should consider the values used by cloud environments, to be sure these pass the setting validations.

Some plugin configurations to keep in mind:

@asteriscos
Copy link
Member

asteriscos commented Oct 31, 2022

I created a new PR related to this issue to add de validation description to multi-line inputs description.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment