From 77f585268425546686601b53fb6e890bacc1509d Mon Sep 17 00:00:00 2001 From: wellsbobby52 Date: Mon, 4 Mar 2024 14:04:36 -0700 Subject: [PATCH 1/6] add condition input form to waitlist formatting add additional-conditions section add new fiels to form logic cleanup design feedback data flow working --- pages/forms/waitlist-form.html | 61 ++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/pages/forms/waitlist-form.html b/pages/forms/waitlist-form.html index 90515691..f0ac1173 100644 --- a/pages/forms/waitlist-form.html +++ b/pages/forms/waitlist-form.html @@ -56,9 +56,9 @@

{{ page.title }}

autocomplete="tel" required /> - +
+ +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +

By submitting this form, you agree to our @@ -116,11 +151,23 @@

Error

"state", "organization", "referral", + "interested in COVID-19", + "interested in Flu A", + "interested in Flu B", + "interested in RSV", + "additional-conditions", ]; const data = {}; fields.forEach( - (field) => (data[field] = document.getElementById(field).value) + (field) => { + const element = document.getElementById(field); + if(element.type === "checkbox"){ + data[field] = element.checked; + } else { + data[field] = element.value; + } + } ); try { From f192b27bfbd635808b8303f7f1fbfbdd89c5cf4f Mon Sep 17 00:00:00 2001 From: fzhao99 Date: Thu, 21 Mar 2024 11:41:18 -0400 Subject: [PATCH 2/6] Bob/use waitlist disease from config (#672) some changes to take advantage of the disease-config work we did for the site audit in the waitlist form --------- Co-authored-by: wellsbobby52 Co-authored-by: Daniel Sass --- _includes/content/supported-diseases.html | 4 +- _pages/getting-started/index.md | 1 + pages/forms/waitlist-form.html | 68 +++++++---------------- 3 files changed, 23 insertions(+), 50 deletions(-) diff --git a/_includes/content/supported-diseases.html b/_includes/content/supported-diseases.html index 696bb03d..e03ab29d 100644 --- a/_includes/content/supported-diseases.html +++ b/_includes/content/supported-diseases.html @@ -1,7 +1,5 @@ -
    +
      {% for disease in site.content.supported_diseases %}
    • {{ disease }}
    • {% endfor %}
    - - diff --git a/_pages/getting-started/index.md b/_pages/getting-started/index.md index 77d5dcdb..e272e1a5 100644 --- a/_pages/getting-started/index.md +++ b/_pages/getting-started/index.md @@ -13,6 +13,7 @@ Before you can use SimpleReport, you’ll need to set it up. SimpleReport supports the following conditions: + {%include content/supported-diseases.html%} If you're looking for an an easier way to report results, find out [how to sign up]({% link _pages/getting-started/organizations-and-testing-facilities/onboard-your-organization.md %}). diff --git a/pages/forms/waitlist-form.html b/pages/forms/waitlist-form.html index f0ac1173..3de7af73 100644 --- a/pages/forms/waitlist-form.html +++ b/pages/forms/waitlist-form.html @@ -25,7 +25,7 @@

    {{ page.title }}

    >Name {% include required.html %} {{ page.title }} >Email address {% include required.html %} {{ page.title }} >Phone number {% include required.html %} {{ page.title }} State {% include required.html %}
    - {% include forms/state-options.html %}
    @@ -78,43 +78,31 @@

    {{ page.title }}

    required />

    Currently, SimpleReport helps facilities report results for:

    -
      -
    • COVID-19
    • -
    • Flu A
    • -
    • Flu B
    • -
    • RSV
    • -
    + + {% include content/supported-diseases.html styles="padding-left-205" %} +
    +
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    + {% for disease in site.content.supported_diseases %} +
    + + +
    + {% endfor %}

    @@ -144,28 +132,14 @@

    Error

    const form = document.getElementById("waitlist-form"); form.onsubmit = async (e) => { e.preventDefault(); - const fields = [ - "name", - "email", - "phone", - "state", - "organization", - "referral", - "interested in COVID-19", - "interested in Flu A", - "interested in Flu B", - "interested in RSV", - "additional-conditions", - ]; - + const fieldsToCheck = Array.from(document.getElementsByClassName("form-input")) const data = {}; - fields.forEach( - (field) => { - const element = document.getElementById(field); + fieldsToCheck.forEach( + (element) => { if(element.type === "checkbox"){ - data[field] = element.checked; + data[element.id] = element.checked; } else { - data[field] = element.value; + data[element.id] = element.value; } } ); From 49d17724121dc0622ed6db8faec44c3afc5a377c Mon Sep 17 00:00:00 2001 From: Bob Zhao Date: Thu, 21 Mar 2024 11:58:50 -0400 Subject: [PATCH 3/6] use name instead --- pages/forms/waitlist-form.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pages/forms/waitlist-form.html b/pages/forms/waitlist-form.html index 3de7af73..0af4795a 100644 --- a/pages/forms/waitlist-form.html +++ b/pages/forms/waitlist-form.html @@ -71,7 +71,7 @@

    {{ page.title }}

    Your facility or the Public Health Department you are representing Error fieldsToCheck.forEach( (element) => { if(element.type === "checkbox"){ - data[element.id] = element.checked; - } else { - data[element.id] = element.value; + data[element.name] = element.checked; + } + else { + data[element.name] = element.value; } } ); From 66868ecf865d9ac63990276f2097ffdc7119efae Mon Sep 17 00:00:00 2001 From: Daniel Sass Date: Thu, 21 Mar 2024 13:27:30 -0400 Subject: [PATCH 4/6] addtional design feedback, updating spacing --- pages/forms/waitlist-form.html | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pages/forms/waitlist-form.html b/pages/forms/waitlist-form.html index 3de7af73..5f3f4d34 100644 --- a/pages/forms/waitlist-form.html +++ b/pages/forms/waitlist-form.html @@ -77,14 +77,13 @@

    {{ page.title }}

    type="text" required /> -

    Currently, SimpleReport helps facilities report results for:

    - + {% include content/supported-diseases.html styles="padding-left-205" %} - -
    - -
    + +
    {% for disease in site.content.supported_diseases %}
    @@ -92,7 +91,6 @@

    {{ page.title }}

    {% endfor %}
    -