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
Don't mark a notification as read when clicking on it
Henriette Darge44745a50ecc1
diff --git a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.html b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.htmlindex 6e46ae68456..214f2a8beba 100644--- a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.html+++ b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.html@@ -60,6 +60,7 @@<div class="op-ian-item--buttons"><i*ngIf="!notification.readIAN"+ data-qa-selector="mark-as-read-button"class="op-ian-item--button icon-mark-read"(click)="markAsRead($event, aggregatedNotifications)">diff --git a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.ts b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.tsindex 39b23caf48d..15ce19b1d33 100644--- a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.ts+++ b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.ts@@ -135,10 +135,6 @@ export class InAppNotificationEntryComponent implements OnInit {return;}- if (!this.notification.readIAN) {- this.ianService.markAsRead(this.aggregatedNotifications, true);- }-this.workPackage$.pipe(diff --git a/spec/features/notifications/notification_center/notification_center_spec.rb b/spec/features/notifications/notification_center/notification_center_spec.rbindex e7683bd4adc..05040b93e4e 100644--- a/spec/features/notifications/notification_center/notification_center_spec.rb+++ b/spec/features/notifications/notification_center/notification_center_spec.rb@@ -68,16 +68,18 @@ describe "Notification center", type: :feature, js: true docenter.expect_no_item second_notificationend- it 'can open the split screen of the notification to mark it as read' do+ it 'can open the split screen of the notification' dovisit home_pathcenter.expect_bell_count 2center.opencenter.click_item notificationsplit_screen.expect_open- center.expect_read_item notification+ center.expect_item_not_read notificationcenter.expect_work_package_item second_notification+ center.mark_notification_as_read notification+retry_block donotification.reloadraise "Expected notification to be marked read" unless notification.read_ian@@ -120,7 +122,7 @@ describe "Notification center", type: :feature, js: true docenter.click_item fourth_notificationsplit_screen.expect_open- center.expect_read_item fourth_notification+ center.mark_notification_as_read fourth_notificationexpect(notification.reload.read_ian).to be_truthyexpect(second_notification.reload.read_ian).to be_falseyexpect(third_notification.reload.read_ian).to be_falsey@@ -131,7 +133,7 @@ describe "Notification center", type: :feature, js: true docenter.click_item third_notificationsecond_split_screen.expect_open- center.expect_read_item third_notification+ center.mark_notification_as_read third_notificationexpect(second_notification.reload.read_ian).to be_truthyexpect(third_notification.reload.read_ian).to be_truthyenddiff --git a/spec/features/notifications/notification_center/split_screen_spec.rb b/spec/features/notifications/notification_center/split_screen_spec.rbindex 055a553421b..9d137e2e6ed 100644--- a/spec/features/notifications/notification_center/split_screen_spec.rb+++ b/spec/features/notifications/notification_center/split_screen_spec.rb@@ -43,21 +43,14 @@ describe "Split screen in the notification center", type: :feature, js: true do# Opening the split screen marks the notifications as readsplit_screen.expect_open- center.expect_read_item notification+ center.expect_work_package_item notificationcenter.expect_work_package_item second_notification# Clicking on a another notification changes the split screen contentcenter.click_item second_notificationsplit_screen = ::Pages::SplitWorkPackage.new(second_work_package, project)split_screen.expect_open- center.expect_read_item second_notification-- # Since both are marked as read, there are no notifications left- center.close- center.expect_bell_count 0-- center.open- center.expect_empty+ center.expect_work_package_item second_notificationendit 'can navigate between the tabs' dodiff --git a/spec/support/components/notifications/center.rb b/spec/support/components/notifications/center.rbindex e9665554867..4b26a0e13c5 100644--- a/spec/support/components/notifications/center.rb+++ b/spec/support/components/notifications/center.rb@@ -48,6 +48,12 @@ module Componentsclick_button 'Mark all as read'end+ def mark_notification_as_read(notification)+ within_item(notification) do+ page.find('[data-qa-selector="mark-as-read-button"]').click+ end+ end+def show_allclick_button 'All'end@@ -65,7 +71,7 @@ module Componentsdef expect_item(notification, subject: notification.subject)within_item(notification) do- expect(page).to have_text subject+ expect(page).to have_text subject, normalize_ws: trueendend@@ -79,12 +85,17 @@ module Components.to have_selector("[data-qa-selector='op-ian-notification-item-#{notification.id}'][data-qa-ian-read]")end+ def expect_item_not_read(notification)+ expect(page)+ .not_to have_selector("[data-qa-selector='op-ian-notification-item-#{notification.id}'][data-qa-ian-read]")+ end+def expect_work_package_item(notification)work_package = notification.resourceraise(ArgumentError, "Expected work package") unless work_package.is_a?(WorkPackage)expect_item notification,- subject: "#{work_package.type.name.upcase} ##{work_package.id} #{work_package.subject}"+ subject: "#{work_package.type.name.upcase} #{work_package.subject}"enddef expect_closed