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 another flaky test triggered by 3e18acec4b

Christophe Bliard159e2970edb5
diff --git a/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.html b/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.html
index 40a3ddb25a4..5acc5b14bfb 100644
--- a/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.html
+++ b/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.html
@@ -93,7 +93,7 @@
[attr.data-qa-highlighted]=" showFieldAsActive('duration') || undefined"
[ngClass]="{'op-datepicker-modal--date-field_current' : showFieldAsActive('duration')}"
[ngModel]="durationFocused ? duration : displayedDuration"
- [showClearButton]="durationFocused"
+ [showClearButton]="currentlyActivatedDateField === 'duration'"
pattern="\d*"
inputmode="numeric"
(ngModelChange)="durationChanges$.next($event)"
diff --git a/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.ts b/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.ts
index ec2e7781ded..e41f74fa3bf 100644
--- a/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.ts
+++ b/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.ts
@@ -48,6 +48,7 @@ import { TimezoneService } from 'core-app/core/datetime/timezone.service';
import { DayElement } from 'flatpickr/dist/types/instance';
import flatpickr from 'flatpickr';
import {
+ debounce,
debounceTime,
filter,
map,
@@ -58,6 +59,7 @@ import {
merge,
Observable,
Subject,
+ timer,
} from 'rxjs';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { FormResource } from 'core-app/features/hal/resources/form-resource';
@@ -210,7 +212,7 @@ export class OpWpMultiDateFormComponent extends UntilDestroyedMixin implements A
.durationChanges$
.pipe(
this.untilDestroyed(),
- debounceTime(500),
+ debounce((value) => (value ? timer(500) : timer(0))),
map((value) => (value === '' ? null : Math.abs(parseInt(value, 10)))),
filter((val) => val === null || !Number.isNaN(val)),
filter((val) => val !== this.duration),