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
c9a7145a
Commit
c9a7145a
authored
Jun 29, 2018
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove GET empty from EnvironmentsController
parent
dd467d6c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
25 deletions
+8
-25
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+5
-12
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+1
-1
config/routes/project.rb
config/routes/project.rb
+0
-1
spec/controllers/projects/environments_controller_spec.rb
spec/controllers/projects/environments_controller_spec.rb
+2
-11
No files found.
app/controllers/projects/environments_controller.rb
View file @
c9a7145a
...
...
@@ -120,21 +120,14 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
end
def
empty
render
:empty
end
def
metrics_redirect
environment
=
project
.
environments
.
with_state
(
:available
).
first
path
=
if
environment
environment_metrics_path
(
environment
)
redirect_to
environment_metrics_path
(
environment
)
else
empty_project_environments_path
(
project
)
render
:empty
end
redirect_to
path
end
def
metrics
...
...
app/views/layouts/nav/sidebar/_project.html.haml
View file @
c9a7145a
...
...
@@ -210,7 +210,7 @@
%li
.divider.fly-out-top-item
-
if
project_nav_tab?
:environments
=
nav_link
(
controller: :environments
,
action:
[
:metrics
,
:
empty
])
do
=
nav_link
(
controller: :environments
,
action:
[
:metrics
,
:
metrics_redirect
])
do
=
link_to
metrics_project_environments_path
(
@project
),
title:
'Metrics'
,
class:
'shortcuts-metrics'
do
%span
=
_
(
'Metrics'
)
...
...
config/routes/project.rb
View file @
c9a7145a
...
...
@@ -236,7 +236,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
collection
do
get
:metrics
,
action: :metrics_redirect
get
:empty
get
:folder
,
path:
'folders/*id'
,
constraints:
{
format:
/(html|json)/
}
end
...
...
spec/controllers/projects/environments_controller_spec.rb
View file @
c9a7145a
...
...
@@ -277,16 +277,6 @@ describe Projects::EnvironmentsController do
end
end
describe
'GET #empty'
do
it
'responds with HTML'
do
get
:empty
,
namespace_id:
project
.
namespace
,
project_id:
project
expect
(
response
).
to
be_ok
expect
(
response
).
to
render_template
'empty'
end
end
describe
'GET #metrics_redirect'
do
let
(
:project
)
{
create
(
:project
)
}
...
...
@@ -301,7 +291,8 @@ describe Projects::EnvironmentsController do
it
'redirects to empty page if no environment exists'
do
get
:metrics_redirect
,
environment_params
expect
(
response
).
to
redirect_to
(
empty_project_environments_path
(
project
))
expect
(
response
).
to
be_ok
expect
(
response
).
to
render_template
'empty'
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