mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 19:20:47 +02:00
Hide exporting for domain request for non org
This commit is contained in:
parent
8aa919cc65
commit
28ce6698da
3 changed files with 3 additions and 9 deletions
|
@ -1505,10 +1505,8 @@ class DomainRequestsTable extends LoadTableBase {
|
|||
}
|
||||
|
||||
toggleExportButton(requests) {
|
||||
console.log("Toggling Export Button Visibility");
|
||||
const exportButton = document.getElementById('export-csv');
|
||||
if (exportButton) {
|
||||
console.log(`Current requests length: ${requests.length}`);
|
||||
if (requests.length > 0) {
|
||||
showElement(exportButton);
|
||||
} else {
|
||||
|
@ -1562,7 +1560,7 @@ class DomainRequestsTable extends LoadTableBase {
|
|||
return;
|
||||
}
|
||||
|
||||
// Call toggleExportButton to manage button visibility
|
||||
// Manage "export as CSV" visibility for domain requests
|
||||
this.toggleExportButton(data.domain_requests);
|
||||
|
||||
// handle the display of proper messaging in the event that no requests exist in the list or search returns no results
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
</form>
|
||||
</section>
|
||||
</div>
|
||||
{% if portfolio %}
|
||||
<div class="section-outlined__utility-button mobile-lg:padding-right-105 {% if portfolio %} mobile:grid-col-12 desktop:grid-col-6 desktop:padding-left-3{% endif %}" id="export-csv">
|
||||
<section aria-label="Domain Requests report component" class="margin-top-205">
|
||||
<a href="{% url 'export_data_type_requests' %}" class="usa-button usa-button--unstyled usa-button--with-icon usa-button--justify-right" role="button">
|
||||
|
@ -58,6 +59,7 @@
|
|||
</a>
|
||||
</section>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if portfolio %}
|
||||
|
|
|
@ -645,12 +645,6 @@ class DomainRequestsDataType:
|
|||
)
|
||||
|
||||
queryset = cls.get_queryset(request)
|
||||
# TO REMOVE
|
||||
print("Queryset IDs:", list(queryset.values_list("id", flat=True)))
|
||||
# TO REMOVE
|
||||
for request in queryset:
|
||||
print("Processing request:", request)
|
||||
|
||||
for request in queryset:
|
||||
writer.writerow(
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue