Skip to content
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
47abd8a
feat: extend DataGridWrapper with server-side search support
NavyasreeBalu Jan 11, 2026
68a8bf0
fix: address CodeRabbit feedback for DataGridWrapper server-side search
NavyasreeBalu Jan 11, 2026
d8675b3
feat: complete DataGridWrapper server-side search implementation
NavyasreeBalu Jan 11, 2026
df5d0fb
test: improve DataGridWrapper test coverage
NavyasreeBalu Jan 11, 2026
546a53c
fix: resolve Rules of Hooks violation in Groups component
NavyasreeBalu Jan 11, 2026
073baab
test: fix TypeScript error in Groups test
NavyasreeBalu Jan 11, 2026
0bdb5bb
fix: use empty string for missing orgId test
NavyasreeBalu Jan 11, 2026
b2c360f
fix: correct misleading test comment in Groups spec
NavyasreeBalu Jan 11, 2026
1a672f7
fix: address code review feedback in Groups test
NavyasreeBalu Jan 11, 2026
a1c3282
Merge branch 'develop' into feature/refactor-screens-datagridwrapper-…
NavyasreeBalu Jan 11, 2026
1c94309
fix: refactor test to focus on behavior and fix data inconsistencies
NavyasreeBalu Jan 11, 2026
f76b1e0
fix: resolve Groups component test failure by using StaticMockLink
NavyasreeBalu Jan 11, 2026
d721668
fix: simplify Groups test to verify empty search conditions
NavyasreeBalu Jan 11, 2026
a30aa67
Merge branch 'develop' into feature/refactor-screens-datagridwrapper-…
palisadoes Jan 11, 2026
03eb5a1
feat: refactor Groups to use DataGridWrapper with server-side search
NavyasreeBalu Jan 11, 2026
92b2338
test: add comprehensive tests to improve coverage
NavyasreeBalu Jan 11, 2026
5140fbe
fix: resolve duplicate test name eslint error
NavyasreeBalu Jan 11, 2026
48091c9
fix: address CodeRabbit feedback
NavyasreeBalu Jan 11, 2026
d8218fd
fix: resolve all test failures and improve coverage
NavyasreeBalu Jan 11, 2026
9852d60
test: improve codecov coverage for DataGridWrapper and Groups
NavyasreeBalu Jan 12, 2026
9e0a127
Merge branch 'develop' into feature/refactor-screens-datagridwrapper-…
NavyasreeBalu Jan 12, 2026
da29f7b
fix: remove failing empty state test
NavyasreeBalu Jan 12, 2026
fcdd172
refactor: clean up DataGridWrapper tests and improve coverage
NavyasreeBalu Jan 12, 2026
115fe04
refactor: optimize DataGridWrapper tests to minimal core coverage
NavyasreeBalu Jan 12, 2026
5d47114
feat: add targeted tests to improve DataGridWrapper coverage
NavyasreeBalu Jan 12, 2026
eb3578f
feat: add targeted tests to improve DataGridWrapper coverage
NavyasreeBalu Jan 12, 2026
f112940
feat: add final tests for onRowClick and actionColumn coverage
NavyasreeBalu Jan 12, 2026
33cdd75
feat: add invalid sort format warning test for DataGridWrapper
NavyasreeBalu Jan 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> **default**(): `Element`

