Commit 968b8186 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'avoid-using-gl-object' into 'master'

Fix outdated MR security warning message

See merge request gitlab-org/gitlab!23496
parents e07468f5 bc88c631
---
title: Fix outdated MR security warning message
merge_request: 23496
author:
type: fixed
......@@ -318,6 +318,7 @@ export default {
:can-create-issue="mr.canCreateIssue"
:can-create-merge-request="mr.canCreateMergeRequest"
:can-dismiss-vulnerability="mr.canDismissVulnerability"
:diverged-commits-count="mr.divergedCommitsCount"
/>
<mr-widget-licenses
v-if="shouldRenderLicenseReport"
......
......@@ -113,6 +113,11 @@ export default {
type: Boolean,
required: true,
},
divergedCommitsCount: {
type: Number,
required: false,
default: 0,
},
},
componentNames,
computed: {
......@@ -154,10 +159,7 @@ export default {
return this.enabledReports.sast;
},
subHeadingText() {
const mrDivergedCommitsCount =
(gl && gl.mrWidgetData && gl.mrWidgetData.diverged_commits_count) || 0;
const isMRBranchOutdated = mrDivergedCommitsCount > 0;
const isMRBranchOutdated = this.divergedCommitsCount > 0;
if (isMRBranchOutdated) {
return sprintf(
s__(
......
......@@ -354,6 +354,7 @@ describe('Grouped security reports app', () => {
createWrapper({
...props,
divergedCommitsCount: 1,
targetBranch: 'master',
enabledReports: {
sast: true,
......
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