Skip to content

Commit

Permalink
feat: can filter by org
Browse files Browse the repository at this point in the history
  • Loading branch information
dadiorchen committed Mar 24, 2022
1 parent 64e387a commit 76d2173
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/components/CaptureMatching/CaptureMatchingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
FormControl,
TextField,
InputLabel,
MenuItem,
} from '@material-ui/core';
import NatureOutlinedIcon from '@material-ui/icons/NatureOutlined';
import { documentTitle } from '../../common/variables';
Expand Down Expand Up @@ -113,6 +114,7 @@ function CaptureMatchingView(props) {
const [treesCount, setTreesCount] = useState(0);
const [startDate, setStartDate] = useState(null);
const [endDate, setEndDate] = useState(null);
const [organizationId, setOrganizationId] = useState(null);
// To get total tree count on candidate capture image icon
// const treesCount = candidateImgData.length;
const treeIcon = <NatureOutlinedIcon className={classes.candidateImgIcon} />;
Expand All @@ -132,6 +134,7 @@ function CaptureMatchingView(props) {
const filter = {
captured_at_start_date: startDate,
captured_at_end_date: endDate,
'organization_ids[]': organizationId,
};
const data = await api.fetchCapturesToMatch(
currentPage,
Expand Down Expand Up @@ -336,20 +339,25 @@ function CaptureMatchingView(props) {
variant="outlined"
className={classes.customTableFilterSelectFormControl}
>
<InputLabel id="sub_organization">Organization</InputLabel>
<InputLabel id="organization">Organization</InputLabel>
<Select
labelId="sub_organization"
labelId="organization"
defaultValue={''}
id="sub_organization"
name="sub_organization"
id="organization"
name="organization"
label="Organization"
onChange={() => {}}
onChange={(e) => {
setOrganizationId(e.target.value);
}}
>
{/* {appContext.orgList.map((org) => (
<MenuItem key={org.stakeholder_uuid} value={org.stakeholder_uuid}>
{org.name}
</MenuItem>
))} */}
{appContext.orgList.map((org) => (
<MenuItem
key={org.stakeholder_uuid}
value={org.stakeholder_uuid}
>
{org.name}
</MenuItem>
))}
</Select>
</FormControl>

Expand Down

0 comments on commit 76d2173

Please sign in to comment.