Skip to content

Commit

Permalink
fix: CE-1308-and-CE-1307 (#812)
Browse files Browse the repository at this point in the history
Co-authored-by: afwilcox <[email protected]>
  • Loading branch information
dk-bcps and afwilcox authored Dec 11, 2024
1 parent 5371a9d commit 7600ddf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,13 @@ export const EditOutcome: FC<props> = ({ id, index, outcome, assignedOfficer: of
placeholder={"Select"}
value={getDropdownOption(data.outcome, outcomes)}
onChange={(evt) => {
showEditWarning(() => {
if (data?.outcome) {
showEditWarning(() => {
updateModel("outcome", evt?.value);
});
} else {
updateModel("outcome", evt?.value);
});
}
}}
defaultOption={getDropdownOption(data.outcome, outcomes)}
/>
Expand Down Expand Up @@ -591,9 +595,13 @@ export const EditOutcome: FC<props> = ({ id, index, outcome, assignedOfficer: of
id="equipment-day-set"
maxDate={new Date()}
onChange={(input: Date) => {
showEditWarning(() => {
if (data?.date) {
showEditWarning(() => {
handleOutcomeDateChange(input);
});
} else {
handleOutcomeDateChange(input);
});
}
}}
selectedDate={data?.date}
placeholder={"Select"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//-- where unable to use the global redux modals
//--

import { FC } from "react";
import { FC, useEffect, useState } from "react";
import { Button, Col, Modal, Row } from "react-bootstrap";

type props = {
Expand All @@ -25,11 +25,22 @@ export const StandaloneConfirmCancelModal: FC<props> = ({
confirm,
cancel,
}) => {
const [showModal, setShowModal] = useState(false);

useEffect(() => {
setShowModal(show);
}, [show]);

const handleClose = () => {
cancel();
};

return (
<Modal
show={show}
show={showModal}
aria-labelledby="contained-modal-title-vcenter"
centered
onHide={handleClose}
>
{title && (
<Modal.Header closeButton={true}>
Expand Down

0 comments on commit 7600ddf

Please sign in to comment.