From 6eb395c49604b1b44eda28ecdf0c7bfd1e7fa7c7 Mon Sep 17 00:00:00 2001
From: Savas Vedova <svedova@gitlab.com>
Date: Wed, 4 May 2022 15:29:16 +0300
Subject: [PATCH] Update text for the existing mr widget

Use `no new vulnerabilities` instead of `no vulnerabilities` when
there are no new vulnerabilities detected.

Changelog: changed
EE: true
---
 .../vue_shared/security_reports/store/utils.js     |  2 +-
 .../vue_mr_widget/ee_mr_widget_options_spec.js     |  6 +++---
 .../grouped_security_reports_app_spec.js           | 14 +++++++-------
 .../store/modules/api_fuzzing/getters_spec.js      |  2 +-
 .../store/modules/sast/getters_spec.js             |  2 +-
 .../store/modules/secret_detection/getters_spec.js |  2 +-
 .../security_reports/store/utils_spec.js           |  6 +++---
 locale/gitlab.pot                                  |  2 +-
 8 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/app/assets/javascripts/vue_shared/security_reports/store/utils.js b/app/assets/javascripts/vue_shared/security_reports/store/utils.js
index 458bacce91567..408b7be6dd01d 100644
--- a/app/assets/javascripts/vue_shared/security_reports/store/utils.js
+++ b/app/assets/javascripts/vue_shared/security_reports/store/utils.js
@@ -90,7 +90,7 @@ const createStatusMessage = ({ reportType, status, total }) => {
   if (status) {
     message = __('%{reportType} %{status}');
   } else if (!total) {
-    message = __('%{reportType} detected %{totalStart}no%{totalEnd} vulnerabilities.');
+    message = __('%{reportType} detected %{totalStart}no%{totalEnd} new vulnerabilities.');
   } else {
     message = __(
       '%{reportType} detected %{totalStart}%{total}%{totalEnd} potential %{vulnMessage}',
diff --git a/ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js b/ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
index a91bd21411529..31e4845fe3c08 100644
--- a/ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
+++ b/ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
@@ -188,7 +188,7 @@ describe('ee merge request widget options', () => {
               .find(`${SAST_SELECTOR} .report-block-list-issue-description`)
               .text(),
           ),
-        ).toEqual('SAST detected no vulnerabilities.');
+        ).toEqual('SAST detected no new vulnerabilities.');
       });
     });
 
@@ -299,7 +299,7 @@ describe('ee merge request widget options', () => {
               .find(`${DEPENDENCY_SCANNING_SELECTOR} .report-block-list-issue-description`)
               .text(),
           ),
-        ).toEqual('Dependency scanning detected no vulnerabilities.');
+        ).toEqual('Dependency scanning detected no new vulnerabilities.');
       });
     });
 
@@ -319,7 +319,7 @@ describe('ee merge request widget options', () => {
               .find(`${DEPENDENCY_SCANNING_SELECTOR} .report-block-list-issue-description`)
               .text(),
           ),
-        ).toEqual('Dependency scanning detected no vulnerabilities.');
+        ).toEqual('Dependency scanning detected no new vulnerabilities.');
       });
     });
 
diff --git a/ee/spec/frontend/vue_shared/security_reports/grouped_security_reports_app_spec.js b/ee/spec/frontend/vue_shared/security_reports/grouped_security_reports_app_spec.js
index bdbd663906fd5..e0b0e3c9ee1f3 100644
--- a/ee/spec/frontend/vue_shared/security_reports/grouped_security_reports_app_spec.js
+++ b/ee/spec/frontend/vue_shared/security_reports/grouped_security_reports_app_spec.js
@@ -251,28 +251,28 @@ describe('Grouped security reports app', () => {
 
         // Renders the summary text
         expect(findReportSummary().text()).toEqual(
-          'Security scanning detected no vulnerabilities.',
+          'Security scanning detected no new vulnerabilities.',
         );
 
         const wrapperText = wrapper.text();
 
         // Renders Sast result
-        expect(wrapperText).toContain('SAST detected no vulnerabilities.');
+        expect(wrapperText).toContain('SAST detected no new vulnerabilities.');
 
         // Renders DSS result
-        expect(wrapper.text()).toContain('Dependency scanning detected no vulnerabilities.');
+        expect(wrapper.text()).toContain('Dependency scanning detected no new vulnerabilities.');
 
         // Renders container scanning result
-        expect(wrapperText).toContain('Container scanning detected no vulnerabilities.');
+        expect(wrapperText).toContain('Container scanning detected no new vulnerabilities.');
 
         // Renders DAST result
-        expect(wrapperText).toContain('DAST detected no vulnerabilities.');
+        expect(wrapperText).toContain('DAST detected no new vulnerabilities.');
 
         // Renders Coverage Fuzzing result
-        expect(wrapperText).toContain('Coverage fuzzing detected no vulnerabilities.');
+        expect(wrapperText).toContain('Coverage fuzzing detected no new vulnerabilities.');
 
         // Renders API Fuzzing result
-        expect(wrapperText).toContain('API fuzzing detected no vulnerabilities.');
+        expect(wrapperText).toContain('API fuzzing detected no new vulnerabilities.');
       });
     });
 
