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

Correct highlighting of unread notifications of activities on overview tab, stabilise tests and fix some EsLint issues

Henriette Dargeed9669265a1e
diff --git a/frontend/src/app/core/global_search/tabs/global-search-tabs.component.ts b/frontend/src/app/core/global_search/tabs/global-search-tabs.component.ts
index 7e20ddb7217..07e39af9b98 100644
--- a/frontend/src/app/core/global_search/tabs/global-search-tabs.component.ts
+++ b/frontend/src/app/core/global_search/tabs/global-search-tabs.component.ts
@@ -53,7 +53,7 @@ export class GlobalSearchTabsComponent extends ScrollableTabsComponent implement
constructor(
readonly globalSearchService:GlobalSearchService,
- public injector: Injector,
+ public injector:Injector,
cdRef:ChangeDetectorRef,
) {
super(cdRef, injector);
diff --git a/frontend/src/app/features/in-app-notifications/store/in-app-notifications.service.ts b/frontend/src/app/features/in-app-notifications/store/in-app-notifications.service.ts
index 2c51609ce07..956008290c3 100644
--- a/frontend/src/app/features/in-app-notifications/store/in-app-notifications.service.ts
+++ b/frontend/src/app/features/in-app-notifications/store/in-app-notifications.service.ts
@@ -1,5 +1,11 @@
import { Injectable } from '@angular/core';
-import { map, switchMap, tap, take, debounceTime } from 'rxjs/operators';
+import {
+ debounceTime,
+ map,
+ switchMap,
+ take,
+ tap,
+} from 'rxjs/operators';
import { applyTransaction, ID, setLoading } from '@datorama/akita';
import { ApiV3ListFilter } from 'core-app/core/apiv3/paths/apiv3-list-resource.interface';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -8,6 +14,8 @@ import { InAppNotificationsQuery } from 'core-app/features/in-app-notifications/
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { InAppNotificationsStore } from './in-app-notifications.store';
import { InAppNotification, NOTIFICATIONS_MAX_SIZE } from './in-app-notification.model';
+import { Observable } from 'rxjs';
+import { IHALCollection } from 'core-app/core/apiv3/types/hal-collection.type';
@Injectable()
export class InAppNotificationsService {
@@ -25,7 +33,7 @@ export class InAppNotificationsService {
});
}
- fetchNotifications() {
+ fetchNotifications():Observable<IHALCollection<InAppNotification>> {
this.store.setLoading(true);
const { activeFacet, activeFilters } = this.query.getValue();
@@ -54,7 +62,7 @@ export class InAppNotificationsService {
return call;
}
- fetchCount() {
+ fetchCount():Observable<number> {
const { activeFilters } = this.query.getValue();
return this
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts
index 2cfb1967c4d..c48ce66f618 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts
@@ -81,7 +81,7 @@ export class ActivityPanelBaseController extends UntilDestroyedMixin implements
this.togglerText = this.text.commentsOnly;
}
- ngOnInit() {
+ ngOnInit():void {
this
.apiV3Service
.work_packages
@@ -96,7 +96,6 @@ export class ActivityPanelBaseController extends UntilDestroyedMixin implements
});
});
-
this.ianService.setActiveFacet('unread');
this.ianService.setActiveFilters([
['resourceId', '=', [this.workPackageId]],
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-on-overview.html b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-on-overview.html
index bf663c8dc1b..662f4265507 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-on-overview.html
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-on-overview.html
@@ -6,7 +6,7 @@
<activity-entry [workPackage]="workPackage"
[activity]="inf.activity"
[activityNo]="inf.number(inf.isReversed)"
- [hasUnreadNotification]="hasUnreadNotification(inf.href)"
+ [hasUnreadNotification]="hasUnreadNotification(inf.href) | async"
[isInitial]="inf.isInitial()">
</activity-entry>
</div>
diff --git a/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.component.ts b/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.component.ts
index 989d6d3f5d2..1c80dd00d0c 100644
--- a/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.component.ts
+++ b/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.component.ts
@@ -26,7 +26,12 @@
// See docs/COPYRIGHT.rdoc for more details.
//++
-import { ChangeDetectionStrategy, Component, Injector, OnInit } from '@angular/core';
+import {
+ ChangeDetectionStrategy,
+ Component,
+ Injector,
+ OnInit,
+} from '@angular/core';
import { StateService } from '@uirouter/core';
import { WorkPackageViewFocusService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-focus.service';
import { States } from 'core-app/core/states/states.service';
diff --git a/frontend/src/app/shared/components/tabs/content-tabs/content-tabs.component.ts b/frontend/src/app/shared/components/tabs/content-tabs/content-tabs.component.ts
index aac2ed53424..b936bbeaad8 100644
--- a/frontend/src/app/shared/components/tabs/content-tabs/content-tabs.component.ts
+++ b/frontend/src/app/shared/components/tabs/content-tabs/content-tabs.component.ts
@@ -62,7 +62,7 @@ export class ContentTabsComponent extends ScrollableTabsComponent {
readonly gon:GonService,
cdRef:ChangeDetectorRef,
readonly I18n:I18nService,
- public injector: Injector,
+ public injector:Injector,
) {
super(cdRef, injector);
diff --git a/frontend/src/app/shared/components/tabs/tab-badges/tab-count.component.ts b/frontend/src/app/shared/components/tabs/tab-badges/tab-count.component.ts
index 4914a21dcbb..d6474a204ec 100644
--- a/frontend/src/app/shared/components/tabs/tab-badges/tab-count.component.ts
+++ b/frontend/src/app/shared/components/tabs/tab-badges/tab-count.component.ts
@@ -1,5 +1,4 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
-import { Observable } from 'rxjs';
@Component({
selector: 'op-tab-count',
@@ -8,5 +7,5 @@ import { Observable } from 'rxjs';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TabCountComponent {
- @Input('count') count:number;
+ @Input() count:number;
}
diff --git a/spec/features/notifications/notification_center/notification_center_spec.rb b/spec/features/notifications/notification_center/notification_center_spec.rb
index 8e75358d790..649f82a7c1f 100644
--- a/spec/features/notifications/notification_center/notification_center_spec.rb
+++ b/spec/features/notifications/notification_center/notification_center_spec.rb
@@ -60,8 +60,10 @@ describe "Notification center", type: :feature, js: true do
center.expect_work_package_item second_notification
center.mark_all_read
- notification.reload
- expect(notification.read_ian).to be_truthy
+ retry_block do
+ notification.reload
+ raise "Expected notification to be marked read" unless notification.read_ian
+ end
center.expect_no_item notification
center.expect_no_item second_notification
@@ -141,7 +143,12 @@ describe "Notification center", type: :feature, js: true do
second_split_screen.expect_open
center.mark_notification_as_read third_notification
- expect(second_notification.reload.read_ian).to be_truthy
+
+ retry_block do
+ second_notification.reload
+ raise "Expected notification to be marked read" unless second_notification.read_ian
+ end
+
expect(third_notification.reload.read_ian).to be_truthy
end
end