FEATURE: Unseen feature indicator in admin sidebar (#28397)

This commit adds a blue dot next to the "What's New"
link in the admin sidebar if the user has not seen the
new features yet, as a followup to 3e5976f843
which removed the tab on the dashboard that had this same
functionality.

When the admin visits the "What's New" page they count
as having seen all the features straight away. This could
be something we want to change, but for now this keeps the
same functionality.
This commit is contained in:
Martin Brennan
2024-08-19 14:50:30 +10:00
committed by GitHub
parent 32195ed77e
commit 31a6d24053
7 changed files with 92 additions and 5 deletions

View File

@@ -77,7 +77,8 @@ class CurrentUserSerializer < BasicUserSerializer
:can_view_raw_email,
:use_glimmer_topic_list?,
:login_method,
:render_experimental_about_page
:render_experimental_about_page,
:has_unseen_features
delegate :user_stat, to: :object, private: true
delegate :any_posts, :draft_count, :pending_posts_count, :read_faq?, to: :user_stat
@@ -142,6 +143,14 @@ class CurrentUserSerializer < BasicUserSerializer
object.staff?
end
def has_unseen_features
DiscourseUpdates.has_unseen_features?(object.id)
end
def include_has_unseen_features?
object.staff?
end
def render_experimental_about_page
object.in_any_groups?(SiteSetting.experimental_redesigned_about_page_groups_map)
end