Skip to content

Commit 0622e6a

Browse files
committed
Merge branch 'feature/critical_facilities_filter' into develop
2 parents c30972a + ca706d2 commit 0622e6a

File tree

1 file changed

+28
-2
lines changed
  • src/GeographicalFeatures/CriticalFacilities/Filters

1 file changed

+28
-2
lines changed

src/GeographicalFeatures/CriticalFacilities/Filters/index.js

+28-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import isFunction from 'lodash/isFunction';
88
import SearchableSelectInput from '../../../components/SearchableSelectInput';
99

1010
/* http actions */
11-
const { getAgencies, getFeatureTypes, getAdministrativeAreas } = httpActions;
11+
const {
12+
getAgencies,
13+
getFeatureTypes,
14+
getAdministrativeAreas,
15+
getPartyOwnerships,
16+
} = httpActions;
1217

1318
/* state actions */
1419
const { clearFeatureFilters, filterFeatures } = reduxActions;
@@ -145,11 +150,32 @@ const FeatureFiltersForm = ({
145150
onCache={(custodians) =>
146151
onCache({ 'relations.custodians': custodians })
147152
}
148-
initialValue={get(cached, 'relations.custodians', [])}
153+
initisFilterialValue={get(cached, 'relations.custodians', [])}
149154
/>
150155
</Form.Item>
151156
{/* end:feature custodians filter */}
152157

158+
{/* start:feature ownership filter */}
159+
<Form.Item
160+
label="By ownership"
161+
title="Critical infrastructure Ownership e.g Government"
162+
name={['relations.ownership']}
163+
>
164+
<SearchableSelectInput
165+
onSearch={(optns = {}) => {
166+
return getPartyOwnerships(optns);
167+
}}
168+
optionLabel={(ownership) => get(ownership, 'strings.name.en')}
169+
optionValue="_id"
170+
mode="multiple"
171+
onCache={(ownerships) =>
172+
onCache({ 'relations.ownerships': ownerships })
173+
}
174+
initialValue={get(cached, 'relations.ownership', [])}
175+
/>
176+
</Form.Item>
177+
{/* end:feature ownership filter */}
178+
153179
{/* start:form actions */}
154180
<Form.Item wrapperCol={{ span: 24 }} style={{ textAlign: 'right' }}>
155181
<Button onClick={onCancel}>Cancel</Button>

0 commit comments

Comments
 (0)