Resolve Report Center Issue.

This commit is contained in:
Patrick Fic
2021-12-08 15:00:23 -08:00
parent 02fcbf7ffa
commit 76ea8ca2ed
3 changed files with 39 additions and 38 deletions

View File

@@ -185,24 +185,14 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
);
}}
</Form.Item>
<Form.Item
shouldUpdate={(prev, cur) =>
Templates[prev.key]?.idtype !== Templates[cur.key]?.idtype
}
style={{ display: "none", margin: 0, padding: 0 }}
>
{() => {
form.setFieldsValue({ id: null });
return null;
}}
</Form.Item>
<Form.Item style={{ margin: 0, padding: 0 }} dependencies={["key"]}>
{() => {
const key = form.getFieldValue("key");
const currentId = form.getFieldValue("id");
if (!key) return null;
//Kind of Id
const idtype = Templates[key] && Templates[key].idtype;
if (!idtype) {
if (!idtype && currentId) {
form.setFieldsValue({ id: null });
return null;
}