Defined in: [src/screens/UserPortal/Volunteer/Groups/Groups.tsx:80](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/screens/UserPortal/Volunteer/Groups/Groups.tsx#L80)
Defined in: [src/screens/UserPortal/Volunteer/Groups/Groups.tsx:69](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/screens/UserPortal/Volunteer/Groups/Groups.tsx#L69)

## Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

# Variable: default

> `const` **default**: `Meta`\<*typeof* [`DataGridWrapper`](../../functions/DataGridWrapper.md)\>
> `const` **default**: `Meta`\<*typeof* [`DataGridWrapper`](../../DataGridWrapper/functions/DataGridWrapper.md)\>

Defined in: [src/shared-components/DataGridWrapper/DataGridWrapper.stories.tsx:114](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/shared-components/DataGridWrapper/DataGridWrapper.stories.tsx#L114)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> **DataGridWrapper**\<`T`\>(`props`): `Element`

Defined in: [src/shared-components/DataGridWrapper/DataGridWrapper.tsx:72](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/shared-components/DataGridWrapper/DataGridWrapper.tsx#L72)
Defined in: [src/shared-components/DataGridWrapper/DataGridWrapper.tsx:71](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/shared-components/DataGridWrapper/DataGridWrapper.tsx#L71)

A generic wrapper around MUI DataGrid with built-in search, sorting, and pagination.

Expand All @@ -16,15 +16,13 @@ A generic wrapper around MUI DataGrid with built-in search, sorting, and paginat

`T` *extends* `object`

The row data type (must include `id: string | number`)

## Parameters

### props

[`InterfaceDataGridWrapperProps`](../../../types/DataGridWrapper/interface/interfaces/InterfaceDataGridWrapperProps.md)\<`T`\>
[`InterfaceDataGridWrapperProps`](../../../../types/DataGridWrapper/interface/interfaces/InterfaceDataGridWrapperProps.md)\<`T`\>

Component props defined by InterfaceDataGridWrapperProps\<T\>
Component props defined by InterfaceDataGridWrapperProps

## Returns

Expand Down
11 changes: 0 additions & 11 deletions docs/docs/auto-docs/shared-components/DataGridWrapper/README-1.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Interface: InterfaceDataGridWrapperProps\<T\>

Defined in: [src/types/DataGridWrapper/interface.ts:15](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L15)
Defined in: [src/types/DataGridWrapper/interface.ts:13](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L13)

Props for the DataGridWrapper component.

Expand All @@ -17,15 +17,13 @@ MUI's DataGrid that provides consistent search, sorting, pagination, and styling

`T` *extends* `GridValidRowModel` = `GridValidRowModel`

The type of the row data. Must extend `GridValidRowModel` (typically requires an `id` property).

## Properties

### actionColumn()?

> `optional` **actionColumn**: (`row`) => `ReactNode`

Defined in: [src/types/DataGridWrapper/interface.ts:93](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L93)
Defined in: [src/types/DataGridWrapper/interface.ts:124](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L124)

A function to render custom content in the "Actions" column (appended to the right).

Expand All @@ -49,33 +47,21 @@ A ReactNode (e.g., buttons, menu) to display in the actions cell.

> `optional` **columns**: `GridColDef`[]

Defined in: [src/types/DataGridWrapper/interface.ts:28](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L28)
Defined in: [src/types/DataGridWrapper/interface.ts:26](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L26)

Configuration for the grid columns.
Defines headers, widths, and cell rendering logic.

***

### ~~emptyStateMessage?~~
### emptyStateMessage?

> `optional` **emptyStateMessage**: `string`

Defined in: [src/types/DataGridWrapper/interface.ts:125](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L125)
Defined in: [src/types/DataGridWrapper/interface.ts:154](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L154)

Custom message to display when there are no rows and `loading` is false.

#### Deprecated

Use `emptyStateProps` instead for full customization.

#### Default

```ts
"No results found" (localized)
```

#### Remarks

If `emptyStateProps` is provided, this prop is ignored.
This property is maintained for backward compatibility.

Expand All @@ -85,7 +71,7 @@ This property is maintained for backward compatibility.

> `optional` **emptyStateProps**: [`InterfaceEmptyStateProps`](../../../shared-components/EmptyState/interface/interfaces/InterfaceEmptyStateProps.md)

Defined in: [src/types/DataGridWrapper/interface.ts:115](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L115)
Defined in: [src/types/DataGridWrapper/interface.ts:146](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L146)

Full EmptyState component props for flexible empty state rendering.
Takes precedence over `emptyStateMessage`.
Expand Down Expand Up @@ -113,7 +99,7 @@ emptyStateProps={{

> `optional` **error**: `ReactNode`

Defined in: [src/types/DataGridWrapper/interface.ts:130](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L130)
Defined in: [src/types/DataGridWrapper/interface.ts:159](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L159)

Error message or component to display instead of the grid when data fetch fails.

Expand All @@ -123,23 +109,17 @@ Error message or component to display instead of the grid when data fetch fails.

> `optional` **loading**: `boolean`

Defined in: [src/types/DataGridWrapper/interface.ts:34](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L34)
Defined in: [src/types/DataGridWrapper/interface.ts:31](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L31)

If `true`, displays a loading indicator (e.g., Progress Bar) overlaying the grid.

#### Default

```ts
false
```

***

### onRowClick()?

> `optional` **onRowClick**: (`row`) => `void`

Defined in: [src/types/DataGridWrapper/interface.ts:86](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L86)
Defined in: [src/types/DataGridWrapper/interface.ts:117](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L117)

Callback fired when a row is clicked.

Expand All @@ -161,7 +141,7 @@ The data object of the clicked row.

> `optional` **paginationConfig**: `object`

Defined in: [src/types/DataGridWrapper/interface.ts:73](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L73)
Defined in: [src/types/DataGridWrapper/interface.ts:104](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L104)

Configuration for pagination.

Expand Down Expand Up @@ -189,7 +169,7 @@ Available options for rows per page. default: [10, 25, 50, 100]

> `optional` **rows**: readonly `T`[]

Defined in: [src/types/DataGridWrapper/interface.ts:22](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L22)
Defined in: [src/types/DataGridWrapper/interface.ts:20](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L20)

The array of data rows to display in the grid.
Each row must include a unique `id` property (string or number).
Expand All @@ -200,42 +180,124 @@ Each row must include a unique `id` property (string or number).

> `optional` **searchConfig**: `object`

Defined in: [src/types/DataGridWrapper/interface.ts:48](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L48)
Defined in: [src/types/DataGridWrapper/interface.ts:61](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L61)

Configuration for client-side search functionality.
Configuration for search functionality (client-side or server-side).

#### debounceMs?

> `optional` **debounceMs**: `number`

Delay in milliseconds for search debounce (if implemented).
Delay in milliseconds for search debounce.

#### enabled

> **enabled**: `boolean`

Enables the search bar in the toolbar.

#### fields
#### fields?

> `optional` **fields**: keyof `T` & `string`[]

The fields (keys of T) to include in the search filter. Client-side only.

#### onSearchByChange()?

> `optional` **onSearchByChange**: (`searchBy`) => `void`

Callback when search type changes in server-side mode.

##### Parameters

###### searchBy

`string`

##### Returns

`void`

#### onSearchChange()?

> `optional` **onSearchChange**: (`term`, `searchBy?`) => `void`

Callback when search changes in server-side mode.

##### Parameters

###### term

`string`

###### searchBy?

`string`

> **fields**: keyof `T` & `string`[]
##### Returns

The fields (keys of T) to include in the search filter.
`void`

#### placeholder?

> `optional` **placeholder**: `string`

Custom placeholder text for the search input.

#### searchByOptions?

> `optional` **searchByOptions**: `object`[]

Search type options dropdown for server-side mode.

#### searchInputTestId?

> `optional` **searchInputTestId**: `string`

Test ID for search input.

#### searchTerm?

> `optional` **searchTerm**: `string`

Current search term value for server-side mode.

#### selectedSearchBy?

> `optional` **selectedSearchBy**: `string`

Current selected search type for server-side mode.

#### serverSide?

> `optional` **serverSide**: `boolean`

Enable server-side search mode.

#### Example

```ts
// Client-side search
searchConfig: {
enabled: true,
fields: ['name', 'email'],
placeholder: 'Search users...',
}

// Server-side search with search-by dropdown
searchConfig: {
enabled: true,
serverSide: true,
searchTerm: 'john',
searchByOptions: [
{ label: 'Group', value: 'group' },
{ label: 'Leader', value: 'leader' }
],
selectedSearchBy: 'group',
onSearchChange: (term, searchBy) => refetchData(term, searchBy),
onSearchByChange: (searchBy) => setSearchBy(searchBy),
searchInputTestId: 'searchByInput'
}
```

***
Expand All @@ -244,7 +306,7 @@ searchConfig: {

> `optional` **sortConfig**: `object`

Defined in: [src/types/DataGridWrapper/interface.ts:63](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L63)
Defined in: [src/types/DataGridWrapper/interface.ts:90](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/types/DataGridWrapper/interface.ts#L90)

Configuration for sorting options displayed in a dropdown.
Note: This is separate from MUI DataGrid's native column header sorting.
Expand All @@ -257,6 +319,28 @@ Note: This is separate from MUI DataGrid's native column header sorting.

> `optional` **defaultSortOrder**: `"desc"` \| `"asc"`

#### onSortChange()?

> `optional` **onSortChange**: (`value`) => `void`

Callback when sort changes in server-side mode.

##### Parameters

###### value

`string` | `number`

##### Returns

`void`

#### selectedSort?

> `optional` **selectedSort**: `string` \| `number`

Current selected sort option for server-side mode.

#### sortingOptions?

> `optional` **sortingOptions**: `object`[]
Expand Down
Loading
Loading