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
3c49bcb6
Commit
3c49bcb6
authored
Jun 20, 2018
by
Tiago Botelho
Committed by
Jose
Jun 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds metrics to Operartions tab in projects sidebar
parent
292cf668
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
0 deletions
+17
-0
app/controllers/projects/application_controller.rb
app/controllers/projects/application_controller.rb
+5
-0
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-0
app/helpers/environments_helper.rb
app/helpers/environments_helper.rb
+6
-0
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+5
-0
No files found.
app/controllers/projects/application_controller.rb
View file @
3c49bcb6
...
...
@@ -5,6 +5,7 @@ class Projects::ApplicationController < ApplicationController
skip_before_action
:authenticate_user!
before_action
:project
before_action
:repository
before_action
:environment
layout
'project'
helper_method
:repository
,
:can_collaborate_with_project?
,
:user_access
...
...
@@ -32,6 +33,10 @@ class Projects::ApplicationController < ApplicationController
@repository
||=
project
.
repository
end
def
environment
@environment
||=
project
.
environments
.
first
end
def
authorize_action!
(
action
)
unless
can?
(
current_user
,
action
,
project
)
return
access_denied!
...
...
app/controllers/projects_controller.rb
View file @
3c49bcb6
...
...
@@ -8,6 +8,7 @@ class ProjectsController < Projects::ApplicationController
before_action
:redirect_git_extension
,
only:
[
:show
]
before_action
:project
,
except:
[
:index
,
:new
,
:create
]
before_action
:repository
,
except:
[
:index
,
:new
,
:create
]
before_action
:environment
,
except:
[
:index
,
:new
,
:create
]
before_action
:assign_ref_vars
,
only:
[
:show
],
if: :repo_exists?
before_action
:tree
,
only:
[
:show
],
if:
[
:repo_exists?
,
:project_view_files?
]
before_action
:lfs_blob_ids
,
only:
[
:show
],
if:
[
:repo_exists?
,
:project_view_files?
]
...
...
app/helpers/environments_helper.rb
View file @
3c49bcb6
...
...
@@ -4,4 +4,10 @@ module EnvironmentsHelper
endpoint:
project_environments_path
(
@project
,
format: :json
)
}
end
def
metrics_path
(
project
,
environment
)
metrics_project_environment_path
(
project
,
environment
)
if
environment
project_environments_path
(
project
)
end
end
app/views/layouts/nav/sidebar/_project.html.haml
View file @
3c49bcb6
...
...
@@ -210,6 +210,11 @@
%li
.divider.fly-out-top-item
-
if
project_nav_tab?
:environments
=
nav_link
(
controller:
[
:environments
,
:metrics
])
do
=
link_to
metrics_path
(
@project
,
@environment
),
title:
'Metrics'
,
class:
'shortcuts-environments'
do
%span
=
_
(
'Metrics'
)
=
nav_link
(
controller: :environments
)
do
=
link_to
project_environments_path
(
@project
),
title:
'Environments'
,
class:
'shortcuts-environments'
do
%span
...
...
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