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

Enterprise Date Range Tiles do not display for translated languages #35499

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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],
Copy link
Contributor

Choose a reason for hiding this comment

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

Love it.

'metric_type': 'Platform Overview',
})

Expand Down
Loading