Skip to content

Commit

Permalink
Merge pull request #456 from UiPath/feat/react_on_max_filters_count
Browse files Browse the repository at this point in the history
Feat: react on max filters count
  • Loading branch information
anbalase authored Feb 8, 2024
2 parents d2a4c83 + 54056a2 commit 33cc811
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v15.1.6 (2024-07-02)
* **grid** react on max filters count changes

# v15.1.5 (2024-05-02)
* **grid** allow adding a custom search component via a template

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-components",
"version": "15.1.5",
"version": "15.1.6",
"author": {
"name": "UiPath Inc",
"url": "https://uipath.com"
Expand Down
19 changes: 15 additions & 4 deletions projects/angular/components/ui-grid/src/ui-grid.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,9 @@ export class UiGridComponent<T extends IGridDataEntry>
*
*/
@Input()
maxSelectedFilterValues = Infinity;

set maxSelectedFilterValues(value: number) {
this.maxSelectedFilterValues$.next(value);
}
/**
* Configure if the pagination should be selectable
*
Expand Down Expand Up @@ -758,6 +759,12 @@ export class UiGridComponent<T extends IGridDataEntry>
}),
);

/**
* Emits current max selected filter values count
*
*/
maxSelectedFilterValues$ = new BehaviorSubject(Infinity);

/**
* Emits the id of the entity that should be highlighted.
*
Expand Down Expand Up @@ -859,8 +866,12 @@ export class UiGridComponent<T extends IGridDataEntry>
);

disableFilterSelection$ = defer(() => this.filterManager.activeFilterValueCount$.pipe(
map(count => count >= this.maxSelectedFilterValues)),
).pipe(shareReplay(1));
switchMap(count => this.maxSelectedFilterValues$
.pipe(
map(max => count >= max),
)),
distinctUntilChanged(),
)).pipe(shareReplay(1));

readonly Infinity = Infinity;
protected _destroyed$ = new Subject<void>();
Expand Down
2 changes: 1 addition & 1 deletion projects/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uipath/angular",
"version": "15.1.5",
"version": "15.1.6",
"license": "MIT",
"author": {
"name": "UiPath Inc",
Expand Down

0 comments on commit 33cc811

Please sign in to comment.