Commit Graph

12 Commits

Author SHA1 Message Date
Thong Kuah 2c6a3f6a1a Remove method as using nested resource routes
We introduced hidden_clusterable_fields in this MR but it is no longer
needed as we have gone back to nested resource routes which should
provide the params such as `project_id`.
2018-11-02 10:40:56 +13: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 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
Thong Kuah 56f309dd53 Remove `rbac_clusters` feature flag
Now that Auto DevOps can run in a RBAC enabled cluster from
https://gitlab.com/gitlab-org/gitlab-ce/issues/51942, we can now remove
the FF.

As the flag only governed if UI elements would appear or not when
creating/adding existing clusters; the effect of removing the FF would
be that the checkbox to choose to enable RBAC clusters will now always
appear.

Remove FF stubs from specs

Improve spec context names
2018-10-04 14:31:05 +13:00
gfyoung 1993a4449a Enable frozen string for app/helpers/**/*.rb
Partially addresses #47424.
2018-09-06 17:33:46 -07:00
Thong Kuah 6f2ad2b604 Enable Kubernetes RBAC for GitLab Managed Apps for existing clusters 2018-09-06 10:03:38 +00:00
Dennis Tang fe268175a2 Resolve "Disable GCP free credit banner at instance level" 2018-07-10 13:20:05 +00:00
Dennis Tang a9496c27c9 Resolve "Inform users of up to $500 offer for GCP account" 2018-05-07 18:06:02 +00:00
Matija Čupić 2b45ae0933
Hardcode clusters helper in CE 2017-12-18 14:35:08 +01:00
Matija Čupić dd66c6a2d8
Use helper for feature check in cluster partials 2017-12-18 14:13:57 +01:00