UX bug: policy error message showing an YAML mode hint while user is editing in UI mode

Problem

While I am editing the UI and putting empty variables, the error message tells me that I need to go to Yaml mode to change something. It actually should highlight the UI mode and tell me that the variable key/value can't be empty

current prefered
Screenshot_2023-07-21_at_14.43.57 Screenshot_2023-07-21_at_14.55.10

There is a similar problem for all required values (e.g. in the below picture, if a user hasn't selected a policy type for a scan result policy, they get several errors, which do not direct them to select a policy type)

image

This is related to Policy Creation: Show error when required appro... (#395545 - closed) (i.e. when the backend emits an error, the frontend should add an error border around the problem in rule mode and give a more meaningful error message).

Old approach

Similar to that issue, the backend needs to be updated to add additional information

Scenario Screenshot
approver error message (making use of validationErrors) image
invalid variables error message image

Implementation

For variables

For general case (e.g. variables, branches, branch_type, ...)

Implementation

  • frontend parse errors in editor_component and add red outline to the specific component that caused the error
Edited by Alexander Turinske