Skip to content

Commit 90df0a4

Browse files
committed
remove unneccessary filters
1 parent 4a1ad04 commit 90df0a4

File tree

2 files changed

+4
-89
lines changed

2 files changed

+4
-89
lines changed

frontend/src/components/filterFields/IndividualDateFilter.jsx

Lines changed: 4 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,12 @@
1-
import React, { useState, useEffect } from "react";
1+
import React, { useState } from "react";
22
import { FormattedMessage } from "react-intl";
33
import Description from "../Form/Description";
4-
import { FormLabel, FormGroup, FormControl } from "react-bootstrap";
4+
import { FormGroup, FormControl } from "react-bootstrap";
55

66
export default function IndividualDateFilter({ onChange }) {
7-
const [startDate, setStartDate] = useState("");
8-
const [endDate, setEndDate] = useState("");
97
const [birthDate, setBirthDate] = useState("");
108
const [deathDate, setDeathDate] = useState("");
119

12-
useEffect(() => {
13-
updateQuery1("startDate", startDate);
14-
}, [startDate]);
15-
useEffect(() => {
16-
updateQuery1("endDate", endDate);
17-
}, [endDate]);
18-
19-
const updateQuery1 = () => {
20-
if (startDate || endDate) {
21-
const query = {
22-
range: {
23-
datematched: {},
24-
},
25-
};
26-
27-
if (startDate) {
28-
query.range.datematched.gte = startDate + "T00:00:00Z";
29-
}
30-
31-
if (endDate) {
32-
query.range.datematched.lte = endDate + "T23:59:59Z";
33-
}
34-
onChange({
35-
filterId: "datematched",
36-
filterKey: "Date Matched",
37-
clause: "filter",
38-
query: query,
39-
});
40-
} else {
41-
onChange(null, "date");
42-
}
43-
};
44-
4510
return (
4611
<div>
4712
<h4>
@@ -70,7 +35,7 @@ export default function IndividualDateFilter({ onChange }) {
7035
gte: `${e.target.value}T00:00:00.000Z`,
7136
lte: `${e.target.value}T23:59:59.000Z`,
7237
},
73-
}
38+
},
7439
},
7540
});
7641
}}
@@ -95,43 +60,12 @@ export default function IndividualDateFilter({ onChange }) {
9560
gte: `${e.target.value}T00:00:00.000Z`,
9661
lte: `${e.target.value}T23:59:59.000Z`,
9762
},
98-
}
63+
},
9964
},
10065
});
10166
}}
10267
/>
10368
</FormGroup>
104-
{/* <FormLabel>
105-
<FormattedMessage id="FILTER_DATE_MATCHED" />
106-
</FormLabel>
107-
<div className="d-flex flex-row w-100 mb-2">
108-
<FormGroup className="w-50" style={{ marginRight: "10px" }}>
109-
<p>
110-
<FormattedMessage id="FILTER_FROM" defaultMessage="From" />
111-
</p>
112-
<FormControl
113-
type="date"
114-
value={startDate}
115-
onChange={(e) => {
116-
setStartDate(e.target.value);
117-
updateQuery1();
118-
}}
119-
/>
120-
</FormGroup>
121-
<FormGroup className="w-50">
122-
<p>
123-
<FormattedMessage id="FILTER_TO" defaultMessage="To" />
124-
</p>
125-
<FormControl
126-
type="date"
127-
value={endDate}
128-
onChange={(e) => {
129-
setEndDate(e.target.value);
130-
updateQuery1();
131-
}}
132-
/>
133-
</FormGroup>
134-
</div> */}
13569
</>
13670
</div>
13771
);

frontend/src/components/filterFields/ObservationAttributeFilter.jsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from "react";
22
import Description from "../Form/Description";
33
import { FormattedMessage } from "react-intl";
44
import FormGroupMultiSelect from "../Form/FormGroupMultiSelect";
5-
import FormGroupText from "../Form/FormGroupText";
65
import DynamicInputs from "../Form/DynamicInputs";
76
import { FormLabel, FormGroup } from "react-bootstrap";
87
import FormMeasurements from "../Form/FormMeasurements";
@@ -108,31 +107,13 @@ export default function ObservationAttributeFilter({ onChange, data }) {
108107
filterKey={"Genus and Species"}
109108
/>
110109

111-
{/* <FormGroupText
112-
label="FILTER_SIGHTING_ID"
113-
noDesc={true}
114-
onChange={onChange}
115-
term="match"
116-
field="occurrenceId"
117-
filterId={"occurrenceId"}
118-
filterKey={"Sighting ID"}
119-
/> */}
120-
121110
<FormGroup className="mt-2">
122111
<FormLabel>
123112
<FormattedMessage id="FILTER_OBSERVATION_SEARCH" />
124113
</FormLabel>
125114

126115
<DynamicInputs onChange={onChange} />
127116
</FormGroup>
128-
{/* <FormGroupText
129-
label="FILTER_OBSERVATION_COMMENTS"
130-
onChange={onChange}
131-
term="match"
132-
field="occurrenceRemarks"
133-
filterId={"occurrenceRemarks"}
134-
filterKey={"Observation Comments"}
135-
/> */}
136117

137118
<FormGroupMultiSelect
138119
isMulti={true}

0 commit comments

Comments
 (0)