diff --git a/src/containers/BGroup/BGroupBuildingTable.js b/src/containers/BGroup/BGroupBuildingTable.js index 9b7b842f3aff0fe9b960019ce36fc3f40fbe56e0..176386936994506818ad5cb53e9ba6d9c852464d 100644 --- a/src/containers/BGroup/BGroupBuildingTable.js +++ b/src/containers/BGroup/BGroupBuildingTable.js @@ -8,6 +8,7 @@ import ReactGA from 'react-ga'; import { Input, Collapse, UncontrolledDropdown, DropdownToggle, DropdownMenu, DropdownItem, + UncontrolledTooltip, } from 'reactstrap'; import userPropTypes from '../User/propTypes'; import AddressSearch from '../../components/AddressSearch/AddressSearch'; @@ -136,6 +137,52 @@ export default class BGroupBuildingTable extends Component { return row[filter.id].length === 0; }; + const impactCompletedRetrofitsFilterMethod = (filter, row) => { + // First check if there is a value and the check box is clicked + if ( + filter.value.check && + (!row[filter.id] || !row[filter.id].length > 0) + ) { + return false; + } + // Then filter by text + if (row[filter.id]) { + // Check if list is empty + if (filter.value.query === '' && row[filter.id].length === 0) { + return true; + } + return row[filter.id].reduce((acc, val) => ( + val && (acc || val.completed.toLowerCase().indexOf( + filter.value.query.toLowerCase() + ) !== -1) + ), false); + } + return false; + }; + + const impactRecommendedRetrofitsFilterMethod = (filter, row) => { + // First check if there is a value and the check box is clicked + if ( + filter.value.check && + (!row[filter.id] || !row[filter.id].length > 0) + ) { + return false; + } + // Then filter by text + if (row[filter.id]) { + // Check if list is empty + if (filter.value.query === '' && row[filter.id].length === 0) { + return true; + } + return row[filter.id].reduce((acc, val) => ( + val && (acc || val.toLowerCase().indexOf( + filter.value.query.toLowerCase() + ) !== -1) + ), false); + } + return false; + }; + const utilityBillFilter = ({ filter, onChange }) => ( ); + const impactCompletedRetrofitsFilter = ({ filter, onChange }) => { + return ( +