From a6bd118f5e77c291e52cf518a812151f9053c0e7 Mon Sep 17 00:00:00 2001
From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com>
Date: Thu, 21 Jan 2021 14:42:05 -0800
Subject: [PATCH] Disable any / all toggle when excluded items
---
.../filterable-dropdown/filterable-dropdown.component.html | 4 ++--
.../filterable-dropdown/filterable-dropdown.component.ts | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html
index 7d3b8dab4..25e9020dc 100644
--- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html
+++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html
@@ -15,10 +15,10 @@
diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts
index 090385fac..413f2fdb6 100644
--- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts
+++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts
@@ -95,6 +95,7 @@ export class FilterableDropdownSelectionModel {
let state = this.temporarySelectionStates.get(id)
if (state == null || state != ToggleableItemState.Excluded) {
this.temporarySelectionStates.set(id, ToggleableItemState.Excluded)
+ this.temporaryLogicalOperator = this._logicalOperator = 'and'
} else if (state == ToggleableItemState.Excluded) {
this.temporarySelectionStates.delete(id)
}
@@ -270,6 +271,10 @@ export class FilterableDropdownComponent {
@Output()
open = new EventEmitter()
+ get operatorToggleEnabled(): boolean {
+ return this.selectionModel.selectionSize() > 1 && this.selectionModel.getExcludedItems().length == 0
+ }
+
constructor(private filterPipe: FilterPipe) {
this.selectionModel = new FilterableDropdownSelectionModel()
}