Commit fadd6e5e authored by Dave Pisek's avatar Dave Pisek

Show generic 'code' type on vuln details

Adds a new Vue component to render the generic vulnerability report's
'code' type on both the vulnerability details page and the pipeline
security modal.
parent f924273d
<script>
import CodeBlock from '~/vue_shared/components/code_block.vue';
export default {
components: {
CodeBlock,
},
props: {
value: {
type: String,
required: true,
},
},
};
</script>
<template>
<code-block :code="value" />
</template>
......@@ -10,6 +10,7 @@ export const REPORT_TYPES = {
moduleLocation: 'module-location',
fileLocation: 'file-location',
table: 'table',
code: 'code',
};
const REPORT_TYPE_TO_COMPONENT_MAP = {
......@@ -22,6 +23,7 @@ const REPORT_TYPE_TO_COMPONENT_MAP = {
[REPORT_TYPES.moduleLocation]: () => import('./module_location.vue'),
[REPORT_TYPES.fileLocation]: () => import('./file_location.vue'),
[REPORT_TYPES.table]: () => import('./table.vue'),
[REPORT_TYPES.code]: () => import('./code.vue'),
};
export const getComponentNameForType = (reportType) =>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment