|
|
|
@ -3,16 +3,21 @@ import { connect } from 'react-redux';
|
|
|
|
|
import { createSelector } from 'reselect';
|
|
|
|
|
import sortByName from 'Utilities/Array/sortByName';
|
|
|
|
|
import { filterBuilderTypes } from 'Helpers/Props';
|
|
|
|
|
import * as filterTypes from 'Helpers/Props/filterTypes';
|
|
|
|
|
import FilterBuilderRowValue from './FilterBuilderRowValue';
|
|
|
|
|
|
|
|
|
|
function createTagListSelector() {
|
|
|
|
|
return createSelector(
|
|
|
|
|
(state, { filterType }) => filterType,
|
|
|
|
|
(state, { sectionItems }) => sectionItems,
|
|
|
|
|
(state, { selectedFilterBuilderProp }) => selectedFilterBuilderProp,
|
|
|
|
|
(sectionItems, selectedFilterBuilderProp) => {
|
|
|
|
|
(filterType, sectionItems, selectedFilterBuilderProp) => {
|
|
|
|
|
if (
|
|
|
|
|
selectedFilterBuilderProp.type === filterBuilderTypes.NUMBER ||
|
|
|
|
|
selectedFilterBuilderProp.type === filterBuilderTypes.STRING
|
|
|
|
|
(selectedFilterBuilderProp.type === filterBuilderTypes.NUMBER ||
|
|
|
|
|
selectedFilterBuilderProp.type === filterBuilderTypes.STRING) &&
|
|
|
|
|
filterType !== filterTypes.EQUAL &&
|
|
|
|
|
filterType !== filterBuilderTypes.NOT_EQUAL ||
|
|
|
|
|
!selectedFilterBuilderProp.optionsSelector
|
|
|
|
|
) {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|