diff --git a/CHANGELOG.md b/CHANGELOG.md index bb709950c..b5a285012 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Added a button to reset the active filters in the assistant (experimental) + ### Changed - Migrated the portfolio allocations to work with the filters of the assistant (experimental) diff --git a/libs/ui/src/lib/assistant/assistant.component.ts b/libs/ui/src/lib/assistant/assistant.component.ts index 79ecce4b5..19cbaefcb 100644 --- a/libs/ui/src/lib/assistant/assistant.component.ts +++ b/libs/ui/src/lib/assistant/assistant.component.ts @@ -216,6 +216,12 @@ export class AssistantComponent implements OnChanges, OnDestroy, OnInit { ); } + public hasFilter(aFormValue: { [key: string]: string }) { + return Object.values(aFormValue).some((value) => { + return !!value; + }); + } + public async initialize() { this.isLoading = true; this.keyManager = new FocusKeyManager(this.assistantListItems).withWrap(); @@ -249,6 +255,21 @@ export class AssistantComponent implements OnChanges, OnDestroy, OnInit { this.closed.emit(); } + public onResetFilters() { + this.filtersChanged.emit([ + { + id: null, + type: 'ACCOUNT' + }, + { + id: null, + type: 'TAG' + } + ]); + + this.onCloseAssistant(); + } + public setIsOpen(aIsOpen: boolean) { this.isOpen = aIsOpen; } diff --git a/libs/ui/src/lib/assistant/assistant.html b/libs/ui/src/lib/assistant/assistant.html index cf1c99ef3..682d2227e 100644 --- a/libs/ui/src/lib/assistant/assistant.html +++ b/libs/ui/src/lib/assistant/assistant.html @@ -91,33 +91,25 @@ *ngIf="!(isLoading || searchFormControl.value) && user?.settings?.isExperimentalFeatures" class="filter-container" > +
+ + Date Range + + @for (range of dateRangeOptions; track range) { + {{ range.label }} + } + + +
- - Date Range -
- - - @for (range of dateRangeOptions; track range) { - {{ range.label }} - } - - -
-
+
+ +
diff --git a/libs/ui/src/lib/assistant/assistant.scss b/libs/ui/src/lib/assistant/assistant.scss index a2b6f1fa2..5003d1c39 100644 --- a/libs/ui/src/lib/assistant/assistant.scss +++ b/libs/ui/src/lib/assistant/assistant.scss @@ -3,7 +3,7 @@ .filter-container { .mat-mdc-tab-group { - max-height: 40vh; + max-height: 20vh; } ::ng-deep {