Duplicate vulnerability-details component
This duplicates the existing `vulnerability-details` component, and replaces its `details` prop with a `vulnerability` prop. To achieve this, the data transformations which turned a `vulnerability` object into a `details` object have been naively copied into this new component. The main data transformation is copied mostly verbatim from the [SET_MODAL_DATA mutation][1] in the Security Dashboard store, rather than from [SET_ISSUE_MODAL_DATA][2] mutation in the security reports store in the Merge Request page. This is because the former is slightly more complete than the latter: - it includes the project the vulnerability belongs to - it includes the report type of the vulnerability - it includes line number information for the `file`, if it exists The latter, however, includes the method in which the vulnerability was detected, if it exists. All this is to say that in addition to rendering everything the old component did, the new component: - in the MR context: - includes the project the vulnerability belongs to (if available) - includes the report type of the vulnerability (if available) - includes line number information for the `file` (if available) - in the Security Dashboard context: - includes the method in which the vulnerability was detected (if available) The [secondary transformation `valuedFields`][3] is copied almost verbatim from the containing modal. [1]: https://gitlab.com/gitlab-org/gitlab/blob/v12.8.1-ee/ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/mutations.js#L76-158 [2]: https://gitlab.com/gitlab-org/gitlab/blob/v12.8.1-ee/ee/app/assets/javascripts/vue_shared/security_reports/store/mutations.js#L135-172 [3]: https://gitlab.com/gitlab-org/gitlab/blob/v12.8.1-ee/ee/app/assets/javascripts/vue_shared/security_reports/components/modal.vue#L123-138
Showing
Please register or sign in to comment