Make dependency row props optional when data is absent

What does this MR do and why?

The dependency list shows dependencies fetched over REST. Two props fail validation when the data lacks certain fields. Dependencies fetched via REST have no hasDependencyPaths field, and rows without a license scan have no licenses field. The child components dependency_location.vue and dependency_license_links.vue required both props, causing warnings on render.

The warnings are: prop "hasDependencyPaths". Expected Boolean, got Undefined and prop "licenses". Expected Array, got Undefined.

Fix: the hasDependencyPaths prop now defaults to false (it only guards a v-if). The licenses prop now defaults to [] (the component already has guards for Array.isArray).

Changes made:

  • ee/app/assets/javascripts/dependencies/components/dependency_location.vue
  • ee/app/assets/javascripts/dependencies/components/dependency_license_links.vue

How to set up and validate locally

  1. Go to Secure > Dependency list in a project with dependencies.
  2. Verify the list shows dependencies without errors.
  3. Check the browser console shows no [Vue warn] line for these warnings.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

References

🤖 Generated with Claude Code

Edited by Miguel Rincon

Merge request reports

Loading
Loading