From ebf344af54203c526023b51c292c2261a6b38181 Mon Sep 17 00:00:00 2001 From: Alexander Turinske Date: Mon, 22 Sep 2025 21:32:52 -0600 Subject: [PATCH] Update MR widget to show bypassed policies - explicitly say policies are bypassed Changelog: added EE: true --- .../components/approvals/number_of_approvals.vue | 11 +++++++++++ locale/gitlab.pot | 3 +++ 2 files changed, 14 insertions(+) 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 731d33bb4b4dfa..29b916cb8df031 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 bd6de52dd6f8fe..c72bd374913691 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 "" -- GitLab