@onehat/ui 0.3.324 → 0.3.325
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -44,6 +44,7 @@ export default function withFilters(WrappedComponent) {
|
|
|
44
44
|
showClearFiltersButton = true,
|
|
45
45
|
defaultFilters = [], // likely a list of field names, possibly could be of shape below
|
|
46
46
|
customFilters = [], // of shape: { title, type, field, value, getRepoFilters(value) }
|
|
47
|
+
clearExceptions = [], // list of fields that should not be cleared when clearFilters button is pressed
|
|
47
48
|
minFilters = 3,
|
|
48
49
|
maxFilters = 6,
|
|
49
50
|
onFilterChange,
|
|
@@ -214,7 +215,9 @@ export default function withFilters(WrappedComponent) {
|
|
|
214
215
|
// Clears values for all active filters
|
|
215
216
|
const newFilters = [];
|
|
216
217
|
_.each(filters, (filter) => {
|
|
217
|
-
filter.
|
|
218
|
+
if (!inArray(filter.field, clearExceptions)) {
|
|
219
|
+
filter.value = null;
|
|
220
|
+
}
|
|
218
221
|
newFilters.push(filter);
|
|
219
222
|
});
|
|
220
223
|
setFilters(newFilters, false);
|