Skip to content

Commit

Permalink
Merge pull request #35499 from dimagi/mjr/enterprise_tile_display_fix
Browse files Browse the repository at this point in the history
Enterprise Date Range Tiles do not display for translated languages
  • Loading branch information
mjriley authored Dec 10, 2024
2 parents 6d5e403 + 3a007c0 commit e56ef3e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ hqDefine("enterprise/js/project_dashboard", [
const maxDateRangeDays = initialPageData.get("max_date_range_days");

const displayMap = {
"form_submission": formSubmissionsDisplay,
"form_submissions": formSubmissionsDisplay,
"sms": smsDisplay,
};
const dateRangeModal = DateRangeModal($dateRangeModal, datePicker, dateRangePresetOptions, maxDateRangeDays, displayMap);

$("#form_submission_dateRangeDisplay").koApplyBindings(formSubmissionsDisplay);
$("#form_submissions_dateRangeDisplay").koApplyBindings(formSubmissionsDisplay);
$("#sms_dateRangeDisplay").koApplyBindings(smsDisplay);
$dateRangeModal.koApplyBindings(
dateRangeModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,16 @@ <h4 class="fs-5 pt-2">{{ report.title }}</h4>
</div>
<div class="fs-5">{{ report.total_description }}</div>
<div class="py-2">
{% if report.title == "Mobile Form Submissions" %}
{% if report.slug in uses_date_range %}
<button
class="btn btn-link fs-6" id="form_submission_dateRangeDisplay" type="button"
class="btn btn-link fs-6" id="{{ report.slug }}_dateRangeDisplay" type="button"
data-bind="text: presetText"
data-bs-toggle="modal"
data-bs-target="#enterpriseFormsDaterange"
data-sender="form_submission"
>&nbsp;</button>
{% elif report.title == "SMS Usage" %}
<button
class="btn btn-link fs-6" id="sms_dateRangeDisplay" type="button"
data-bind="text: presetText"
data-bs-toggle="modal"
data-bs-target="#enterpriseFormsDaterange"
data-sender="sms"
data-sender="{{ report.slug }}"
>&nbsp;</button>
{% else %}
<div class="form-control-plaintext fs-6">{{ "&nbsp;" }}</div>
<div class="form-control-plaintext fs-6">&nbsp;</div>
{% endif %}
</div>
<button class="btn btn-primary btn-lg">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<div class="row mt-4">
{% for report in reports %}
{% include 'enterprise/partials/project_tile.html' with report=report %}
{% include 'enterprise/partials/project_tile.html' with report=report uses_date_range=uses_date_range %}
{% endfor %}
</div>

Expand Down
1 change: 1 addition & 0 deletions corehq/apps/enterprise/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def platform_overview(request, domain):
EnterpriseReport.ODATA_FEEDS,
EnterpriseReport.SMS,
)],
'uses_date_range': [EnterpriseReport.FORM_SUBMISSIONS, EnterpriseReport.SMS],
'metric_type': 'Platform Overview',
})

Expand Down

0 comments on commit e56ef3e

Please sign in to comment.