Commit bc88c631 authored by Dheeraj Joshi's avatar Dheeraj Joshi

Fix outdated MR security warning

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