From f343a8c9501580746571452cb2f458dd3231afef Mon Sep 17 00:00:00 2001 From: guillermo2519 Date: Fri, 24 Apr 2026 15:09:31 -0600 Subject: [PATCH] Fix #5534: allow multiple accordions to stay open in Collection Filter Report --- .../filtered-collections.component.html | 2 +- .../filtered-collections.component.spec.ts | 15 +++++++++++++++ .../filtered-collections.component.ts | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.html b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.html index c696fa23ba2..ec9f8baf86b 100644 --- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.html +++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.html @@ -5,7 +5,7 @@

{{ "admin.reports.collections.head" | translate }}

- + {{ "admin.reports.commons.filters" | translate }} diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts index 40a4f18c7cf..6a3757ecd43 100644 --- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts +++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts @@ -83,6 +83,7 @@ describe('FiltersComponent', () => { spyOn(component, 'getFilteredCollections').and.returnValue(of(expected)); spyOn(component.results, 'deserialize'); spyOn(component.accordionComponent, 'expand').and.callThrough(); + spyOn(component.accordionComponent, 'collapse').and.callThrough(); component.submit(); fixture.detectChanges(); }); @@ -93,5 +94,19 @@ describe('FiltersComponent', () => { expect(component.accordionComponent.isExpanded('collections')).toBeTrue(); }); })); + + it('should collapse the filters panel after submitting', waitForAsync(() => { + fixture.whenStable().then(() => { + expect(component.accordionComponent.isExpanded('filters')).toBeFalse(); + }); + })); + }); + + it('should allow both accordions to be open at the same time', () => { + let accordion: NgbAccordion = component.accordionComponent; + accordion.expand('filters'); + accordion.expand('collections'); + expect(accordion.isExpanded('filters')).toBeTrue(); + expect(accordion.isExpanded('collections')).toBeTrue(); }); }); diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts index c300d9b9ca9..14b1f642362 100644 --- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts +++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts @@ -66,6 +66,7 @@ export class FilteredCollectionsComponent implements OnInit { .subscribe( response => { this.results.deserialize(response.payload); + this.accordionComponent.collapse('filters'); // ← agregar esto this.accordionComponent.expand('collections'); }, );