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

Rename InAppNotification model to INotifcation

Oliver Günther3add65c0f6db
diff --git a/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notification-paths.ts b/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notification-paths.ts
index 4733eb39505..2dce469db3a 100644
--- a/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notification-paths.ts
+++ b/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notification-paths.ts
@@ -30,9 +30,9 @@ import { ApiV3GettableResource } from 'core-app/core/apiv3/paths/apiv3-resource'
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
-import { InAppNotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
+import { INotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
-export class ApiV3NotificationPaths extends ApiV3GettableResource<InAppNotification> {
+export class ApiV3NotificationPaths extends ApiV3GettableResource<INotification> {
@InjectField() http:HttpClient;
public markRead():Observable<unknown> {
diff --git a/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notifications-paths.ts b/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notifications-paths.ts
index f7530244c56..7839ae16bc7 100644
--- a/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notifications-paths.ts
+++ b/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notifications-paths.ts
@@ -39,10 +39,10 @@ import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decora
import { HttpClient } from '@angular/common/http';
import { IHALCollection } from 'core-app/core/apiv3/types/hal-collection.type';
import { ID } from '@datorama/akita';
-import { InAppNotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
+import { INotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
export class ApiV3NotificationsPaths
- extends ApiV3ResourceCollection<InAppNotification, ApiV3NotificationPaths> {
+ extends ApiV3ResourceCollection<INotification, ApiV3NotificationPaths> {
@InjectField() http:HttpClient;
constructor(protected apiRoot:ApiV3Service,
@@ -50,7 +50,7 @@ export class ApiV3NotificationsPaths
super(apiRoot, basePath, 'notifications', ApiV3NotificationPaths);
}
- public facet(facet:string, params?:ApiV3ListParameters):Observable<IHALCollection<InAppNotification>> {
+ public facet(facet:string, params?:ApiV3ListParameters):Observable<IHALCollection<INotification>> {
if (facet === 'unread') {
return this.unread(params);
}
@@ -61,10 +61,10 @@ export class ApiV3NotificationsPaths
* Load a list of events with a given list parameter filter
* @param params
*/
- public list(params?:ApiV3ListParameters):Observable<IHALCollection<InAppNotification>> {
+ public list(params?:ApiV3ListParameters):Observable<IHALCollection<INotification>> {
return this
.http
- .get<IHALCollection<InAppNotification>>(this.path + listParamsString(params));
+ .get<IHALCollection<INotification>>(this.path + listParamsString(params));
}
public listPath(params?:ApiV3ListParameters):string {
@@ -74,7 +74,7 @@ export class ApiV3NotificationsPaths
/**
* Load unread events
*/
- public unread(additional?:ApiV3ListParameters):Observable<IHALCollection<InAppNotification>> {
+ public unread(additional?:ApiV3ListParameters):Observable<IHALCollection<INotification>> {
const unreadFilter:ApiV3ListFilter = ['readIAN', '=', false];
const filters = [
...(additional?.filters ? additional.filters : []),
diff --git a/frontend/src/app/core/state/in-app-notifications/in-app-notification.model.ts b/frontend/src/app/core/state/in-app-notifications/in-app-notification.model.ts
index cc9260e6767..94e1750e655 100644
--- a/frontend/src/app/core/state/in-app-notifications/in-app-notification.model.ts
+++ b/frontend/src/app/core/state/in-app-notifications/in-app-notification.model.ts
@@ -13,7 +13,7 @@ export interface IInAppNotificationHalResourceLinks extends IHalResourceLinks {
activity:IHalResourceLink;
}
-export interface InAppNotification {
+export interface INotification {
id:ID;
subject:string;
createdAt:string;
diff --git a/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts b/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts
index 4348c0b55b5..f73e370401d 100644
--- a/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts
+++ b/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts
@@ -21,7 +21,7 @@ import {
} from 'core-app/core/state/effects/effect-handler.decorator';
import { ActionsService } from 'core-app/core/state/actions/actions.service';
import { InAppNotificationsStore } from './in-app-notifications.store';
-import { InAppNotification } from './in-app-notification.model';
+import { INotification } from './in-app-notification.model';
import {
CollectionStore,
ResourceCollectionService,
@@ -29,7 +29,7 @@ import {
@EffectHandler
@Injectable()
-export class InAppNotificationsResourceService extends ResourceCollectionService<InAppNotification> {
+export class InAppNotificationsResourceService extends ResourceCollectionService<INotification> {
private get notificationsPath():string {
return this
.apiV3Service
@@ -46,18 +46,18 @@ export class InAppNotificationsResourceService extends ResourceCollectionService
super();
}
- fetchNotifications(params:ApiV3ListParameters):Observable<IHALCollection<InAppNotification>> {
+ fetchNotifications(params:ApiV3ListParameters):Observable<IHALCollection<INotification>> {
const collectionURL = collectionKey(params);
return this
.http
- .get<IHALCollection<InAppNotification>>(this.notificationsPath + collectionURL)
+ .get<IHALCollection<INotification>>(this.notificationsPath + collectionURL)
.pipe(
tap((collection) => insertCollectionIntoState(this.store, collection, collectionURL)),
);
}
- update(id:ID, inAppNotification:Partial<InAppNotification>):void {
+ update(id:ID, inAppNotification:Partial<INotification>):void {
this.store.update(id, inAppNotification);
}
@@ -85,7 +85,7 @@ export class InAppNotificationsResourceService extends ResourceCollectionService
));
}
- protected createStore():CollectionStore<InAppNotification> {
+ protected createStore():CollectionStore<INotification> {
return new InAppNotificationsStore();
}
}
diff --git a/frontend/src/app/core/state/in-app-notifications/in-app-notifications.store.ts b/frontend/src/app/core/state/in-app-notifications/in-app-notifications.store.ts
index 4d0f8512814..b8623be358a 100644
--- a/frontend/src/app/core/state/in-app-notifications/in-app-notifications.store.ts
+++ b/frontend/src/app/core/state/in-app-notifications/in-app-notifications.store.ts
@@ -1,8 +1,8 @@
import { EntityStore, StoreConfig } from '@datorama/akita';
-import { InAppNotification } from './in-app-notification.model';
+import { INotification } from './in-app-notification.model';
import { CollectionState, createInitialCollectionState } from 'core-app/core/state/collection-store';
-export interface InAppNotificationsState extends CollectionState<InAppNotification> {
+export interface InAppNotificationsState extends CollectionState<INotification> {
}
@StoreConfig({ name: 'in-app-notifications' })
diff --git a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts
index a626108bef8..50a001dddb1 100644
--- a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts
+++ b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts
@@ -14,7 +14,7 @@ import { StateService } from '@uirouter/angular';
import { UIRouterGlobals } from '@uirouter/core';
import { IanCenterService } from 'core-app/features/in-app-notifications/center/state/ian-center.service';
import {
- InAppNotification,
+ INotification,
NOTIFICATIONS_MAX_SIZE,
} from 'core-app/core/state/in-app-notifications/in-app-notification.model';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -61,7 +61,7 @@ export class InAppNotificationCenterComponent implements OnInit {
originalOrder = ():number => 0;
- trackNotificationGroups = (i:number, item:InAppNotification[]):string => item
+ trackNotificationGroups = (i:number, item:INotification[]):string => item
.map((el) => `${el.id}@${el.updatedAt}`)
.join(',');
diff --git a/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts b/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
index 28e22d0ee66..cea0247ec81 100644
--- a/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
+++ b/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
@@ -34,7 +34,7 @@ import {
notificationCountIncreased,
notificationsMarkedRead,
} from 'core-app/core/state/in-app-notifications/in-app-notifications.actions';
-import { InAppNotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
+import { INotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
import {
EffectCallback,
EffectHandler,
@@ -82,7 +82,7 @@ export class IanCenterService extends UntilDestroyedMixin {
loading$:Observable<boolean> = this.query.selectLoading();
- selectNotifications$:Observable<InAppNotification[]> = this
+ selectNotifications$:Observable<INotification[]> = this
.activeCollection$
.pipe(
switchMap((collection) => forkJoin(collection.ids.map((id) => this.resourceService.lookup(id)))),
@@ -252,7 +252,7 @@ export class IanCenterService extends UntilDestroyedMixin {
.notifications$
.pipe(
take(1),
- ).subscribe((notifications:InAppNotification[][]) => {
+ ).subscribe((notifications:INotification[][]) => {
if (notifications.length <= 0) {
void this.state.go(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/restrict-template-expressions
@@ -321,7 +321,7 @@ export class IanCenterService extends UntilDestroyedMixin {
}
}
- private sideLoadInvolvedWorkPackages(elements:InAppNotification[]):Promise<unknown> {
+ private sideLoadInvolvedWorkPackages(elements:INotification[]):Promise<unknown> {
const { cache } = this.apiV3Service.work_packages;
const wpIds = elements
.map((element) => {
@@ -353,7 +353,7 @@ export class IanCenterService extends UntilDestroyedMixin {
take(1),
)
.subscribe(
- (notifications:InAppNotification[][]) => {
+ (notifications:INotification[][]) => {
for (let i = 0; i < notifications.length; ++i) {
if (notifications[i][0]._links.resource
&& idFromLink(notifications[i][0]._links.resource.href) === this.uiRouterGlobals.params.workPackageId) {
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 fb3f34aa599..c5ab4c951df 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
@@ -24,7 +24,7 @@ import { PathHelperService } from 'core-app/core/path-helper/path-helper.service
import { take } from 'rxjs/internal/operators/take';
import { StateService } from '@uirouter/angular';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
-import { InAppNotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
+import { INotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
import { IanCenterService } from 'core-app/features/in-app-notifications/center/state/ian-center.service';
import { DeviceService } from 'core-app/core/browser/device.service';
@@ -38,9 +38,9 @@ import { DeviceService } from 'core-app/core/browser/device.service';
export class InAppNotificationEntryComponent implements OnInit {
@HostBinding('class.op-ian-item') className = true;
- @Input() notification:InAppNotification;
+ @Input() notification:INotification;
- @Input() aggregatedNotifications:InAppNotification[];
+ @Input() aggregatedNotifications:INotification[];
workPackage$:Observable<WorkPackageResource>|null = null;
@@ -134,7 +134,7 @@ export class InAppNotificationEntryComponent implements OnInit {
event.stopPropagation();
}
- markAsRead(event:MouseEvent, notifications:InAppNotification[]):void {
+ markAsRead(event:MouseEvent, notifications:INotification[]):void {
event.stopPropagation();
this.storeService.markAsRead(notifications.map((el) => el.id));
}