-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(manager-react-components): add filters in datagrid (#14203)
* feat(manager-react-components): add filters in datagrid - feat(manager-core-api): update filters categories - feat(generator): update v6 listing filter ref: MANAGER-15088 Signed-off-by: Alex Boungnaseng <[email protected]> --------- Signed-off-by: Alex Boungnaseng <[email protected]>
- Loading branch information
1 parent
410145c
commit fb7515d
Showing
16 changed files
with
451 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/manager-react-components/src/components/datagrid/datagrid.mock.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { FilterCategories } from '@ovh-ux/manager-core-api'; | ||
import { DataGridTextCell } from './text-cell.component'; | ||
|
||
export interface Item { | ||
label: string; | ||
price: number; | ||
} | ||
|
||
export const columns = [ | ||
{ | ||
id: 'label', | ||
cell: (item: Item) => { | ||
return <DataGridTextCell>{item.label}</DataGridTextCell>; | ||
}, | ||
label: 'Label', | ||
}, | ||
{ | ||
id: 'price', | ||
cell: (item: Item) => { | ||
return <DataGridTextCell>{item.price} €</DataGridTextCell>; | ||
}, | ||
label: 'Price', | ||
}, | ||
]; | ||
|
||
export const columsFilters = [ | ||
{ | ||
id: 'label', | ||
cell: (item: Item) => { | ||
return <DataGridTextCell>{item.label}</DataGridTextCell>; | ||
}, | ||
label: 'Label', | ||
isFilterable: true, | ||
comparator: FilterCategories.String, | ||
}, | ||
{ | ||
id: 'price', | ||
cell: (item: Item) => { | ||
return <DataGridTextCell>{item.price} €</DataGridTextCell>; | ||
}, | ||
label: 'Price', | ||
isFilterable: true, | ||
comparator: FilterCategories.String, | ||
}, | ||
]; |
Oops, something went wrong.