From 0b295ba5d732eddac267bc4b20b7c0cc5f3acbd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20J?= Date: Fri, 15 Mar 2024 11:28:11 +0100 Subject: [PATCH] Fix redirection after adding a new oneshot job --- src/Controller/JobController.php | 2 +- .../admin/ezdataflow/Dashboard/main.html.twig | 16 ---------------- .../admin/ezdataflow/Dashboard/oneshot.html.twig | 1 + 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/Controller/JobController.php b/src/Controller/JobController.php index 07246e4..cf90231 100644 --- a/src/Controller/JobController.php +++ b/src/Controller/JobController.php @@ -91,7 +91,7 @@ public function create(Request $request): Response } return new JsonResponse([ - 'redirect' => $this->generateUrl('coderhapsodie.ezdataflow.main', ['_fragment' => 'oneshot'], + 'redirect' => $this->generateUrl('coderhapsodie.ezdataflow.main', ['_fragment' => 'ibexa-tab-coderhapsodie-ezdataflow-code-rhapsodie-ezdataflow-oneshot'], UrlGeneratorInterface::ABSOLUTE_URL), ]); } diff --git a/src/Resources/views/themes/admin/ezdataflow/Dashboard/main.html.twig b/src/Resources/views/themes/admin/ezdataflow/Dashboard/main.html.twig index 77072bd..f7e9097 100644 --- a/src/Resources/views/themes/admin/ezdataflow/Dashboard/main.html.twig +++ b/src/Resources/views/themes/admin/ezdataflow/Dashboard/main.html.twig @@ -71,22 +71,6 @@ .closest('ul').querySelectorAll('li.ibexa-tabs__tab'); const tabs = document.getElementById('ibexa-tab-coderhapsodie-ezdataflow-code-rhapsodie-ezdataflow-repeating') .closest('.tab-content').querySelectorAll('.tab-pane'); - if (window.location.hash && window.location.hash === '#oneshot') { - labels.forEach((link) => link.classList.remove('active')); - tabs.forEach((tab) => tab.classList.remove('active')); - document.getElementById('ibexa-tab-label-coderhapsodie-ezdataflow-code-rhapsodie-ezdataflow-oneshot') - .closest('li.ibexa-tabs__tab').classList.add('active'); - document.getElementById('ibexa-tab-coderhapsodie-ezdataflow-code-rhapsodie-ezdataflow-oneshot') - .closest('.tab-pane').classList.add('active'); - } - if (window.location.hash && window.location.hash === '#history') { - labels.forEach((link) => link.classList.remove('active')); - tabs.forEach((tab) => tab.classList.remove('active')); - document.getElementById('ibexa-tab-label-coderhapsodie-ezdataflow-code-rhapsodie-ezdataflow-history') - .closest('li.ibexa-tabs__tab').classList.add('active'); - document.getElementById('ibexa-tab-coderhapsodie-ezdataflow-code-rhapsodie-ezdataflow-history') - .closest('.tab-pane').classList.add('active'); - } }); {% endblock %} diff --git a/src/Resources/views/themes/admin/ezdataflow/Dashboard/oneshot.html.twig b/src/Resources/views/themes/admin/ezdataflow/Dashboard/oneshot.html.twig index da0a86e..894a81f 100644 --- a/src/Resources/views/themes/admin/ezdataflow/Dashboard/oneshot.html.twig +++ b/src/Resources/views/themes/admin/ezdataflow/Dashboard/oneshot.html.twig @@ -44,6 +44,7 @@ .then((result) => { if (result.redirect) { window.location = result.redirect; + window.location.reload(); return; } const node = document.createElement('div');