
As part of the upgrade process, we need to rework the tracing instrumentation. Now, we are just wrapping all async functions in a new sentry transaction, which will automatically end once the function returns. Further, the structure of the Sentry packages got reworked, so that we only need a single package by now. This removes the need to group dependabot updates. Co-authored-by: Jan Graichen <jgraichen@altimos.de>
42 lines
1.5 KiB
JavaScript
42 lines
1.5 KiB
JavaScript
$(document).on('turbolinks:load', function() {
|
|
|
|
if ($.isController('community_solutions') && $('#community-solution-editor').isPresent()) {
|
|
CodeOceanEditor.sendEvents = false;
|
|
CodeOceanEditor.editors = [];
|
|
CodeOceanEditor.initializeDescriptionToggle();
|
|
CodeOceanEditor.initializeEditors();
|
|
CodeOceanEditor.initializeEditors(true);
|
|
CodeOceanEditor.initializeFileTree();
|
|
CodeOceanEditor.initializeFileTree(true);
|
|
CodeOceanEditor.showFirstFile();
|
|
CodeOceanEditor.showFirstFile(true);
|
|
CodeOceanEditor.resizeAceEditors();
|
|
CodeOceanEditor.resizeAceEditors(true);
|
|
|
|
$.extend(
|
|
CodeOceanEditor,
|
|
CodeOceanEditorAJAX,
|
|
CodeOceanEditorSubmissions
|
|
)
|
|
|
|
$(document).on('theme:change:ace', CodeOceanEditor.handleAceThemeChangeEvent.bind(CodeOceanEditor));
|
|
$('#submit').one('click', submitCode.bind(CodeOceanEditor));
|
|
$('#accept').one('click', submitCode.bind(CodeOceanEditor));
|
|
}
|
|
});
|
|
|
|
function submitCode(event) {
|
|
const button = $(event.target) || $('#submit');
|
|
this.newSentryTransaction(button, async () => {
|
|
const submission = await this.createSubmission(button, null).catch(this.ajaxError.bind(this));
|
|
if (!submission) return;
|
|
if (!submission.redirect) return;
|
|
|
|
this.autosaveIfChanged();
|
|
this.stopCode(event);
|
|
this.editors = [];
|
|
Turbolinks.clearCache();
|
|
Turbolinks.visit(submission.redirect);
|
|
});
|
|
}
|