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

reload the costs page when the time entry is edited

Klaus Zanders105cec5c41ff
diff --git a/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts b/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts
index 421a082af51..20ba65bd7fd 100644
--- a/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts
+++ b/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts
@@ -59,7 +59,12 @@ export class TriggerActionsEntryComponent {
editTimeEntry() {
void this.loadEntry().subscribe((entry:TimeEntryResource) => {
- // TODO: We need to reload here when the dialog is submitted ... How should we do this?
+ document.addEventListener('dialog:close', (event:CustomEvent) => {
+ const { detail: { dialog } } = event as { detail:{ dialog:HTMLDialogElement } };
+ if (dialog.id === 'time-entry-dialog') {
+ window.location.reload();
+ }
+ });
void this.turboRequestService.request(
this.pathHelper.timeEntryEditDialog(entry.id as string),
{ method: 'GET' },
diff --git a/frontend/src/turbo/turbo-event-listeners.ts b/frontend/src/turbo/turbo-event-listeners.ts
index 4d4f13348c5..667cc6f98ab 100644
--- a/frontend/src/turbo/turbo-event-listeners.ts
+++ b/frontend/src/turbo/turbo-event-listeners.ts
@@ -15,11 +15,11 @@ export function addTurboEventListeners() {
const dialog = target.closest('dialog') as HTMLDialogElement;
if (dialog) {
- document.dispatchEvent(new CustomEvent('dialog:close', { detail: { dialog } }));
-
if (dialog.dataset.keepOpenOnSubmit !== 'true') {
dialog.close();
}
+
+ document.dispatchEvent(new CustomEvent('dialog:close', { detail: { dialog } }));
}
}
});