Commit Graph

10 Commits

Author SHA1 Message Date
GitLab Bot a544d1da18 Add latest changes from gitlab-org/gitlab@master 2020-08-10 03:09:44 +00:00
GitLab Bot 4ab94bde3a Add latest changes from gitlab-org/gitlab@master 2020-07-22 00:09:26 +00:00
GitLab Bot 1b3eb6f388 Add latest changes from gitlab-org/gitlab@master 2020-06-11 06:08:22 +00:00
GitLab Bot dc003cd08b Add latest changes from gitlab-org/gitlab@master 2020-03-26 18:08:03 +00:00
Ryan Cobb 935ecf5c91 Add method to authorize reading from prometheus proxy 2019-09-07 08:24:33 +00:00
Thong Kuah 1a1fdf8efe Resolve controller sharing concern
Use ClustersController as base while having Projects::ClustersController
to inform what `clusterable` is. Thanks @ayufan for the great suggestion
!

- View changes to work with new approach

- Fix javascript for new approach

- Fix feature specs for new approach

- Fix QA
2018-11-01 19:37:33 +13:00
Thong Kuah 28dabc67f4 Restore 403 functionality for external auth (EE)
When we unhooked ClustersController from
Project::ApplicationsController, we missed an EE override to
handle_not_found_or_authorized.

Rather than carry on with override RoutingActions, make a specific proc
for Project that we override in EE instead. Use that proc in both
Clusters::BaseController and Project::ApplicationsController.
2018-11-01 19:37:32 +13:00
Thong Kuah 1163b23539 Move view and path concerns to presenters
- Move show path for cluster to ClusterPresenter

- Create ClusterablePresenter to encapsulate logic. Consolidates
scattered methods from BaseController and ClustersHelper into an object.
2018-11-01 19:37:32 +13:00
Thong Kuah 88800abcd8 Abstract out project out of ClustersController
To the extent possible swap out `project` with `clusterable`

- Abstract paths for showing cluster or clusters. This will allow us to
swap in alternative paths for group level cluster

- Push :project_id and :namespace_id params from the URL to the POST
body.

- Create a nice helper for to generate links for the destroy
action

For some reason, spec :project_id and :namespace_id param are not going
through `to_param` for a JSON format. Manually call `to_param` to fix
specs.

- Move :layout to BaseController
2018-11-01 19:36:58 +13:00
Thong Kuah 5b3c096c9e Convert clusters to use a top-level controller
In preparation so that we can create both cluster attached to project
and cluster attached to group.

- Move ClustersController to top level

- Move Clusters::ApplicationsController to top-level too

- Creates a Clusters::BaseController to share common functions

- Do not rely on @project ivar. Anything could set the ivar.

- Fix Vue page components due to new data-page value

Because of the controller change we have gone from
`projects:clusters:new` to `clusters:new`, so we need to update the file
location of the page components. There is somewhere a function that will
convert data-page to a file location.

On that note, projects/clusters/gcp/new/, translate to
Projects::Clusters::Gcp#new doesn't exist so replace that with
clusters/create_gcp/ and clusters/create_user/
2018-11-01 18:38:36 +13:00