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 NotificationSetting model to INotificationSetting

Oliver Günther1bf8cb2e46f8
diff --git a/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts b/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts
index 388a84f3798..262a27b9c75 100644
--- a/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts
+++ b/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts
@@ -16,7 +16,7 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
import { CurrentUserService } from 'core-app/core/current-user/current-user.service';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
import { UserPreferencesService } from 'core-app/features/user-preferences/state/user-preferences.service';
-import { NotificationSetting } from 'core-app/features/user-preferences/state/notification-setting.model';
+import { INotificationSetting } from 'core-app/features/user-preferences/state/notification-setting.model';
export const myNotificationsPageComponentSelector = 'op-notifications-page';
@@ -155,8 +155,8 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin impl
public saveChanges():void {
const prefs = this.storeService.store.getValue();
const notificationSettings = (this.form.value as IFullNotificationSettingsValue);
- const globalNotification = prefs.notifications.find((notification) => !notification._links.project.href) as NotificationSetting;
- const globalPrefs:NotificationSetting = {
+ const globalNotification = prefs.notifications.find((notification) => !notification._links.project.href) as INotificationSetting;
+ const globalPrefs:INotificationSetting = {
...globalNotification,
_links: { project: { href: null } },
watched: true,
@@ -169,7 +169,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin impl
workPackageCommented: notificationSettings.workPackageCommented,
};
- const projectPrefs:NotificationSetting[] = notificationSettings.projectSettings.map((settings) => ({
+ const projectPrefs:INotificationSetting[] = notificationSettings.projectSettings.map((settings) => ({
_links: { project: { href: settings.project.href } },
watched: true,
mentioned: true,
diff --git a/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.ts b/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.ts
index cef0665ac23..469d4143346 100644
--- a/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.ts
+++ b/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.ts
@@ -30,7 +30,7 @@ import {
withLatestFrom,
} from 'rxjs/operators';
import { filterObservable } from 'core-app/shared/helpers/rxjs/filterWith';
-import { NotificationSetting } from 'core-app/features/user-preferences/state/notification-setting.model';
+import { INotificationSetting } from 'core-app/features/user-preferences/state/notification-setting.model';
export const myReminderPageComponentSelector = 'op-reminders-page';
@@ -125,7 +125,7 @@ export class ReminderSettingsPageComponent extends UntilDestroyedMixin implement
});
}
- private buildForm(settings:UserPreferencesModel, globalSetting:NotificationSetting) {
+ private buildForm(settings:UserPreferencesModel, globalSetting:INotificationSetting) {
this.form.get('immediateReminders.mentioned')?.setValue(settings.immediateReminders.mentioned);
this.form.get('dailyReminders.enabled')?.setValue(settings.dailyReminders.enabled);
diff --git a/frontend/src/app/features/user-preferences/state/notification-setting.model.ts b/frontend/src/app/features/user-preferences/state/notification-setting.model.ts
index c00707818bd..d1504842505 100644
--- a/frontend/src/app/features/user-preferences/state/notification-setting.model.ts
+++ b/frontend/src/app/features/user-preferences/state/notification-setting.model.ts
@@ -1,6 +1,6 @@
import { HalSourceLink } from 'core-app/features/hal/resources/hal-resource';
-export interface NotificationSetting {
+export interface INotificationSetting {
_links:{ project:HalSourceLink };
watched:boolean;
involved:boolean;
@@ -20,7 +20,7 @@ export interface NotificationSetting {
membershipUpdated:boolean;
}
-export function buildNotificationSetting(project:null|HalSourceLink, params:Partial<NotificationSetting>):NotificationSetting {
+export function buildNotificationSetting(project:null|HalSourceLink, params:Partial<INotificationSetting>):INotificationSetting {
return {
_links: {
project: {
diff --git a/frontend/src/app/features/user-preferences/state/user-preferences.model.ts b/frontend/src/app/features/user-preferences/state/user-preferences.model.ts
index 84b35664de5..41523632551 100644
--- a/frontend/src/app/features/user-preferences/state/user-preferences.model.ts
+++ b/frontend/src/app/features/user-preferences/state/user-preferences.model.ts
@@ -1,4 +1,4 @@
-import { NotificationSetting } from 'core-app/features/user-preferences/state/notification-setting.model';
+import { INotificationSetting } from 'core-app/features/user-preferences/state/notification-setting.model';
export interface DailyRemindersSettings {
enabled:boolean;
@@ -20,7 +20,7 @@ export interface UserPreferencesModel {
timeZone:string|null;
warnOnLeavingUnsaved:boolean;
workdays:number[];
- notifications:NotificationSetting[];
+ notifications:INotificationSetting[];
dailyReminders:DailyRemindersSettings;
immediateReminders:ImmediateRemindersSettings;
pauseReminders:Partial<PauseRemindersSettings>;
diff --git a/frontend/src/app/features/user-preferences/state/user-preferences.query.ts b/frontend/src/app/features/user-preferences/state/user-preferences.query.ts
index 1ece0799d73..231e2ca0f21 100644
--- a/frontend/src/app/features/user-preferences/state/user-preferences.query.ts
+++ b/frontend/src/app/features/user-preferences/state/user-preferences.query.ts
@@ -8,12 +8,12 @@ import {
import { Observable } from 'rxjs';
import { UserPreferencesStore } from 'core-app/features/user-preferences/state/user-preferences.store';
import { UserPreferencesModel } from 'core-app/features/user-preferences/state/user-preferences.model';
-import { NotificationSetting } from 'core-app/features/user-preferences/state/notification-setting.model';
+import { INotificationSetting } from 'core-app/features/user-preferences/state/notification-setting.model';
export class UserPreferencesQuery extends Query<UserPreferencesModel> {
notificationSettings$ = this.select('notifications');
- notificationsGroupedByProject$:Observable<{ [key:string]:NotificationSetting[] }> = this
+ notificationsGroupedByProject$:Observable<{ [key:string]:INotificationSetting[] }> = this
.notificationSettings$
.pipe(
map((settings) => settings.filter((setting) => setting._links.project.href)),
@@ -21,7 +21,7 @@ export class UserPreferencesQuery extends Query<UserPreferencesModel> {
);
/** Notification settings grouped by Project */
- notificationsForGlobal$:Observable<NotificationSetting|undefined> = this
+ notificationsForGlobal$:Observable<INotificationSetting|undefined> = this
.notificationSettings$
.pipe(
map((notifications) => notifications.find((setting) => setting._links.project.href === null)),
@@ -38,7 +38,7 @@ export class UserPreferencesQuery extends Query<UserPreferencesModel> {
.pipe(
map((settings) => settings.find((notification) => !notification._links.project.href)),
filter((global) => !!global),
- ) as Observable<NotificationSetting>;
+ ) as Observable<INotificationSetting>;
/** Selected projects */
selectedProjects$ = this