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

Adapt test to new calendar functionality let widget calendars show weeks again (instead of months) Avoid notifying about the param change of `cdate` and `cview` because otherwise thequeryparamListener fires and triggers an additional api call (with faulty parameters). The loading works correctly because the calendar triggers the data load on view change itself

Henriette Darge90ffcccb38c5
diff --git a/frontend/src/app/features/calendar/op-calendar.service.ts b/frontend/src/app/features/calendar/op-calendar.service.ts
index a5ffeaa65c9..758c7425f4d 100644
--- a/frontend/src/app/features/calendar/op-calendar.service.ts
+++ b/frontend/src/app/features/calendar/op-calendar.service.ts
@@ -28,10 +28,8 @@ import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/q
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
import { take } from 'rxjs/operators';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
-import { QueryFilterInstanceResource } from 'core-app/features/hal/resources/query-filter-instance-resource';
import { QueryResource } from 'core-app/features/hal/resources/query-resource';
import {
- QueryProps,
QueryPropsFilter,
UrlParamsHelperService,
} from 'core-app/features/work-packages/components/wp-query/url-params-helper';
@@ -364,6 +362,9 @@ export class OpCalendarService extends UntilDestroyedMixin {
cdate: this.timezoneService.formattedISODate(dates.view.currentStart),
cview: dates.view.type,
},
+ {
+ custom: { notify: false },
+ },
);
}
}
diff --git a/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts b/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
index 484b88b3d55..582b6a863b2 100644
--- a/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
+++ b/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
@@ -108,7 +108,7 @@ export class WorkPackagesCalendarComponent extends UntilDestroyedMixin implement
});
}
- this.calendar.updateTimeframe(fetchInfo, this.currentProject.identifier || undefined);
+ void this.calendar.updateTimeframe(fetchInfo, this.currentProject.identifier || undefined);
}
// eslint-disable-next-line @angular-eslint/use-lifecycle-interface
@@ -118,16 +118,22 @@ export class WorkPackagesCalendarComponent extends UntilDestroyedMixin implement
}
private initializeCalendar() {
+ const additionalOptions:{ [key:string]:unknown } = {
+ height: '100%',
+ headerToolbar: this.buildHeader(),
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+ events: this.calendarEventsFunction.bind(this),
+ plugins: [dayGridPlugin],
+ };
+
+ if (this.static) {
+ additionalOptions.initialView = 'dayGridWeek';
+ }
+
void this.configuration.initialized
.then(() => {
this.calendarOptions$.next(
- this.calendar.calendarOptions({
- height: '100%',
- headerToolbar: this.buildHeader(),
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
- events: this.calendarEventsFunction.bind(this),
- plugins: [dayGridPlugin],
- }),
+ this.calendar.calendarOptions(additionalOptions),
);
});
}
@@ -174,4 +180,8 @@ export class WorkPackagesCalendarComponent extends UntilDestroyedMixin implement
return events;
}
+
+ private get initialView():string|undefined {
+ return this.static ? 'dayGridWeek' : undefined;
+ }
}
diff --git a/frontend/src/global_styles/vendor/_full_calendar.sass b/frontend/src/global_styles/vendor/_full_calendar.sass
index 573e49c4695..f4bb3c08064 100644
--- a/frontend/src/global_styles/vendor/_full_calendar.sass
+++ b/frontend/src/global_styles/vendor/_full_calendar.sass
@@ -35,6 +35,7 @@
&:before,
&:after
padding-right: 4px
+ pointer-events: none
.fc-event-title-container
margin: 0 16px
diff --git a/modules/calendar/spec/features/calendars_spec.rb b/modules/calendar/spec/features/calendars_spec.rb
index d3818e65ab5..2c1366d49ae 100644
--- a/modules/calendar/spec/features/calendars_spec.rb
+++ b/modules/calendar/spec/features/calendars_spec.rb
@@ -66,6 +66,7 @@ describe 'Work package calendars', type: :feature, js: true do
due_date: Date.today.at_beginning_of_month.next_month + 18.days)
end
let(:filters) { ::Components::WorkPackages::Filters.new }
+ let(:current_wp_split_screen) { Pages::SplitWorkPackage.new(current_work_package, project) }
before do
login_as(user)
@@ -78,6 +79,8 @@ describe 'Work package calendars', type: :feature, js: true do
click_link 'Calendar'
end
+ loading_indicator_saveguard
+
# should open the calendar with the current month displayed
expect(page)
.to have_selector '.fc-event-title', text: current_work_package.subject
@@ -168,30 +171,26 @@ describe 'Work package calendars', type: :feature, js: true do
expect(page)
.to have_no_selector '.fc-event-title', text: another_future_work_package.subject
- # click goes to work package show page
+ # click goes to work package split screen
page.find('.fc-event-title', text: current_work_package.subject).click
-
- expect(page)
- .to have_selector('.subject-header', text: current_work_package.subject)
+ current_wp_split_screen.expect_open
# Going back in browser history will lead us back to the calendar
# Regression #29664
page.go_back
-
- # click goes to work package show page
expect(page)
.to have_selector('.fc-event-title', text: current_work_package.subject, wait: 20)
+ current_wp_split_screen.expect_closed
- # click goes to work package show page again
+ # click goes to work package split screen page again
page.find('.fc-event-title', text: current_work_package.subject).click
-
- expect(page)
- .to have_selector('.subject-header', text: current_work_package.subject)
+ current_wp_split_screen.expect_open
# click back goes back to calendar
- page.find('.work-packages-back-button').click
+ current_wp_split_screen.close
expect(page)
.to have_selector '.fc-event-title', text: current_work_package.subject, wait: 20
+ current_wp_split_screen.expect_closed
end
end
diff --git a/modules/dashboards/lib/dashboards/engine.rb b/modules/dashboards/lib/dashboards/engine.rb
index 6796cd5424e..a945a2f09f1 100644
--- a/modules/dashboards/lib/dashboards/engine.rb
+++ b/modules/dashboards/lib/dashboards/engine.rb
@@ -14,7 +14,6 @@ module Dashboards
{ controller: '/dashboards/dashboards', action: 'show' },
caption: :'dashboards.label',
after: :work_packages,
- before: :calendar,
icon: 'icon2 icon-status',
badge: 'label_menu_badge.alpha')
end