Commit e11af694 authored by Miguel Rincon's avatar Miguel Rincon

Merge branch '218485-update-vulnerability-page-styling' into 'master'

Improve design for vulnerability details

See merge request gitlab-org/gitlab!43274
parents c6a47799 84a0b771
...@@ -16,7 +16,7 @@ export default { ...@@ -16,7 +16,7 @@ export default {
</script> </script>
<template> <template>
<li :data-testid="valueName"> <li :data-testid="valueName" class="gl-list-style-none gl-ml-0! gl-mb-4">
<gl-sprintf :message="sprintfMessage"> <gl-sprintf :message="sprintfMessage">
<template #label="{ content }"> <template #label="{ content }">
<strong data-testid="label">{{ content }}</strong> <strong data-testid="label">{{ content }}</strong>
......
...@@ -91,7 +91,12 @@ export default { ...@@ -91,7 +91,12 @@ export default {
}, },
shouldShowLocation() { shouldShowLocation() {
return ( return (
this.location.crash_address || this.location.crash_type || this.location.stacktrace_snippet this.location.crash_address ||
this.location.crash_type ||
this.location.stacktrace_snippet ||
this.location.file ||
this.location.image ||
this.location.operating_system
); );
}, },
}, },
...@@ -123,12 +128,7 @@ export default { ...@@ -123,12 +128,7 @@ export default {
<detail-item :sprintf-message="__('%{labelStart}Severity:%{labelEnd} %{severity}')"> <detail-item :sprintf-message="__('%{labelStart}Severity:%{labelEnd} %{severity}')">
<severity-badge :severity="vulnerability.severity" class="gl-display-inline ml-1" /> <severity-badge :severity="vulnerability.severity" class="gl-display-inline ml-1" />
</detail-item> </detail-item>
<detail-item <detail-item :sprintf-message="__('%{labelStart}Scan Type:%{labelEnd} %{reportType}')"
v-if="vulnerability.evidence"
:sprintf-message="__('%{labelStart}Evidence:%{labelEnd} %{evidence}')"
>{{ vulnerability.evidence }}
</detail-item>
<detail-item :sprintf-message="__('%{labelStart}Report Type:%{labelEnd} %{reportType}')"
>{{ vulnerability.report_type }} >{{ vulnerability.report_type }}
</detail-item> </detail-item>
<detail-item <detail-item
...@@ -151,14 +151,20 @@ export default { ...@@ -151,14 +151,20 @@ export default {
</component> </component>
</detail-item> </detail-item>
<detail-item <detail-item
v-if="location.image" v-if="location.class"
:sprintf-message="__('%{labelStart}Image:%{labelEnd} %{image}')" :sprintf-message="__('%{labelStart}Class:%{labelEnd} %{class}')"
>{{ location.image }} >{{ location.class }}
</detail-item> </detail-item>
<detail-item <detail-item
v-if="location.operating_system" v-if="location.method"
:sprintf-message="__('%{labelStart}Namespace:%{labelEnd} %{namespace}')" :sprintf-message="__('%{labelStart}Method:%{labelEnd} %{method}')"
>{{ location.operating_system }} >
<code>{{ location.method }}</code>
</detail-item>
<detail-item
v-if="vulnerability.evidence"
:sprintf-message="__('%{labelStart}Evidence:%{labelEnd} %{evidence}')"
>{{ vulnerability.evidence }}
</detail-item> </detail-item>
</ul> </ul>
...@@ -166,35 +172,31 @@ export default { ...@@ -166,35 +172,31 @@ export default {
<h3>{{ __('Location') }}</h3> <h3>{{ __('Location') }}</h3>
<ul> <ul>
<detail-item <detail-item
v-if="location.crash_address" v-if="location.image"
:sprintf-message="__('%{labelStart}Crash Address:%{labelEnd} %{crash_address}')" :sprintf-message="__('%{labelStart}Image:%{labelEnd} %{image}')"
>{{ location.crash_address }} >{{ location.image }}
</detail-item> </detail-item>
<detail-item <detail-item
v-if="location.stacktrace_snippet" v-if="location.operating_system"
:sprintf-message="__('%{labelStart}Crash State:%{labelEnd} %{stacktrace_snippet}')" :sprintf-message="__('%{labelStart}Namespace:%{labelEnd} %{namespace}')"
> >{{ location.operating_system }}
<code-block :code="location.stacktrace_snippet" max-height="225px" />
</detail-item> </detail-item>
</ul> <detail-item
</template> v-if="location.file"
:sprintf-message="__('%{labelStart}File:%{labelEnd} %{file}')"
<template v-if="location.file"> >
<h3>{{ __('Location') }}</h3>
<ul>
<detail-item :sprintf-message="__('%{labelStart}File:%{labelEnd} %{file}')">
<gl-link :href="fileUrl" target="_blank">{{ fileText }}</gl-link> <gl-link :href="fileUrl" target="_blank">{{ fileText }}</gl-link>
</detail-item> </detail-item>
<detail-item <detail-item
v-if="location.class" v-if="location.crash_address"
:sprintf-message="__('%{labelStart}Class:%{labelEnd} %{class}')" :sprintf-message="__('%{labelStart}Crash Address:%{labelEnd} %{crash_address}')"
>{{ location.class }} >{{ location.crash_address }}
</detail-item> </detail-item>
<detail-item <detail-item
v-if="location.method" v-if="location.stacktrace_snippet"
:sprintf-message="__('%{labelStart}Method:%{labelEnd} %{method}')" :sprintf-message="__('%{labelStart}Crash State:%{labelEnd} %{stacktrace_snippet}')"
> >
<code>{{ location.method }}</code> <code-block :code="location.stacktrace_snippet" max-height="225px" />
</detail-item> </detail-item>
</ul> </ul>
</template> </template>
...@@ -202,7 +204,11 @@ export default { ...@@ -202,7 +204,11 @@ export default {
<template v-if="vulnerability.links && vulnerability.links.length"> <template v-if="vulnerability.links && vulnerability.links.length">
<h3>{{ __('Links') }}</h3> <h3>{{ __('Links') }}</h3>
<ul> <ul>
<li v-for="(link, index) in vulnerability.links" :key="`${index}:${link.url}`"> <li
v-for="(link, index) in vulnerability.links"
:key="`${index}:${link.url}`"
class="gl-ml-0! gl-list-style-position-inside"
>
<gl-link <gl-link
:href="link.url" :href="link.url"
data-testid="link" data-testid="link"
...@@ -222,6 +228,7 @@ export default { ...@@ -222,6 +228,7 @@ export default {
<li <li
v-for="(identifier, index) in vulnerability.identifiers" v-for="(identifier, index) in vulnerability.identifiers"
:key="`${index}:${identifier.url}`" :key="`${index}:${identifier.url}`"
class="gl-ml-0! gl-list-style-position-inside"
> >
<gl-link :href="identifier.url" data-testid="identifier" target="_blank"> <gl-link :href="identifier.url" data-testid="identifier" target="_blank">
{{ identifier.name }} {{ identifier.name }}
......
---
title: Improve design for vulnerability details
merge_request: 43274
author:
type: changed
...@@ -36,7 +36,7 @@ describe('Vulnerability Details', () => { ...@@ -36,7 +36,7 @@ describe('Vulnerability Details', () => {
expect(getText('title')).toBe(vulnerability.title); expect(getText('title')).toBe(vulnerability.title);
expect(getText('description')).toBe(vulnerability.description); expect(getText('description')).toBe(vulnerability.description);
expect(wrapper.find(SeverityBadge).props('severity')).toBe(vulnerability.severity); expect(wrapper.find(SeverityBadge).props('severity')).toBe(vulnerability.severity);
expect(getText('reportType')).toBe(`Report Type: ${vulnerability.report_type}`); expect(getText('reportType')).toBe(`Scan Type: ${vulnerability.report_type}`);
expect(getById('image').exists()).toBe(false); expect(getById('image').exists()).toBe(false);
expect(getById('os').exists()).toBe(false); expect(getById('os').exists()).toBe(false);
......
...@@ -537,7 +537,7 @@ msgstr "" ...@@ -537,7 +537,7 @@ msgstr ""
msgid "%{labelStart}Namespace:%{labelEnd} %{namespace}" msgid "%{labelStart}Namespace:%{labelEnd} %{namespace}"
msgstr "" msgstr ""
msgid "%{labelStart}Report Type:%{labelEnd} %{reportType}" msgid "%{labelStart}Scan Type:%{labelEnd} %{reportType}"
msgstr "" msgstr ""
msgid "%{labelStart}Scanner:%{labelEnd} %{scanner}" msgid "%{labelStart}Scanner:%{labelEnd} %{scanner}"
......
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