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

Remove unused component

Benjamin Bädorf17582a831acb
diff --git a/frontend/src/app/features/user-preferences/notifications-settings/row/notification-setting-row.component.html b/frontend/src/app/features/user-preferences/notifications-settings/row/notification-setting-row.component.html
deleted file mode 100644
index f67e0de4930..00000000000
--- a/frontend/src/app/features/user-preferences/notifications-settings/row/notification-setting-row.component.html
+++ /dev/null
@@ -1,116 +0,0 @@
-<td
- *ngIf="first"
- [attr.rowspan]="count"
->
- <span
- *ngIf="setting._links.project.href; else defaultTitle"
- [textContent]="setting._links.project.title"
- ></span>
- <ng-template #defaultTitle>
- <em [textContent]="text.default_all_projects"></em>
- </ng-template>
-</td>
-<td [textContent]="text.channel(setting.channel)">
-</td>
-<td>
- <input
- type="checkbox"
- [checked]="setting.involved || setting.all"
- [disabled]="setting.all"
- (change)="update({ involved: $event.target.checked })"
- data-qa-notification-type="involved"
- [attr.aria-label]="text.involved_header"
- />
-</td>
-<td>
- <input
- type="checkbox"
- [checked]="setting.mentioned || setting.all"
- [disabled]="setting.all"
- (change)="update({ mentioned: $event.target.checked })"
- data-qa-notification-type="mentioned"
- [attr.aria-label]="text.mentioned_header"
- />
-</td>
-<td>
- <input
- type="checkbox"
- [checked]="setting.watched || setting.all"
- [disabled]="setting.all"
- (change)="update({ watched: $event.target.checked })"
- data-qa-notification-type="watched"
- [attr.aria-label]="text.watched_header"
- />
-</td>
-<td>
- <input
- type="checkbox"
- [checked]="setting.workPackageCreated || setting.all"
- [disabled]="setting.all"
- (change)="update({ workPackageCreated: $event.target.checked })"
- data-qa-notification-type="work_package_created"
- [attr.aria-label]="text.work_package_created_header"
- />
-</td>
-<td>
- <input
- type="checkbox"
- [checked]="setting.workPackageCommented || setting.all"
- [disabled]="setting.all"
- (change)="update({ workPackageCommented: $event.target.checked })"
- data-qa-notification-type="work_package_commented"
- [attr.aria-label]="text.work_package_commented_header"
- />
-</td>
-<td>
- <input
- type="checkbox"
- [checked]="setting.workPackageProcessed || setting.all"
- [disabled]="setting.all"
- (change)="update({ workPackageProcessed: $event.target.checked })"
- data-qa-notification-type="work_package_processed"
- [attr.aria-label]="text.work_package_processed_header"
- />
-</td>
-<td>
- <input
- type="checkbox"
- [checked]="setting.workPackagePrioritized || setting.all"
- [disabled]="setting.all"
- (change)="update({ workPackagePrioritized: $event.target.checked })"
- data-qa-notification-type="work_package_prioritized"
- [attr.aria-label]="text.work_package_prioritized_header"
- />
-</td>
-<td>
- <input
- type="checkbox"
- [checked]="setting.workPackageScheduled || setting.all"
- [disabled]="setting.all"
- (change)="update({ workPackageScheduled: $event.target.checked })"
- data-qa-notification-type="work_package_scheduled"
- [attr.aria-label]="text.work_package_scheduled_header"
- />
-</td>
-<td>
- <input
- type="checkbox"
- [checked]="setting.all"
- (change)="update({ all: $event.target.checked })"
- data-qa-notification-type="all"
- [attr.aria-label]="text.any_event_header"
- />
-</td>
-<td
- *ngIf="first"
- [attr.rowspan]="count"
- class="buttons"
->
- <button
- *ngIf="!global"
- class="op-link"
- (click)="remove()"
- >
- <op-icon icon-classes="icon-remove icon-no-color"></op-icon>
- </button>
-</td>
\ No newline at end of file
diff --git a/frontend/src/app/features/user-preferences/notifications-settings/row/notification-setting-row.component.ts b/frontend/src/app/features/user-preferences/notifications-settings/row/notification-setting-row.component.ts
deleted file mode 100644
index bc8855ec606..00000000000
--- a/frontend/src/app/features/user-preferences/notifications-settings/row/notification-setting-row.component.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-import {
- ChangeDetectionStrategy, Component, Input, OnInit,
-} from '@angular/core';
-import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { arrayUpdate } from '@datorama/akita';
-import { NotificationSetting } from 'core-app/features/user-preferences/state/notification-setting.model';
-import { UserPreferencesStore } from 'core-app/features/user-preferences/state/user-preferences.store';
-
-@Component({
- // eslint-disable-next-line @angular-eslint/component-selector
- selector: '[op-notification-setting-row]',
- templateUrl: './notification-setting-row.component.html',
- changeDetection: ChangeDetectionStrategy.OnPush,
-})
-export class NotificationSettingRowComponent implements OnInit {
- @Input() first = false;
-
- @Input() count:number;
-
- @Input() setting:NotificationSetting;
-
- /** Whether this setting is global */
- global = false;
-
- text = {
- title: this.I18n.t('js.notifications.settings.title'),
- save: this.I18n.t('js.button_save'),
- email: this.I18n.t('js.notifications.email'),
- inApp: this.I18n.t('js.notifications.in_app'),
- remove_all: this.I18n.t('js.notifications.settings.remove_all'),
- involved_header: this.I18n.t('js.notifications.settings.involved'),
- mentioned_header: this.I18n.t('js.notifications.settings.mentioned'),
- watched_header: this.I18n.t('js.notifications.settings.watched'),
- work_package_commented_header: this.I18n.t('js.notifications.settings.work_package_commented'),
- work_package_created_header: this.I18n.t('js.notifications.settings.work_package_created'),
- work_package_processed_header: this.I18n.t('js.notifications.settings.work_package_processed'),
- work_package_prioritized_header: this.I18n.t('js.notifications.settings.work_package_prioritized'),
- work_package_scheduled_header: this.I18n.t('js.notifications.settings.work_package_scheduled'),
- any_event_header: this.I18n.t('js.notifications.settings.all'),
- default_all_projects: this.I18n.t('js.notifications.settings.default_all_projects'),
- add_setting: this.I18n.t('js.notifications.settings.add'),
- channel: (channel:string):string => this.I18n.t(`js.notifications.channels.${channel}`),
- };
-
- constructor(
- private I18n:I18nService,
- private store:UserPreferencesStore,
- ) {
- }
-
- ngOnInit() {
- this.global = this.setting._links.project.href === null;
- }
-
- remove():void {
- this.store.update(
- ({ notifications }) => ({
- notifications: notifications.filter((notification) => notification._links.project.href !== this.setting._links.project.href),
- }),
- );
- }
-
- update(delta:Partial<NotificationSetting>) {
- this.store.update(
- ({ notifications }) => ({
- notifications: arrayUpdate(
- notifications, this.matcherFn.bind(this), delta,
- ),
- }),
- );
- }
-
- private matcherFn(notification:NotificationSetting) {
- return notification._links.project.href === this.setting._links.project.href
- && notification.channel === this.setting.channel;
- }
-}
diff --git a/frontend/src/app/features/user-preferences/user-preferences.module.ts b/frontend/src/app/features/user-preferences/user-preferences.module.ts
index 3b31d787a96..a09391636fe 100644
--- a/frontend/src/app/features/user-preferences/user-preferences.module.ts
+++ b/frontend/src/app/features/user-preferences/user-preferences.module.ts
@@ -8,7 +8,6 @@ import { UserPreferencesStore } from 'core-app/features/user-preferences/state/u
import { UserPreferencesQuery } from 'core-app/features/user-preferences/state/user-preferences.query';
import { UserPreferencesService } from 'core-app/features/user-preferences/state/user-preferences.service';
import { NotificationsSettingsPageComponent } from 'core-app/features/user-preferences/notifications-settings/page/notifications-settings-page.component';
-import { NotificationSettingRowComponent } from 'core-app/features/user-preferences/notifications-settings/row/notification-setting-row.component';
import { NotificationSettingInlineCreateComponent } from 'core-app/features/user-preferences/notifications-settings/inline-create/notification-setting-inline-create.component';
import { MY_ACCOUNT_ROUTES } from 'core-app/features/user-preferences/user-preferences.routes';
import { NotificationsSettingsToolbarComponent } from './notifications-settings/toolbar/notifications-settings-toolbar.component';
@@ -22,7 +21,6 @@ import { NotificationSettingsTableComponent } from './notifications-settings/tab
],
declarations: [
NotificationsSettingsPageComponent,
- NotificationSettingRowComponent,
NotificationSettingInlineCreateComponent,
NotificationsSettingsToolbarComponent,
NotificationSettingsTableComponent,