Skip to content

Commit

Permalink
change visit column filter to select
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen committed Nov 20, 2024
1 parent c58ed38 commit 380c6ac
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion portal/static/js/src/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ let requestTimerId = 0;
this.filterOptionsList.forEach((o) => {
for (const [key, values] of Object.entries(o)) {
values.forEach((value) => {
if (!value[1]) return true;
if (
$(
`#adminTable .bootstrap-table-filter-control-${key} option[value='${value[0]}']`
Expand Down Expand Up @@ -1412,7 +1413,7 @@ let requestTimerId = 0;
max_attempts: 1,
},
function (result) {
if (!result?.error) self.currentTablePreference = data;
if (result && !result.error) self.currentTablePreference = data;
if (callback) callback();
}
);
Expand Down
1 change: 1 addition & 0 deletions portal/templates/admin/admin_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,6 @@
// placeholder variables
var qStatusFilterOptions = {};
var clinicianActionStateFilterOptions = {};
var visitOptions = {};
</script>
{%- endmacro -%}
2 changes: 1 addition & 1 deletion portal/templates/admin/patients_by_org.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h4 class="tnth-headline">{{_("Patient List")}}</h4>
<th data-field="email" data-sortable="true" data-class="email-field" data-filter-control="input">{{ _("Email") }}</th>
{% if 'status' in config.PATIENT_LIST_ADDL_FIELDS %}
<th data-field="questionnaire_status" data-sortable="true" data-card-visible="false" data-searchable="true" data-width="5%" data-class="status-field" data-filter-control="select" data-filter-strict-search="true" data-filter-data="var:qStatusFilterOptions">{{ _("Questionnaire Status") }}</th>
<th data-field="visit" data-sortable="true" data-card-visible="false" data-searchable="true" data-width="5%" data-class="visit-field" data-filter-control="input">{{ _("Visit") }}</th>
<th data-field="visit" data-sortable="true" data-card-visible="false" data-searchable="true" data-width="5%" data-class="visit-field" data-filter-control="select" data-filter-data="var:visitOptions">{{ _("Visit") }}</th>
{% endif %}
{% if 'study_id' in config.PATIENT_LIST_ADDL_FIELDS %}<th data-field="study_id" data-sortable="true" data-searchable="true" data-class="study-id-field" data-filter-control="input" data-sorter="tnthTables.alphanumericSorter" data-width="5%">{{ _("Study ID") }}</th>{% endif %}
<th data-field="consentdate" data-sortable="true" data-card-visible="false" data-sorter="tnthTables.dateSorter" data-searchable="true" data-class="consentdate-field text-center">{{ _("Study Consent Date") }}</th>
Expand Down
2 changes: 1 addition & 1 deletion portal/templates/admin/patients_substudy.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h2>{{list_title}}</h2>
<th data-field="birthdate" data-sortable="true" data-class="birthdate-field" data-visible="false">{{ _("Date of Birth") }}</th>
<th data-field="clinician" data-sortable="true" data-class="clinician-field" data-filter-control="input">{{ _("Treating Clinician") }}</th>
<th data-field="empro_status" data-sortable="true" data-card-visible="true" data-searchable="true" data-width="5%" data-class="status-field" data-filter-control="select" data-filter-strict-search="true" data-filter-data="var:qStatusFilterOptions">{{_("EMPRO Questionnaire Status")}}</th>
<th data-field="empro_visit" data-sortable="true" data-card-visible="false" data-searchable="true" data-width="5%" data-class="visit-field" data-filter-control="input" data-visible="false">{{ _("Visit") }}</th>
<th data-field="empro_visit" data-sortable="true" data-card-visible="false" data-searchable="true" data-width="5%" data-class="visit-field" data-filter-control="select" data-visible="false" data-filter-data="var:visitOptions">{{ _("Visit") }}</th>
<th data-field="action_state" data-sortable="true" data-class="intervention-actions-field" data-filter-control="select" data-filter-data="var:clinicianActionStateFilterOptions">{{ _("Clinician Action Status") }}</th>
<th data-field="study_id" data-sortable="true" data-searchable="true" data-class="study-id-field" data-filter-control="input" data-visible="false" data-sorter="tnthTables.alphanumericSorter" data-width="5%">{{ _("Study ID") }}</th>
<th data-field="empro_consentdate" data-sortable="true" data-card-visible="false" data-sorter="tnthTables.dateSorter" data-searchable="true" data-visible="false" data-class="consentdate-field text-center" data-visible="true">{{ _("Study Consent Date") }}</th>
Expand Down

0 comments on commit 380c6ac

Please sign in to comment.