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
8dca810c
Commit
8dca810c
authored
Jul 12, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-07-12
parents
6c31f38c
5c7e2987
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
47 additions
and
89 deletions
+47
-89
app/assets/javascripts/diffs/components/app.vue
app/assets/javascripts/diffs/components/app.vue
+0
-16
app/assets/javascripts/diffs/components/changed_files.vue
app/assets/javascripts/diffs/components/changed_files.vue
+14
-27
app/assets/javascripts/diffs/components/changed_files_dropdown.vue
...s/javascripts/diffs/components/changed_files_dropdown.vue
+1
-1
app/assets/javascripts/diffs/components/diff_file.vue
app/assets/javascripts/diffs/components/diff_file.vue
+0
-37
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+6
-0
changelogs/unreleased/48789-remove-event-listeners-scroll.yml
...gelogs/unreleased/48789-remove-event-listeners-scroll.yml
+6
-0
changelogs/unreleased/fix-performance-problem-of-tags-query.yml
...logs/unreleased/fix-performance-problem-of-tags-query.yml
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+11
-4
locale/gitlab.pot
locale/gitlab.pot
+0
-3
qa/qa/factory/resource/kubernetes_cluster.rb
qa/qa/factory/resource/kubernetes_cluster.rb
+3
-0
qa/qa/runtime/namespace.rb
qa/qa/runtime/namespace.rb
+1
-1
No files found.
app/assets/javascripts/diffs/components/app.vue
View file @
8dca810c
...
...
@@ -41,11 +41,6 @@ export default {
required
:
true
,
},
},
data
()
{
return
{
activeFile
:
''
,
};
},
computed
:
{
...
mapState
({
isLoading
:
state
=>
state
.
diffs
.
isLoading
,
...
...
@@ -126,14 +121,6 @@ export default {
eventHub
.
$emit
(
'
fetchNotesData
'
);
}
},
setActive
(
filePath
)
{
this
.
activeFile
=
filePath
;
},
unsetActive
(
filePath
)
{
if
(
this
.
activeFile
===
filePath
)
{
this
.
activeFile
=
''
;
}
},
adjustView
()
{
if
(
this
.
shouldShow
&&
this
.
isParallelView
)
{
window
.
mrTabs
.
expandViewContainer
();
...
...
@@ -195,7 +182,6 @@ export default {
<changed-files
:diff-files=
"diffFiles"
:active-file=
"activeFile"
/>
<div
...
...
@@ -207,8 +193,6 @@ export default {
:key=
"file.newPath"
:file=
"file"
:current-user=
"currentUser"
@
setActive=
"setActive(file.filePath)"
@
unsetActive=
"unsetActive(file.filePath)"
/>
</div>
<no-changes
v-else
/>
...
...
app/assets/javascripts/diffs/components/changed_files.vue
View file @
8dca810c
...
...
@@ -16,13 +16,6 @@ export default {
ClipboardButton
,
},
mixins
:
[
changedFilesMixin
],
props
:
{
activeFile
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
data
()
{
return
{
isStuck
:
false
,
...
...
@@ -70,7 +63,7 @@ export default {
pluralize
,
handleScroll
()
{
if
(
!
this
.
updating
)
{
requestAnimationFrame
(
this
.
updateIsStuck
);
this
.
$nextTick
(
this
.
updateIsStuck
);
this
.
updating
=
true
;
}
},
...
...
@@ -148,25 +141,8 @@ export default {
/>
<span
v-show=
"activeFile"
class=
"prepend-left-5"
>
<strong
class=
"prepend-right-5"
>
{{
truncatedDiffPath
(
activeFile
)
}}
</strong>
<clipboard-button
:text=
"activeFile"
:title=
"s__('Copy file name to clipboard')"
tooltip-placement=
"bottom"
tooltip-container=
"body"
class=
"btn btn-default btn-transparent btn-clipboard"
/>
</span>
<span
v-show=
"!isStuck"
id=
"diff-stats"
class=
"diff-stats-additions-deletions-expanded"
class=
"js-diff-stats-additions-deletions-expanded
diff-stats-additions-deletions-expanded"
>
with
<strong
class=
"cgreen"
>
...
...
@@ -177,6 +153,17 @@ export default {
{{
pluralize
(
`${sumRemovedLines
}
deletion`
,
sumRemovedLines
)
}}
<
/strong
>
<
/span
>
<
div
class
=
"
js-diff-stats-additions-deletions-collapsed
diff-stats-additions-deletions-collapsed float-right d-sm-none
"
>
<
strong
class
=
"
cgreen
"
>
+
{{
sumAddedLines
}}
<
/strong
>
<
strong
class
=
"
cred
"
>
-
{{
sumRemovedLines
}}
<
/strong
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
app/assets/javascripts/diffs/components/changed_files_dropdown.vue
View file @
8dca810c
...
...
@@ -40,7 +40,7 @@ export default {
{{
n__
(
'
%d changed file
'
,
'
%d changed files
'
,
diffFiles
.
length
)
}}
</span>
<icon
:size=
"8
"
class=
"caret-icon
"
name=
"chevron-down"
/>
</button>
...
...
app/assets/javascripts/diffs/components/diff_file.vue
View file @
8dca810c
...
...
@@ -25,7 +25,6 @@ export default {
},
data
()
{
return
{
isActive
:
false
,
isLoadingCollapsedDiff
:
false
,
forkMessageVisible
:
false
,
};
...
...
@@ -48,12 +47,6 @@ export default {
return
this
.
isCollapsed
&&
!
this
.
isLoadingCollapsedDiff
&&
!
this
.
file
.
tooLarge
;
},
},
mounted
()
{
document
.
addEventListener
(
'
scroll
'
,
this
.
handleScroll
);
},
beforeDestroy
()
{
document
.
removeEventListener
(
'
scroll
'
,
this
.
handleScroll
);
},
methods
:
{
...
mapActions
(
'
diffs
'
,
[
'
loadCollapsedDiff
'
]),
handleToggle
()
{
...
...
@@ -65,36 +58,6 @@ export default {
this
.
file
.
collapsed
=
!
this
.
file
.
collapsed
;
}
},
handleScroll
()
{
if
(
!
this
.
updating
)
{
requestAnimationFrame
(
this
.
scrollUpdate
.
bind
(
this
));
this
.
updating
=
true
;
}
},
scrollUpdate
()
{
const
header
=
document
.
querySelector
(
'
.js-diff-files-changed
'
);
if
(
!
header
)
{
this
.
updating
=
false
;
return
;
}
const
{
top
,
bottom
}
=
this
.
$el
.
getBoundingClientRect
();
const
{
top
:
topOfFixedHeader
,
bottom
:
bottomOfFixedHeader
}
=
header
.
getBoundingClientRect
();
const
headerOverlapsContent
=
top
<
topOfFixedHeader
&&
bottom
>
bottomOfFixedHeader
;
const
fullyAboveHeader
=
bottom
<
bottomOfFixedHeader
;
const
fullyBelowHeader
=
top
>
topOfFixedHeader
;
if
(
headerOverlapsContent
&&
!
this
.
isActive
)
{
this
.
$emit
(
'
setActive
'
);
this
.
isActive
=
true
;
}
else
if
(
this
.
isActive
&&
(
fullyAboveHeader
||
fullyBelowHeader
))
{
this
.
$emit
(
'
unsetActive
'
);
this
.
isActive
=
false
;
}
this
.
updating
=
false
;
},
handleLoadCollapsedDiff
()
{
this
.
isLoadingCollapsedDiff
=
true
;
...
...
app/assets/stylesheets/pages/diff.scss
View file @
8dca810c
...
...
@@ -518,6 +518,12 @@
outline
:
none
;
color
:
$gl-link-hover-color
;
}
.caret-icon
{
position
:
relative
;
top
:
2px
;
left
:
-1px
;
}
}
// Mobile
...
...
changelogs/unreleased/48789-remove-event-listeners-scroll.yml
0 → 100644
View file @
8dca810c
---
title
:
Improves performance on Merge Request diff tab by removing the scroll event
listeners being added to every file
merge_request
:
author
:
type
:
performance
changelogs/unreleased/fix-performance-problem-of-tags-query.yml
0 → 100644
View file @
8dca810c
---
title
:
Fix performance problem of accessing tag list for projects api endpoints
merge_request
:
author
:
type
:
performance
lib/api/entities.rb
View file @
8dca810c
...
...
@@ -135,10 +135,13 @@ module API
expose
:custom_attributes
,
using:
'API::Entities::CustomAttribute'
,
if: :with_custom_attributes
def
self
.
preload_relation
(
projects_relation
,
options
=
{})
# Preloading tags, should be done with using only `:tags`,
# as `:tags` are defined as: `has_many :tags, through: :taggings`
# N+1 is solved then by using `subject.tags.map(&:name)`
# MR describing the solution: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20555
projects_relation
.
preload
(
:project_feature
,
:route
)
.
preload
(
:import_state
)
.
preload
(
namespace:
[
:route
,
:owner
],
tags: :taggings
)
.
preload
(
:import_state
,
:tags
)
.
preload
(
namespace:
[
:route
,
:owner
])
end
end
...
...
@@ -212,11 +215,15 @@ module API
expose
:statistics
,
using:
'API::Entities::ProjectStatistics'
,
if: :statistics
def
self
.
preload_relation
(
projects_relation
,
options
=
{})
# Preloading tags, should be done with using only `:tags`,
# as `:tags` are defined as: `has_many :tags, through: :taggings`
# N+1 is solved then by using `subject.tags.map(&:name)`
# MR describing the solution: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20555
super
(
projects_relation
).
preload
(
:group
)
.
preload
(
project_group_links: :group
,
fork_network: :root_project
,
forked_project_link: :forked_from_project
,
forked_from_project:
[
:route
,
:forks
,
namespace: :route
,
tags: :taggings
])
forked_from_project:
[
:route
,
:forks
,
:tags
,
namespace: :route
])
end
def
self
.
forks_counting_projects
(
projects_relation
)
...
...
locale/gitlab.pot
View file @
8dca810c
...
...
@@ -1952,9 +1952,6 @@ msgstr ""
msgid "Copy commit SHA to clipboard"
msgstr ""
msgid "Copy file name to clipboard"
msgstr ""
msgid "Copy file path to clipboard"
msgstr ""
...
...
qa/qa/factory/resource/kubernetes_cluster.rb
View file @
8dca810c
...
...
@@ -36,6 +36,9 @@ module QA
if
@install_helm_tiller
Page
::
Project
::
Operations
::
Kubernetes
::
Show
.
perform
do
|
page
|
# We must wait a few seconds for permissions to be setup correctly for new cluster
sleep
10
# Helm must be installed before everything else
page
.
install!
(
:helm
)
page
.
await_installed
(
:helm
)
...
...
qa/qa/runtime/namespace.rb
View file @
8dca810c
...
...
@@ -8,7 +8,7 @@ module QA
end
def
name
"qa-test-
#{
time
.
strftime
(
'%Y-%m-%d-%
Y-%
H-%M-%S'
)
}
"
"qa-test-
#{
time
.
strftime
(
'%Y-%m-%d-%H-%M-%S'
)
}
"
end
def
path
...
...
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