Commit 12aa2fcf authored by Phil Hughes's avatar Phil Hughes

Merge branch '4310-security-reports' into 'master'

Improve UI in security reports

See merge request gitlab-org/gitlab-ee!4124
parents 17e4fcbc 2de81e3a
...@@ -785,10 +785,6 @@ ...@@ -785,10 +785,6 @@
} }
.mr-widget-code-quality { .mr-widget-code-quality {
.ci-status-icon-warning svg {
fill: $theme-gray-600;
}
.code-quality-container { .code-quality-container {
border-top: 1px solid $gray-darker; border-top: 1px solid $gray-darker;
padding: $gl-padding-top; padding: $gl-padding-top;
...@@ -796,7 +792,7 @@ ...@@ -796,7 +792,7 @@
margin: $gl-padding -16px -16px; margin: $gl-padding -16px -16px;
.mr-widget-code-quality-info { .mr-widget-code-quality-info {
padding-left: 12px; padding-left: 10px;
} }
.mr-widget-dast-code { .mr-widget-dast-code {
...@@ -805,34 +801,29 @@ ...@@ -805,34 +801,29 @@
.mr-widget-code-quality-list { .mr-widget-code-quality-list {
list-style: none; list-style: none;
padding: 0 12px; padding: 0 2px 0 0;
margin: 0; margin: 0;
line-height: $code_line_height; line-height: $code_line_height;
.mr-widget-code-quality-icon { .mr-widget-code-quality-list-item {
margin-right: 12px; display: flex;
fill: currentColor;
svg {
width: 10px;
height: 10px;
}
} }
.success { .failed .mr-widget-code-quality-icon {
color: $green-500; color: $red-500;
} }
.failed { .success .mr-widget-code-quality-icon {
color: $red-500; color: $green-500;
} }
.neutral { .neutral .mr-widget-code-quality-icon {
color: $gl-gray-light; color: $theme-gray-700;
} }
.modal-body { .mr-widget-code-quality-icon {
color: $gl-text-color; margin: -5px 4px 0 0;
fill: currentColor;
} }
} }
} }
......
---
title: Update UI for merge widget reports
merge_request:
author:
type: changed
<script> <script>
/* eslint-disable vue/require-default-prop */ import { __ } from '~/locale';
import statusIcon from '~/vue_merge_request_widget/components/mr_widget_status_icon.vue'; import statusIcon from '~/vue_merge_request_widget/components/mr_widget_status_icon.vue';
import loadingIcon from '~/vue_shared/components/loading_icon.vue'; import loadingIcon from '~/vue_shared/components/loading_icon.vue';
import issuesBlock from './mr_widget_report_issues.vue'; import issuesBlock from './mr_widget_report_issues.vue';
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
infoText: { infoText: {
type: String, type: String,
required: false, required: false,
default: null,
}, },
hasPriority: { hasPriority: {
type: Boolean, type: Boolean,
...@@ -62,7 +63,7 @@ ...@@ -62,7 +63,7 @@
data() { data() {
return { return {
collapseText: 'Expand', collapseText: __('Expand'),
isCollapsed: true, isCollapsed: true,
}; };
}, },
...@@ -92,7 +93,7 @@ ...@@ -92,7 +93,7 @@
toggleCollapsed() { toggleCollapsed() {
this.isCollapsed = !this.isCollapsed; this.isCollapsed = !this.isCollapsed;
const text = this.isCollapsed ? 'Expand' : 'Collapse'; const text = this.isCollapsed ? __('Expand') : __('Collapse');
this.collapseText = text; this.collapseText = text;
}, },
}, },
...@@ -103,28 +104,40 @@ ...@@ -103,28 +104,40 @@
<div <div
v-if="isLoading" v-if="isLoading"
class="media"> class="media"
<div class="mr-widget-icon"> >
<div
class="mr-widget-icon"
>
<loading-icon /> <loading-icon />
</div> </div>
<div class="media-body"> <div
class="media-body"
>
{{ loadingText }} {{ loadingText }}
</div> </div>
</div> </div>
<div <div
v-else-if="isSuccess" v-else-if="isSuccess"
class="media"> class="media"
<status-icon :status="statusIconName" /> >
<status-icon
:status="statusIconName"
/>
<div class="media-body space-children"> <div
<span class="js-code-text"> class="media-body space-children"
>
<span
class="js-code-text"
>
{{ successText }} {{ successText }}
</span> </span>
<button <button
type="button" type="button"
class="btn-link btn-blank" class="btn pull-right btn-sm"
v-if="hasIssues" v-if="hasIssues"
@click="toggleCollapsed" @click="toggleCollapsed"
> >
......
<script> <script>
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import { spriteIcon } from '~/lib/utils/common_utils'; import icon from '~/vue_shared/components/icon.vue';
import modal from './mr_widget_dast_modal.vue'; import modal from './mr_widget_dast_modal.vue';
const modalDefaultData = { const modalDefaultData = {
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
name: 'MrWidgetReportIssues', name: 'MrWidgetReportIssues',
components: { components: {
modal, modal,
icon,
}, },
props: { props: {
issues: { issues: {
...@@ -41,15 +42,18 @@ ...@@ -41,15 +42,18 @@
return modalDefaultData; return modalDefaultData;
}, },
computed: { computed: {
icon() {
return this.isStatusSuccess ? spriteIcon('plus') : this.cutIcon;
},
cutIcon() {
return spriteIcon('cut');
},
fixedLabel() { fixedLabel() {
return s__('ciReport|Fixed:'); return s__('ciReport|Fixed:');
}, },
iconName() {
if (this.isStatusFailed) {
return 'status_failed_borderless';
} else if (this.isStatusSuccess) {
return 'status_success_borderless';
}
return 'status_created_borderless';
},
isStatusFailed() { isStatusFailed() {
return this.status === 'failed'; return this.status === 'failed';
}, },
...@@ -114,15 +118,15 @@ ...@@ -114,15 +118,15 @@
success: isStatusSuccess, success: isStatusSuccess,
neutral: isStatusNeutral neutral: isStatusNeutral
}" }"
class="mr-widget-code-quality-list-item"
v-for="(issue, index) in issues" v-for="(issue, index) in issues"
:key="index" :key="index"
> >
<icon
<span
class="mr-widget-code-quality-icon" class="mr-widget-code-quality-icon"
v-html="icon" :name="iconName"
> :size="32"
</span> />
<template v-if="isStatusSuccess && isTypeQuality">{{ fixedLabel }}</template> <template v-if="isStatusSuccess && isTypeQuality">{{ fixedLabel }}</template>
<template v-if="shouldRenderPriority(issue)">{{ issue.priority }}:</template> <template v-if="shouldRenderPriority(issue)">{{ issue.priority }}:</template>
......
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