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
d2e070e8
Commit
d2e070e8
authored
Mar 15, 2020
by
Gilang Gumilar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearrange project-level analytics sidebar menu
parent
67e2ce26
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
19 deletions
+22
-19
app/helpers/analytics_navbar_helper.rb
app/helpers/analytics_navbar_helper.rb
+10
-9
app/views/layouts/nav/sidebar/_analytics_links.html.haml
app/views/layouts/nav/sidebar/_analytics_links.html.haml
+1
-1
ee/app/helpers/ee/analytics_navbar_helper.rb
ee/app/helpers/ee/analytics_navbar_helper.rb
+11
-9
No files found.
app/helpers/analytics_navbar_helper.rb
View file @
d2e070e8
...
...
@@ -14,9 +14,9 @@ module AnalyticsNavbarHelper
def
project_analytics_navbar_links
(
project
,
current_user
)
[
cycle_analytics_navbar_link
(
project
,
current_user
),
repository_analytics_navbar_link
(
project
,
current_user
),
ci_cd_analytics_navbar_link
(
project
,
current_user
)
cycle_analytics_navbar_link
(
project
,
current_user
,
0
),
repository_analytics_navbar_link
(
project
,
current_user
,
3
),
ci_cd_analytics_navbar_link
(
project
,
current_user
,
5
)
].
compact
end
...
...
@@ -30,36 +30,37 @@ module AnalyticsNavbarHelper
NavbarSubItem
.
new
(
args
)
end
def
cycle_analytics_navbar_link
(
project
,
current_user
)
def
cycle_analytics_navbar_link
(
project
,
current_user
,
index
=
0
)
return
unless
project_nav_tab?
(
:cycle_analytics
)
navbar_sub_item
(
title:
_
(
'Value Stream'
),
path:
'cycle_analytics#show'
,
link:
project_cycle_analytics_path
(
project
),
link_to_options:
{
class:
'shortcuts-project-cycle-analytics'
}
link_to_options:
{
class:
'shortcuts-project-cycle-analytics'
,
data:
{
index:
index
}
}
)
end
def
repository_analytics_navbar_link
(
project
,
current_user
)
def
repository_analytics_navbar_link
(
project
,
current_user
,
index
=
0
)
return
if
project
.
empty_repo?
navbar_sub_item
(
title:
_
(
'Repository'
),
path:
'graphs#charts'
,
link:
charts_project_graph_path
(
project
,
current_ref
),
link_to_options:
{
class:
'shortcuts-repository-charts'
}
link_to_options:
{
class:
'shortcuts-repository-charts'
,
data:
{
index:
index
}
}
)
end
def
ci_cd_analytics_navbar_link
(
project
,
current_user
)
def
ci_cd_analytics_navbar_link
(
project
,
current_user
,
index
=
0
)
return
unless
project_nav_tab?
(
:pipelines
)
return
unless
project
.
feature_available?
(
:builds
,
current_user
)
||
!
project
.
empty_repo?
navbar_sub_item
(
title:
_
(
'CI / CD'
),
path:
'pipelines#charts'
,
link:
charts_project_pipelines_path
(
project
)
link:
charts_project_pipelines_path
(
project
),
link_to_options:
{
data:
{
index:
index
}
}
)
end
end
...
...
app/views/layouts/nav/sidebar/_analytics_links.html.haml
View file @
d2e070e8
-
navbar_links
=
links
.
sort_by
(
&
:title
)
-
navbar_links
=
links
.
sort_by
{
|
link
|
[
link
.
link_to_options
.
fetch
(
:data
,
{}).
fetch
(
:index
,
0
),
link
.
title
]
}
-
all_paths
=
navbar_links
.
map
(
&
:path
)
-
analytics_link
=
navbar_links
.
find
{
|
link
|
link
.
title
==
_
(
'Value Stream'
)
}
||
navbar_links
.
first
...
...
ee/app/helpers/ee/analytics_navbar_helper.rb
View file @
d2e070e8
...
...
@@ -7,9 +7,9 @@ module EE
override
:project_analytics_navbar_links
def
project_analytics_navbar_links
(
project
,
current_user
)
super
+
[
insights_navbar_link
(
project
,
current_user
),
code_review_analytics_navbar_link
(
project
,
current_user
),
project_issues_analytics_navbar_link
(
project
,
current_user
)
project_issues_analytics_navbar_link
(
project
,
current_user
,
1
),
insights_navbar_link
(
project
,
current_user
,
2
),
code_review_analytics_navbar_link
(
project
,
current_user
,
4
)
].
compact
end
...
...
@@ -26,14 +26,15 @@ module EE
private
def
project_issues_analytics_navbar_link
(
project
,
current_user
)
def
project_issues_analytics_navbar_link
(
project
,
current_user
,
index
=
0
)
return
unless
::
Feature
.
enabled?
(
:project_level_issues_analytics
,
project
,
default_enabled:
true
)
return
unless
project_nav_tab?
(
:issues_analytics
)
navbar_sub_item
(
title:
_
(
'Issues'
),
path:
'issues_analytics#show'
,
link:
project_analytics_issues_analytics_path
(
project
)
link:
project_analytics_issues_analytics_path
(
project
),
link_to_options:
{
data:
{
index:
index
}
}
)
end
...
...
@@ -89,24 +90,25 @@ module EE
)
end
def
insights_navbar_link
(
project
,
current_user
)
def
insights_navbar_link
(
project
,
current_user
,
index
=
0
)
return
unless
project_nav_tab?
(
:project_insights
)
navbar_sub_item
(
title:
_
(
'Insights'
),
path:
'insights#show'
,
link:
project_insights_path
(
project
),
link_to_options:
{
class:
'shortcuts-project-insights'
,
data:
{
qa_selector:
'project_insights_link'
}
}
link_to_options:
{
class:
'shortcuts-project-insights'
,
data:
{
qa_selector:
'project_insights_link'
,
index:
index
}
}
)
end
def
code_review_analytics_navbar_link
(
project
,
current_user
)
def
code_review_analytics_navbar_link
(
project
,
current_user
,
index
=
0
)
return
unless
project_nav_tab?
(
:code_review
)
navbar_sub_item
(
title:
_
(
'Code Review'
),
path:
'projects/analytics/code_reviews#index'
,
link:
project_analytics_code_reviews_path
(
project
)
link:
project_analytics_code_reviews_path
(
project
),
link_to_options:
{
data:
{
index:
index
}
}
)
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