diff options
Diffstat (limited to 'app/helpers/whats_new_helper.rb')
-rw-r--r-- | app/helpers/whats_new_helper.rb | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/app/helpers/whats_new_helper.rb b/app/helpers/whats_new_helper.rb index 9362ae1491f..5fca00c5dce 100644 --- a/app/helpers/whats_new_helper.rb +++ b/app/helpers/whats_new_helper.rb @@ -10,6 +10,33 @@ module WhatsNewHelper end def display_whats_new? - Gitlab.dev_env_org_or_com? || user_signed_in? + (Gitlab.dev_env_org_or_com? || user_signed_in?) && + !Gitlab::CurrentSettings.current_application_settings.whats_new_variant_disabled? + end + + def whats_new_variants + ApplicationSetting.whats_new_variants + end + + def whats_new_variants_label(variant) + case variant + when 'all_tiers' + _("Enable What's new: All tiers") + when 'current_tier' + _("Enable What's new: Current tier only") + when 'disabled' + _("Disable What's new") + end + end + + def whats_new_variants_description(variant) + case variant + when 'all_tiers' + _("What's new presents new features from all tiers to help you keep track of all new features.") + when 'current_tier' + _("What's new presents new features for your current subscription tier, while hiding new features not available to your subscription tier.") + when 'disabled' + _("What's new is disabled and can no longer be viewed.") + end end end |