Skip to content

Commit

Permalink
prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
patorjk committed Jul 11, 2020
1 parent 69b2590 commit b12bccd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/components/TableFilterList.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,20 @@ const TableFilterList = ({
} else {
type = columnNames[index].filterType;
}

return (
<ItemComponent
label={customFilterItem}
key={customFilterItemIndex}
onDelete={() => removeFilter(index, item[customFilterItemIndex] || [], columnNames[index].name, type, customFilterListUpdate[index])}
onDelete={() =>
removeFilter(
index,
item[customFilterItemIndex] || [],
columnNames[index].name,
type,
customFilterListUpdate[index],
)
}
className={classes.chip}
itemKey={customFilterItemIndex}
index={index}
Expand Down
9 changes: 7 additions & 2 deletions test/MUIDataTableFilterList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@ describe('<TableFilterList />', function() {
const renderCall = spy();
const updateCall = spy();
const columnsWithCustomFilterListOptions = [
{ name: 'name', label: 'Name', display: true, sort: true, filter: true,
{
name: 'name',
label: 'Name',
display: true,
sort: true,
filter: true,
// buildColumns in MUIDataTables spreads options over the column object, so no need to nest this within options
filterType: 'custom',
customFilterListOptions: {
Expand Down Expand Up @@ -194,7 +199,7 @@ describe('<TableFilterList />', function() {
name: column.name,
filterType: column.filterType || options.filterType,
}));

const wrapper = mount(
<TableFilterList
options={options}
Expand Down

0 comments on commit b12bccd

Please sign in to comment.