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
468f9168
Commit
468f9168
authored
May 24, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MRWidget: Change order of if blocks to determine widget state properly.
parent
52527be4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
app/assets/javascripts/vue_merge_request_widget/stores/get_state_key.js
...ascripts/vue_merge_request_widget/stores/get_state_key.js
+4
-4
spec/javascripts/vue_mr_widget/stores/get_state_key_spec.js
spec/javascripts/vue_mr_widget/stores/get_state_key_spec.js
+6
-6
No files found.
app/assets/javascripts/vue_merge_request_widget/stores/get_state_key.js
View file @
468f9168
...
...
@@ -11,10 +11,6 @@ export default function deviseState(data) {
return
'
conflicts
'
;
}
else
if
(
data
.
work_in_progress
)
{
return
'
workInProgress
'
;
}
else
if
(
this
.
mergeWhenPipelineSucceeds
)
{
return
this
.
mergeError
?
'
autoMergeFailed
'
:
'
mergeWhenPipelineSucceeds
'
;
}
else
if
(
!
this
.
canMerge
)
{
return
'
notAllowedToMerge
'
;
}
else
if
(
this
.
onlyAllowMergeIfPipelineSucceeds
&&
this
.
isPipelineFailed
)
{
return
'
pipelineFailed
'
;
}
else
if
(
this
.
hasMergeableDiscussionsState
)
{
...
...
@@ -23,6 +19,10 @@ export default function deviseState(data) {
return
'
pipelineBlocked
'
;
}
else
if
(
this
.
hasSHAChanged
)
{
return
'
shaMismatch
'
;
}
else
if
(
this
.
mergeWhenPipelineSucceeds
)
{
return
this
.
mergeError
?
'
autoMergeFailed
'
:
'
mergeWhenPipelineSucceeds
'
;
}
else
if
(
!
this
.
canMerge
)
{
return
'
notAllowedToMerge
'
;
}
else
if
(
this
.
canBeMerged
)
{
return
'
readyToMerge
'
;
}
...
...
spec/javascripts/vue_mr_widget/stores/get_state_key_spec.js
View file @
468f9168
...
...
@@ -25,6 +25,12 @@ describe('getStateKey', () => {
context
.
canBeMerged
=
true
;
expect
(
bound
()).
toEqual
(
'
readyToMerge
'
);
context
.
canMerge
=
false
;
expect
(
bound
()).
toEqual
(
'
notAllowedToMerge
'
);
context
.
mergeWhenPipelineSucceeds
=
true
;
expect
(
bound
()).
toEqual
(
'
mergeWhenPipelineSucceeds
'
);
context
.
hasSHAChanged
=
true
;
expect
(
bound
()).
toEqual
(
'
shaMismatch
'
);
...
...
@@ -38,12 +44,6 @@ describe('getStateKey', () => {
context
.
isPipelineFailed
=
true
;
expect
(
bound
()).
toEqual
(
'
pipelineFailed
'
);
context
.
canMerge
=
false
;
expect
(
bound
()).
toEqual
(
'
notAllowedToMerge
'
);
context
.
mergeWhenPipelineSucceeds
=
true
;
expect
(
bound
()).
toEqual
(
'
mergeWhenPipelineSucceeds
'
);
data
.
work_in_progress
=
true
;
expect
(
bound
()).
toEqual
(
'
workInProgress
'
);
...
...
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