diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:39 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:39 +0000 |
commit | dc889678d1de8c09310b2f8f9742bb6c78a6f1a4 (patch) | |
tree | 70945aa6721a271fc8057efa13c3216a03fbac45 /app/helpers | |
parent | cd52759ee33051b8ad7b88b02ba7954e4fad7018 (diff) | |
download | gitlab-ce-dc889678d1de8c09310b2f8f9742bb6c78a6f1a4.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/auth_helper.rb | 4 | ||||
-rw-r--r-- | app/helpers/clusters_helper.rb | 27 |
2 files changed, 29 insertions, 2 deletions
diff --git a/app/helpers/auth_helper.rb b/app/helpers/auth_helper.rb index 1f15ac42260..26d73007e65 100644 --- a/app/helpers/auth_helper.rb +++ b/app/helpers/auth_helper.rb @@ -5,11 +5,11 @@ module AuthHelper LDAP_PROVIDER = /\Aldap/.freeze def ldap_enabled? - Gitlab::Auth::LDAP::Config.enabled? + Gitlab::Auth::Ldap::Config.enabled? end def ldap_sign_in_enabled? - Gitlab::Auth::LDAP::Config.sign_in_enabled? + Gitlab::Auth::Ldap::Config.sign_in_enabled? end def omniauth_enabled? diff --git a/app/helpers/clusters_helper.rb b/app/helpers/clusters_helper.rb index 80bf765f3a4..21bd2ff9e32 100644 --- a/app/helpers/clusters_helper.rb +++ b/app/helpers/clusters_helper.rb @@ -26,11 +26,38 @@ module ClustersHelper end end + def render_cluster_info_tab_content(tab, expanded) + case tab + when 'environments' + render_if_exists 'clusters/clusters/environments' + when 'health' + render_if_exists 'clusters/clusters/health' + when 'apps' + render 'applications' + when 'settings' + render 'advanced_settings_container' + else + render('details', expanded: expanded) + end + end + def has_rbac_enabled?(cluster) return cluster.platform_kubernetes_rbac? if cluster.platform_kubernetes cluster.provider.has_rbac_enabled? end + + def project_cluster?(cluster) + cluster.cluster_type.in?('project_type') + end + + def cluster_created?(cluster) + !cluster.status_name.in?(%i/scheduled creating/) + end + + def can_admin_cluster?(user, cluster) + can?(user, :admin_cluster, cluster) + end end ClustersHelper.prepend_if_ee('EE::ClustersHelper') |