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

Load notification center with a hard reload as preceding work for the sidebar menu. Thereby adapt the back button functionality

Henriette Darge00095af8621d
diff --git a/frontend/src/app/core/path-helper/path-helper.service.ts b/frontend/src/app/core/path-helper/path-helper.service.ts
index 6fd992e0db8..a9f3ffc0fea 100644
--- a/frontend/src/app/core/path-helper/path-helper.service.ts
+++ b/frontend/src/app/core/path-helper/path-helper.service.ts
@@ -108,6 +108,10 @@ export class PathHelperService {
return `${this.staticBase}/news/${newsId}`;
}
+ public notificationsPath():string {
+ return `${this.staticBase}/notifications`;
+ }
+
public loginPath() {
return `${this.staticBase}/login`;
}
diff --git a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html
index 528950d02a1..83a445e8984 100644
--- a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html
+++ b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html
@@ -1,7 +1,7 @@
<a
class="op-ian-bell op-app-menu--item-action"
data-qa-selector="op-ian-bell"
- uiSref="notifications"
+ [href]="notificationsPath()"
>
<op-icon icon-classes="icon-bell">
</op-icon>
diff --git a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts
index 69c27c92cae..434bce9255b 100644
--- a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts
+++ b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts
@@ -5,6 +5,7 @@ import { OpModalService } from 'core-app/shared/components/modal/modal.service';
import { merge, timer } from 'rxjs';
import { filter, switchMap } from 'rxjs/operators';
import { ActiveWindowService } from 'core-app/core/active-window/active-window.service';
+import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
export const opInAppNotificationBellSelector = 'op-in-app-notification-bell';
const POLLING_INTERVAL = 10000;
@@ -27,9 +28,15 @@ export class InAppNotificationBellComponent {
this.inAppQuery.unreadCount$,
);
- constructor(readonly inAppQuery:InAppNotificationsQuery,
+ constructor(
+ readonly inAppQuery:InAppNotificationsQuery,
readonly inAppService:InAppNotificationsService,
readonly activeWindow:ActiveWindowService,
- readonly modalService:OpModalService) {
+ readonly modalService:OpModalService,
+ readonly pathHelper:PathHelperService,
+ ) {}
+
+ notificationsPath():string {
+ return this.pathHelper.notificationsPath();
}
}
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 ed5ab42f2bc..e71874709ef 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
@@ -76,12 +76,9 @@ export class InAppNotificationCenterPageComponent extends UntilDestroyedMixin im
},
];
- /** Global referrer set when coming from a hard reload */
+ /** Global referrer set when coming to the notification center */
private documentReferer:string;
- /** Local referrer set when coming from an angular route */
- private backRoute:BackRouteOptions;
-
constructor(
readonly I18n:I18nService,
readonly cdRef:ChangeDetectorRef,
@@ -96,7 +93,6 @@ export class InAppNotificationCenterPageComponent extends UntilDestroyedMixin im
}
ngOnInit():void {
- this.backRoute = this.backRoutingService.backRoute;
this.documentReferer = document.referrer;
}
@@ -119,11 +115,6 @@ export class InAppNotificationCenterPageComponent extends UntilDestroyedMixin im
changeChangesFromTitle(val:string):void {}
private backButtonFn():void {
- if (this.backRoute) {
- void this.backRoutingService.goToOtherState(this.backRoute.name, this.backRoute.params);
- return;
- }
-
if (this.documentReferer.length > 0) {
window.location.href = this.documentReferer;
} else {
diff --git a/spec/features/notifications/navigation_spec.rb b/spec/features/notifications/navigation_spec.rb
index 08bc5616e89..3cab2df8f24 100644
--- a/spec/features/notifications/navigation_spec.rb
+++ b/spec/features/notifications/navigation_spec.rb
@@ -43,9 +43,8 @@ describe "Notification center navigation", type: :feature, js: true do
navigation_helper.open_center_and_navigate_within
expect(page).to have_current_path home_path
- # Todo Implement (#38564)
- # navigation_helper.open_center_and_navigate_out
- # expect(current_path).to eq 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
@@ -57,9 +56,8 @@ describe "Notification center navigation", type: :feature, js: true do
navigation_helper.open_center_and_navigate_within
expect(page).to have_current_path project_work_package_path(project, work_package, state: 'activity')
- # Todo: Implement (#38564)
- # navigation_helper.open_center_and_navigate_out
- # visit 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