From 9ebe66ab20e3fa6662b7926ea5d98ca75c03cde2 Mon Sep 17 00:00:00 2001 From: Richard McCarthy Date: Wed, 19 Jul 2023 10:59:49 +0100 Subject: [PATCH 01/16] make v2 default --- templates/launch.html | 842 +++++++++++++++++++++--------------------- 1 file changed, 421 insertions(+), 421 deletions(-) diff --git a/templates/launch.html b/templates/launch.html index 4d4d9edd..47e5aaa3 100644 --- a/templates/launch.html +++ b/templates/launch.html @@ -1,477 +1,477 @@ -{{define "title"}}Launch a Survey{{end}} - -{{define "body"}} - - -

Launch a survey

-
-
- - Launch Pattern -
- - -
- - Launch by Schema Name -
- - -
- -

----------

- - Launch by Schema URL - -
- - - + + + +
+ + Launch by Schema Name +
+ + - -
- -
- - - - -
- -
- -
- -

----------

- - - -

Survey Metadata

- - -

Supplementary Data

-
-
- -

Required Data

- -
- - - - - -
- -
- - - - - -
- -
- - - - - -
- -
- - - - - -
- - -

Runner Data

-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
-
- - + -{{end}} +{{ end }} From c21c0a4455e36da6a7c8ae42f703e3652202c344 Mon Sep 17 00:00:00 2001 From: Richard McCarthy Date: Thu, 20 Jul 2023 09:16:53 +0100 Subject: [PATCH 02/16] remove unused var --- templates/launch.html | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/launch.html b/templates/launch.html index 47e5aaa3..81451d99 100644 --- a/templates/launch.html +++ b/templates/launch.html @@ -218,7 +218,6 @@

${survey_type} Survey Metadata

} function displayLaunchButton(launchBySchemaUrl) { - let version = document.querySelector("#launch_pattern").value let schema_name = document.querySelector("#schema_name").value if (schema_name !== "Select Schema") { From 476f9e144346ab52a8861ff63f4777cc31e92b68 Mon Sep 17 00:00:00 2001 From: Richard McCarthy Date: Thu, 20 Jul 2023 10:44:58 +0100 Subject: [PATCH 03/16] fix console error remove unused if --- templates/launch.html | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/templates/launch.html b/templates/launch.html index 81451d99..f1dca7f5 100644 --- a/templates/launch.html +++ b/templates/launch.html @@ -10,7 +10,7 @@

Launch a survey

Launch Pattern
- @@ -35,7 +35,6 @@

Launch a survey

----------

Launch by Schema URL -
@@ -175,14 +174,6 @@

Runner Data

document.querySelectorAll("#survey_metadata, .field-container--hidden, .group-title--hidden").forEach(function (element) { element.style.display = 'block'; }); - - let launchPattern = document.querySelector("#launch_pattern").value - - if (launchPattern === "v1") { - document.querySelectorAll(".Social").forEach(function(element) {element.setAttribute("disabled", "disabled")}) - } else { - document.querySelectorAll(".Social").forEach(function(element) {element.removeAttribute("disabled")}) - } } function includeSurveyMetadataFields(schema_name, survey_type) { @@ -203,16 +194,14 @@

${survey_type} Survey Metadata

-
- ` +
` } else { document.querySelector('#survey_metadata_fields').innerHTML = `

${survey_type} Survey Metadata

-
- ` +
` } } @@ -250,13 +239,17 @@

${survey_type} Survey Metadata

} function loadMetadataForSchemaName() { - clearAndDisableSchemaUrlSelection() + let schema_name = document.querySelector("#schema_name").value - const schemaName = document.querySelector("#schema_name").value - const surveyType = document.querySelector(`#schema_name option[value="${schemaName}"]`).dataset.surveyType + if (schema_name !== "Select Schema") { + clearAndDisableSchemaUrlSelection() - loadSurveyMetadata(schemaName, surveyType) - loadSchemaMetadata(schemaName, null) + const schemaName = document.querySelector("#schema_name").value + const surveyType = document.querySelector(`#schema_name option[value="${schemaName}"]`).dataset.surveyType + + loadSurveyMetadata(schemaName, surveyType) + loadSchemaMetadata(schemaName, null) + } } function loadMetadataForSchemaUrl() { @@ -332,7 +325,6 @@

${survey_type} Survey Metadata

function handleNoSupplementaryData() { hideSupplementaryData() - document.querySelector("#sds_dataset_id").innerHTML = null document.querySelector(`#submit-btn`).style.display = 'none'; document.querySelector("#flush-btn").style.display = 'none'; From 48c735ce6a5ff5f43c34745384742e300cc7cb35 Mon Sep 17 00:00:00 2001 From: Richard McCarthy Date: Thu, 20 Jul 2023 12:12:08 +0100 Subject: [PATCH 04/16] remove unused css --- static/css/main.css | 2 +- templates/launch.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/css/main.css b/static/css/main.css index 9793671b..3620e8c1 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -11,7 +11,7 @@ label { display:inline-block; font-weight: 600; margin-bottom: 0.25rem; width:20 position: relative; } -.field-container--hidden, .metadata-fields--hidden, .button--hidden, .group-title--hidden, .supplementary-data--hidden { +.field-container--hidden, .button--hidden, .group-title--hidden, .supplementary-data--hidden { display:none; } diff --git a/templates/launch.html b/templates/launch.html index f1dca7f5..b6c1fa8a 100644 --- a/templates/launch.html +++ b/templates/launch.html @@ -60,11 +60,11 @@

Launch a survey

----------

-