FEATURE: Send notifications to admins when new features are released (#19460)

This commit adds a new notification that gets sent to admins when the site gets new features after an upgrade/deploy. Clicking on the notification takes the admin to the admin dashboard at `/admin` where they can see the new features under the "New Features" section.

Internal topic: t/87166.
This commit is contained in:
Osama Sayegh
2022-12-15 20:12:53 +03:00
committed by GitHub
parent d9806b5314
commit 1c03d6f9b9
15 changed files with 289 additions and 8 deletions

View File

@ -24,8 +24,14 @@ class Admin::DashboardController < Admin::StaffController
end
def new_features
new_features = DiscourseUpdates.new_features
if current_user.admin? && most_recent = new_features&.first
DiscourseUpdates.bump_last_viewed_feature_date(current_user.id, most_recent["created_at"])
end
data = {
new_features: DiscourseUpdates.new_features,
new_features: new_features,
has_unseen_features: DiscourseUpdates.has_unseen_features?(current_user.id),
release_notes_link: AdminDashboardGeneralData.fetch_cached_stats["release_notes_link"]
}