2020-08-26 02:10:34 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module WhatsNewHelper
|
2020-09-28 14:09:40 -04:00
|
|
|
def whats_new_most_recent_release_items_count
|
2020-11-24 13:09:14 -05:00
|
|
|
ReleaseHighlight.most_recent_item_count
|
2020-09-28 14:09:40 -04:00
|
|
|
end
|
|
|
|
|
2021-04-12 17:11:12 -04:00
|
|
|
def whats_new_version_digest
|
|
|
|
ReleaseHighlight.most_recent_version_digest
|
2020-12-10 10:10:12 -05:00
|
|
|
end
|
2021-04-15 11:09:11 -04:00
|
|
|
|
|
|
|
def display_whats_new?
|
2022-03-10 22:08:14 -05:00
|
|
|
(Gitlab.org_or_com? || user_signed_in?) &&
|
2021-04-27 11:09:52 -04:00
|
|
|
!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'
|
2021-07-05 08:08:33 -04:00
|
|
|
_("Include new features from all tiers.")
|
2021-04-27 11:09:52 -04:00
|
|
|
when 'current_tier'
|
2021-07-05 08:08:33 -04:00
|
|
|
_("Only include features new to your current subscription tier.")
|
2021-04-27 11:09:52 -04:00
|
|
|
when 'disabled'
|
2021-07-05 08:08:33 -04:00
|
|
|
_("%{italic_start}What's new%{italic_end} is inactive and cannot be viewed.").html_safe % { italic_start: '<i>'.html_safe, italic_end: '</i>'.html_safe }
|
2021-04-27 11:09:52 -04:00
|
|
|
end
|
2021-04-15 11:09:11 -04:00
|
|
|
end
|
2020-08-26 02:10:34 -04:00
|
|
|
end
|