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
c3ba5ac5
Commit
c3ba5ac5
authored
Feb 03, 2020
by
Takuya Noguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid loading user activity calendar on mobile
Signed-off-by:
Takuya Noguchi
<
takninnovationresearch@gmail.com
>
parent
bfa3e62d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
8 deletions
+34
-8
app/assets/javascripts/pages/users/user_tabs.js
app/assets/javascripts/pages/users/user_tabs.js
+2
-1
changelogs/unreleased/201743-avoid-loading-user-activity-calendar-data-on-mobile.yml
...3-avoid-loading-user-activity-calendar-data-on-mobile.yml
+5
-0
spec/features/calendar_spec.rb
spec/features/calendar_spec.rb
+27
-7
No files found.
app/assets/javascripts/pages/users/user_tabs.js
View file @
c3ba5ac5
import
$
from
'
jquery
'
;
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
Activities
from
'
~/activities
'
;
import
{
localTimeAgo
}
from
'
~/lib/utils/datetime_utility
'
;
...
...
@@ -209,7 +210,7 @@ export default class UserTabs {
loadActivityCalendar
()
{
const
$calendarWrap
=
this
.
$parentEl
.
find
(
'
.tab-pane.active .user-calendar
'
);
if
(
!
$calendarWrap
.
length
)
return
;
if
(
!
$calendarWrap
.
length
||
bp
.
getBreakpointSize
()
===
'
xs
'
)
return
;
const
calendarPath
=
$calendarWrap
.
data
(
'
calendarPath
'
);
...
...
changelogs/unreleased/201743-avoid-loading-user-activity-calendar-data-on-mobile.yml
0 → 100644
View file @
c3ba5ac5
---
title
:
Avoid loading user activity calendar on mobile
merge_request
:
24277
author
:
Takuya Noguchi
type
:
fixed
spec/features/calendar_spec.rb
View file @
c3ba5ac5
...
...
@@ -3,6 +3,8 @@
require
'spec_helper'
describe
'Contributions Calendar'
,
:js
do
include
MobileHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:contributed_project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:issue_note
)
{
create
(
:note
,
project:
contributed_project
)
}
...
...
@@ -122,7 +124,6 @@ describe 'Contributions Calendar', :js do
end
end
describe
'calendar daily activities'
do
shared_context
'visit user page'
do
before
do
visit
user
.
username
...
...
@@ -131,6 +132,7 @@ describe 'Contributions Calendar', :js do
end
end
describe
'calendar daily activities'
do
shared_examples
'a day with activity'
do
|
contribution_count
:|
include_context
'visit user page'
...
...
@@ -199,4 +201,22 @@ describe 'Contributions Calendar', :js do
end
end
end
describe
'on smaller screens'
do
shared_examples
'hidden activity calendar'
do
include_context
'visit user page'
it
'hides the activity calender'
do
expect
(
find
(
'#js-overview'
)).
not_to
have_css
(
'.js-contrib-calendar'
)
end
end
context
'size xs'
do
before
do
resize_screen_xs
end
it_behaves_like
'hidden activity calendar'
end
end
end
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