Skip to content

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

Merged
shah-harshit merged 7 commits intomainfrom
issue-2249
Mar 10, 2026
Merged

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

Conversation

@shah-harshit
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

github-actions Bot commented Feb 26, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 65%
66% (57385/86939) 45.69% (30304/66314) 48.48% (9091/18749)

@shah-harshit shah-harshit marked this pull request as draft March 4, 2026 05:34
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Mar 10, 2026

Code Review 👍 Approved with suggestions 2 resolved / 3 findings

Adds a select all feature for test case lists in bundle suites with clean implementation. Consider clarifying the button label or behavior since "Select All" currently only applies to loaded items in the paginated view, not the full result set.

💡 Edge Case: "Select All" only applies to loaded items, not full result set

📄 openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:298 📄 openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:137

The button label says "Select All" but the list uses infinite scroll with PAGE_SIZE_MEDIUM (25) items per page. If there are 100 test cases and only 25 are loaded, clicking "Select All" only selects the 25 visible ones. The count shown (N) reflects selectedItems.size, which may confuse users who expect all test cases to be selected. Consider either clarifying the label (e.g., "Select visible") or documenting this as intentional behavior.

✅ 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".

🤖 Prompt for agents
Code Review: Adds a select all feature for test case lists in bundle suites with clean implementation. Consider clarifying the button label or behavior since "Select All" currently only applies to loaded items in the paginated view, not the full result set.

1. 💡 Edge Case: "Select All" only applies to loaded items, not full result set
   Files: openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:298, openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:137

   The button label says "Select All" but the list uses infinite scroll with `PAGE_SIZE_MEDIUM` (25) items per page. If there are 100 test cases and only 25 are loaded, clicking "Select All" only selects the 25 visible ones. The count shown `(N)` reflects `selectedItems.size`, which may confuse users who expect all test cases to be selected. Consider either clarifying the label (e.g., "Select visible") or documenting this as intentional behavior.

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
Copy Markdown

@shah-harshit shah-harshit merged commit b50d40f into main Mar 10, 2026
22 checks passed
@shah-harshit shah-harshit deleted the issue-2249 branch March 10, 2026 12:01
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.

2 participants