diff options
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') |