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

Multiple actors

Oliver Günther7d376fc4e4bc
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.html
index c76c9b544f9..3c85619581e 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
@@ -54,9 +54,10 @@
<div
class="op-ian-item--actor"
- *ngIf="actor"
+ *ngIf="actors.length > 0"
>
<op-principal
+ *ngFor="let actor of actors"
[hide-name]="true"
[principal]="actor"
[link]="false"
diff --git a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.sass b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.sass
index 47098abd0ed..7f2e5f7f6de 100644
--- a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.sass
+++ b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.sass
@@ -30,7 +30,7 @@ $subject-font-size: 14px
display: grid
grid-template-columns: 50px 1fr 200px 15% 15%
grid-template-rows: auto $subject-font-size 1fr
- grid-template-areas: "project project project project project" "title title status date buttons" "actor reason reason reason reason"
+ grid-template-areas: "project project project project project" "title title status date buttons" "actor actor reason reason reason"
grid-gap: 0.5rem
align-items: center
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.ts
index 5fd54791943..6b3b9d853dd 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
@@ -1,18 +1,29 @@
import {
- EventEmitter, ChangeDetectionStrategy, Component, Input, OnInit, Output,
+ EventEmitter,
+ ChangeDetectionStrategy,
+ Component,
+ Input,
+ OnInit,
+ Output,
} from '@angular/core';
import {
InAppNotification,
InAppNotificationDetail,
} from 'core-app/features/in-app-notifications/store/in-app-notification.model';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
-import { Observable, timer } from 'rxjs';
+import {
+ Observable,
+ timer,
+} from 'rxjs';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { InAppNotificationsService } from 'core-app/features/in-app-notifications/store/in-app-notifications.service';
import { TimezoneService } from 'core-app/core/datetime/timezone.service';
-import { distinctUntilChanged, map } from 'rxjs/operators';
+import {
+ distinctUntilChanged,
+ map,
+} from 'rxjs/operators';
import { PrincipalLike } from 'core-app/shared/components/principal/principal-types';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
@@ -40,7 +51,7 @@ export class InAppNotificationEntryComponent implements OnInit {
unexpandable = false;
// The actor, if any
- actor?:PrincipalLike;
+ actors:PrincipalLike[] = [];
// The translated reason, if available
translatedReason?:string;
@@ -69,7 +80,7 @@ export class InAppNotificationEntryComponent implements OnInit {
ngOnInit():void {
this.buildTranslatedReason();
- this.buildActor();
+ this.buildActors();
this.buildDetails();
this.buildTime();
this.buildProject();
@@ -120,15 +131,22 @@ export class InAppNotificationEntryComponent implements OnInit {
}
}
- private buildActor() {
- const { actor } = this.notification._links;
-
- if (actor) {
- this.actor = {
- href: actor.href,
- name: actor.title,
- };
- }
+ private buildActors() {
+ this.actors = this
+ .aggregatedNotifications
+ .map((notification) => {
+ const { actor } = notification._links;
+
+ if (!actor) {
+ return null;
+ }
+
+ return {
+ href: actor.href,
+ name: actor.title,
+ };
+ })
+ .filter((actor) => actor !== null) as PrincipalLike[];
}
private buildTranslatedReason() {