IO-1978 Selection of lines for parts return

This commit is contained in:
Patrick Fic
2022-07-18 16:25:33 -07:00
parent 4976e6be95
commit a23b3bf02d
6 changed files with 441 additions and 281 deletions

View File

@@ -5,7 +5,7 @@ import AlertComponent from "../alert/alert.component";
import { Prompt, useLocation } from "react-router-dom";
import "./form-fields-changed.styles.scss";
export default function FormsFieldChanged({ form }) {
export default function FormsFieldChanged({ form, skipPrompt }) {
const { t } = useTranslation();
const handleReset = () => {
@@ -25,7 +25,7 @@ export default function FormsFieldChanged({ form }) {
return (
<Space direction="vertical" style={{ width: "100%" }}>
<Prompt
when={true}
when={skipPrompt ? false : true}
message={(location) => {
if (loc.pathname === location.pathname) return false;
return t("general.messages.unsavedchangespopup");