Skip to content

Commit

Permalink
Fix redirection after adding a new oneshot job
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremycr committed Mar 15, 2024
1 parent 1be233b commit 0b295ba
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Controller/JobController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});
</script>
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
.then((result) => {
if (result.redirect) {
window.location = result.redirect;
window.location.reload();
return;
}
const node = document.createElement('div');
Expand Down

0 comments on commit 0b295ba

Please sign in to comment.