Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance System Items Table Filtering #1140

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
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 @@

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 @@
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 @@
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 @@
localization: {
...MRT_Localization_EN,
...MRT_Functions_Localisation,
noRecordsToDisplay: noResultsTxt,
noRecordsToDisplay: noResultsText,
},
//State
initialState: {
Expand Down
Loading