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
Léo-Paul Géneau
gitlab-ce
Commits
8f1dd45a
Commit
8f1dd45a
authored
May 29, 2018
by
Lukas Eipert
Committed by
Clement Ho
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Merge request spinner spins forever after loading the diff"
parent
4c74936f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
21 deletions
+32
-21
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+1
-1
app/assets/javascripts/pages/users/user_tabs.js
app/assets/javascripts/pages/users/user_tabs.js
+17
-14
spec/features/projects/merge_requests/user_views_diffs_spec.rb
...features/projects/merge_requests/user_views_diffs_spec.rb
+4
-0
spec/features/users/user_browses_projects_on_user_page_spec.rb
...features/users/user_browses_projects_on_user_page_spec.rb
+10
-6
No files found.
app/assets/javascripts/merge_request_tabs.js
View file @
8f1dd45a
...
@@ -362,7 +362,7 @@ export default class MergeRequestTabs {
...
@@ -362,7 +362,7 @@ export default class MergeRequestTabs {
//
//
// status - Boolean, true to show, false to hide
// status - Boolean, true to show, false to hide
toggleLoading
(
status
)
{
toggleLoading
(
status
)
{
$
(
'
.mr-loading-status .loading
'
).
toggleClass
(
'
hidden
'
,
status
);
$
(
'
.mr-loading-status .loading
'
).
toggleClass
(
'
hidden
'
,
!
status
);
}
}
diffViewType
()
{
diffViewType
()
{
...
...
app/assets/javascripts/pages/users/user_tabs.js
View file @
8f1dd45a
...
@@ -77,8 +77,7 @@ export default class UserTabs {
...
@@ -77,8 +77,7 @@ export default class UserTabs {
this
.
action
=
action
||
this
.
defaultAction
;
this
.
action
=
action
||
this
.
defaultAction
;
this
.
$parentEl
=
$
(
parentEl
)
||
$
(
document
);
this
.
$parentEl
=
$
(
parentEl
)
||
$
(
document
);
this
.
windowLocation
=
window
.
location
;
this
.
windowLocation
=
window
.
location
;
this
.
$parentEl
.
find
(
'
.nav-links a
'
)
this
.
$parentEl
.
find
(
'
.nav-links a
'
).
each
((
i
,
navLink
)
=>
{
.
each
((
i
,
navLink
)
=>
{
this
.
loaded
[
$
(
navLink
).
attr
(
'
data-action
'
)]
=
false
;
this
.
loaded
[
$
(
navLink
).
attr
(
'
data-action
'
)]
=
false
;
});
});
this
.
actions
=
Object
.
keys
(
this
.
loaded
);
this
.
actions
=
Object
.
keys
(
this
.
loaded
);
...
@@ -116,8 +115,7 @@ export default class UserTabs {
...
@@ -116,8 +115,7 @@ export default class UserTabs {
}
}
activateTab
(
action
)
{
activateTab
(
action
)
{
return
this
.
$parentEl
.
find
(
`.nav-links .js-
${
action
}
-tab a`
)
return
this
.
$parentEl
.
find
(
`.nav-links .js-
${
action
}
-tab a`
).
tab
(
'
show
'
);
.
tab
(
'
show
'
);
}
}
setTab
(
action
,
endpoint
)
{
setTab
(
action
,
endpoint
)
{
...
@@ -137,7 +135,8 @@ export default class UserTabs {
...
@@ -137,7 +135,8 @@ export default class UserTabs {
loadTab
(
action
,
endpoint
)
{
loadTab
(
action
,
endpoint
)
{
this
.
toggleLoading
(
true
);
this
.
toggleLoading
(
true
);
return
axios
.
get
(
endpoint
)
return
axios
.
get
(
endpoint
)
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
const
tabSelector
=
`div#
${
action
}
`
;
const
tabSelector
=
`div#
${
action
}
`
;
this
.
$parentEl
.
find
(
tabSelector
).
html
(
data
.
html
);
this
.
$parentEl
.
find
(
tabSelector
).
html
(
data
.
html
);
...
@@ -161,10 +160,11 @@ export default class UserTabs {
...
@@ -161,10 +160,11 @@ export default class UserTabs {
const
utcOffset
=
$calendarWrap
.
data
(
'
utcOffset
'
);
const
utcOffset
=
$calendarWrap
.
data
(
'
utcOffset
'
);
let
utcFormatted
=
'
UTC
'
;
let
utcFormatted
=
'
UTC
'
;
if
(
utcOffset
!==
0
)
{
if
(
utcOffset
!==
0
)
{
utcFormatted
=
`UTC
${
utcOffset
>
0
?
'
+
'
:
''
}${
(
utcOffset
/
3600
)
}
`
;
utcFormatted
=
`UTC
${
utcOffset
>
0
?
'
+
'
:
''
}${
utcOffset
/
3600
}
`
;
}
}
axios
.
get
(
calendarPath
)
axios
.
get
(
calendarPath
)
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
$calendarWrap
.
html
(
CALENDAR_TEMPLATE
);
$calendarWrap
.
html
(
CALENDAR_TEMPLATE
);
$calendarWrap
.
find
(
'
.calendar-hint
'
).
append
(
`(Timezone:
${
utcFormatted
}
)`
);
$calendarWrap
.
find
(
'
.calendar-hint
'
).
append
(
`(Timezone:
${
utcFormatted
}
)`
);
...
@@ -180,17 +180,20 @@ export default class UserTabs {
...
@@ -180,17 +180,20 @@ export default class UserTabs {
}
}
toggleLoading
(
status
)
{
toggleLoading
(
status
)
{
return
this
.
$parentEl
.
find
(
'
.loading-status .loading
'
)
return
this
.
$parentEl
.
find
(
'
.loading-status .loading
'
).
toggleClass
(
'
hidden
'
,
!
status
);
.
toggleClass
(
'
hidden
'
,
status
);
}
}
setCurrentAction
(
source
)
{
setCurrentAction
(
source
)
{
let
newState
=
source
;
let
newState
=
source
;
newState
=
newState
.
replace
(
/
\/
+$/
,
''
);
newState
=
newState
.
replace
(
/
\/
+$/
,
''
);
newState
+=
this
.
windowLocation
.
search
+
this
.
windowLocation
.
hash
;
newState
+=
this
.
windowLocation
.
search
+
this
.
windowLocation
.
hash
;
history
.
replaceState
({
history
.
replaceState
(
{
url
:
newState
,
url
:
newState
,
},
document
.
title
,
newState
);
},
document
.
title
,
newState
,
);
return
newState
;
return
newState
;
}
}
...
...
spec/features/projects/merge_requests/user_views_diffs_spec.rb
View file @
8f1dd45a
...
@@ -26,6 +26,10 @@ describe 'User views diffs', :js do
...
@@ -26,6 +26,10 @@ describe 'User views diffs', :js do
expect
(
page
).
to
have_css
(
'#inline-diff-btn'
,
count:
1
)
expect
(
page
).
to
have_css
(
'#inline-diff-btn'
,
count:
1
)
end
end
it
'hides loading spinner after load'
do
expect
(
page
).
not_to
have_selector
(
'.mr-loading-status .loading'
,
visible:
true
)
end
context
'when in the inline view'
do
context
'when in the inline view'
do
include_examples
'unfold diffs'
include_examples
'unfold diffs'
end
end
...
...
spec/features/users/user_browses_projects_on_user_page_spec.rb
View file @
8f1dd45a
...
@@ -26,18 +26,23 @@ describe 'Users > User browses projects on user page', :js do
...
@@ -26,18 +26,23 @@ describe 'Users > User browses projects on user page', :js do
end
end
end
end
it
'hides loading spinner after load'
,
:js
do
visit
user_path
(
user
)
click_nav_link
(
'Personal projects'
)
wait_for_requests
expect
(
page
).
not_to
have_selector
(
'.loading-status .loading'
,
visible:
true
)
end
it
'paginates projects'
,
:js
do
it
'paginates projects'
,
:js
do
project
=
create
(
:project
,
namespace:
user
.
namespace
,
updated_at:
2
.
minutes
.
since
)
project
=
create
(
:project
,
namespace:
user
.
namespace
,
updated_at:
2
.
minutes
.
since
)
project2
=
create
(
:project
,
namespace:
user
.
namespace
,
updated_at:
1
.
minute
.
since
)
project2
=
create
(
:project
,
namespace:
user
.
namespace
,
updated_at:
1
.
minute
.
since
)
allow
(
Project
).
to
receive
(
:default_per_page
).
and_return
(
1
)
allow
(
Project
).
to
receive
(
:default_per_page
).
and_return
(
1
)
sign_in
(
user
)
sign_in
(
user
)
visit
user_path
(
user
)
visit
user_path
(
user
)
click_nav_link
(
'Personal projects'
)
page
.
within
(
'.user-profile-nav'
)
do
click_link
(
'Personal projects'
)
end
wait_for_requests
wait_for_requests
...
@@ -92,7 +97,6 @@ describe 'Users > User browses projects on user page', :js do
...
@@ -92,7 +97,6 @@ describe 'Users > User browses projects on user page', :js do
click_nav_link
(
'Personal projects'
)
click_nav_link
(
'Personal projects'
)
expect
(
title
).
to
start_with
(
user
.
name
)
expect
(
title
).
to
start_with
(
user
.
name
)
expect
(
page
).
to
have_content
(
private_project
.
name
)
expect
(
page
).
to
have_content
(
private_project
.
name
)
expect
(
page
).
to
have_content
(
public_project
.
name
)
expect
(
page
).
to
have_content
(
public_project
.
name
)
expect
(
page
).
to
have_content
(
internal_project
.
name
)
expect
(
page
).
to
have_content
(
internal_project
.
name
)
...
...
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