Commit be136a07 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'mr-widget-merge-error-ee' into 'master'

EE port of mr-widget-merge-error

See merge request gitlab-org/gitlab-ee!13496
parents f7053458 a25b9fb3
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
</script> </script>
<template> <template>
<div class="m-3 ml-5" :class="messageClass"> <div class="m-3 ml-7" :class="messageClass">
<slot></slot> <slot></slot>
<gl-link v-if="helpPath" :href="helpPath" target="_blank"> <gl-link v-if="helpPath" :href="helpPath" target="_blank">
<icon :size="16" name="question-o" class="align-middle" /> <icon :size="16" name="question-o" class="align-middle" />
......
...@@ -35,9 +35,7 @@ export default { ...@@ -35,9 +35,7 @@ export default {
<status-icon status="warning" /> <status-icon status="warning" />
<div class="media-body space-children"> <div class="media-body space-children">
<span class="bold"> <span class="bold">
<template v-if="mr.mergeError" <template v-if="mr.mergeError">{{ mr.mergeError }}</template>
>{{ mr.mergeError }}.</template
>
{{ s__('mrWidget|This merge request failed to be merged automatically') }} {{ s__('mrWidget|This merge request failed to be merged automatically') }}
</span> </span>
<button <button
......
...@@ -330,6 +330,7 @@ export default { ...@@ -330,6 +330,7 @@ export default {
:commits-count="mr.commitsCount" :commits-count="mr.commitsCount"
:target-branch="mr.targetBranch" :target-branch="mr.targetBranch"
:is-fast-forward-enabled="mr.ffOnlyEnabled" :is-fast-forward-enabled="mr.ffOnlyEnabled"
:class="{ 'border-bottom': mr.mergeError }"
> >
<ul class="border-top content-list commits-list flex-list"> <ul class="border-top content-list commits-list flex-list">
<commit-edit <commit-edit
......
<script> <script>
import _ from 'underscore'; import _ from 'underscore';
import { __ } from '~/locale'; import { sprintf, s__, __ } from '~/locale';
import Project from '~/pages/projects/project'; import Project from '~/pages/projects/project';
import SmartInterval from '~/smart_interval'; import SmartInterval from '~/smart_interval';
import MRWidgetStore from 'ee_else_ce/vue_merge_request_widget/stores/mr_widget_store'; import MRWidgetStore from 'ee_else_ce/vue_merge_request_widget/stores/mr_widget_store';
...@@ -125,6 +125,11 @@ export default { ...@@ -125,6 +125,11 @@ export default {
this.mr.pipeline.target_sha !== this.mr.targetBranchSha, this.mr.pipeline.target_sha !== this.mr.targetBranchSha,
); );
}, },
mergeError() {
return sprintf(s__('mrWidget|Merge failed: %{mergeError}. Please try again.'), {
mergeError: this.mr.mergeError,
});
},
}, },
watch: { watch: {
state(newVal, oldVal) { state(newVal, oldVal) {
...@@ -370,6 +375,10 @@ export default { ...@@ -370,6 +375,10 @@ export default {
}} }}
</mr-widget-alert-message> </mr-widget-alert-message>
<mr-widget-alert-message v-if="mr.mergeError" type="danger">
{{ mergeError }}
</mr-widget-alert-message>
<source-branch-removal-status v-if="shouldRenderSourceBranchRemovalStatus" /> <source-branch-removal-status v-if="shouldRenderSourceBranchRemovalStatus" />
</div> </div>
</div> </div>
......
...@@ -331,6 +331,10 @@ export default { ...@@ -331,6 +331,10 @@ export default {
}} }}
</mr-widget-alert-message> </mr-widget-alert-message>
<mr-widget-alert-message v-if="mr.mergeError" type="danger">
{{ mergeError }}
</mr-widget-alert-message>
<source-branch-removal-status v-if="shouldRenderSourceBranchRemovalStatus" /> <source-branch-removal-status v-if="shouldRenderSourceBranchRemovalStatus" />
</div> </div>
</div> </div>
......
...@@ -15988,6 +15988,9 @@ msgstr "" ...@@ -15988,6 +15988,9 @@ msgstr ""
msgid "mrWidget|Merge failed." msgid "mrWidget|Merge failed."
msgstr "" msgstr ""
msgid "mrWidget|Merge failed: %{mergeError}. Please try again."
msgstr ""
msgid "mrWidget|Merge locally" msgid "mrWidget|Merge locally"
msgstr "" msgstr ""
......
...@@ -159,8 +159,8 @@ describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -159,8 +159,8 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_requests wait_for_requests
page.within('.mr-widget-body') do page.within('.mr-section-container') do
expect(page).to have_content('Something went wrong') expect(page).to have_content('Merge failed: Something went wrong')
end end
end end
end end
...@@ -178,8 +178,8 @@ describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -178,8 +178,8 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_requests wait_for_requests
page.within('.mr-widget-body') do page.within('.mr-section-container') do
expect(page).to have_content('Something went wrong') expect(page).to have_content('Merge failed: Something went wrong')
end end
end end
end end
......
...@@ -327,8 +327,8 @@ describe 'Merge request > User sees merge widget', :js do ...@@ -327,8 +327,8 @@ describe 'Merge request > User sees merge widget', :js do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_requests wait_for_requests
page.within('.mr-widget-body') do page.within('.mr-section-container') do
expect(page).to have_content('Something went wrong') expect(page).to have_content('Merge failed: Something went wrong')
end end
end end
end end
...@@ -348,8 +348,8 @@ describe 'Merge request > User sees merge widget', :js do ...@@ -348,8 +348,8 @@ describe 'Merge request > User sees merge widget', :js do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_requests wait_for_requests
page.within('.mr-widget-body') do page.within('.mr-section-container') do
expect(page).to have_content('Something went wrong') expect(page).to have_content('Merge failed: Something went wrong')
end end
end end
end end
......
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