Skip to content

Commit

Permalink
added filters to systemitemstable #1039
Browse files Browse the repository at this point in the history
  • Loading branch information
asuresh-code committed Nov 25, 2024
1 parent c3fc2a1 commit 331d310
Show file tree
Hide file tree
Showing 3 changed files with 541 additions and 97 deletions.
8 changes: 4 additions & 4 deletions src/items/itemsTable.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function ItemsTable(props: ItemTableProps) {

const [tableRows, setTableRows] = React.useState<TableRowData[]>([]);

const noResultsTxt =
const noResultsText =
'No results found: Try adding an item by using the Add Item button on the top left of your screen';
const { data: itemsData, isLoading: isLoadingItems } = useGetItems(
undefined,
Expand Down Expand Up @@ -198,7 +198,7 @@ export function ItemsTable(props: ItemTableProps) {
accessorFn: (row) =>
row.item.warranty_end_date
? new Date(row.item.warranty_end_date)
: null,
: '',

Check warning on line 201 in src/items/itemsTable.component.tsx

View check run for this annotation

Codecov / codecov/patch

src/items/itemsTable.component.tsx#L201

Added line #L201 was not covered by tests
id: 'item.warranty_end_date',
filterVariant: COLUMN_FILTER_VARIANTS.date,
filterFn: COLUMN_FILTER_FUNCTIONS.date,
Expand All @@ -217,7 +217,7 @@ export function ItemsTable(props: ItemTableProps) {
header: 'Delivered Date',
Header: TableHeaderOverflowTip,
accessorFn: (row) =>
row.item.delivered_date ? new Date(row.item.delivered_date) : null,
row.item.delivered_date ? new Date(row.item.delivered_date) : '',
id: 'item.delivered_date',
filterVariant: COLUMN_FILTER_VARIANTS.date,
filterFn: COLUMN_FILTER_FUNCTIONS.date,
Expand Down Expand Up @@ -434,7 +434,7 @@ export function ItemsTable(props: ItemTableProps) {
localization: {
...MRT_Localization_EN,
...MRT_Functions_Localisation,
noRecordsToDisplay: noResultsTxt,
noRecordsToDisplay: noResultsText,
},
//State
initialState: {
Expand Down
Loading

0 comments on commit 331d310

Please sign in to comment.