Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
aba1c07a
Commit
aba1c07a
authored
Feb 16, 2018
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix "Remove source branch" button in MR widget during MWPS state
Fix
https://gitlab.com/gitlab-org/gitlab-ce/issues/4281
parent
7734e85b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
14 deletions
+20
-14
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merge_when_pipeline_succeeds.vue
...ponents/states/mr_widget_merge_when_pipeline_succeeds.vue
+1
-1
changelogs/unreleased/42814-fix-remove-source-branch-when-mwps.yml
...s/unreleased/42814-fix-remove-source-branch-when-mwps.yml
+6
-0
spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb
.../merge_request/user_merges_when_pipeline_succeeds_spec.rb
+6
-0
spec/javascripts/vue_mr_widget/components/states/mr_widget_merge_when_pipeline_succeeds_spec.js
...nts/states/mr_widget_merge_when_pipeline_succeeds_spec.js
+7
-13
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merge_when_pipeline_succeeds.vue
View file @
aba1c07a
...
...
@@ -63,7 +63,7 @@
};
this
.
isRemovingSourceBranch
=
true
;
this
.
service
.
merge
Resource
.
save
(
options
)
this
.
service
.
merge
(
options
)
.
then
(
res
=>
res
.
data
)
.
then
((
data
)
=>
{
if
(
data
.
status
===
'
merge_when_pipeline_succeeds
'
)
{
...
...
changelogs/unreleased/42814-fix-remove-source-branch-when-mwps.yml
0 → 100644
View file @
aba1c07a
---
title
:
Fix "Remove source branch" button in Merge request widget during merge when pipeline
succeeds state
merge_request
:
17192
author
:
type
:
fixed
spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb
View file @
aba1c07a
...
...
@@ -125,6 +125,12 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
expect
(
page
).
to
have_content
"canceled the automatic merge"
end
it
'allows to remove source branch'
do
click_link
"Remove source branch"
expect
(
page
).
to
have_content
"The source branch will be removed"
end
context
'when pipeline succeeds'
do
before
do
build
.
success
...
...
spec/javascripts/vue_mr_widget/components/states/mr_widget_merge_when_pipeline_succeeds_spec.js
View file @
aba1c07a
import
Vue
from
'
vue
'
;
import
mwpsComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_merge_when_pipeline_succeeds.vue
'
;
import
MRWidgetService
from
'
~/vue_merge_request_widget/services/mr_widget_service
'
;
import
eventHub
from
'
~/vue_merge_request_widget/event_hub
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
...
...
@@ -25,12 +26,7 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
targetBranchPath
,
targetBranch
,
},
service
:
{
cancelAutomaticMerge
()
{},
mergeResource
:
{
save
()
{},
},
},
service
:
new
MRWidgetService
({}),
});
});
...
...
@@ -90,18 +86,16 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
describe
(
'
removeSourceBranch
'
,
()
=>
{
it
(
'
should set flag and call service then request main component to update the widget
'
,
(
done
)
=>
{
spyOn
(
vm
.
service
.
mergeResource
,
'
save
'
).
and
.
returnValue
(
new
Promise
((
resolve
)
=>
{
resolve
({
data
:
{
status
:
'
merge_when_pipeline_succeeds
'
,
},
});
spyOn
(
vm
.
service
,
'
merge
'
).
and
.
returnValue
(
Promise
.
resolve
({
data
:
{
status
:
'
merge_when_pipeline_succeeds
'
,
},
}));
vm
.
removeSourceBranch
();
setTimeout
(()
=>
{
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
MRWidgetUpdateRequested
'
);
expect
(
vm
.
service
.
merge
Resource
.
save
).
toHaveBeenCalledWith
({
expect
(
vm
.
service
.
merge
).
toHaveBeenCalledWith
({
sha
,
merge_when_pipeline_succeeds
:
true
,
should_remove_source_branch
:
true
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment