IO-2335 Exported GSR to Excel
Change idtype to reporttype to prevent issues later on down the road if we extend more reports to excel format
This commit is contained in:
@@ -92,7 +92,11 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
|
|||||||
to: values.to,
|
to: values.to,
|
||||||
subject: Templates[values.key]?.subject,
|
subject: Templates[values.key]?.subject,
|
||||||
},
|
},
|
||||||
values.sendby === "excel" ? "x" : values.sendby === "email" ? "e" : "p",
|
values.sendbyexcel === "excel"
|
||||||
|
? "x"
|
||||||
|
: values.sendby === "email"
|
||||||
|
? "e"
|
||||||
|
: "p",
|
||||||
id
|
id
|
||||||
);
|
);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
@@ -253,27 +257,22 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
|
|||||||
<Form.Item style={{ margin: 0, padding: 0 }} dependencies={["key"]}>
|
<Form.Item style={{ margin: 0, padding: 0 }} dependencies={["key"]}>
|
||||||
{() => {
|
{() => {
|
||||||
const key = form.getFieldValue("key");
|
const key = form.getFieldValue("key");
|
||||||
const currentId = form.getFieldValue("id");
|
|
||||||
if (!key) return null;
|
|
||||||
//Kind of Id
|
//Kind of Id
|
||||||
const idtype = Templates[key] && Templates[key].idtype;
|
const reporttype = Templates[key] && Templates[key].reporttype;
|
||||||
if (!idtype && currentId) {
|
|
||||||
form.setFieldsValue({ id: null });
|
if (reporttype === "excel")
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (idtype === "excel")
|
|
||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("general.labels.sendby")}
|
label={t("general.labels.sendby")}
|
||||||
name="sendby"
|
name="sendbyexcel"
|
||||||
initialValue="print"
|
initialValue="excel"
|
||||||
>
|
>
|
||||||
<Radio.Group>
|
<Radio.Group>
|
||||||
<Radio value="excel">{t("general.labels.excel")}</Radio>
|
<Radio value="excel">{t("general.labels.excel")}</Radio>
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
if (idtype !== "excel")
|
if (reporttype !== "excel")
|
||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("general.labels.sendby")}
|
label={t("general.labels.sendby")}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user