From 9ef4d159d656aadf8a18068c5c143bef3eaf619c Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 24 Aug 2023 11:29:37 +0200 Subject: [PATCH 1/2] remove time delay --- .../assets/js/nf-core-schema-builder.js | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/public_html/assets/js/nf-core-schema-builder.js b/public_html/assets/js/nf-core-schema-builder.js index 2475ee01bf..2629b3f31d 100644 --- a/public_html/assets/js/nf-core-schema-builder.js +++ b/public_html/assets/js/nf-core-schema-builder.js @@ -283,25 +283,23 @@ $(function () { $('.add-param-btn, .add-group-btn, .collapse-groups-btn, .expand-groups-btn, .to-top-btn').attr('disabled', true); $('#schema-send-status').text('Saving schema..'); // wait a bit to allow any previous events to finish - setTimeout(function () { - post_data = { - post_content: 'json_schema', - version: 'web_builder', - status: 'web_builder_edited', - api: 'true', - cache_id: $('#schema_cache_id').text(), - schema: JSON.stringify(schema), - }; - $.post('pipeline_schema_builder', post_data).done(function (returned_data) { - console.log('Sent schema to API. Response:', returned_data); - if (returned_data.status == 'recieved') { - // DO NOT FIX THIS TYPO. nf-core/tools will break. - $('#schema-send-status').text("Ok, that's it - done!"); - } else { - $('#schema-send-status').text('Oops, something went wrong!'); - } - }); - }, 300); + post_data = { + post_content: 'json_schema', + version: 'web_builder', + status: 'web_builder_edited', + api: 'true', + cache_id: $('#schema_cache_id').text(), + schema: JSON.stringify(schema), + }; + $.post('pipeline_schema_builder', post_data).done(function (returned_data) { + console.log('Sent schema to API. Response:', returned_data); + if (returned_data.status == 'recieved') { + // DO NOT FIX THIS TYPO. nf-core/tools will break. + $('#schema-send-status').text("Ok, that's it - done!"); + } else { + $('#schema-send-status').text('Oops, something went wrong!'); + } + }); } else { $('.add-param-btn, .add-group-btn, .collapse-groups-btn, .expand-groups-btn, .to-top-btn').attr( 'disabled', From 549ad7373d366efd46d7eae845b0d90433987801 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 24 Aug 2023 11:40:51 +0200 Subject: [PATCH 2/2] add missingi slash to url --- public_html/assets/js/nf-core-schema-builder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/assets/js/nf-core-schema-builder.js b/public_html/assets/js/nf-core-schema-builder.js index 2629b3f31d..da0790aecf 100644 --- a/public_html/assets/js/nf-core-schema-builder.js +++ b/public_html/assets/js/nf-core-schema-builder.js @@ -291,7 +291,7 @@ $(function () { cache_id: $('#schema_cache_id').text(), schema: JSON.stringify(schema), }; - $.post('pipeline_schema_builder', post_data).done(function (returned_data) { + $.post('/pipeline_schema_builder', post_data).done(function (returned_data) { console.log('Sent schema to API. Response:', returned_data); if (returned_data.status == 'recieved') { // DO NOT FIX THIS TYPO. nf-core/tools will break.