Skip to content

feat: Grouped all search- and filter-related fields on TableCardConfig#188

Merged
gkrajniak merged 8 commits into
mainfrom
feat/extend-table-card-to-be-able-to-set-initial-search-and-filter-tab
Jul 6, 2026
Merged

feat: Grouped all search- and filter-related fields on TableCardConfig#188
gkrajniak merged 8 commits into
mainfrom
feat/extend-table-card-to-be-able-to-set-initial-search-and-filter-tab

Conversation

@gkrajniak

@gkrajniak gkrajniak commented Jul 2, 2026

Copy link
Copy Markdown
Member
  • Grouped all search- and filter-related fields on TableCardConfig under 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) a
  • filterTabs (moved into searchConfig) - a breaking change.

Summary by CodeRabbit

  • New Features
    • Added unified searchConfig for table card search and filter tabs.
    • initialSearch can preset the search input, and initialFilter can preselect the matching filter tab.
    • Updated table card stories/examples to demonstrate richer filter-tab setups, including an explicit “All” tab.
  • Bug Fixes
    • Prevented seeded initialSearch values from triggering an extra searchChanged event on load.
    • Improved initialFilter seeding so default-tab promotion happens only once and won’t override later user selections.
  • Chores
    • Updated type safety for declarative form initial value handling.

…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>
@gkrajniak gkrajniak self-assigned this Jul 2, 2026
@gkrajniak gkrajniak requested review from a team as code owners July 2, 2026 13:40
@gkrajniak gkrajniak added the enhancement New feature or request label Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@gkrajniak, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2ef8472f-80f9-4041-bd8f-a92130f2bc7b

📥 Commits

Reviewing files that changed from the base of the PR and between ad6377f and 7076a9b.

📒 Files selected for processing (2)
  • projects/ngx/declarative-ui/table-card/declarative-table-card.component.spec.ts
  • projects/ngx/declarative-ui/table-card/declarative-table-card.component.ts
📝 Walkthrough

Walkthrough

This PR consolidates table-card search/filter inputs under searchConfig, adds one-shot initial search and filter seeding, updates the table-card template, stories, and tests, and narrows a form helper parameter type.

Changes

TableCardConfig search/filter consolidation

Layer / File(s) Summary
TableCardSearchConfig model and TableCardConfig updates
projects/ngx/declarative-ui/table-card/models/configs.ts
Adds TableCardSearchConfig with initialSearch, filterTabs, and initialFilter, updates the filter-tab JSDoc, and replaces TableCardConfig search-related top-level fields with searchConfig.
Component computed properties and seeding effects
projects/ngx/declarative-ui/table-card/declarative-table-card.component.ts
Adds searchConfig/resourcesSearchable computed properties, one-time initialFilter promotion for filterTabs, and one-shot initialSearch seeding through an effect().
Template gating and specs
projects/ngx/declarative-ui/table-card/declarative-table-card.component.html, projects/ngx/declarative-ui/table-card/declarative-table-card.component.spec.ts
Switches template gating to resourcesSearchable() and extends tests for searchConfig seeding, tab defaults, and search button presence/absence.
Stories updated to searchConfig
projects/ngx/declarative-ui/stories/declarative-table-card.stories.ts
Moves the table-card story search/filter examples under searchConfig.filterTabs.
Initial value type narrowing
projects/ngx/declarative-ui/form/declarative-form/declarative-form.component.ts
Narrows setInitialValues to accept the component resource type parameter T.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: Sobyt483, lpgarzonr

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed It accurately summarizes the main change: moving search and filter fields into a new searchConfig on TableCardConfig.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/extend-table-card-to-be-able-to-set-initial-search-and-filter-tab

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gkrajniak gkrajniak moved this to In progress in OpenMFP Development Jul 2, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 511ae2c and 8cf6fc2.

📒 Files selected for processing (6)
  • projects/ngx/declarative-ui/form/declarative-form/declarative-form.component.ts
  • projects/ngx/declarative-ui/stories/declarative-table-card.stories.ts
  • projects/ngx/declarative-ui/table-card/declarative-table-card.component.html
  • projects/ngx/declarative-ui/table-card/declarative-table-card.component.spec.ts
  • projects/ngx/declarative-ui/table-card/declarative-table-card.component.ts
  • projects/ngx/declarative-ui/table-card/models/configs.ts

Comment thread projects/ngx/declarative-ui/table-card/declarative-table-card.component.ts Outdated
@gkrajniak gkrajniak requested a review from Sobyt483 July 3, 2026 07:17
@gkrajniak gkrajniak enabled auto-merge (squash) July 3, 2026 07:18
gkrajniak added 2 commits July 3, 2026 09:27
trigger rebuild

Signed-off-by: Grzegorz Krajniak <gkrajniak@gmail.com>

@Sobyt483 Sobyt483 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread projects/ngx/declarative-ui/table-card/declarative-table-card.component.ts Outdated
gkrajniak added 5 commits July 6, 2026 10:11
Signed-off-by: gkrajniak <gkrajniak@gmail.com>
…l value

Signed-off-by: gkrajniak <gkrajniak@gmail.com>
…tric approach with the filter tabs initialFilter

Signed-off-by: gkrajniak <gkrajniak@gmail.com>
Signed-off-by: gkrajniak <gkrajniak@gmail.com>
@gkrajniak gkrajniak merged commit 8c94320 into main Jul 6, 2026
9 checks passed
@gkrajniak gkrajniak deleted the feat/extend-table-card-to-be-able-to-set-initial-search-and-filter-tab branch July 6, 2026 08:38
@github-project-automation github-project-automation Bot moved this from In progress to Done in OpenMFP Development Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants