From 0451b09db195765209762c3b8408ceaf132c4abc Mon Sep 17 00:00:00 2001 From: Wieland Lindenthal Date: Fri, 8 Feb 2019 16:47:10 +0100 Subject: [PATCH] Fix how we determine when to show advanced filter spacer lines --- .../filters/query-filters/query-filters.component.html | 4 ++-- .../filters/query-filters/query-filters.component.ts | 6 ++++++ .../src/app/components/wp-fast-table/wp-table-filters.ts | 4 ---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/components/filters/query-filters/query-filters.component.html b/frontend/src/app/components/filters/query-filters/query-filters.component.html index fca179dd25..7d1ed00d6c 100644 --- a/frontend/src/app/components/filters/query-filters/query-filters.component.html +++ b/frontend/src/app/components/filters/query-filters/query-filters.component.html @@ -22,7 +22,7 @@ -
  • +
  • -
  • +
  • diff --git a/frontend/src/app/components/filters/query-filters/query-filters.component.ts b/frontend/src/app/components/filters/query-filters/query-filters.component.ts index d424923e7e..a040ded22d 100644 --- a/frontend/src/app/components/filters/query-filters/query-filters.component.ts +++ b/frontend/src/app/components/filters/query-filters/query-filters.component.ts @@ -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'); } diff --git a/frontend/src/app/components/wp-fast-table/wp-table-filters.ts b/frontend/src/app/components/wp-fast-table/wp-table-filters.ts index fdd84fd77f..f38ace3d40 100644 --- a/frontend/src/app/components/wp-fast-table/wp-table-filters.ts +++ b/frontend/src/app/components/wp-fast-table/wp-table-filters.ts @@ -105,10 +105,6 @@ export class WorkPackageTableFilters extends WorkPackageTableBaseState invisibleFilters.has(filter.id)); } - public get anyCurrentlyVisibleFilters():boolean { - return this.currentlyVisibleFilters.length > 0; - } - private get currentFilters() { return this.current.map((filter:QueryFilterInstanceResource) => filter.filter); }