diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 24b0df10810..729867d1660 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -2021,10 +2021,7 @@ class CoursesController < ApplicationController js_env(:SHOW_ANNOUNCEMENTS => true, :ANNOUNCEMENT_LIMIT => @context.home_page_announcement_limit) end - if @domain_root_account&.feature_enabled?(:mute_notifications_by_course) && params[:view] == 'notifications' - render_course_notification_settings - return - end + return render_course_notification_settings if params[:view] == 'notifications' @contexts = [@context] case @course_home_view diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 92fb362e772..a168f33c8d5 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -171,7 +171,7 @@ <% end %> - <% if @context_enrollment && @domain_root_account.try(:feature_enabled?, :mute_notifications_by_course) %> + <% if @context_enrollment %> "> <%= t('links.view_course_notification_settings', %{View Course Notifications}) %> diff --git a/config/feature_flags/vice_release_flags.yml b/config/feature_flags/vice_release_flags.yml index 16fe7df24da..1e15456e6bf 100644 --- a/config/feature_flags/vice_release_flags.yml +++ b/config/feature_flags/vice_release_flags.yml @@ -30,13 +30,6 @@ hide_course_sections_from_students: Allows teachers to hide course sections from students on the People page when there is more than one section in the course. applies_to: RootAccount -mute_notifications_by_course: - state: hidden - display_name: Mute notifications by course - description: |- - Allows users to mute notifications on a course level granularity. - applies_to: RootAccount - notification_granular_course_preferences: state: hidden display_name: Course level overrides for notification preferences diff --git a/lib/notification_message_creator.rb b/lib/notification_message_creator.rb index 68e60e1483a..d796a572d48 100644 --- a/lib/notification_message_creator.rb +++ b/lib/notification_message_creator.rb @@ -44,7 +44,6 @@ class NotificationMessageCreator if course_id && root_account_id @account = Account.new(id: root_account_id) @course = Course.new(id: course_id) - @mute_notifications_by_course_enabled = @account.feature_enabled?(:mute_notifications_by_course) @override_preferences_enabled = Account.site_admin.feature_enabled?(:notification_granular_course_preferences) end end @@ -109,9 +108,9 @@ class NotificationMessageCreator # if the message is not summarizable?, it is in a context that notifications # cannot be disabled, so return true before checking. return true unless @notification.summarizable? - if @mute_notifications_by_course_enabled - return NotificationPolicyOverride.enabled_for(user, context) - end + + return NotificationPolicyOverride.enabled_for(user, context) if context + true end diff --git a/spec/controllers/courses_controller_spec.rb b/spec/controllers/courses_controller_spec.rb index 9165bde5216..66abcb02beb 100644 --- a/spec/controllers/courses_controller_spec.rb +++ b/spec/controllers/courses_controller_spec.rb @@ -642,8 +642,7 @@ describe CoursesController do @teacher = course_with_user("TeacherEnrollment", course: @course, active_all: true).user end - it 'shows the course notification settings page if enabled' do - Account.default.enable_feature!(:mute_notifications_by_course) + it 'shows the course notification settings page' do user_session(@teacher) get 'show', params: {id: @course.id, view: 'notifications'} expect(response).to be_successful @@ -654,18 +653,6 @@ describe CoursesController do end expect(contains_js_bundle).to be true end - - it 'does not show the course notification settings page if disabled' do - user_session(@teacher) - get 'show', params: {id: @course.id, view: 'notifications'} - expect(response).to be_successful - - contains_js_bundle = false - assigns['js_bundles'].each do |js_bundle| - contains_js_bundle = js_bundle.include? :course_notification_settings_show if js_bundle.include? :course_notification_settings_show - end - expect(contains_js_bundle).to be false - end end end diff --git a/spec/graphql/mutations/update_notification_preferences_spec.rb b/spec/graphql/mutations/update_notification_preferences_spec.rb index e39b0493f44..e73d18740d9 100644 --- a/spec/graphql/mutations/update_notification_preferences_spec.rb +++ b/spec/graphql/mutations/update_notification_preferences_spec.rb @@ -27,7 +27,6 @@ RSpec.describe Mutations::UpdateNotificationPreferences do @course = @account.courses.create! @teacher = @course.enroll_teacher(User.create!, enrollment_state: 'active').user @student = @course.enroll_student(User.create!, enrollemnt_state: 'active').user - @account.enable_feature!(:mute_notifications_by_course) communication_channel(@teacher, {username: 'two@example.com', active_cc: true}) @notification = Notification.create!(:name => "Assignment Created", :subject => "Test", :category => 'Due Date') end diff --git a/spec/lib/notification_message_creator_spec.rb b/spec/lib/notification_message_creator_spec.rb index 11767159ed8..7f818f81c47 100644 --- a/spec/lib/notification_message_creator_spec.rb +++ b/spec/lib/notification_message_creator_spec.rb @@ -128,7 +128,6 @@ describe NotificationMessageCreator do it 'does not send a notification when policy override is disabled for a course' do notification_set(notification_opts: { :category => "Announcement" }) - @course.root_account.enable_feature!(:mute_notifications_by_course) NotificationPolicyOverride.enable_for_context(@user, @course, enable: false) data = { course_id: @course.id, root_account_id: @course.root_account_id } messages = NotificationMessageCreator.new(@notification, @assignment, to_list: @user, data: data).create_message @@ -137,7 +136,6 @@ describe NotificationMessageCreator do it 'does send a notification when course_id is not passed in' do notification_set(notification_opts: { :category => "Announcement" }) - @course.root_account.enable_feature!(:mute_notifications_by_course) NotificationPolicyOverride.enable_for_context(@user, @course, enable: false) data = { root_account_id: @course.root_account_id } messages = NotificationMessageCreator.new(@notification, @assignment, to_list: @user, data: data).create_message @@ -154,7 +152,6 @@ describe NotificationMessageCreator do it 'does send other notifications when policy override is in effect' do notification_set(notification_opts: { :category => "Registration" }) - @course.root_account.enable_feature!(:mute_notifications_by_course) NotificationPolicyOverride.enable_for_context(@user, @course, enable: false) data = { course_id: @course.id, root_account_id: @course.root_account_id } messages = NotificationMessageCreator.new(@notification, @assignment, to_list: @user, data: data).create_message @@ -490,7 +487,6 @@ describe NotificationMessageCreator do context "notification policy overrides" do before(:each) do notification_set({notification_opts: {category: 'PandaExpressTime'}}) - @course.root_account.enable_feature!(:mute_notifications_by_course) Account.site_admin.enable_feature!(:notification_granular_course_preferences) end