feat: filter field for google api windows (#1170)

This commit is contained in:
Egor Lezhnin authored and Danny Brown committed 2019-11-13 09:38:49 -05:00
1 parent c4adcfd39e
commit c59c5b3f14
9 files changed
+100 -43

No files matched your search

@@ -46,21 +46,23 @@ class LocationsList extends Component {
}
render() {
if (this.props.error) {
return <p>{this.props.error}</p>;
const { loading, locations, filter, error } = this.props;
if (error) {
return <p>{error}</p>;
}
const loadingIcon = (
<Icon name="circle-notch" className="loading-icon-spin loading-icon" />
);
if (this.props.loading) {
if (loading) {
return loadingIcon;
}
const body = (
<tbody id="LocationList">
{this.props.locations.map(this.renderTableRow)}
{locations.filter(location => (location.name.split('/')[3].toLowerCase().includes(filter.toLowerCase()) || filter=="")).map(this.renderTableRow)}
</tbody>
);
@@ -71,7 +73,7 @@ class LocationsList extends Component {
<th>{this.props.t('Location')}</th>
</tr>
</thead>
{this.props.locations && body}
{locations && body}
</table>
);
}