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

add temprorary edit link and reload calendar with new entries

Klaus Zanders32341f99d9a2
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 5764aab86b9..27c0151a18f 100644
--- a/frontend/src/stimulus/controllers/dynamic/my/time-tracking.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/my/time-tracking.controller.ts
@@ -20,6 +20,14 @@ export default class MyTimeTrackingController extends Controller {
private calendar:Calendar;
connect() {
+ // handle dialog close event
+ document.addEventListener('dialog:close', (event:CustomEvent) => {
+ const { detail: { dialog, submitted } } = event as { detail:{ dialog:HTMLDialogElement; submitted:boolean }; };
+ if (dialog.id === 'time-entry-dialog' && submitted) {
+ window.location.reload();
+ }
+ });
+
// styling for the calendar entries can be stolen from the team planner
this.calendar = new Calendar(this.calendarTarget, {
diff --git a/modules/costs/app/components/time_tracking/time_entry_event_component.html.erb b/modules/costs/app/components/time_tracking/time_entry_event_component.html.erb
index 4a9b905bed3..4879bc8cd2b 100644
--- a/modules/costs/app/components/time_tracking/time_entry_event_component.html.erb
+++ b/modules/costs/app/components/time_tracking/time_entry_event_component.html.erb
@@ -1,5 +1,6 @@
<div class="calendar-time-entry-event--content">
<div class="calendar-time-entry-event-content-dates">
+ <%= link_to "edit", dialog_time_entry_path(time_entry, onlyMe: true), data: { "turbo-stream" => true } %>
<%= l(time_entry.spent_on) %>
<%- if time_entry.has_start_and_end_time? %>
<%= time_entry.start_timestamp.strftime("%H:%M") %>-<%= time_entry.end_timestamp.strftime("%H:%M") %>