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, 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