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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
41b22188
Commit
41b22188
authored
Jun 12, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
ace2a586
1b42447e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
6 deletions
+82
-6
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue
..._request_widget/components/states/mr_widget_conflicts.vue
+1
-1
app/assets/stylesheets/framework/highlight.scss
app/assets/stylesheets/framework/highlight.scss
+3
-3
changelogs/unreleased/sh-fix-resolve-button-not-available.yml
...gelogs/unreleased/sh-fix-resolve-button-not-available.yml
+5
-0
spec/javascripts/vue_mr_widget/components/states/mr_widget_conflicts_spec.js
...e_mr_widget/components/states/mr_widget_conflicts_spec.js
+73
-2
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue
View file @
41b22188
...
...
@@ -26,7 +26,7 @@ export default {
);
},
showResolveButton
()
{
return
this
.
mr
.
conflictResolutionPath
&&
this
.
mr
.
can
Merge
;
return
this
.
mr
.
conflictResolutionPath
&&
this
.
mr
.
can
PushToSourceBranch
;
},
showPopover
()
{
return
this
.
showResolveButton
&&
this
.
mr
.
sourceBranchProtected
;
...
...
app/assets/stylesheets/framework/highlight.scss
View file @
41b22188
...
...
@@ -11,7 +11,7 @@
border-radius
:
0
0
$border-radius-default
$border-radius-default
;
font-family
:
$monospace-font
;
font-size
:
$code-font-size
;
line-height
:
1
9px
;
line-height
:
1
.5
;
margin
:
0
;
overflow
:
auto
;
overflow-y
:
hidden
;
...
...
@@ -30,7 +30,7 @@
.line
{
display
:
block
;
width
:
100%
;
min-height
:
1
9px
;
min-height
:
1
.5em
;
padding-left
:
10px
;
padding-right
:
10px
;
white-space
:
pre
;
...
...
@@ -48,7 +48,7 @@
font-family
:
$monospace-font
;
display
:
block
;
font-size
:
$code-font-size
!
important
;
min-height
:
1
9px
;
min-height
:
1
.5em
;
white-space
:
nowrap
;
i
{
...
...
changelogs/unreleased/sh-fix-resolve-button-not-available.yml
0 → 100644
View file @
41b22188
---
title
:
Fix "Resolve conflicts" button not appearing for some users
merge_request
:
29535
author
:
type
:
fixed
spec/javascripts/vue_mr_widget/components/states/mr_widget_conflicts_spec.js
View file @
41b22188
...
...
@@ -23,11 +23,78 @@ describe('MRWidgetConflicts', () => {
vm
.
destroy
();
});
describe
(
'
when allowed to merge
'
,
()
=>
{
// There are two permissions we need to consider:
//
// 1. Is the user allowed to merge to the target branch?
// 2. Is the user allowed to push to the source branch?
//
// This yields 4 possible permutations that we need to test, and
// we test them below. A user who can push to the source
// branch should be allowed to resolve conflicts. This is
// consistent with what the backend does.
describe
(
'
when allowed to merge but not allowed to push to source branch
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
mr
:
{
canMerge
:
true
,
canPushToSourceBranch
:
false
,
conflictResolutionPath
:
path
,
conflictsDocsPath
:
''
,
},
});
});
it
(
'
should tell you about conflicts without bothering other people
'
,
()
=>
{
expect
(
vm
.
text
()).
toContain
(
'
There are merge conflicts
'
);
expect
(
vm
.
text
()).
not
.
toContain
(
'
ask someone with write access
'
);
});
it
(
'
should not allow you to resolve the conflicts
'
,
()
=>
{
expect
(
vm
.
text
()).
not
.
toContain
(
'
Resolve conflicts
'
);
});
it
(
'
should have merge buttons
'
,
()
=>
{
const
mergeLocallyButton
=
vm
.
find
(
'
.js-merge-locally-button
'
);
expect
(
mergeLocallyButton
.
text
()).
toContain
(
'
Merge locally
'
);
});
});
describe
(
'
when not allowed to merge but allowed to push to source branch
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
mr
:
{
canMerge
:
false
,
canPushToSourceBranch
:
true
,
conflictResolutionPath
:
path
,
conflictsDocsPath
:
''
,
},
});
});
it
(
'
should tell you about conflicts
'
,
()
=>
{
expect
(
vm
.
text
()).
toContain
(
'
There are merge conflicts
'
);
expect
(
vm
.
text
()).
toContain
(
'
ask someone with write access
'
);
});
it
(
'
should allow you to resolve the conflicts
'
,
()
=>
{
const
resolveButton
=
vm
.
find
(
'
.js-resolve-conflicts-button
'
);
expect
(
resolveButton
.
text
()).
toContain
(
'
Resolve conflicts
'
);
expect
(
resolveButton
.
attributes
(
'
href
'
)).
toEqual
(
path
);
});
it
(
'
should not have merge buttons
'
,
()
=>
{
expect
(
vm
.
text
()).
not
.
toContain
(
'
Merge locally
'
);
});
});
describe
(
'
when allowed to merge and push to source branch
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
mr
:
{
canMerge
:
true
,
canPushToSourceBranch
:
true
,
conflictResolutionPath
:
path
,
conflictsDocsPath
:
''
,
},
...
...
@@ -53,11 +120,12 @@ describe('MRWidgetConflicts', () => {
});
});
describe
(
'
when user does not have permission to
merge
'
,
()
=>
{
describe
(
'
when user does not have permission to
push to source branch
'
,
()
=>
{
it
(
'
should show proper message
'
,
()
=>
{
createComponent
({
mr
:
{
canMerge
:
false
,
canPushToSourceBranch
:
false
,
conflictsDocsPath
:
''
,
},
});
...
...
@@ -74,6 +142,7 @@ describe('MRWidgetConflicts', () => {
createComponent
({
mr
:
{
canMerge
:
false
,
canPushToSourceBranch
:
false
,
conflictsDocsPath
:
''
,
},
});
...
...
@@ -115,6 +184,7 @@ describe('MRWidgetConflicts', () => {
createComponent
({
mr
:
{
canMerge
:
true
,
canPushToSourceBranch
:
true
,
conflictResolutionPath
:
gl
.
TEST_HOST
,
sourceBranchProtected
:
true
,
conflictsDocsPath
:
''
,
...
...
@@ -136,6 +206,7 @@ describe('MRWidgetConflicts', () => {
createComponent
({
mr
:
{
canMerge
:
true
,
canPushToSourceBranch
:
true
,
conflictResolutionPath
:
gl
.
TEST_HOST
,
sourceBranchProtected
:
false
,
conflictsDocsPath
:
''
,
...
...
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