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

Do not morph angular tags if the turbo request is not changing the scheduling type.

Dombi Attila4ce674fad2b7
diff --git a/frontend/src/stimulus/controllers/dynamic/work-packages/dialog/preview.controller.ts b/frontend/src/stimulus/controllers/dynamic/work-packages/dialog/preview.controller.ts
index cb6fdd1e36f..4c890ebfc41 100644
--- a/frontend/src/stimulus/controllers/dynamic/work-packages/dialog/preview.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/work-packages/dialog/preview.controller.ts
@@ -74,6 +74,11 @@ export abstract class DialogPreviewController extends Controller {
// caption and validation message unaccessible for screen readers and other
// assistive technologies. This is why morph cannot be used here.
this.frameMorphRenderer = (event:CustomEvent<TurboBeforeFrameRenderEventDetail>) => {
+ const oldFrame = event.srcElement as HTMLTurboFrameElement;
+ const requestUrl = new URL(oldFrame.src || '');
+ // Do not replace the angular datepicker unless the schedule_manually flag is changed.
+ const replaceAngularTags = requestUrl.searchParams.has('schedule_manually');
+
event.detail.render = (currentElement:HTMLElement, newElement:HTMLElement) => {
Idiomorph.morph(currentElement, newElement, {
ignoreActiveValue: this.ignoreActiveValueWhenMorphing(),
@@ -82,7 +87,9 @@ export abstract class DialogPreviewController extends Controller {
// In case the element is an OpenProject custom dom element, prevent morphing and
// replace the angular tag with the new version.
if (oldNode.tagName?.startsWith('OPCE-')) {
- oldNode.replaceWith(newNode);
+ if (replaceAngularTags) {
+ oldNode.replaceWith(newNode);
+ }
return false;
}
return true;