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

[OP#65516] completely disable resizing for events without start & end times

Klaus Zandersc23dea10ac62
diff --git a/frontend/src/stimulus/controllers/dynamic/my/time-tracking.controller.ts b/frontend/src/stimulus/controllers/dynamic/my/time-tracking.controller.ts
index ef2bc602b09..bcac37be9b6 100644
--- a/frontend/src/stimulus/controllers/dynamic/my/time-tracking.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/my/time-tracking.controller.ts
@@ -210,6 +210,9 @@ export default class MyTimeTrackingController extends Controller {
);
}
+ // mark the event explicitly as resizable if it is not an all day event
+ info.event.setProp('durationEditable', !info.event.allDay);
+
this.calendar.setOption('defaultTimedEventDuration', this.DEFAULT_TIMED_EVENT_DURATION);
},
eventClick: (info) => {
diff --git a/lib/full_calendar/event.rb b/lib/full_calendar/event.rb
index ee1c5e37ab9..6b161a4e42a 100644
--- a/lib/full_calendar/event.rb
+++ b/lib/full_calendar/event.rb
@@ -57,7 +57,7 @@ module FullCalendar
"title" => title,
"url" => url,
"classNames" => class_names
- }.merge(additional_attributes).compact_blank.as_json
+ }.merge(additional_attributes).compact.as_json
end
def to_json(*)
diff --git a/modules/costs/lib/full_calendar/time_entry_event.rb b/modules/costs/lib/full_calendar/time_entry_event.rb
index 1a4b89eb564..22f31827b02 100644
--- a/modules/costs/lib/full_calendar/time_entry_event.rb
+++ b/modules/costs/lib/full_calendar/time_entry_event.rb
@@ -47,8 +47,9 @@ module FullCalendar
end
end
- def additional_attributes
+ def additional_attributes # rubocop:disable Metrics/AbcSize
{
+ durationEditable: time_entry.start_time.present?,
hours: time_entry.hours,
typeId: time_entry.work_package.type_id,
workPackageId: time_entry.work_package.id,