diff --git a/ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/number_of_approvals.vue b/ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/number_of_approvals.vue index 731d33bb4b4dfa2e11981dfac2ebb2d371029eba..29b916cb8df031f3e2bf4620f643a7aa773be0be 100644 --- a/ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/number_of_approvals.vue +++ b/ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/number_of_approvals.vue @@ -6,6 +6,7 @@ import { helpPagePath } from '~/helpers/help_page_helper'; const i18n = { autoApproved: s__('Approvals|Auto approved'), actionRequired: s__('Approvals|Action required'), + bypassed: __('Bypassed'), optional: __('Optional'), help: __('help'), countOfTotal: s__('Approvals|%{count} of %{total}'), @@ -58,11 +59,21 @@ export default { if (!this.rule.approvalsRequired) { return i18n.optional; } + if (this.hasBypassedSecurityPolicy) { + return i18n.bypassed; + } return sprintf(i18n.countOfTotal, { count: this.rule.approvedBy.nodes.length, total: this.rule.approvalsRequired, }); }, + hasBypassedSecurityPolicy() { + return ( + this.rule.scanResultPolicies.length && + this.rule.approved && + this.rule.approvedBy.nodes.length < this.rule.approvalsRequired + ); + }, hasInvalidRules() { return this.rule.invalid; }, diff --git a/locale/gitlab.pot b/locale/gitlab.pot index bd6de52dd6f8fe13b3224d737677148cae839512..c72bd374913691e38568d0d1cec57847848241d7 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -12176,6 +12176,9 @@ msgstr "" msgid "Bypass requested changes" msgstr "" +msgid "Bypassed" +msgstr "" + msgid "Bypassing blocking reviews will allow the merge request to be merged even if any reviewer has requested changes. This applies to future reviews as well." msgstr ""