summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-11 17:04:49 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-11 17:04:49 +0000
commitbbfdfe0f69ec43862a3b2390002016bc7208bb43 (patch)
tree70c118ea2ca14efe160e598035438fc4323cda64
parent8e37e6808f9fb486ad750e6385b8f3a37aabc90a (diff)
downloadgitlab-ce-bbfdfe0f69ec43862a3b2390002016bc7208bb43.tar.gz
Add latest changes from gitlab-org/gitlab@15-11-stable-ee
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue53
-rw-r--r--locale/gitlab.pot58
2 files changed, 31 insertions, 80 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue b/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
index 25cf5335fb5..c19dfe663f4 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
@@ -5,7 +5,7 @@ import { STATUS_MERGED } from '~/issues/constants';
import { BV_SHOW_MODAL } from '~/lib/utils/constants';
import { HTTP_STATUS_UNAUTHORIZED } from '~/lib/utils/http_status';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
-import { s__, __, sprintf } from '~/locale';
+import { s__, __ } from '~/locale';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import eventHub from '../../event_hub';
import approvalsMixin from '../../mixins/approvals';
@@ -84,22 +84,13 @@ export default {
return Boolean(this.action);
},
invalidRules() {
- return this.approvals.approvalState?.rules?.filter((rule) => rule.invalid) || [];
- },
- invalidApprovedRules() {
- return this.invalidRules.filter((rule) => rule.allowMergeWhenInvalid);
- },
- invalidFailedRules() {
- return this.invalidRules.filter((rule) => !rule.allowMergeWhenInvalid);
+ return this.approvals.approvalState?.invalidApproversRules || [];
},
hasInvalidRules() {
return this.mr.mergeRequestApproversAvailable && this.invalidRules.length;
},
- hasInvalidApprovedRules() {
- return this.mr.mergeRequestApproversAvailable && this.invalidApprovedRules.length;
- },
- hasInvalidFailedRules() {
- return this.mr.mergeRequestApproversAvailable && this.invalidFailedRules.length;
+ invalidRulesText() {
+ return this.invalidRules.length;
},
approvedBy() {
return this.approvals.approvedBy?.nodes || [];
@@ -142,29 +133,11 @@ export default {
return null;
},
- pluralizedApprovedRuleText() {
- return this.invalidApprovedRules.length > 1
+ pluralizedRuleText() {
+ return this.invalidRules.length > 1
? this.$options.i18n.invalidRulesPlural
: this.$options.i18n.invalidRuleSingular;
},
- pluralizedFailedRuleText() {
- return this.invalidFailedRules.length > 1
- ? this.$options.i18n.invalidFailedRulesPlural
- : this.$options.i18n.invalidFailedRuleSingular;
- },
- pluralizedRuleText() {
- return [
- this.hasInvalidFailedRules
- ? sprintf(this.pluralizedFailedRuleText, { rules: this.invalidFailedRules.length })
- : null,
- this.hasInvalidApprovedRules
- ? sprintf(this.pluralizedApprovedRuleText, { rules: this.invalidApprovedRules.length })
- : null,
- ]
- .filter((text) => Boolean(text))
- .join(', ')
- .concat('.');
- },
},
methods: {
approve() {
@@ -232,13 +205,11 @@ export default {
FETCH_LOADING,
linkToInvalidRules: INVALID_RULES_DOCS_PATH,
i18n: {
- invalidRuleSingular: s__('mrWidget|%{rules} invalid rule has been approved automatically'),
- invalidRulesPlural: s__('mrWidget|%{rules} invalid rules have been approved automatically'),
- invalidFailedRuleSingular: s__(
- "mrWidget|%{dangerStart}%{rules} rule can't be approved%{dangerEnd}",
+ invalidRuleSingular: s__(
+ 'mrWidget|%{rules} invalid rule has been approved automatically, as no one can approve it.',
),
- invalidFailedRulesPlural: s__(
- "mrWidget|%{dangerStart}%{rules} rules can't be approved%{dangerEnd}",
+ invalidRulesPlural: s__(
+ 'mrWidget|%{rules} invalid rules have been approved automatically, as no one can approve them.',
),
learnMore: __('Learn more.'),
},
@@ -284,9 +255,7 @@ export default {
</div>
<div v-if="hasInvalidRules" class="gl-text-gray-400 gl-mt-2" data-testid="invalid-rules">
<gl-sprintf :message="pluralizedRuleText">
- <template #danger="{ content }">
- <span class="gl-font-weight-bold text-danger">{{ content }}</span>
- </template>
+ <template #rules>{{ invalidRulesText }}</template>
</gl-sprintf>
</div>
</div>
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index f5bbc5c5771..67c4b1f5a3b 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -859,6 +859,9 @@ msgstr ""
msgid "%{linkStart} Learn more%{linkEnd}."
msgstr ""
+msgid "%{linkStart}Approval settings%{linkEnd} prevent approvals by its eligible approvers."
+msgstr ""
+
msgid "%{listToShow}, and %{awardsListLength} more"
msgstr ""
@@ -5505,39 +5508,9 @@ msgstr ""
msgid "Approvals required"
msgstr ""
-msgid "Approvals|%{count} of %{total}"
-msgstr ""
-
-msgid "Approvals|Action required"
-msgstr ""
-
-msgid "Approvals|Auto approved"
-msgstr ""
-
-msgid "Approvals|It looks like there was a conflict between the rules for approving this Merge Request and the users who were eligible to approve it. As a result, the system has automatically approved it to keep things moving."
-msgstr ""
-
-msgid "Approvals|Rule automatically approved"
-msgstr ""
-
-msgid "Approvals|Rule cannot be approved"
-msgstr ""
-
msgid "Approvals|Section: %section"
msgstr ""
-msgid "Approvals|The number of people who need to approve this is more than those who are allowed to. Please ask the project owner to update %{securityPolicy}."
-msgstr ""
-
-msgid "Approvals|Verify the number of %{linkStart}eligible security approvers%{linkEnd} matches the required approvers for the security policy."
-msgstr ""
-
-msgid "Approvals|Verify your %{eligibleApproverLinkStart}eligible approvers%{eligibleApproverLinkEnd} and %{approvalSettingsLinkStart}approval settings%{approvalSettingsLinkEnd} agree with each other."
-msgstr ""
-
-msgid "Approvals|Verify your %{linkStart}approval settings%{linkEnd} do not conflict with this rule."
-msgstr ""
-
msgid "Approve"
msgstr ""
@@ -23773,6 +23746,9 @@ msgstr ""
msgid "Introducing Your DevOps Reports"
msgstr ""
+msgid "Invalid"
+msgstr ""
+
msgid "Invalid Insights config file detected"
msgstr ""
@@ -23836,6 +23812,9 @@ msgstr ""
msgid "Invalid repository path"
msgstr ""
+msgid "Invalid rules are automatically approved to unblock the merge request."
+msgstr ""
+
msgid "Invalid server response"
msgstr ""
@@ -24468,6 +24447,9 @@ msgstr ""
msgid "Issue|Title"
msgstr ""
+msgid "It doesn't have any %{linkStart}eligible approvers%{linkEnd}."
+msgstr ""
+
msgid "It looks like you're attempting to activate your subscription. Use %{a_start}the Subscription page%{a_end} instead."
msgstr ""
@@ -45638,6 +45620,9 @@ msgstr ""
msgid "This repository was last checked %{last_check_timestamp}. The check passed."
msgstr ""
+msgid "This rule is invalid because no one can approve it for one or more of these reasons:"
+msgstr ""
+
msgid "This runner will only run on pipelines triggered on protected branches"
msgstr ""
@@ -49868,6 +49853,9 @@ msgstr ""
msgid "Why can't I approve?"
msgstr ""
+msgid "Why is this rule invalid?"
+msgstr ""
+
msgid "Wiki"
msgstr ""
@@ -52958,12 +52946,6 @@ msgstr ""
msgid "mrWidget|%{boldStart}Ready to be merged automatically.%{boldEnd} Ask someone with write access to this repository to merge this request."
msgstr ""
-msgid "mrWidget|%{dangerStart}%{rules} rule can't be approved%{dangerEnd}"
-msgstr ""
-
-msgid "mrWidget|%{dangerStart}%{rules} rules can't be approved%{dangerEnd}"
-msgstr ""
-
msgid "mrWidget|%{mergeError}."
msgstr ""
@@ -52979,10 +52961,10 @@ msgstr ""
msgid "mrWidget|%{metricsLinkStart} Memory %{metricsLinkEnd} usage is %{emphasisStart} unchanged %{emphasisEnd} at %{memoryFrom}MB"
msgstr ""
-msgid "mrWidget|%{rules} invalid rule has been approved automatically"
+msgid "mrWidget|%{rules} invalid rule has been approved automatically, as no one can approve it."
msgstr ""
-msgid "mrWidget|%{rules} invalid rules have been approved automatically"
+msgid "mrWidget|%{rules} invalid rules have been approved automatically, as no one can approve them."
msgstr ""
msgid "mrWidget|A merge train is a queued list of merge requests waiting to be merged into the target branch. The changes in each merge request are combined with the changes in earlier merge requests and tested before merge."