mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-24 19:48:36 +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) {
|
toggleExportButton(requests) {
|
||||||
console.log("Toggling Export Button Visibility");
|
|
||||||
const exportButton = document.getElementById('export-csv');
|
const exportButton = document.getElementById('export-csv');
|
||||||
if (exportButton) {
|
if (exportButton) {
|
||||||
console.log(`Current requests length: ${requests.length}`);
|
|
||||||
if (requests.length > 0) {
|
if (requests.length > 0) {
|
||||||
showElement(exportButton);
|
showElement(exportButton);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1562,7 +1560,7 @@ class DomainRequestsTable extends LoadTableBase {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call toggleExportButton to manage button visibility
|
// Manage "export as CSV" visibility for domain requests
|
||||||
this.toggleExportButton(data.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
|
// 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>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</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">
|
<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">
|
<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">
|
<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>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if portfolio %}
|
{% if portfolio %}
|
||||||
|
|
|
@ -645,12 +645,6 @@ class DomainRequestsDataType:
|
||||||
)
|
)
|
||||||
|
|
||||||
queryset = cls.get_queryset(request)
|
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:
|
for request in queryset:
|
||||||
writer.writerow(
|
writer.writerow(
|
||||||
[
|
[
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue