Commit e258cf31 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'unify-some-app-helpers' into 'master'

Move some EE only helper methods to EE modules

See merge request gitlab-org/gitlab-ee!6275
parents c488e07b d63fb0cf
...@@ -4,16 +4,10 @@ module AuthHelper ...@@ -4,16 +4,10 @@ module AuthHelper
PROVIDERS_WITH_ICONS = %w(twitter github gitlab bitbucket google_oauth2 facebook azure_oauth2 authentiq).freeze PROVIDERS_WITH_ICONS = %w(twitter github gitlab bitbucket google_oauth2 facebook azure_oauth2 authentiq).freeze
LDAP_PROVIDER = /\Aldap/ LDAP_PROVIDER = /\Aldap/
delegate :slack_app_id, to: :'Gitlab::CurrentSettings.current_application_settings'
def ldap_enabled? def ldap_enabled?
Gitlab::Auth::LDAP::Config.enabled? Gitlab::Auth::LDAP::Config.enabled?
end end
def kerberos_enabled?
auth_providers.include?(:kerberos)
end
def omniauth_enabled? def omniauth_enabled?
Gitlab.config.omniauth.enabled Gitlab.config.omniauth.enabled
end end
...@@ -80,9 +74,5 @@ module AuthHelper ...@@ -80,9 +74,5 @@ module AuthHelper
%w(saml cas3).exclude?(provider.to_s) %w(saml cas3).exclude?(provider.to_s)
end end
def slack_redirect_uri(project)
slack_auth_project_settings_slack_url(project)
end
extend self extend self
end end
...@@ -85,12 +85,6 @@ module GroupsHelper ...@@ -85,12 +85,6 @@ module GroupsHelper
end end
end end
def size_limit_message_for_group(group)
show_lfs = group.lfs_enabled? ? 'and their respective LFS files' : ''
"Repositories within this group #{show_lfs} will be restricted to this maximum size. Can be overridden inside each project. 0 for unlimited. Leave empty to inherit the global value."
end
def group_lfs_status(group) def group_lfs_status(group)
status = group.lfs_enabled? ? 'enabled' : 'disabled' status = group.lfs_enabled? ? 'enabled' : 'disabled'
......
...@@ -234,12 +234,4 @@ module MilestonesHelper ...@@ -234,12 +234,4 @@ module MilestonesHelper
group_milestone_path(@group, milestone.iid, milestone: params) group_milestone_path(@group, milestone.iid, milestone: params)
end end
end end
def milestone_weight_tooltip_text(weight)
if weight.zero?
_("Weight")
else
_("Weight %{weight}") % { weight: weight }
end
end
end end
...@@ -4,6 +4,8 @@ module EE ...@@ -4,6 +4,8 @@ module EE
GROUP_LEVEL_PROVIDERS = %i(group_saml).freeze GROUP_LEVEL_PROVIDERS = %i(group_saml).freeze
delegate :slack_app_id, to: :'Gitlab::CurrentSettings.current_application_settings'
override :button_based_providers override :button_based_providers
def button_based_providers def button_based_providers
super - GROUP_LEVEL_PROVIDERS super - GROUP_LEVEL_PROVIDERS
...@@ -18,5 +20,13 @@ module EE ...@@ -18,5 +20,13 @@ module EE
def form_based_provider?(name) def form_based_provider?(name)
super || name.to_s == 'kerberos' super || name.to_s == 'kerberos'
end end
def kerberos_enabled?
auth_providers.include?(:kerberos)
end
def slack_redirect_uri(project)
slack_auth_project_settings_slack_url(project)
end
end end
end end
...@@ -11,6 +11,12 @@ module EE ...@@ -11,6 +11,12 @@ module EE
end end
end end
def size_limit_message_for_group(group)
show_lfs = group.lfs_enabled? ? 'and their respective LFS files' : ''
"Repositories within this group #{show_lfs} will be restricted to this maximum size. Can be overridden inside each project. 0 for unlimited. Leave empty to inherit the global value."
end
private private
def get_group_sidebar_links def get_group_sidebar_links
......
...@@ -38,6 +38,14 @@ module EE ...@@ -38,6 +38,14 @@ module EE
end end
end end
def milestone_weight_tooltip_text(weight)
if weight.zero?
_("Weight")
else
_("Weight %{weight}") % { weight: weight }
end
end
private private
def can_admin_milestone?(milestone) def can_admin_milestone?(milestone)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment