Skip to content

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

Remove back button from notification center

Oliver Günther3bf07117168c
diff --git a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts
index eb6b704896b..eb3eb431fe9 100644
--- a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts
+++ b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts
@@ -39,8 +39,8 @@ export class InAppNotificationCenterPageComponent extends UntilDestroyedMixin im
title: this.I18n.t('js.notifications.title'),
};
- /** Go back using back-button */
- backButtonCallback:() => void = this.backButtonFn.bind(this);
+ /** Disable the back button */
+ backButtonCallback = undefined;
/** Current query title to render */
selectedTitle = this.text.title;
@@ -131,13 +131,4 @@ export class InAppNotificationCenterPageComponent extends UntilDestroyedMixin im
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
changeChangesFromTitle(val:string):void {
}
-
- private backButtonFn():void {
- if (this.documentReferer.length > 0) {
- window.location.href = this.documentReferer;
- } else {
- // Default fallback
- window.history.back();
- }
- }
}
diff --git a/spec/features/notifications/navigation_spec.rb b/spec/features/notifications/navigation_spec.rb
index f1dbf0bb9e1..f4986926e4f 100644
--- a/spec/features/notifications/navigation_spec.rb
+++ b/spec/features/notifications/navigation_spec.rb
@@ -31,36 +31,6 @@ describe "Notification center navigation", type: :feature, js: true do
current_user { recipient }
- describe 'the back button brings me back to where I came from' do
- let(:navigation_helper) { ::Notifications::NavigationHelper.new(center, notification, work_package) }
-
- it 'when coming from a rails based page' do
- visit home_path
-
- navigation_helper.open_and_close_the_center
- expect(page).to have_current_path home_path
-
- navigation_helper.open_center_and_navigate_within
- expect(page).to have_current_path home_path
-
- navigation_helper.open_center_and_navigate_out
- expect(page).to have_current_path home_path
- end
-
- it 'when coming from an angular page' do
- visit project_work_package_path(project, work_package, state: 'activity')
-
- navigation_helper.open_and_close_the_center
- expect(page).to have_current_path project_work_package_path(project, work_package, state: 'activity')
-
- navigation_helper.open_center_and_navigate_within
- expect(page).to have_current_path project_work_package_path(project, work_package, state: 'activity')
-
- navigation_helper.open_center_and_navigate_out
- expect(page).to have_current_path project_work_package_path(project, work_package, state: 'activity')
- end
- end
-
describe 'the path updates accordingly' do
it 'when navigating between the tabs' do
visit home_path
diff --git a/spec/features/notifications/notification_center/notification_center_spec.rb b/spec/features/notifications/notification_center/notification_center_spec.rb
index 77af150de93..d786e9e1e59 100644
--- a/spec/features/notifications/notification_center/notification_center_spec.rb
+++ b/spec/features/notifications/notification_center/notification_center_spec.rb
@@ -109,7 +109,7 @@ describe "Notification center", type: :feature, js: true, with_settings: { journ
raise "Expected notification to be marked read" unless notification.read_ian
end
- center.close
+ visit home_path
center.expect_bell_count 1
center.open
diff --git a/spec/support/pages/notifications/center.rb b/spec/support/pages/notifications/center.rb
index 50000e4f6e3..327c7071276 100644
--- a/spec/support/pages/notifications/center.rb
+++ b/spec/support/pages/notifications/center.rb
@@ -39,11 +39,6 @@ module Pages
notifications_center_path
end
- def close
- page.find('button[data-qa-selector="op-back-button"]').click
- expect_closed
- end
-
def mark_all_read
click_button 'Mark all as read'
end