Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mk/3454-add-quick-case-exports' …
Browse files Browse the repository at this point in the history
…into autostaging
  • Loading branch information
kaapstorm committed Jun 28, 2024
2 parents bb45543 + 91be659 commit 5ff08f8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,16 @@ hqDefine("data_dictionary/js/data_dictionary", [
return true;
};

self.quickCaseExportPath = ko.computed(function () {
if (self.getActiveCaseType()) {
return (
initialPageData.reverse('new_custom_export_case') +
"?export_tag=" +
self.getActiveCaseType().name
);
}
});

self.clearForm = function () {
$("#create-case-type-form").trigger("reset");
self.name("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ <h4 class="modal-title">{% trans "Create a new Case Type" %}</h4>
{% registerurl 'deprecate_or_restore_case_type' domain '---' %}
{% registerurl 'delete_case_type' domain '---' %}
{% registerurl 'data_dictionary' domain %}
{% registerurl 'new_custom_export_case' domain %}
{% initial_page_data 'typeChoices' question_types %}
{% initial_page_data 'fhirResourceTypes' fhir_resource_types %}
{% initial_page_data 'read_only_mode' request.is_view_only %}
Expand Down Expand Up @@ -193,6 +194,13 @@ <h3 data-bind="text: $root.activeCaseType()" style="display: inline-block;"></h3
{% trans "Delete Case Type" %}
</a>
{% endif %}
{% if request.couch_user.can_edit_data %}
<a class="btn btn-default" id="export-case-type-data-dict"
data-bind="attr: { href: quickCaseExportPath }, visible: activeCaseType()">
<i class="icon icon-share fa-solid fa-share-square"></i>
{% trans "Export Case Data" %}
</a>
{% endif %}
<div data-bind="visible: $root.activeCaseType()">
<button data-bind="click: $root.showDeprecated, visible: !showAll()" class="btn btn-default pull-right">{% trans "Show Deprecated" %}</button>
<button data-bind="click: $root.hideDeprecated, visible: showAll" class="btn btn-default pull-right">{% trans "Hide Deprecated" %}</button>
Expand Down

0 comments on commit 5ff08f8

Please sign in to comment.