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

Fix linting errors

Benjamin Bädorfaa0592609631
diff --git a/frontend/src/app/features/user-preferences/notifications-settings/inline-create/notification-setting-inline-create.component.ts b/frontend/src/app/features/user-preferences/notifications-settings/inline-create/notification-setting-inline-create.component.ts
index adb055fa2ab..3bcdc45a8a5 100644
--- a/frontend/src/app/features/user-preferences/notifications-settings/inline-create/notification-setting-inline-create.component.ts
+++ b/frontend/src/app/features/user-preferences/notifications-settings/inline-create/notification-setting-inline-create.component.ts
@@ -76,7 +76,9 @@ export class NotificationSettingInlineCreateComponent {
map((collection) => collection.elements.map((project) => ({
href: project.href || '',
name: project.name,
- disabled: !!this.settings.controls.find((projectSetting) => projectSetting.get('project')!.value.href === project.href),
+ disabled: !!this.settings.controls.find(
+ (projectSetting) => (projectSetting.get('project')!.value as NotificationSettingProjectOption).href === project.href,
+ ),
}))),
);
}
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 48b4e561411..5e5e8c4503a 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
@@ -32,9 +32,9 @@ interface INotificationSettingsFormValue {
}
interface IProjectNotificationSettingsValue extends INotificationSettingsFormValue {
- project: {
+ project:{
title:string;
- href:string;
+ href:string;
};
}
@@ -91,7 +91,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin impl
};
constructor(
- private changeDetectorRef: ChangeDetectorRef,
+ private changeDetectorRef:ChangeDetectorRef,
private I18n:I18nService,
private stateService:UserPreferencesService,
private query:UserPreferencesQuery,
@@ -135,14 +135,13 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin impl
return;
}
- const sortedSettings = settings.sort(
- (a, b):number => a._links.project.title!.localeCompare(b._links.project.title!)
- );
-
const projectSettings = new FormArray([]);
projectSettings.clear();
- for (let setting of sortedSettings) {
- projectSettings.push(new FormGroup({
+ settings
+ .sort(
+ (a, b):number => a._links.project.title!.localeCompare(b._links.project.title!),
+ )
+ .forEach((setting) => projectSettings.push(new FormGroup({
project: new FormControl(setting._links.project),
involved: new FormControl(setting.involved),
workPackageCreated: new FormControl(setting.workPackageCreated),
@@ -150,8 +149,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin impl
workPackageScheduled: new FormControl(setting.workPackageScheduled),
workPackagePrioritized: new FormControl(setting.workPackagePrioritized),
workPackageCommented: new FormControl(setting.workPackageCommented),
- }));
- }
+ })));
this.form.setControl('projectSettings', projectSettings);
this.changeDetectorRef.detectChanges();
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 f0d4d82bd49..1819953dc31 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
@@ -28,7 +28,7 @@ export class UserPreferencesQuery extends Query<UserPreferencesModel> {
projectNotifications$ = this
.notificationSettings$
.pipe(
- map((settings) => settings.filter((setting) => setting.channel === 'in_app'&& setting._links.project.href !== null)),
+ map((settings) => settings.filter((setting) => setting.channel === 'in_app' && setting._links.project.href !== null)),
);
/** Selected projects */
diff --git a/frontend/src/app/shared/components/forms/checkbox-field/checkbox-field.component.ts b/frontend/src/app/shared/components/forms/checkbox-field/checkbox-field.component.ts
index 1677d5962d7..f06c7eccdb2 100644
--- a/frontend/src/app/shared/components/forms/checkbox-field/checkbox-field.component.ts
+++ b/frontend/src/app/shared/components/forms/checkbox-field/checkbox-field.component.ts
@@ -1,11 +1,17 @@
import {
- Component, ContentChild, HostBinding, Input, Optional,
+ Component,
+ ContentChild,
+ HostBinding,
+ Input,
+ Optional,
+ ChangeDetectionStrategy,
} from '@angular/core';
import { AbstractControl, FormGroupDirective, NgControl } from '@angular/forms';
@Component({
selector: 'op-checkbox-field',
templateUrl: './checkbox-field.component.html',
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OpCheckboxFieldComponent {
@HostBinding('class.op-form-field') className = true;