Plugin for Discourse Admins
Discourse Disable New Features Notice
Why this Plugin?
Discourse recently added Ruby and EmberJS code to check for "new features" and to display these new features in the Discourse Admin Dashboard using a huge banner which must be manually dismissed.
How Does It Work?
# frozen_string_literal: true
# name: discourse-disable-new-features-notice
# about: Disables new features notices in admin dashboard
# version: 0.139
# date: 6 March 2020
# authors: Neo
# url: https://github.com/unixneo/discourse-disable-new-features-notice.git
PLUGIN_NAME = "discourse-disable-new-features-notice"
enabled_site_setting :enable_disable_new_features_notice
after_initialize do
Admin::DashboardController.class_eval do
before_action :mark_new_features_as_seen
def new_features
new_features = DiscourseUpdates.new_features
has_unseen_features = DiscourseUpdates.has_unseen_features?(current_user.id)
if SiteSetting.enable_disable_new_features_notice? && SiteSetting.disable_new_features_fixed_notice?
new_features = nil
has_unseen_features = false
end
data = {
new_features: new_features,
has_unseen_features: has_unseen_features,
release_notes_link: AdminDashboardGeneralData.fetch_cached_stats["release_notes_link"]
}
render json: data
end
private
def mark_new_features_as_seen
if SiteSetting.enable_disable_new_features_notice? && SiteSetting.disable_new_features_dismissable_notice?
DiscourseUpdates.mark_new_features_as_seen(current_user.id)
end
end
end
end
Personally, I prefer not to hide HTML elements when I can easily just remove them from the DOM, hence, I wrote this plugin:
I'm not trying to be anti-social, but this huge notice in the admin panel can be annoying (especially the silly icons).
See Also:
Future Enhancements (Done)
I did not test it, but I assume Discourse moderators also see this huge banner. If anyone (or any moderators) want to see this notice in the admin panel, I can easily modify this plugin so Discourse admins can enter the user ids of those who wish to have this notice suppressed (as a site setting) so this notice can be disabled based on the user id. The current plugin disables this notice for everyone (the "hammer" approach).