Skip to content

Follow-up from "Resolve "Shortest path not displayed in vulnerability page""

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

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

    suggestion (non-blocking): WDYT about renaming all these detail components so they are in accordance with the vue/multi-word-component-names eslint rule? I know we don't have an issue because we're setting the component name with [getComponentNameForType(...)] here and with VulnerabilityDetail... in report_item_graphql.vue but if we rename all the components, we can get rid of the eslint disable rule comment <!-- eslint-disable vue/multi-word-component-names --> for all those components.

    We can also do this in a follow-up.

    We could add _item at the end of each component and rework getComponentNameForType to be:

    export const getComponentNameForType = (reportType) =>
      `${capitalizeFirstCharacter(reportType)}Item`;

Possible implementation plan

  1. rename all components within ee/app/assets/javascripts/vulnerabilities/components/generic_report/types to be suffixed with _item -> e.g. url.vue -> url_item.vue
  2. Remove <!-- eslint-disable vue/multi-word-component-names --> eslint disable rule from all those components
  3. replace ReportType${capitalizeFirstCharacter(reportType)} with ${capitalizeFirstCharacter(reportType)}Item in getComponentNameForType
  4. Update component names in ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/component_map.js and ee/app/assets/javascripts/vulnerabilities/components/generic_report/report_item_graphql.vue
Edited by Lorenz van Herwaarden