From a31756a036b05f3538263173c41cac189725acf3 Mon Sep 17 00:00:00 2001 From: Cassidy Symons Date: Mon, 11 Sep 2023 15:26:34 -0700 Subject: [PATCH 1/8] Addressing production testing feedback --- microsetta_interface/implementation.py | 41 ++- microsetta_interface/routes.yaml | 5 + .../static/css/minimal_interface.css | 25 +- .../templates/account_overview.jinja2 | 2 +- .../templates/consents.jinja2 | 7 + microsetta_interface/templates/kits.jinja2 | 3 +- .../templates/new_participant.jinja2 | 13 + .../templates/nutrition.jinja2 | 32 +- microsetta_interface/templates/reports.jinja2 | 6 + microsetta_interface/templates/sample.jinja2 | 2 +- .../templates/sitebase.jinja2 | 3 +- microsetta_interface/templates/source.jinja2 | 14 +- microsetta_interface/templates/survey.jinja2 | 2 + .../es_ES/LC_MESSAGES/messages.po | 345 ++++++++++-------- .../es_MX/LC_MESSAGES/messages.po | 344 +++++++++-------- 15 files changed, 510 insertions(+), 334 deletions(-) diff --git a/microsetta_interface/implementation.py b/microsetta_interface/implementation.py index 901aed32..438fe017 100644 --- a/microsetta_interface/implementation.py +++ b/microsetta_interface/implementation.py @@ -1396,11 +1396,6 @@ def get_fill_source_survey(*, ctr = 0 trig_ctr = 0 for field in group['fields']: - if need_reconsent: - # If the user has not agreed to the current consent, we - # disable all of the fields. - field['disabled'] = True - if "triggered_by" in field: field['label'] = str(ctr) + ascii_lowercase[trig_ctr]\ + ". " + field['label'] @@ -1410,10 +1405,22 @@ def get_fill_source_survey(*, ctr += 1 survey_question_count += 1 field['label'] = str(ctr) + ". " + field['label'] - field['label'] = ''\ - + gettext('SKIP')\ - + '' + field['label'] + + if need_reconsent: + # If the user has not agreed to the current consent, we + # disable all of the fields. + field['disabled'] = True + # And we remove the onClick action from the Skip/Display + # text, but leave it to reflect their last response + field['label'] = '' \ + + gettext('SKIP') \ + + '' + field['label'] + else: + field['label'] = ''\ + + gettext('SKIP')\ + + '' + field['label'] return _render_with_defaults( "survey.jinja2", @@ -1481,14 +1488,16 @@ def get_fill_vioscreen_remote_sample_survey(*, account_id=None, source_id=None, sample_id=None, - registration_code=None): + registration_code=None, + vio_id=None): suffix = "vspassthru" redirect_url = SERVER_CONFIG["endpoint"] + \ _make_source_path(account_id, source_id, suffix=suffix) params = { 'survey_redirect_url': redirect_url, 'vioscreen_ext_sample_id': sample_id, - 'registration_code': registration_code + 'registration_code': registration_code, + 'vio_id': vio_id } has_error, survey_output, _ = ApiRequest.get( '/accounts/%s/sources/%s/survey_templates/%s' % @@ -1928,6 +1937,9 @@ def get_nutrition(*, account_id=None, source_id=None, new_ffq_code=None): return vioscreen_output profile_has_samples = _check_if_source_has_samples(account_id, source_id) + need_reconsent_data = check_current_consent( + account_id, source_id, "data" + ) return _render_with_defaults( 'nutrition.jinja2', @@ -1940,7 +1952,8 @@ def get_nutrition(*, account_id=None, source_id=None, new_ffq_code=None): nutrition_tab_whitelist=NUTRITION_TAB_WHITELIST, new_ffq_code=new_ffq_code, profile_has_samples=profile_has_samples, - has_basic_info=has_basic_info + has_basic_info=has_basic_info, + need_reconsent_data=need_reconsent_data ) @@ -2011,9 +2024,7 @@ def get_consents(*, account_id=None, source_id=None): ) if has_error: if has_error == 404: - # If historical users who haven't re-consented try to view signed - # consents, we redirect them to the consent page - return render_consent_page(account_id, source_id, "data") + data_consent = None else: return data_consent diff --git a/microsetta_interface/routes.yaml b/microsetta_interface/routes.yaml index 4d56acff..91c98c8a 100644 --- a/microsetta_interface/routes.yaml +++ b/microsetta_interface/routes.yaml @@ -792,6 +792,11 @@ paths: schema: type: string nullable: true + - in: query + name: vio_id + schema: + type: string + nullable: true responses: '200': description: Take the vioscreen remote survey diff --git a/microsetta_interface/static/css/minimal_interface.css b/microsetta_interface/static/css/minimal_interface.css index aadd1ee1..11f35212 100644 --- a/microsetta_interface/static/css/minimal_interface.css +++ b/microsetta_interface/static/css/minimal_interface.css @@ -257,6 +257,11 @@ h2.account-h2 { h2.profile-card-h2 { color: var(--tmi-blue); + height: 40px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 90%; } h3 { @@ -458,7 +463,7 @@ p.tmi-content { @media (max-width: 575.98px) { .card-survey { - height: 230px; + height: 280px; } .card-survey-external { @@ -683,8 +688,8 @@ h1.profile-h1 { color: var(--tmi-gray-80); } -@media (max-width: 575.98px) { - .survey-info-row { +@media (max-width: 359.98px) { + .survey-info-row > .text-end { display: none; } } @@ -894,6 +899,16 @@ li.active-profile { text-decoration: underline; } +.survey-skip-dis { + float: right; + margin-right: 10px; + color: var(--tmi-gray-80) !important; + font-weight: 400 !important; + font-size: 12px !important; + line-height: 20px !important; + text-decoration: none; +} + .skip-text { color: var(--tmi-gray-80) !important; font-weight: 400 !important; @@ -1267,6 +1282,10 @@ input.barcode-checkbox[type=checkbox]:checked+label { margin-left: auto; } +.barcode-col > .btn { + display: inline; +} + .barcode-text { color: var(--tmi-blue); font-weight: 700; diff --git a/microsetta_interface/templates/account_overview.jinja2 b/microsetta_interface/templates/account_overview.jinja2 index 9e3f8d6b..b8fdc7c3 100644 --- a/microsetta_interface/templates/account_overview.jinja2 +++ b/microsetta_interface/templates/account_overview.jinja2 @@ -68,7 +68,7 @@ {% else %}
-

{{ source.source_name|e}}

+

{{ source.source_name|e}}

{{ _('Go to My Profile') }} diff --git a/microsetta_interface/templates/consents.jinja2 b/microsetta_interface/templates/consents.jinja2 index 6f248966..2d1c41df 100644 --- a/microsetta_interface/templates/consents.jinja2 +++ b/microsetta_interface/templates/consents.jinja2 @@ -24,12 +24,18 @@ {% endblock %} {% block content %}
+ {% if data_consent is none and biospecimen_consent is none %} + + {% endif %}

{{ _('Consent Documents') }}

+ {% if data_consent is not none %}
@@ -46,6 +52,7 @@
+ {% endif %} {% if biospecimen_consent is not none %}
diff --git a/microsetta_interface/templates/kits.jinja2 b/microsetta_interface/templates/kits.jinja2 index 798c6bde..fb805bf4 100644 --- a/microsetta_interface/templates/kits.jinja2 +++ b/microsetta_interface/templates/kits.jinja2 @@ -302,7 +302,8 @@ {{ _('2. Add the date and time of sample collection and select the sample type taken.') }}
{{ _('Important') }}:
{{ _('The sample cannot be processed in the lab until this information is complete.') }}
-{{ _('Keep a record of these details. The barcode is needed to resolve any issues you may have with your sample collection.') }}" data-bs-toggle="tooltip" data-bs-html="true" data-bs-placement="top" title="">{{ _('What is the barcode and why is it important?') }}


+{{ _('Keep a record of these details. The barcode is needed to resolve any issues you may have with your sample collection.') }}
+{{ _('If the barcode(s) listed do not match the barcode(s) on your collection device(s), please contact us at microsetta@ucsd.edu.') }}" data-bs-toggle="tooltip" data-bs-html="true" data-bs-placement="top" title="">{{ _('What is the barcode and why is it important?') }}


diff --git a/microsetta_interface/templates/new_participant.jinja2 b/microsetta_interface/templates/new_participant.jinja2 index 70cce74d..3bd7d573 100644 --- a/microsetta_interface/templates/new_participant.jinja2 +++ b/microsetta_interface/templates/new_participant.jinja2 @@ -11,6 +11,9 @@ $("#7-12-div").hide(); $("#13-17-div").hide(); $("#18-plus-div").hide(); + {% if age_range == 'legacy' %} + $("#legacy-cancel-div").hide(); + {% endif %} $("#"+ radio.value +"-div").show(); } @@ -514,6 +517,16 @@
+{% if age_range == 'legacy' %} +
+
+
+ +
+
+
+{% endif %} +