Selected policy dropdown does not populate without an id

The following discussion from !147307 (merged) should be addressed:

  • @arfedoro started a discussion: (+1 comment)

    question (non-blocking)

    If I remove project id in yaml mode, there is weird border color difference:

    borders.mov

    What do you think about making style consistent? follow-up is also possible

Summary

  • when a user removes the id from the yaml, the selected policies dropdown does not populate

How to reproduce

  1. Upload a GitLab Ultimate license
  2. Enable the feature flag echo "Feature.enable(:compliance_pipeline_in_policies)" | rails c.
  3. Navigate to a project => Secure => Policies => New policy => Scan Execution Policy
  4. Add a new action => Run CI/CD code => Run Linked existing CI file
  5. Select a project
  6. Navigate to yaml mode and from the recently added id
  7. Navigate to rule mode

How to fix