Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ce 1112 #679

Merged
merged 6 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading