Skip to content

Commit 33cc811

Browse files
authored
Merge pull request #456 from UiPath/feat/react_on_max_filters_count
Feat: react on max filters count
2 parents d2a4c83 + 54056a2 commit 33cc811

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v15.1.6 (2024-07-02)
2+
* **grid** react on max filters count changes
3+
14
# v15.1.5 (2024-05-02)
25
* **grid** allow adding a custom search component via a template
36

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-components",
3-
"version": "15.1.5",
3+
"version": "15.1.6",
44
"author": {
55
"name": "UiPath Inc",
66
"url": "https://uipath.com"

projects/angular/components/ui-grid/src/ui-grid.component.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,9 @@ export class UiGridComponent<T extends IGridDataEntry>
449449
*
450450
*/
451451
@Input()
452-
maxSelectedFilterValues = Infinity;
453-
452+
set maxSelectedFilterValues(value: number) {
453+
this.maxSelectedFilterValues$.next(value);
454+
}
454455
/**
455456
* Configure if the pagination should be selectable
456457
*
@@ -758,6 +759,12 @@ export class UiGridComponent<T extends IGridDataEntry>
758759
}),
759760
);
760761

762+
/**
763+
* Emits current max selected filter values count
764+
*
765+
*/
766+
maxSelectedFilterValues$ = new BehaviorSubject(Infinity);
767+
761768
/**
762769
* Emits the id of the entity that should be highlighted.
763770
*
@@ -859,8 +866,12 @@ export class UiGridComponent<T extends IGridDataEntry>
859866
);
860867

861868
disableFilterSelection$ = defer(() => this.filterManager.activeFilterValueCount$.pipe(
862-
map(count => count >= this.maxSelectedFilterValues)),
863-
).pipe(shareReplay(1));
869+
switchMap(count => this.maxSelectedFilterValues$
870+
.pipe(
871+
map(max => count >= max),
872+
)),
873+
distinctUntilChanged(),
874+
)).pipe(shareReplay(1));
864875

865876
readonly Infinity = Infinity;
866877
protected _destroyed$ = new Subject<void>();

projects/angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uipath/angular",
3-
"version": "15.1.5",
3+
"version": "15.1.6",
44
"license": "MIT",
55
"author": {
66
"name": "UiPath Inc",

0 commit comments

Comments
 (0)