-
Notifications
You must be signed in to change notification settings - Fork 28
refactor: convert groupedRows to signal input #524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dbdc192 to
ebb5a76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors groupedRows and groupRowsBy from decorator-based @Input() properties to signal inputs, introducing a new computed signal _internalGroupedRows that consolidates the logic for calculating and sorting grouped rows. The refactoring moves sorting and grouping logic from imperative lifecycle methods into reactive computed signals.
Key changes:
- Converted
groupedRowsandgroupRowsByto signal inputs - Introduced
_internalGroupedRowscomputed signal to handle grouped row calculation and sorting - Removed manual sorting calls from
ngDoCheck()andonColumnSort(), as sorting is now reactive - Removed the
sortInternalRows()private method and_groupRowsByfield
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| projects/ngx-datatable/src/lib/components/datatable.component.ts | Converted inputs to signals, added _internalGroupedRows computed signal, removed imperative sorting logic |
| projects/ngx-datatable/src/lib/components/datatable.component.html | Updated bindings to use _internalGroupedRows() instead of groupedRows, removed groupRowsBy binding |
| projects/ngx-datatable/src/lib/components/body/body.component.ts | Removed unused groupRowsBy input from body component |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
projects/ngx-datatable/src/lib/components/datatable.component.ts
Outdated
Show resolved
Hide resolved
projects/ngx-datatable/src/lib/components/datatable.component.ts
Outdated
Show resolved
Hide resolved
ebb5a76 to
1adc5b9
Compare
Converts `groupedRows` and `groupRowsBy` to signal inputs. Introduces a new `_internalGroupedRows` which contains the combination of both inputs. BREAKING CHANGE: Previously, the `groupedRows` input was updated by the datatable, when `groupRowsBy` was used. This behavior was dropped. `groupedRows` will only contain application provided values. The table calculates internal the actual `groupedRows` without exposing them.
1adc5b9 to
731df2b
Compare
fh1ch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spike-rabbit outstanding work, thanks a bunch 🙇
LGTM 👍
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
groupedRowsandgroupRowsByare decorator based inputs.What is the new behavior?
groupedRowsandgroupRowsByare signal inputs. A new_internalGroupedRowscontains the calculated combination.Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications:
groupedRowswill no longer be updated, if grouped rows are calculated based ongroupRowsBy.Other information: