This commit is contained in:
Dave Richer
2023-12-11 17:34:05 -05:00
parent 5c164f807d
commit ad79344709
87 changed files with 1100 additions and 1113 deletions

View File

@@ -2,7 +2,7 @@ import React from "react";
import { Form, Space } from "antd";
import { useTranslation } from "react-i18next";
import AlertComponent from "../alert/alert.component";
import {useLocation } from "react-router-dom";
import {useSearchParams } from "react-router-dom";
import "./form-fields-changed.styles.scss";
import Prompt from "../../utils/prompt";
@@ -12,7 +12,7 @@ export default function FormsFieldChanged({ form, skipPrompt }) {
const handleReset = () => {
form.resetFields();
};
const loc = useLocation();
const loc = useSearchParams();
//if (!form.isFieldsTouched()) return <></>;
return (
<Form.Item
@@ -26,7 +26,7 @@ export default function FormsFieldChanged({ form, skipPrompt }) {
return (
<Space direction="vertical" style={{ width: "100%" }}>
<Prompt
when={skipPrompt ? false : true}
when={!skipPrompt}
message={(location) => {
if (loc.pathname === location.pathname) return false;
return t("general.messages.unsavedchangespopup");