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
a881ffad
Commit
a881ffad
authored
Apr 05, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
389d54da
36d1d908
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
172 additions
and
67 deletions
+172
-67
app/assets/javascripts/ide/components/file_row_extra.vue
app/assets/javascripts/ide/components/file_row_extra.vue
+3
-2
app/assets/javascripts/ide/components/new_dropdown/index.vue
app/assets/javascripts/ide/components/new_dropdown/index.vue
+7
-16
app/assets/javascripts/ide/stores/actions/merge_request.js
app/assets/javascripts/ide/stores/actions/merge_request.js
+2
-1
app/assets/javascripts/vue_shared/components/file_row.vue
app/assets/javascripts/vue_shared/components/file_row.vue
+6
-6
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+17
-0
app/finders/merge_requests_finder.rb
app/finders/merge_requests_finder.rb
+12
-1
app/views/projects/diffs/_replaced_image_diff.html.haml
app/views/projects/diffs/_replaced_image_diff.html.haml
+2
-2
app/views/projects/diffs/_single_image_diff.html.haml
app/views/projects/diffs/_single_image_diff.html.haml
+1
-1
changelogs/unreleased/56762-fix-commit-swipe-view-26968.yml
changelogs/unreleased/56762-fix-commit-swipe-view-26968.yml
+5
-0
changelogs/unreleased/ide-fix-detect-mr-from-fork.yml
changelogs/unreleased/ide-fix-detect-mr-from-fork.yml
+5
-0
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+1
-0
spec/finders/merge_requests_finder_spec.rb
spec/finders/merge_requests_finder_spec.rb
+8
-0
spec/javascripts/ide/components/file_row_extra_spec.js
spec/javascripts/ide/components/file_row_extra_spec.js
+1
-1
spec/javascripts/ide/components/new_dropdown/index_spec.js
spec/javascripts/ide/components/new_dropdown/index_spec.js
+2
-2
spec/javascripts/ide/stores/actions/merge_request_spec.js
spec/javascripts/ide/stores/actions/merge_request_spec.js
+40
-35
spec/javascripts/vue_shared/components/file_row_spec.js
spec/javascripts/vue_shared/components/file_row_spec.js
+60
-0
No files found.
app/assets/javascripts/ide/components/file_row_extra.vue
View file @
a881ffad
...
@@ -23,7 +23,7 @@ export default {
...
@@ -23,7 +23,7 @@ export default {
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
mouseOver
:
{
dropdownOpen
:
{
type
:
Boolean
,
type
:
Boolean
,
required
:
true
,
required
:
true
,
},
},
...
@@ -92,8 +92,9 @@ export default {
...
@@ -92,8 +92,9 @@ export default {
<new-dropdown
<new-dropdown
:type=
"file.type"
:type=
"file.type"
:path=
"file.path"
:path=
"file.path"
:
mouse-over=
"mouseOver
"
:
is-open=
"dropdownOpen
"
class=
"prepend-left-8"
class=
"prepend-left-8"
v-on=
"$listeners"
/>
/>
</div>
</div>
</
template
>
</
template
>
app/assets/javascripts/ide/components/new_dropdown/index.vue
View file @
a881ffad
...
@@ -21,38 +21,29 @@ export default {
...
@@ -21,38 +21,29 @@ export default {
required
:
false
,
required
:
false
,
default
:
''
,
default
:
''
,
},
},
mouseOver
:
{
isOpen
:
{
type
:
Boolean
,
type
:
Boolean
,
required
:
tru
e
,
required
:
fals
e
,
}
,
default
:
false
,
},
},
data
()
{
return
{
dropdownOpen
:
false
,
};
},
},
watch
:
{
watch
:
{
dropdown
Open
()
{
is
Open
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
dropdownMenu
.
scrollIntoView
({
this
.
$refs
.
dropdownMenu
.
scrollIntoView
({
block
:
'
nearest
'
,
block
:
'
nearest
'
,
});
});
});
});
},
},
mouseOver
()
{
if
(
!
this
.
mouseOver
)
{
this
.
dropdownOpen
=
false
;
}
},
},
},
methods
:
{
methods
:
{
...
mapActions
([
'
createTempEntry
'
,
'
openNewEntryModal
'
,
'
deleteEntry
'
]),
...
mapActions
([
'
createTempEntry
'
,
'
openNewEntryModal
'
,
'
deleteEntry
'
]),
createNewItem
(
type
)
{
createNewItem
(
type
)
{
this
.
openNewEntryModal
({
type
,
path
:
this
.
path
});
this
.
openNewEntryModal
({
type
,
path
:
this
.
path
});
this
.
dropdownOpen
=
false
;
this
.
$emit
(
'
toggle
'
,
false
)
;
},
},
openDropdown
()
{
openDropdown
()
{
this
.
dropdownOpen
=
!
this
.
dropdownOpen
;
this
.
$emit
(
'
toggle
'
,
!
this
.
isOpen
)
;
},
},
},
},
modalTypes
,
modalTypes
,
...
@@ -63,7 +54,7 @@ export default {
...
@@ -63,7 +54,7 @@ export default {
<div
class=
"ide-new-btn"
>
<div
class=
"ide-new-btn"
>
<div
<div
:class=
"
{
:class=
"
{
show:
dropdown
Open,
show:
is
Open,
}"
}"
class="dropdown d-flex"
class="dropdown d-flex"
>
>
...
...
app/assets/javascripts/ide/stores/actions/merge_request.js
View file @
a881ffad
...
@@ -4,10 +4,11 @@ import service from '../../services';
...
@@ -4,10 +4,11 @@ import service from '../../services';
import
*
as
types
from
'
../mutation_types
'
;
import
*
as
types
from
'
../mutation_types
'
;
import
{
activityBarViews
}
from
'
../../constants
'
;
import
{
activityBarViews
}
from
'
../../constants
'
;
export
const
getMergeRequestsForBranch
=
({
commit
},
{
projectId
,
branchId
}
=
{})
=>
export
const
getMergeRequestsForBranch
=
({
commit
,
state
},
{
projectId
,
branchId
}
=
{})
=>
service
service
.
getProjectMergeRequests
(
`
${
projectId
}
`
,
{
.
getProjectMergeRequests
(
`
${
projectId
}
`
,
{
source_branch
:
branchId
,
source_branch
:
branchId
,
source_project_id
:
state
.
projects
[
projectId
].
id
,
order_by
:
'
created_at
'
,
order_by
:
'
created_at
'
,
per_page
:
1
,
per_page
:
1
,
})
})
...
...
app/assets/javascripts/vue_shared/components/file_row.vue
View file @
a881ffad
...
@@ -39,7 +39,7 @@ export default {
...
@@ -39,7 +39,7 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
mouseOver
:
false
,
dropdownOpen
:
false
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -123,8 +123,8 @@ export default {
...
@@ -123,8 +123,8 @@ export default {
return
this
.
$router
.
currentRoute
.
path
===
`/project
${
this
.
file
.
url
}
`
;
return
this
.
$router
.
currentRoute
.
path
===
`/project
${
this
.
file
.
url
}
`
;
},
},
toggle
Hover
(
over
)
{
toggle
Dropdown
(
val
)
{
this
.
mouseOver
=
over
;
this
.
dropdownOpen
=
val
;
},
},
},
},
};
};
...
@@ -140,8 +140,7 @@ export default {
...
@@ -140,8 +140,7 @@ export default {
class=
"file-row"
class=
"file-row"
role=
"button"
role=
"button"
@
click=
"clickFile"
@
click=
"clickFile"
@
mouseover=
"toggleHover(true)"
@
mouseleave=
"toggleDropdown(false)"
@
mouseout=
"toggleHover(false)"
>
>
<div
class=
"file-row-name-container"
>
<div
class=
"file-row-name-container"
>
<span
ref=
"textOutput"
:style=
"levelIndentation"
class=
"file-row-name str-truncated"
>
<span
ref=
"textOutput"
:style=
"levelIndentation"
class=
"file-row-name str-truncated"
>
...
@@ -160,7 +159,8 @@ export default {
...
@@ -160,7 +159,8 @@ export default {
:is=
"extraComponent"
:is=
"extraComponent"
v-if=
"extraComponent && !(hideExtraOnTree && file.type === 'tree')"
v-if=
"extraComponent && !(hideExtraOnTree && file.type === 'tree')"
:file=
"file"
:file=
"file"
:mouse-over=
"mouseOver"
:dropdown-open=
"dropdownOpen"
@
toggle=
"toggleDropdown($event)"
/>
/>
</div>
</div>
</div>
</div>
...
...
app/assets/stylesheets/pages/diff.scss
View file @
a881ffad
...
@@ -167,6 +167,23 @@
...
@@ -167,6 +167,23 @@
}
}
}
}
.frame
{
top
:
0
;
right
:
0
;
&
.old-diff
{
/* only for commit / compare view */
position
:
absolute
;
}
&
.deleted
{
margin
:
0
;
display
:
block
;
top
:
13px
;
right
:
7px
;
}
}
.swipe-bar
{
.swipe-bar
{
display
:
block
;
display
:
block
;
height
:
100%
;
height
:
100%
;
...
...
app/finders/merge_requests_finder.rb
View file @
a881ffad
...
@@ -40,7 +40,8 @@ class MergeRequestsFinder < IssuableFinder
...
@@ -40,7 +40,8 @@ class MergeRequestsFinder < IssuableFinder
items
=
by_commit
(
super
)
items
=
by_commit
(
super
)
items
=
by_source_branch
(
items
)
items
=
by_source_branch
(
items
)
items
=
by_wip
(
items
)
items
=
by_wip
(
items
)
by_target_branch
(
items
)
items
=
by_target_branch
(
items
)
by_source_project_id
(
items
)
end
end
private
private
...
@@ -74,6 +75,16 @@ class MergeRequestsFinder < IssuableFinder
...
@@ -74,6 +75,16 @@ class MergeRequestsFinder < IssuableFinder
items
.
where
(
target_branch:
target_branch
)
items
.
where
(
target_branch:
target_branch
)
end
end
def
source_project_id
@source_project_id
||=
params
[
:source_project_id
].
presence
end
def
by_source_project_id
(
items
)
return
items
unless
source_project_id
items
.
where
(
source_project_id:
source_project_id
)
end
def
by_wip
(
items
)
def
by_wip
(
items
)
if
params
[
:wip
]
==
'yes'
if
params
[
:wip
]
==
'yes'
items
.
where
(
wip_match
(
items
.
arel_table
))
items
.
where
(
wip_match
(
items
.
arel_table
))
...
...
app/views/projects/diffs/_replaced_image_diff.html.haml
View file @
a881ffad
...
@@ -35,10 +35,10 @@
...
@@ -35,10 +35,10 @@
.swipe.view.hide
.swipe.view.hide
.swipe-frame
.swipe-frame
.frame.deleted
.frame.deleted
.old-diff
=
image_tag
(
old_blob_raw_url
,
alt:
diff_file
.
old_path
,
lazy:
false
)
=
image_tag
(
old_blob_raw_url
,
alt:
diff_file
.
old_path
,
lazy:
false
)
.swipe-wrap.left-oriented
.swipe-wrap.left-oriented
=
render
partial:
"projects/diffs/image_diff_frame"
,
locals:
{
class_name:
"added js-image-frame
#{
class_name
}
"
,
position:
position
,
note_type:
DiffNote
.
name
,
image_path:
blob_raw_url
,
alt:
diff_file
.
new_path
}
=
render
partial:
"projects/diffs/image_diff_frame"
,
locals:
{
class_name:
"added
old-diff
js-image-frame
#{
class_name
}
"
,
position:
position
,
note_type:
DiffNote
.
name
,
image_path:
blob_raw_url
,
alt:
diff_file
.
new_path
}
%span
.swipe-bar
%span
.swipe-bar
%span
.top-handle
%span
.top-handle
%span
.bottom-handle
%span
.bottom-handle
...
...
app/views/projects/diffs/_single_image_diff.html.haml
View file @
a881ffad
...
@@ -10,5 +10,5 @@
...
@@ -10,5 +10,5 @@
.image.js-single-image
{
data:
diff_view_data
}
.image.js-single-image
{
data:
diff_view_data
}
.wrap
.wrap
-
single_class_name
=
diff_file
.
deleted_file?
?
'deleted'
:
'added'
-
single_class_name
=
diff_file
.
deleted_file?
?
'deleted'
:
'added'
=
render
partial:
"projects/diffs/image_diff_frame"
,
locals:
{
class_name:
"
#{
single_class_name
}
#{
class_name
}
js-image-frame"
,
position:
position
,
note_type:
DiffNote
.
name
,
image_path:
blob_raw_url
,
alt:
diff_file
.
file_path
}
=
render
partial:
"projects/diffs/image_diff_frame"
,
locals:
{
class_name:
"
#{
single_class_name
}
#{
class_name
}
old-diff
js-image-frame"
,
position:
position
,
note_type:
DiffNote
.
name
,
image_path:
blob_raw_url
,
alt:
diff_file
.
file_path
}
%p
.image-info
=
number_to_human_size
(
blob
.
size
)
%p
.image-info
=
number_to_human_size
(
blob
.
size
)
changelogs/unreleased/56762-fix-commit-swipe-view-26968.yml
0 → 100644
View file @
a881ffad
---
title
:
"
Fix
image
diff
swipe
view
on
commit
and
compare
pages"
merge_request
:
26968
author
:
ftab
type
:
fixed
\ No newline at end of file
changelogs/unreleased/ide-fix-detect-mr-from-fork.yml
0 → 100644
View file @
a881ffad
---
title
:
Fix IDE detection of MR from fork with same branch name
merge_request
:
26986
author
:
type
:
fixed
lib/api/merge_requests.rb
View file @
a881ffad
...
@@ -113,6 +113,7 @@ module API
...
@@ -113,6 +113,7 @@ module API
desc:
'Return merge requests for the given scope: `created_by_me`, `assigned_to_me` or `all`'
desc:
'Return merge requests for the given scope: `created_by_me`, `assigned_to_me` or `all`'
optional
:my_reaction_emoji
,
type:
String
,
desc:
'Return issues reacted by the authenticated user by the given emoji'
optional
:my_reaction_emoji
,
type:
String
,
desc:
'Return issues reacted by the authenticated user by the given emoji'
optional
:source_branch
,
type:
String
,
desc:
'Return merge requests with the given source branch'
optional
:source_branch
,
type:
String
,
desc:
'Return merge requests with the given source branch'
optional
:source_project_id
,
type:
Integer
,
desc:
'Return merge requests with the given source project id'
optional
:target_branch
,
type:
String
,
desc:
'Return merge requests with the given target branch'
optional
:target_branch
,
type:
String
,
desc:
'Return merge requests with the given target branch'
optional
:search
,
type:
String
,
desc:
'Search merge requests for text present in the title, description, or any combination of these'
optional
:search
,
type:
String
,
desc:
'Search merge requests for text present in the title, description, or any combination of these'
optional
:in
,
type:
String
,
desc:
'`title`, `description`, or a string joining them with comma'
optional
:in
,
type:
String
,
desc:
'`title`, `description`, or a string joining them with comma'
...
...
spec/finders/merge_requests_finder_spec.rb
View file @
a881ffad
...
@@ -83,6 +83,14 @@ describe MergeRequestsFinder do
...
@@ -83,6 +83,14 @@ describe MergeRequestsFinder do
expect
(
merge_requests
).
to
contain_exactly
(
merge_request2
)
expect
(
merge_requests
).
to
contain_exactly
(
merge_request2
)
end
end
it
'filters by source project id'
do
params
=
{
source_project_id:
merge_request2
.
source_project_id
}
merge_requests
=
described_class
.
new
(
user
,
params
).
execute
expect
(
merge_requests
).
to
contain_exactly
(
merge_request1
,
merge_request2
,
merge_request3
)
end
it
'filters by state'
do
it
'filters by state'
do
params
=
{
state:
'locked'
}
params
=
{
state:
'locked'
}
...
...
spec/javascripts/ide/components/file_row_extra_spec.js
View file @
a881ffad
...
@@ -20,7 +20,7 @@ describe('IDE extra file row component', () => {
...
@@ -20,7 +20,7 @@ describe('IDE extra file row component', () => {
file
:
{
file
:
{
...
file
(
'
test
'
),
...
file
(
'
test
'
),
},
},
mouseOver
:
false
,
dropdownOpen
:
false
,
});
});
spyOnProperty
(
vm
,
'
getUnstagedFilesCountForPath
'
).
and
.
returnValue
(()
=>
unstagedFilesCount
);
spyOnProperty
(
vm
,
'
getUnstagedFilesCountForPath
'
).
and
.
returnValue
(()
=>
unstagedFilesCount
);
...
...
spec/javascripts/ide/components/new_dropdown/index_spec.js
View file @
a881ffad
...
@@ -56,11 +56,11 @@ describe('new dropdown component', () => {
...
@@ -56,11 +56,11 @@ describe('new dropdown component', () => {
});
});
});
});
describe
(
'
dropdown
Open
'
,
()
=>
{
describe
(
'
is
Open
'
,
()
=>
{
it
(
'
scrolls dropdown into view
'
,
done
=>
{
it
(
'
scrolls dropdown into view
'
,
done
=>
{
spyOn
(
vm
.
$refs
.
dropdownMenu
,
'
scrollIntoView
'
);
spyOn
(
vm
.
$refs
.
dropdownMenu
,
'
scrollIntoView
'
);
vm
.
dropdown
Open
=
true
;
vm
.
is
Open
=
true
;
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
vm
.
$refs
.
dropdownMenu
.
scrollIntoView
).
toHaveBeenCalledWith
({
expect
(
vm
.
$refs
.
dropdownMenu
.
scrollIntoView
).
toHaveBeenCalledWith
({
...
...
spec/javascripts/ide/stores/actions/merge_request_spec.js
View file @
a881ffad
This diff is collapsed.
Click to expand it.
spec/javascripts/vue_shared/components/file_row_spec.js
View file @
a881ffad
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
FileRow
from
'
~/vue_shared/components/file_row.vue
'
;
import
FileRow
from
'
~/vue_shared/components/file_row.vue
'
;
import
FileRowExtra
from
'
~/ide/components/file_row_extra.vue
'
;
import
{
file
}
from
'
spec/ide/helpers
'
;
import
{
file
}
from
'
spec/ide/helpers
'
;
import
mountComponent
from
'
../../helpers/vue_mount_component_helper
'
;
import
mountComponent
from
'
../../helpers/vue_mount_component_helper
'
;
...
@@ -16,6 +17,10 @@ describe('File row component', () => {
...
@@ -16,6 +17,10 @@ describe('File row component', () => {
vm
.
$destroy
();
vm
.
$destroy
();
});
});
const
findNewDropdown
=
()
=>
vm
.
$el
.
querySelector
(
'
.ide-new-btn .dropdown
'
);
const
findNewDropdownButton
=
()
=>
vm
.
$el
.
querySelector
(
'
.ide-new-btn .dropdown button
'
);
const
findFileRow
=
()
=>
vm
.
$el
.
querySelector
(
'
.file-row
'
);
it
(
'
renders name
'
,
()
=>
{
it
(
'
renders name
'
,
()
=>
{
createComponent
({
createComponent
({
file
:
file
(
'
t4
'
),
file
:
file
(
'
t4
'
),
...
@@ -84,4 +89,59 @@ describe('File row component', () => {
...
@@ -84,4 +89,59 @@ describe('File row component', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.js-file-row-header
'
)).
not
.
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-file-row-header
'
)).
not
.
toBe
(
null
);
});
});
describe
(
'
new dropdown
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
file
:
file
(
'
t5
'
),
level
:
1
,
extraComponent
:
FileRowExtra
,
});
});
it
(
'
renders in extra component
'
,
()
=>
{
expect
(
findNewDropdown
()).
not
.
toBe
(
null
);
});
it
(
'
is hidden at start
'
,
()
=>
{
expect
(
findNewDropdown
()).
not
.
toHaveClass
(
'
show
'
);
});
it
(
'
is opened when button is clicked
'
,
done
=>
{
expect
(
vm
.
dropdownOpen
).
toBe
(
false
);
findNewDropdownButton
().
dispatchEvent
(
new
Event
(
'
click
'
));
vm
.
$nextTick
()
.
then
(()
=>
{
expect
(
vm
.
dropdownOpen
).
toBe
(
true
);
expect
(
findNewDropdown
()).
toHaveClass
(
'
show
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
describe
(
'
when opened
'
,
()
=>
{
beforeEach
(()
=>
{
vm
.
dropdownOpen
=
true
;
});
it
(
'
stays open when button triggers mouseout
'
,
()
=>
{
findNewDropdownButton
().
dispatchEvent
(
new
Event
(
'
mouseout
'
));
expect
(
vm
.
dropdownOpen
).
toBe
(
true
);
});
it
(
'
stays open when button triggers mouseleave
'
,
()
=>
{
findNewDropdownButton
().
dispatchEvent
(
new
Event
(
'
mouseleave
'
));
expect
(
vm
.
dropdownOpen
).
toBe
(
true
);
});
it
(
'
closes when row triggers mouseleave
'
,
()
=>
{
findFileRow
().
dispatchEvent
(
new
Event
(
'
mouseleave
'
));
expect
(
vm
.
dropdownOpen
).
toBe
(
false
);
});
});
});
});
});
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