Fix how we determine when to show advanced filter spacer lines

pull/7066/head
Wieland Lindenthal 6 years ago
parent 62d1151392
commit da100f59c2
  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