diff --git a/ee/spec/frontend/vue_shared/security_reports/store/modules/api_fuzzing/getters_spec.js b/ee/spec/frontend/vue_shared/security_reports/store/modules/api_fuzzing/getters_spec.js
index eb8ea57f9ad6b..cfb973c7c2934 100644
--- a/ee/spec/frontend/vue_shared/security_reports/store/modules/api_fuzzing/getters_spec.js
+++ b/ee/spec/frontend/vue_shared/security_reports/store/modules/api_fuzzing/getters_spec.js
@@ -30,7 +30,7 @@ describe('groupedApiFuzzingText', () => {
       countMessage: '',
       critical: 0,
       high: 0,
-      message: 'API fuzzing detected %{totalStart}no%{totalEnd} vulnerabilities.',
+      message: 'API fuzzing detected %{totalStart}no%{totalEnd} new vulnerabilities.',
       other: 0,
       status: '',
       total: 0,
diff --git a/ee/spec/frontend/vue_shared/security_reports/store/modules/sast/getters_spec.js b/ee/spec/frontend/vue_shared/security_reports/store/modules/sast/getters_spec.js
index e1c9aaf95aca1..44acc20798dad 100644
--- a/ee/spec/frontend/vue_shared/security_reports/store/modules/sast/getters_spec.js
+++ b/ee/spec/frontend/vue_shared/security_reports/store/modules/sast/getters_spec.js
@@ -30,7 +30,7 @@ describe('groupedSastText', () => {
       countMessage: '',
       critical: 0,
       high: 0,
-      message: 'SAST detected %{totalStart}no%{totalEnd} vulnerabilities.',
+      message: 'SAST detected %{totalStart}no%{totalEnd} new vulnerabilities.',
       other: 0,
       status: '',
       total: 0,
diff --git a/ee/spec/frontend/vue_shared/security_reports/store/modules/secret_detection/getters_spec.js b/ee/spec/frontend/vue_shared/security_reports/store/modules/secret_detection/getters_spec.js
index 6747bddc0e4a1..364187c25f92e 100644
--- a/ee/spec/frontend/vue_shared/security_reports/store/modules/secret_detection/getters_spec.js
+++ b/ee/spec/frontend/vue_shared/security_reports/store/modules/secret_detection/getters_spec.js
@@ -30,7 +30,7 @@ describe('groupedSecretDetectionText', () => {
       countMessage: '',
       critical: 0,
       high: 0,
-      message: 'Secret detection detected %{totalStart}no%{totalEnd} vulnerabilities.',
+      message: 'Secret detection detected %{totalStart}no%{totalEnd} new vulnerabilities.',
       other: 0,
       status: '',
       total: 0,
diff --git a/ee/spec/frontend/vue_shared/security_reports/store/utils_spec.js b/ee/spec/frontend/vue_shared/security_reports/store/utils_spec.js
index 094e6615d2689..f07f871111ff3 100644
--- a/ee/spec/frontend/vue_shared/security_reports/store/utils_spec.js
+++ b/ee/spec/frontend/vue_shared/security_reports/store/utils_spec.js
@@ -117,7 +117,7 @@ describe('security reports utils', () => {
 
     it.each`
       vulnerabilities              | message                                                             | countMessage
-      ${undefined}                 | ${' detected %{totalStart}no%{totalEnd} vulnerabilities.'}          | ${''}
+      ${undefined}                 | ${' detected %{totalStart}no%{totalEnd} new vulnerabilities.'}      | ${''}
       ${{ critical }}              | ${` detected %{totalStart}2%{totalEnd} potential vulnerabilities`}  | ${`%{criticalStart}2 Critical%{criticalEnd} %{highStart}0 High%{highEnd} and %{otherStart}0 Others%{otherEnd}`}
       ${{ high }}                  | ${` detected %{totalStart}4%{totalEnd} potential vulnerabilities`}  | ${`%{criticalStart}0 Critical%{criticalEnd} %{highStart}4 High%{highEnd} and %{otherStart}0 Others%{otherEnd}`}
       ${{ other }}                 | ${` detected %{totalStart}7%{totalEnd} potential vulnerabilities`}  | ${`%{criticalStart}0 Critical%{criticalEnd} %{highStart}0 High%{highEnd} and %{otherStart}7 Others%{otherEnd}`}
@@ -146,7 +146,7 @@ describe('security reports utils', () => {
     it('should pass through the report type', () => {
       const reportType = 'HAL';
       expect(groupedTextBuilder({ reportType }).message).toEqual(
-        'HAL detected %{totalStart}no%{totalEnd} vulnerabilities.',
+        'HAL detected %{totalStart}no%{totalEnd} new vulnerabilities.',
       );
     });
 
@@ -233,7 +233,7 @@ describe('security reports utils', () => {
         countMessage: '',
         critical: 0,
         high: 0,
-        message: 'dummyReport detected %{totalStart}no%{totalEnd} vulnerabilities.',
+        message: 'dummyReport detected %{totalStart}no%{totalEnd} new vulnerabilities.',
         other: 0,
         status: '',
         total: 0,
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index d90273ef8db6b..50de84a560e2d 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -911,7 +911,7 @@ msgstr ""
 msgid "%{reportType} detected %{totalStart}%{total}%{totalEnd} potential %{vulnMessage}"
 msgstr ""
 
-msgid "%{reportType} detected %{totalStart}no%{totalEnd} vulnerabilities."
+msgid "%{reportType} detected %{totalStart}no%{totalEnd} new vulnerabilities."
 msgstr ""
 
 msgid "%{retryButtonStart}Try again%{retryButtonEnd} or %{newFileButtonStart}attach a new file%{newFileButtonEnd}."
-- 
GitLab