Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two New UI Features #275

Closed
wants to merge 13 commits into from
Closed

Two New UI Features #275

wants to merge 13 commits into from

Conversation

cassidysymons
Copy link
Collaborator

  1. Adds support for a "test mode" system message that indicates that users should stay off the platform.
  2. When a user logs sample information, it checks when they last updated their surveys - if it has been over a week, it prompts them to review their survey answers.

This PR should be merged after #274

@cassidysymons
Copy link
Collaborator Author

Leaving it as a draft for the moment as the Spanish translations for the new messages need to be dropped in on Monday morning.

@cassidysymons cassidysymons marked this pull request as ready for review March 13, 2023 22:25
Copy link
Member

@wasade wasade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Most comments are minor. It would I think be valuable to decompose the common logic in the vue_survey_form_*.js scripts though as the duplications represent a maintenance burden (and avenue for bugs) should that logic need to be modified in the future

@@ -1631,13 +1678,25 @@ def get_nutrition(*, account_id=None, source_id=None):
if has_error:
return source_output

# Check the FFQ prereqs for the source (birth year, gender, height, weight
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Check the FFQ prereqs for the source (birth year, gender, height, weight
# Check the FFQ prereqs for the source (birth year, gender, height, weight)

},

methods: {
prettyJSON: function(json) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of the stuff here and below looks like it's replicated across multiple files. Can the common logic be centralized?

@@ -129,7 +129,7 @@
let kit_validation_setup_func = make_kit_validation_setup_func(form_name, kitSubmitHandler);
kit_validation_setup_func()

{% for kit_samples in kits.values() | sort() %}
{% for kit_samples in kits.values() %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the sort not working?

</div>
{% else %}
<div class="barcode-col barcode-warning-text barcode-col-hide-mobile">
Info Needed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Info Needed
{{ _('Info Needed') }}

Comment on lines +73 to +82

/*$('button').on('click', function() {
if($("form[name='ffq_code_form']").valid()) {
updateButtonState("");
// $('#ffq_code_button').prop('disabled', true);
} else {
updateButtonState("yes");
// $('#ffq_code_button').prop('disabled', false);
}
});*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*$('button').on('click', function() {
if($("form[name='ffq_code_form']").valid()) {
updateButtonState("");
// $('#ffq_code_button').prop('disabled', true);
} else {
updateButtonState("yes");
// $('#ffq_code_button').prop('disabled', false);
}
});*/

<div class="col-8 small-text survey-info">{{ _('Last modified') }} {{ detail.date_last_taken }}</div>
{% else %}
<div class="col-8 card-survey-new">{{ _('NEW') }}</div>
{% if detail.survey_template_id == 10 %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could 10 be replaced with a named variable at the top of the template?

Comment on lines +6191 to +6244
#~ msgid "Primary Questionnaire"
#~ msgstr ""

#~ msgid "Pet Information"
#~ msgstr ""

#~ msgid "Fermented Foods Questionnaire"
#~ msgstr ""

#~ msgid "Surfer Questionnaire"
#~ msgstr ""

#~ msgid "Personal Microbiome Information"
#~ msgstr ""

#~ msgid "COVID-19 Questionnaire"
#~ msgstr ""

#~ msgid "Vioscreen Food Frequency Questionnaire"
#~ msgstr ""

#~ msgid "Polyphenol Food Frequency Questionnaire"
#~ msgstr ""

#~ msgid "Cooking Oils and Oxalate-rich Foods"
#~ msgstr ""

#~ msgid ""
#~ "It looks like you have not "
#~ "completed the Basic Information survey "
#~ "yet. If you begin your FFQ without"
#~ " providing your height, weight, age, "
#~ "and gender on the Basic Information "
#~ "survey, your FFQ report will be "
#~ "inaccurate. Do you wish to proceed "
#~ "with the FFQ?"
#~ msgstr ""

#~ msgid ""
#~ "You can also resume the FFQ later"
#~ " by closing the browser tab. The "
#~ "option to \"Continue FFQ\" will then "
#~ "appear under My FFQs. "
#~ msgstr ""

#~ msgid ""
#~ "Lifestyle, health, and diet information "
#~ "is essential in order to gain "
#~ "novel insights into the human microbiome"
#~ " and design better studies. You can"
#~ " help us by completing our surveys,"
#~ " starting with your Basic Information."
#~ msgstr ""

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#~ msgid "Primary Questionnaire"
#~ msgstr ""
#~ msgid "Pet Information"
#~ msgstr ""
#~ msgid "Fermented Foods Questionnaire"
#~ msgstr ""
#~ msgid "Surfer Questionnaire"
#~ msgstr ""
#~ msgid "Personal Microbiome Information"
#~ msgstr ""
#~ msgid "COVID-19 Questionnaire"
#~ msgstr ""
#~ msgid "Vioscreen Food Frequency Questionnaire"
#~ msgstr ""
#~ msgid "Polyphenol Food Frequency Questionnaire"
#~ msgstr ""
#~ msgid "Cooking Oils and Oxalate-rich Foods"
#~ msgstr ""
#~ msgid ""
#~ "It looks like you have not "
#~ "completed the Basic Information survey "
#~ "yet. If you begin your FFQ without"
#~ " providing your height, weight, age, "
#~ "and gender on the Basic Information "
#~ "survey, your FFQ report will be "
#~ "inaccurate. Do you wish to proceed "
#~ "with the FFQ?"
#~ msgstr ""
#~ msgid ""
#~ "You can also resume the FFQ later"
#~ " by closing the browser tab. The "
#~ "option to \"Continue FFQ\" will then "
#~ "appear under My FFQs. "
#~ msgstr ""
#~ msgid ""
#~ "Lifestyle, health, and diet information "
#~ "is essential in order to gain "
#~ "novel insights into the human microbiome"
#~ " and design better studies. You can"
#~ " help us by completing our surveys,"
#~ " starting with your Basic Information."
#~ msgstr ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants