summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-06-21 10:05:25 +0100
committerJose <jvargas@gitlab.com>2018-06-26 23:06:25 -0500
commit55943872f43798b58009c4248d993cc8cb8d34cc (patch)
tree626c2e14592a7dcb8853e0a8ad5debdfdf374d5d /app/controllers
parent3c49bcb602a38364d0034bfe927097bedbca986c (diff)
downloadgitlab-ce-55943872f43798b58009c4248d993cc8cb8d34cc.tar.gz
Adds empty environments page
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/application_controller.rb6
-rw-r--r--app/controllers/projects/environments_controller.rb4
-rw-r--r--app/controllers/projects_controller.rb2
3 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb
index 719a3c37f45..5475e333db9 100644
--- a/app/controllers/projects/application_controller.rb
+++ b/app/controllers/projects/application_controller.rb
@@ -5,7 +5,7 @@ class Projects::ApplicationController < ApplicationController
skip_before_action :authenticate_user!
before_action :project
before_action :repository
- before_action :environment
+ before_action :available_environment
layout 'project'
helper_method :repository, :can_collaborate_with_project?, :user_access
@@ -33,8 +33,8 @@ class Projects::ApplicationController < ApplicationController
@repository ||= project.repository
end
- def environment
- @environment ||= project.environments.first
+ def available_environment
+ @available_environment ||= project.environments.with_state(:available).first
end
def authorize_action!(action)
diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb
index 0821362f5df..47b2028860d 100644
--- a/app/controllers/projects/environments_controller.rb
+++ b/app/controllers/projects/environments_controller.rb
@@ -31,6 +31,10 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
end
+ def empty
+ render :empty
+ end
+
def folder
folder_environments = project.environments.where(environment_type: params[:id])
@environments = folder_environments.with_state(params[:scope] || :available)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 582e4d26685..5a6ccd629d1 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -8,7 +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 :available_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?]