Commit graph

9 commits

Author SHA1 Message Date
Thong Kuah
0e78834bc9 Move code to presenter
Part of the code such as #show_path is already present on the presenter.
Also avoid having code in two places (helper and presenter)

Sanitize and assert html_safe. Additional layer of defense - on top of
GitLab already requiring group names to be composed of small set of
chars A-Z, - and spaces.

Only link to cluster if user can read cluster

Make clear that arg is a GroupClusterablePresenter

Add more specs for completeness
2018-12-17 09:51:53 +13:00
Thong Kuah
459758921f Move description of cluster type to presenter 2018-12-13 20:53:15 +13:00
Thong Kuah
b4488cee97 Consolidate how we allow user defined namespace
Use model method as single source of truth instead of splitting between
presenter and Kubernetes model
2018-11-08 23:28:30 +13:00
Thong Kuah
5a042ef2fb Only project clusters has Project Namespace field
Group clusters should not allow Project Namespace so don't show that
field input too
2018-11-08 23:28:30 +13:00
Thong Kuah
54e8ff0f21 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
2018-11-08 23:14:06 +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
gfyoung
d5bf57a6af Enable frozen string in presenters and policies
Enable frozen string in:

* app/presenters
* app/policies

Partially addresses #47424.
2018-07-24 13:18:25 -07:00
Matija Čupić
83648f243d
Move can_toggle_cluster? from helper to presenter 2017-12-05 17:09:04 +01:00
Shinya Maeda
d0cff7f585 This works 2017-10-23 11:36:35 +03:00