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

Linting

Oliver Günther3654daf9abf7
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-date-times-value/filter-date-times-value.component.ts b/frontend/src/app/features/work-packages/components/filters/filter-date-times-value/filter-date-times-value.component.ts
index b398f07df70..4fa68e3e611 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-date-times-value/filter-date-times-value.component.ts
+++ b/frontend/src/app/features/work-packages/components/filters/filter-date-times-value/filter-date-times-value.component.ts
@@ -26,11 +26,10 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { Moment } from 'moment';
import {
- HostBinding,
Component,
+ HostBinding,
Input,
OnInit,
Output,
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-dates-value/filter-dates-value.component.ts b/frontend/src/app/features/work-packages/components/filters/filter-dates-value/filter-dates-value.component.ts
index cf61853bd31..5918e001cde 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-dates-value/filter-dates-value.component.ts
+++ b/frontend/src/app/features/work-packages/components/filters/filter-dates-value/filter-dates-value.component.ts
@@ -26,8 +26,12 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { HalResource } from 'core-app/features/hal/resources/hal-resource';
-import { Component, HostBinding, Input, Output } from '@angular/core';
+import {
+ Component,
+ HostBinding,
+ Input,
+ Output,
+} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { DebouncedEventEmitter } from 'core-app/shared/helpers/rxjs/debounced-event-emitter';
import * as moment from 'moment';
@@ -59,35 +63,36 @@ export class FilterDatesValueComponent extends UntilDestroyedMixin {
constructor(
readonly timezoneService:TimezoneService,
- readonly I18n:I18nService) {
+ readonly I18n:I18nService,
+ ) {
super();
}
- public get value():(HalResource[]|string[]) {
- return this.filter.values || [];
+ public get value():string[] {
+ return (this.filter.values || []) as string[];
}
- public set value(val:(HalResource[]|string[])) {
+ public set value(val:string[]) {
this.filter.values = val;
this.filterChanged.emit(this.filter);
}
- public get begin():any {
- return this.filter.values[0];
+ public get begin():string {
+ return (this.filter.values[0] || '') as string;
}
- public get end():HalResource|string {
- return this.filter.values[1];
+ public get end():string {
+ return (this.filter.values[1] || '') as string;
}
- public parser(data:any) {
+ public parser(data:string):string|null {
if (moment(data, 'YYYY-MM-DD', true).isValid()) {
return data;
}
return null;
}
- public formatter(data:any) {
+ public formatter(data:string):string|null {
if (moment(data, 'YYYY-MM-DD', true).isValid()) {
const d = this.timezoneService.parseDate(data);
return this.timezoneService.formattedISODate(d);
diff --git a/spec/features/work_packages/table/queries/filter_spec.rb b/spec/features/work_packages/table/queries/filter_spec.rb
index e4909b8f97c..ddf91767574 100644
--- a/spec/features/work_packages/table/queries/filter_spec.rb
+++ b/spec/features/work_packages/table/queries/filter_spec.rb
@@ -497,16 +497,14 @@ describe 'filter work packages', js: true do
subject: 'Created today',
project:,
created_at: Time.current.change(hour: 12),
- updated_at: Time.current.change(hour: 12),
- )
+ updated_at: Time.current.change(hour: 12))
end
shared_let(:wp_updated_5d_ago) do
create(:work_package,
subject: 'Created 5d ago',
project:,
created_at: 5.days.ago,
- updated_at: 5.days.ago,
- )
+ updated_at: 5.days.ago)
end
it 'filters on date by created_at (Regression #28459)' do
@@ -614,7 +612,7 @@ describe 'filter work packages', js: true do
filters.add_filter_by 'Updated',
'between',
- [6.day.ago.to_date.iso8601],
+ [6.days.ago.to_date.iso8601],
'updatedAt'
loading_indicator_saveguard
@@ -665,7 +663,7 @@ describe 'filter work packages', js: true do
filters.add_filter_by 'Updated',
'between',
- [nil, 6.day.ago.to_date.iso8601],
+ [nil, 6.days.ago.to_date.iso8601],
'updatedAt'
loading_indicator_saveguard
diff --git a/spec/support/components/work_packages/filters.rb b/spec/support/components/work_packages/filters.rb
index cea90483ba7..92ee71a9c98 100644
--- a/spec/support/components/work_packages/filters.rb
+++ b/spec/support/components/work_packages/filters.rb
@@ -226,10 +226,10 @@ module Components
retry_block do
# wait for filter to be present
filter_element = page.find("#filter_#{id}")
- if operator == 'between'
- insert_two_single_dates(id, value)
- elsif filter_element.has_selector?("[data-qa-selector='op-basic-range-date-picker']", wait: false)
+ if filter_element.has_selector?("[data-qa-selector='op-basic-range-date-picker']", wait: false)
insert_date_range(filter_element, value)
+ elsif operator == 'between'
+ insert_two_single_dates(id, value)
elsif filter_element.has_selector?(".ng-select-container", wait: false)
insert_autocomplete_item(filter_element, value)
else