feat: Grouped all search- and filter-related fields on TableCardConfig#188
Conversation
…r a new searchConfig object, adding initialSearch and initialFilter as one-shot seeds so hosts can hydrate the search input and selected filter tab from external state (e.g. URL params) — previously impossible. Removed the now-redundant top-level resourcesSearchable (derived from searchConfig presence) and filterTabs (moved into searchConfig), a breaking change. Signed-off-by: gkrajniak <gkrajniak@gmail.com>
|
Warning Review limit reached
Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR consolidates table-card search/filter inputs under ChangesTableCardConfig search/filter consolidation
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@projects/ngx/declarative-ui/table-card/declarative-table-card.component.spec.ts`:
- Around line 322-323: The test file uses multiple inline
`@typescript-eslint/no-explicit-any` disables around `component as any`, which
violates the linting guidelines. Replace these accesses with a narrow test-only
internals type (for example, a `TestTableCardInternals` cast used in the
affected specs) or, if a disable must remain, add an explanatory reason plus a
TODO to remove it. Update all affected assertions and helpers in
`declarative-table-card.component.spec.ts` so the internals are accessed without
undocumented `any` usage.
- Around line 332-337: The seeded search test in
declarative-table-card.component.spec.ts is asserting too early to prove silence
because the debounce window has not elapsed. Update the spec around
setupWithSearchConfig and the searchChanged assertion to run under fakeAsync,
advance time with tick(301), and then verify searchEvents remains empty so the
test will fail if the initial seed emits.
In `@projects/ngx/declarative-ui/table-card/declarative-table-card.component.ts`:
- Around line 153-160: `DeclarativeTableCardComponent` is latching tab state too
early in the `getFilterTabs`/`seededFilterTabs` flow. Update the logic so
`initialFilter` is only consumed once when it actually exists, but do not mark
`hasSeededFilter` on the no-initial case; also stop returning a permanently
cached promoted array so later `searchConfig().filterTabs` changes can still
flow through. Apply the same one-shot-but-not-frozen behavior to the related
tab/filter handling in the other referenced blocks so `initialFilter` and tab
updates stay in sync.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8ff12274-642f-4db0-a971-7dd3d9ca844f
📒 Files selected for processing (6)
projects/ngx/declarative-ui/form/declarative-form/declarative-form.component.tsprojects/ngx/declarative-ui/stories/declarative-table-card.stories.tsprojects/ngx/declarative-ui/table-card/declarative-table-card.component.htmlprojects/ngx/declarative-ui/table-card/declarative-table-card.component.spec.tsprojects/ngx/declarative-ui/table-card/declarative-table-card.component.tsprojects/ngx/declarative-ui/table-card/models/configs.ts
trigger rebuild Signed-off-by: Grzegorz Krajniak <gkrajniak@gmail.com>
…tial-search-and-filter-tab
Sobyt483
left a comment
There was a problem hiding this comment.
And please can you put less comments on code itself. I don't know why, but It feel so messy when i see so many comments in code
Signed-off-by: gkrajniak <gkrajniak@gmail.com>
…l value Signed-off-by: gkrajniak <gkrajniak@gmail.com>
…tial-search-and-filter-tab
…tric approach with the filter tabs initialFilter Signed-off-by: gkrajniak <gkrajniak@gmail.com>
Summary by CodeRabbit
searchConfigfor table card search and filter tabs.initialSearchcan preset the search input, andinitialFiltercan preselect the matching filter tab.initialSearchvalues from triggering an extrasearchChangedevent on load.initialFilterseeding so default-tab promotion happens only once and won’t override later user selections.