diff options
author | Thong Kuah <tkuah@gitlab.com> | 2018-10-23 16:51:29 +1300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2018-11-08 23:14:06 +1300 |
commit | 54e8ff0f218371262d85989b3e08fd1a22958717 (patch) | |
tree | 5927446b7be5f1b0cb298d215dba737a5f630c23 /app/controllers | |
parent | 76991929855f2a9f801fa16f80ccebad28853dd8 (diff) | |
download | gitlab-ce-54e8ff0f218371262d85989b3e08fd1a22958717.tar.gz |
Extend clusters_controller for group type clusters
- Add pages javascripts to intialize clusters for group pages
- Move specs asserting gcp specific validations from controller into
UpdateService spec
- Also teach Clusters::ApplicationController about groups
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/groups/clusters/applications_controller.rb | 18 | ||||
-rw-r--r-- | app/controllers/groups/clusters_controller.rb | 20 |
2 files changed, 38 insertions, 0 deletions
diff --git a/app/controllers/groups/clusters/applications_controller.rb b/app/controllers/groups/clusters/applications_controller.rb new file mode 100644 index 00000000000..8dd8a01cf40 --- /dev/null +++ b/app/controllers/groups/clusters/applications_controller.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class Groups::Clusters::ApplicationsController < Clusters::ApplicationsController + include ControllerWithCrossProjectAccessCheck + + prepend_before_action :group + requires_cross_project_access + + private + + def clusterable + @clusterable ||= ClusterablePresenter.fabricate(group, current_user: current_user) + end + + def group + @group ||= find_routable!(Group, params[:group_id] || params[:id]) + end +end diff --git a/app/controllers/groups/clusters_controller.rb b/app/controllers/groups/clusters_controller.rb new file mode 100644 index 00000000000..92602fd8096 --- /dev/null +++ b/app/controllers/groups/clusters_controller.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class Groups::ClustersController < Clusters::ClustersController + include ControllerWithCrossProjectAccessCheck + + prepend_before_action :group + requires_cross_project_access + + layout 'group' + + private + + def clusterable + @clusterable ||= ClusterablePresenter.fabricate(group, current_user: current_user) + end + + def group + @group ||= find_routable!(Group, params[:group_id] || params[:id]) + end +end |