Commit 36421944 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/228922/fixMergeBlockedText' into 'master'

Fixed incorrect merge disabled text showing

See merge request gitlab-org/gitlab!82206
parents 3892e4e9 3a7a22c5
import { __ } from '~/locale';
export const MERGE_DISABLED_TEXT = __(
'Merge blocked: all merge request dependencies must be merged or closed.',
);
export const MERGE_DISABLED_TEXT = __('You can only merge once the items above are resolved.');
export const MERGE_DISABLED_SKIPPED_PIPELINE_TEXT = __(
"Merge blocked: pipeline must succeed. It's waiting for a manual job to continue.",
);
......
......@@ -15,6 +15,9 @@ export const MERGE_DISABLED_TEXT_UNAPPROVED = s__(
export const PIPELINE_MUST_SUCCEED_CONFLICT_TEXT = __(
'A CI/CD pipeline must run and be successful before merge.',
);
export const MERGE_DISABLED_DEPENDENCIES_TEXT = __(
'Merge blocked: all merge request dependencies must be merged or closed.',
);
export default {
computed: {
......@@ -31,15 +34,18 @@ export default {
this.mr.preventMerge,
);
},
hasBlockingMergeRequests() {
return (
(this.mr.blockingMergeRequests?.visible_merge_requests?.merged?.length || 0) !==
(this.mr.blockingMergeRequests?.total_count || 0)
);
},
shouldShowMergeControls() {
if (this.glFeatures.restructuredMrWidget) {
return this.restructuredWidgetShowMergeButtons;
}
if (
(this.mr.blockingMergeRequests?.visible_merge_requests?.merged?.length || 0) !==
(this.mr.blockingMergeRequests?.total_count || 0)
) {
if (this.hasBlockingMergeRequests) {
return false;
}
......@@ -48,6 +54,8 @@ export default {
mergeDisabledText() {
if (this.isApprovalNeeded) {
return MERGE_DISABLED_TEXT_UNAPPROVED;
} else if (this.hasBlockingMergeRequests) {
return MERGE_DISABLED_DEPENDENCIES_TEXT;
}
return base.computed.mergeDisabledText.call(this);
......
......@@ -42156,6 +42156,9 @@ msgstr ""
msgid "You can only edit files when you are on a branch"
msgstr ""
msgid "You can only merge once the items above are resolved."
msgstr ""
msgid "You can only transfer the project to namespaces you manage."
msgstr ""
......
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