Skip to content

Commit

Permalink
fix: Ce 1112 (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorylavery authored Oct 1, 2024
1 parent 99acf57 commit dbc31a9
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
selectGirTypeCodeDropdown,
selectComplaintReceivedMethodDropdown,
} from "../../../store/reducers/code-table";
import { selectOfficersDropdown } from "../../../store/reducers/officer";
import { selectOfficersByAgencyDropdown } from "../../../store/reducers/officer";
import COMPLAINT_TYPES from "../../../types/app/complaint-types";
import DatePicker from "react-datepicker";
import { CompSelect } from "../../common/comp-select";
Expand Down Expand Up @@ -46,11 +46,11 @@ export const ComplaintFilter: FC<Props> = ({ type }) => {
dispatch,
} = useContext(ComplaintFilterContext);

let officers = useAppSelector(selectOfficersDropdown(false));
if (officers && officers[0]?.value !== "Unassigned") {
officers.unshift({ value: "Unassigned", label: "Unassigned" });
}
const agency = getUserAgency();
let officersByAgency = useAppSelector(selectOfficersByAgencyDropdown(agency));
if (officersByAgency && officersByAgency[0]?.value !== "Unassigned") {
officersByAgency.unshift({ value: "Unassigned", label: "Unassigned" });
}
const natureOfComplaintTypes = useAppSelector(selectHwcrNatureOfComplaintCodeDropdown);
const speciesTypes = useAppSelector(selectSpeciesCodeDropdown);
const statusTypes = useAppSelector(selectComplaintStatusWithPendingCodeDropdown);
Expand Down Expand Up @@ -224,9 +224,8 @@ export const ComplaintFilter: FC<Props> = ({ type }) => {
<div>
<button
aria-label="Previous Month"
className={`react-datepicker__navigation react-datepicker__navigation--previous ${
customHeaderCount === 1 ? "datepicker-nav-hidden" : "datepicker-nav-visible"
}`}
className={`react-datepicker__navigation react-datepicker__navigation--previous ${customHeaderCount === 1 ? "datepicker-nav-hidden" : "datepicker-nav-visible"
}`}
onClick={decreaseMonth}
>
<span
Expand All @@ -245,9 +244,8 @@ export const ComplaintFilter: FC<Props> = ({ type }) => {
</span>
<button
aria-label="Next Month"
className={`react-datepicker__navigation react-datepicker__navigation--next ${
customHeaderCount === 1 ? "datepicker-nav-hidden" : "datepicker-nav-visible"
}`}
className={`react-datepicker__navigation react-datepicker__navigation--next ${customHeaderCount === 1 ? "datepicker-nav-hidden" : "datepicker-nav-visible"
}`}
onClick={increaseMonth}
>
<span
Expand Down Expand Up @@ -413,7 +411,7 @@ export const ComplaintFilter: FC<Props> = ({ type }) => {
classNames={{
menu: () => "top-layer-select",
}}
options={officers}
options={officersByAgency}
defaultOption={{ label: "Unassigned", value: "Unassigned" }}
placeholder="Select"
enableValidation={false}
Expand Down

0 comments on commit dbc31a9

Please sign in to comment.