Skip to content

feat(ui): Add select all for test case list in bundle suite#26125

Open
shah-harshit wants to merge 4 commits intomainfrom
issue-2249
Open

feat(ui): Add select all for test case list in bundle suite#26125
shah-harshit wants to merge 4 commits intomainfrom
issue-2249

Conversation

@shah-harshit
Copy link
Contributor

@shah-harshit shah-harshit commented Feb 26, 2026

Description

Adds optional Select All for the test case list used in the bundle suite flow. When enabled, users can select all visible test cases or deselect all with one click, and see the selected count in the button label.

Fixes collate issue #2249

Changes

AddTestCaseList

  • showSelectAll prop (default false): When true, shows a "Select All" link. Click: select all when none/some are selected; deselect all when all are selected.
  • Selected count: Button shows Select All (N) when N > 0 selected (e.g. Select All (5)).
  • Styling: List container background #F8F9FC; Select All button uses Tailwind underline.
  • BundleSuiteForm: Passes showSelectAll to AddTestCaseList in the test case selection card.

Unit tests (AddTestCaseList.component.test.tsx)

  • showSelectAll false (default): button not rendered.
  • showSelectAll true with items: button visible; with no items: button not visible.
  • Select all: click selects all and onChange receives all items; button shows count.
  • Deselect all: when all selected, click clears selection and onChange([]).
  • Partial selection: click Select all selects remaining items.

Internationalization

  • label.select-all added to all 19 locale files (en-us already had it) with appropriate translations (e.g. 全选, Tout sélectionner, Seleccionar todo, Alle auswählen).

E2E (TestSuite.spec.ts)

  • In Add test suite pipeline, after opening the pipeline test case modal:
    • Select all: click Select All, assert button text contains count e.g. (2).
    • Deselect all: click again, assert button no longer shows count.
  • Then select all again and continue with existing deploy flow.

Testing

  • yarn test src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.test.tsx
  • Playwright: Test Suites → Logical TestSuite → Add test suite pipeline (select all / deselect all steps)

Screenshots / UX

  • With 0 selected: Select All
Screen.Recording.2026-02-26.at.5.19.15.PM.mov
  • With 3 selected: Select All (3)
Screenshot 2026-02-26 at 5 34 35 PM

Made with Cursor

…suite

- Add showSelectAll prop to AddTestCaseList (default false); toggle: select all when not all selected, deselect all when all selected
- Show selected count in Select All button when count > 0 (e.g. Select All (5))
- Apply list background #F8F9FC and Tailwind underline for Select All button
- Use showSelectAll in BundleSuiteForm
- Add unit tests for showSelectAll visibility and select/deselect behavior
- Add label.select-all to all 19 locale files
- Add E2E steps in TestSuite.spec for select all and deselect all in pipeline modal

Made-with: Cursor
@github-actions
Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@shah-harshit shah-harshit changed the title feat(ui): Add select all / deselect all for test case list in bundle suite feat(ui): Add select all for test case list in bundle suite Feb 26, 2026
@github-actions
Copy link
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 65%
65.75% (56564/86029) 45.27% (29674/65556) 47.97% (8928/18611)

@gitar-bot
Copy link

gitar-bot bot commented Feb 27, 2026

Code Review ✅ Approved 2 resolved / 2 findings

Clean, well-tested implementation of "Select All" toggle for test case lists. The feature is properly opt-in, backward compatible, with comprehensive unit/E2E tests and full i18n coverage across 19 locales. No new issues found.

✅ 2 resolved
Bug: Incorrect prefixCls prop breaks Ant Design Space styling

📄 openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:201
The prefixCls="w-full" prop on the Space component (line 201) is incorrectly used. In Ant Design, prefixCls replaces the internal CSS class prefix (e.g., changes ant-space to w-full), which breaks the component's internal styling since it will no longer match Ant Design's CSS rules.

This appears to have been accidentally introduced during the reformatting of the JSX. The original code only had className="w-full" and direction="vertical" — the prefixCls line is new in this diff.

This affects the error placeholder rendering when no test cases match a search filter. The Space component's internal layout (gap, alignment, direction) will break because the generated class names won't match Ant Design's CSS selectors.

Bug: "Select All" discards previously selected items not in current view

📄 openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:137
The handleSelectAll function at line 148 creates a brand new Map containing only items currently visible in the items array:

const allSelected = new Map(items.map((test) => [test.id ?? '', test]));
setSelectedItems(allSelected);

This discards any previously selected items that are not in the current items array. This can happen in two scenarios:

  1. After searching: User selects items → searches (which resets items to search results) → clicks "Select All" → previously selected items from the original list are lost.
  2. Deselect All: Similarly, line 145 does setSelectedItems(new Map()) which clears ALL selections, not just the visible ones.

The parent component (BundleSuiteForm) receives the truncated array via onChange, permanently losing the prior selections.

Fix: Merge new selections with existing ones for "Select All", and only remove visible items for "Deselect All".

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant