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
Jérome Perrin
gitlab-ce
Commits
6e3ca79d
Commit
6e3ca79d
authored
Aug 10, 2017
by
Mehdi Lahmam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a `Last 7 days` option for Cycle Analytics view
parent
4e8a2feb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
app/controllers/concerns/cycle_analytics_params.rb
app/controllers/concerns/cycle_analytics_params.rb
+8
-1
app/views/projects/cycle_analytics/show.html.haml
app/views/projects/cycle_analytics/show.html.haml
+3
-0
changelogs/unreleased/seven-days-cycle-analytics.yml
changelogs/unreleased/seven-days-cycle-analytics.yml
+5
-0
spec/features/cycle_analytics_spec.rb
spec/features/cycle_analytics_spec.rb
+14
-0
No files found.
app/controllers/concerns/cycle_analytics_params.rb
View file @
6e3ca79d
...
@@ -6,6 +6,13 @@ module CycleAnalyticsParams
...
@@ -6,6 +6,13 @@ module CycleAnalyticsParams
end
end
def
start_date
(
params
)
def
start_date
(
params
)
params
[
:start_date
]
==
'30'
?
30
.
days
.
ago
:
90
.
days
.
ago
case
params
[
:start_date
]
when
'7'
7
.
days
.
ago
when
'30'
30
.
days
.
ago
else
90
.
days
.
ago
end
end
end
end
end
app/views/projects/cycle_analytics/show.html.haml
View file @
6e3ca79d
...
@@ -39,6 +39,9 @@
...
@@ -39,6 +39,9 @@
%span
.dropdown-label
{{ n__('Last %d day', 'Last %d days', 30) }}
%span
.dropdown-label
{{ n__('Last %d day', 'Last %d days', 30) }}
%i
.fa.fa-chevron-down
%i
.fa.fa-chevron-down
%ul
.dropdown-menu.dropdown-menu-align-right
%ul
.dropdown-menu.dropdown-menu-align-right
%li
%a
{
"href"
=>
"#"
,
"data-value"
=>
"7"
}
{{ n__('Last %d day', 'Last %d days', 7) }}
%li
%li
%a
{
"href"
=>
"#"
,
"data-value"
=>
"30"
}
%a
{
"href"
=>
"#"
,
"data-value"
=>
"30"
}
{{ n__('Last %d day', 'Last %d days', 30) }}
{{ n__('Last %d day', 'Last %d days', 30) }}
...
...
changelogs/unreleased/seven-days-cycle-analytics.yml
0 → 100644
View file @
6e3ca79d
---
title
:
Add a `Last 7 days` option for Cycle Analytics view
merge_request
:
13443
author
:
Mehdi Lahmam (@mehlah)
type
:
added
spec/features/cycle_analytics_spec.rb
View file @
6e3ca79d
...
@@ -75,6 +75,20 @@ feature 'Cycle Analytics', js: true do
...
@@ -75,6 +75,20 @@ feature 'Cycle Analytics', js: true do
click_stage
(
'Production'
)
click_stage
(
'Production'
)
expect_issue_to_be_present
expect_issue_to_be_present
end
end
context
"when I change the time period observed"
do
before
do
_two_weeks_old_issue
=
create
(
:issue
,
project:
project
,
created_at:
2
.
weeks
.
ago
)
click_button
(
'Last 30 days'
)
click_link
(
'Last 7 days'
)
wait_for_requests
end
it
'shows only relevant data'
do
expect
(
new_issues_counter
).
to
have_content
(
'1'
)
end
end
end
end
context
"when my preferred language is Spanish"
do
context
"when my preferred language is Spanish"
do
...
...
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