[Frontend] Improve from yaml validation

Why are we doing this work

Yaml validation when switching between modes only supports keys validations

It should also support values validation

Use the backend schema to validate

Relevant links

Non-functional requirements

  • Documentation:
  • Feature flag:
  • Performance:
  • Testing:

Implementation plan

  1. Refactor:

    1. ee/app/assets/javascripts/security_orchestration/components/policy_editor/scan_result/lib/from_yaml.js
    2. ee/app/assets/javascripts/security_orchestration/components/policy_editor/scan_execution/lib/from_yaml.js
    3. ee/app/assets/javascripts/security_orchestration/components/policy_editor/pipeline_execution/utils.js

    fromYaml method, so it also supports check of yaml values, not only keys, using the backend schema

Verification steps

Edited by Alexander Turinske