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

hide select inputs instead of disabling them

Dmitrii5a513fcc386f
diff --git a/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.html b/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.html
index 0c34d344dec..9d464052073 100644
--- a/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.html
+++ b/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.html
@@ -75,6 +75,7 @@
class="op-reminder-settings-date-alerts--time form--select -narrow"
attr.id="op-reminder-settings-date-alerts"
required="true"
+ *ngIf="dateAlertsStatuses.startDate"
>
<option
*ngFor="let availableTime of availableTimes"
@@ -105,6 +106,7 @@
class="op-reminder-settings-date-alerts--time form--select -narrow"
attr.id="op-reminder-settings-date-alerts"
required="true"
+ *ngIf="dateAlertsStatuses.dueDate"
>
<option
*ngFor="let availableTime of availableTimes"
@@ -133,6 +135,7 @@
class="op-reminder-settings-date-alerts--time form--select -narrow"
attr.id="op-reminder-settings-date-alerts"
required="true"
+ *ngIf="dateAlertsStatuses.overdue"
>
<option
*ngFor="let availableTime of availableTimesOverdue"
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 282c589952f..4089582e40f 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
@@ -116,6 +116,12 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin impl
overdue: this.I18n.t('js.notifications.settings.global.overdue'),
};
+ dateAlertsStatuses = {
+ startDate: false,
+ dueDate: false,
+ overdue: false,
+ }
+
constructor(
private changeDetectorRef:ChangeDetectorRef,
private I18n:I18nService,
@@ -141,27 +147,27 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin impl
this.form.get('startDate.active')?.valueChanges.subscribe((newValue) => {
const timeCtrl = this.form.get('startDate.time')!;
if (!newValue) {
- timeCtrl.disable();
+ this.dateAlertsStatuses.startDate = false
} else {
- timeCtrl.enable();
+ this.dateAlertsStatuses.startDate = true
}
});
this.form.get('dueDate.active')?.valueChanges.subscribe((newValue) => {
const timeCtrl = this.form.get('dueDate.time')!;
if (!newValue) {
- timeCtrl.disable();
+ this.dateAlertsStatuses.dueDate = false
} else {
- timeCtrl.enable();
+ this.dateAlertsStatuses.dueDate = true
}
});
this.form.get('overdue.active')?.valueChanges.subscribe((newValue) => {
const timeCtrl = this.form.get('overdue.time')!;
if (!newValue) {
- timeCtrl.disable();
+ this.dateAlertsStatuses.overdue = false
} else {
- timeCtrl.enable();
+ this.dateAlertsStatuses.overdue = true
}
});