Merge pull request #7035 from opf/fix/filter-spacer-visibility

Fix how we determine when to show advanced filter spacer lines
pull/7064/head
Wieland Lindenthal 6 years ago committed by GitHub
commit 61639d8cb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      frontend/src/app/components/filters/query-filters/query-filters.component.html
  2. 6
      frontend/src/app/components/filters/query-filters/query-filters.component.ts
  3. 4
      frontend/src/app/components/wp-fast-table/wp-table-filters.ts

@ -22,7 +22,7 @@
</div>
</li>
<li class="advanced-filters--spacer" *ngIf="filters.anyCurrentlyVisibleFilters"></li>
<li class="advanced-filters--spacer"></li>
<ng-container *ngFor="let filter of filters.current; trackBy: trackByName ; let index = index">
<li id="filter_{{filter.id}}"
@ -35,7 +35,7 @@
</li>
</ng-container>
<li class="advanced-filters--spacer" *ngIf="filters.current.length > 0"></li>
<li class="advanced-filters--spacer" *ngIf="isSecondSpacerVisible"></li>
<li class="advanced-filters--add-filter">
<!-- Add filters -->

@ -120,6 +120,12 @@ export class QueryFiltersComponent implements OnInit, OnChanges, OnDestroy {
this.updateRemainingFilters();
}
public get isSecondSpacerVisible():boolean {
return _.reject(this.filters.current, (filter) => {
return (filter.id === 'search');
}).length > 0;
}
private updateRemainingFilters() {
this.remainingFilters = _.sortBy(this.filters.remainingVisibleFilters, 'name');
}

@ -105,10 +105,6 @@ export class WorkPackageTableFilters extends WorkPackageTableBaseState<QueryFilt
return _.reject(this.currentFilters, (filter) => invisibleFilters.has(filter.id));
}
public get anyCurrentlyVisibleFilters():boolean {
return this.currentlyVisibleFilters.length > 0;
}
private get currentFilters() {
return this.current.map((filter:QueryFilterInstanceResource) => filter.filter);
}

Loading…
Cancel
Save