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:
Allan Carr
2023-04-20 12:43:06 -07:00
parent 2a0ad46eea
commit 522665256e
2 changed files with 2105 additions and 2104 deletions

View File

@@ -92,7 +92,11 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
to: values.to,
subject: Templates[values.key]?.subject,
},
values.sendby === "excel" ? "x" : values.sendby === "email" ? "e" : "p",
values.sendbyexcel === "excel"
? "x"
: values.sendby === "email"
? "e"
: "p",
id
);
setLoading(false);
@@ -253,27 +257,22 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
<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 && currentId) {
form.setFieldsValue({ id: null });
return null;
}
if (idtype === "excel")
const reporttype = Templates[key] && Templates[key].reporttype;
if (reporttype === "excel")
return (
<Form.Item
label={t("general.labels.sendby")}
name="sendby"
initialValue="print"
name="sendbyexcel"
initialValue="excel"
>
<Radio.Group>
<Radio value="excel">{t("general.labels.excel")}</Radio>
</Radio.Group>
</Form.Item>
);
if (idtype !== "excel")
if (reporttype !== "excel")
return (
<Form.Item
label={t("general.labels.sendby")}

File diff suppressed because it is too large Load Diff