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
159c0d36
Commit
159c0d36
authored
Mar 19, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
52c378d7
7fb9dff4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
71 deletions
+21
-71
app/assets/javascripts/diffs/components/tree_list.vue
app/assets/javascripts/diffs/components/tree_list.vue
+18
-34
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-1
app/models/repository.rb
app/models/repository.rb
+2
-9
lib/gitlab/file_detector.rb
lib/gitlab/file_detector.rb
+0
-1
spec/lib/gitlab/file_detector_spec.rb
spec/lib/gitlab/file_detector_spec.rb
+0
-4
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+1
-22
No files found.
app/assets/javascripts/diffs/components/tree_list.vue
View file @
159c0d36
...
...
@@ -30,8 +30,9 @@ export default {
filteredTreeList
()
{
const
search
=
this
.
search
.
toLowerCase
().
trim
();
if
(
search
===
''
||
this
.
$options
.
fuzzyFileFinderEnabled
)
if
(
search
===
''
)
{
return
this
.
renderTreeList
?
this
.
tree
:
this
.
allBlobs
;
}
return
this
.
allBlobs
.
reduce
((
acc
,
folder
)
=>
{
const
tree
=
folder
.
tree
.
filter
(
f
=>
f
.
path
.
toLowerCase
().
indexOf
(
search
)
>=
0
);
...
...
@@ -51,13 +52,11 @@ export default {
},
},
methods
:
{
...
mapActions
(
'
diffs
'
,
[
'
toggleTreeOpen
'
,
'
scrollToFile
'
,
'
toggleFileFinder
'
]),
...
mapActions
(
'
diffs
'
,
[
'
toggleTreeOpen
'
,
'
scrollToFile
'
]),
clearSearch
()
{
this
.
search
=
''
;
},
},
shortcutKeyCharacter
:
`
${
/
Mac
/
i
.
test
(
navigator
.
userAgent
)
?
'
⌘
'
:
'
Ctrl
'
}
+P`
,
diffTreeFiltering
:
gon
.
features
&&
gon
.
features
.
diffTreeFiltering
,
};
</
script
>
...
...
@@ -66,36 +65,21 @@ export default {
<div
class=
"append-bottom-8 position-relative tree-list-search d-flex"
>
<div
class=
"flex-fill d-flex"
>
<icon
name=
"search"
class=
"position-absolute tree-list-icon"
/>
<template
v-if=
"$options.diffTreeFiltering"
>
<input
v-model=
"search"
:placeholder=
"s__('MergeRequest|Filter files')"
type=
"search"
class=
"form-control"
/>
<button
v-show=
"search"
:aria-label=
"__('Clear search')"
type=
"button"
class=
"position-absolute bg-transparent tree-list-icon tree-list-clear-icon border-0 p-0"
@
click=
"clearSearch"
>
<icon
name=
"close"
/>
</button>
</
template
>
<
template
v-else
>
<button
type=
"button"
class=
"form-control text-left text-secondary"
@
click=
"toggleFileFinder(true)"
>
{{
s__
(
'
MergeRequest|Search files
'
)
}}
</button>
<span
class=
"position-absolute text-secondary diff-tree-search-shortcut"
v-html=
"$options.shortcutKeyCharacter"
></span>
</
template
>
<input
v-model=
"search"
:placeholder=
"s__('MergeRequest|Filter files')"
type=
"search"
class=
"form-control"
/>
<button
v-show=
"search"
:aria-label=
"__('Clear search')"
type=
"button"
class=
"position-absolute bg-transparent tree-list-icon tree-list-clear-icon border-0 p-0"
@
click=
"clearSearch"
>
<icon
name=
"close"
/>
</button>
</div>
</div>
<div
:class=
"
{ 'pt-0 tree-list-blobs': !renderTreeList }" class="tree-list-scroll">
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
159c0d36
...
...
@@ -17,7 +17,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action
:check_user_can_push_to_source_branch!
,
only:
[
:rebase
]
before_action
only:
[
:show
]
do
push_frontend_feature_flag
(
:diff_tree_filtering
,
default_enabled:
true
)
push_frontend_feature_flag
(
:expand_diff_full_file
)
end
...
...
app/models/repository.rb
View file @
159c0d36
...
...
@@ -39,8 +39,7 @@ class Repository
changelog license_blob license_key gitignore
gitlab_ci_yml branch_names tag_names branch_count
tag_count avatar exists? root_ref has_visible_content?
issue_template_names merge_request_template_names xcode_project?
insights_config)
.
freeze
issue_template_names merge_request_template_names xcode_project?)
.
freeze
# Methods that use cache_method but only memoize the value
MEMOIZED_CACHED_METHODS
=
%i(license)
.
freeze
...
...
@@ -58,8 +57,7 @@ class Repository
avatar: :avatar
,
issue_template: :issue_template_names
,
merge_request_template: :merge_request_template_names
,
xcode_config: :xcode_project?
,
insights_config: :insights_config
xcode_config: :xcode_project?
}.
freeze
def
initialize
(
full_path
,
project
,
disk_path:
nil
,
is_wiki:
false
)
...
...
@@ -665,11 +663,6 @@ class Repository
end
cache_method
:xcode_project?
def
insights_config
file_on_head
(
:insights_config
)
end
cache_method
:insights_config
def
head_commit
@head_commit
||=
commit
(
self
.
root_ref
)
end
...
...
lib/gitlab/file_detector.rb
View file @
159c0d36
...
...
@@ -22,7 +22,6 @@ module Gitlab
gitignore:
'.gitignore'
,
gitlab_ci:
'.gitlab-ci.yml'
,
route_map:
'.gitlab/route-map.yml'
,
insights_config:
'.gitlab/insights.yml'
,
# Dependency files
cartfile:
%r{
\A
Cartfile[^/]*
\z
}
,
...
...
spec/lib/gitlab/file_detector_spec.rb
View file @
159c0d36
...
...
@@ -77,10 +77,6 @@ describe Gitlab::FileDetector do
expect
(
described_class
.
type_of
(
'.gitlab/merge_request_templates/foo.md'
)).
to
eq
(
:merge_request_template
)
end
it
'returns the type of an Insights config file'
do
expect
(
described_class
.
type_of
(
'.gitlab/insights.yml'
)).
to
eq
(
:insights_config
)
end
it
'returns nil for an unknown file'
do
expect
(
described_class
.
type_of
(
'foo.txt'
)).
to
be_nil
end
...
...
spec/models/repository_spec.rb
View file @
159c0d36
...
...
@@ -1616,8 +1616,7 @@ describe Repository do
:has_visible_content?
,
:issue_template_names
,
:merge_request_template_names
,
:xcode_project?
,
:insights_config
:xcode_project?
])
repository
.
after_change_head
...
...
@@ -1883,26 +1882,6 @@ describe Repository do
end
end
describe
"#insights_config"
,
:use_clean_rails_memory_store_caching
do
it
'returns a valid Insights config file'
do
files
=
[
TestBlob
.
new
(
'file'
),
TestBlob
.
new
(
'.gitlab/insights.yml'
)]
expect
(
repository
.
tree
).
to
receive
(
:blobs
).
and_return
(
files
)
expect
(
repository
.
insights_config
.
path
).
to
eq
(
'.gitlab/insights.yml'
)
end
it
'returns nil if does not exist'
do
expect
(
repository
.
tree
).
to
receive
(
:blobs
).
and_return
([])
expect
(
repository
.
insights_config
).
to
be_nil
end
it
'returns nil for an empty repository'
do
allow
(
repository
).
to
receive
(
:root_ref
).
and_raise
(
Gitlab
::
Git
::
Repository
::
NoRepository
)
expect
(
repository
.
insights_config
).
to
be_nil
end
end
describe
"#keep_around"
do
it
"does not fail if we attempt to reference bad commit"
do
expect
(
repository
.
kept_around?
(
'abc1234'
)).
to
be_falsey
...
...
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