OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix upsale in notifications
Oliver Günther219581665d03
diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rbindex 394d8243cd0..6551f019f2b 100644--- a/app/controllers/notifications_controller.rb+++ b/app/controllers/notifications_controller.rb@@ -33,6 +33,8 @@ class NotificationsController < ApplicationControllerbefore_action :filtered_query, only: :mark_all_readno_authorization_required! :index, :split_view, :update_counter, :mark_all_read, :date_alerts, :share_upsale+ before_action :check_filter, only: %i[index]+def indexrender_notifications_layoutend@@ -93,4 +95,12 @@ class NotificationsController < ApplicationController@filtered_query = queryend++ def check_filter+ return if EnterpriseToken.allows_to?(:date_alerts)++ if params[:filter] == "reason" && params[:name] == "dateAlert"+ redirect_to notifications_date_alert_upsale_path+ end+ endenddiff --git a/spec/features/notifications/notification_center/notification_center_date_alerts_spec.rb b/spec/features/notifications/notification_center/notification_center_date_alerts_spec.rbindex 729c4e2cbc9..185e8704a06 100644--- a/spec/features/notifications/notification_center/notification_center_date_alerts_spec.rb+++ b/spec/features/notifications/notification_center/notification_center_date_alerts_spec.rb@@ -195,15 +195,13 @@ RSpec.describe "Notification center date alerts", :js, with_settings: { journal_side_menu.click_item "Date alert"expect(page).to have_current_path(/notifications\/date_alerts/)- expect(page).to have_enterprise_upsale_page- expect(page).to have_text "Available only through the Basic enterprise plan"+ expect(page).to have_enterprise_upsale_page(:basic)# It does not allows direct url accessvisit notifications_center_path(filter: "reason", name: "dateAlert")expect(page).to have_current_path(/notifications\/date_alerts/)- expect(page).to have_enterprise_upsale_page- expect(page).to have_text "Available only through the Basic enterprise plan"+ expect(page).to have_enterprise_upsale_page(:basic)endend