| @@ -19,7 +19,7 @@ interface Props { | |||||
| } | } | ||||
| interface SubComponents { | interface SubComponents { | ||||
| Loading: typeof GenerateProjectPandLReportLoading; | |||||
| // Loading: typeof GenerateProjectPandLReportLoading; | |||||
| } | } | ||||
| @@ -43,16 +43,16 @@ const GenerateProjectPandLReport: React.FC<Props> & SubComponents = ({ projects | |||||
| [t], | [t], | ||||
| ); | ); | ||||
| const [loading, setLoading] = React.useState(false); | |||||
| // const [loading, setLoading] = React.useState(false); | |||||
| return ( | return ( | ||||
| <> | <> | ||||
| {loading && <GenerateProjectPandLReport.Loading />} | |||||
| {!loading && | |||||
| {/* {loading && <GenerateProjectPandLReport.Loading />} */} | |||||
| {/* {!loading && */} | |||||
| <SearchBox | <SearchBox | ||||
| criteria={searchCriteria} | criteria={searchCriteria} | ||||
| onSearch={async (query) => { | onSearch={async (query) => { | ||||
| setLoading(true); | |||||
| // setLoading(true); | |||||
| if (query.project && query.project !== "All") { | if (query.project && query.project !== "All") { | ||||
| if (query.project && query.startMonth && query.startMonthTo) { | if (query.project && query.startMonth && query.startMonthTo) { | ||||
| try { | try { | ||||
| @@ -66,25 +66,26 @@ const GenerateProjectPandLReport: React.FC<Props> & SubComponents = ({ projects | |||||
| } | } | ||||
| } catch (error) { | } catch (error) { | ||||
| errorDialogWithContent(t("Download Fail"), t("Please try it later"), t) | errorDialogWithContent(t("Download Fail"), t("Please try it later"), t) | ||||
| .then(() => { | |||||
| window.location.reload(); | |||||
| }); | |||||
| // .then(() => { | |||||
| // window.location.reload(); | |||||
| // }); | |||||
| } | } | ||||
| } else { | } else { | ||||
| errorDialogWithContent(t("Download Fail"), t("Please check the required field"), t) | errorDialogWithContent(t("Download Fail"), t("Please check the required field"), t) | ||||
| .then(() => { | |||||
| window.location.reload(); | |||||
| }); | |||||
| // .then(() => { | |||||
| // window.location.reload(); | |||||
| // }); | |||||
| } | } | ||||
| } | } | ||||
| setLoading(false); | |||||
| // setLoading(false); | |||||
| }} | }} | ||||
| formType={"download"} | formType={"download"} | ||||
| />} | |||||
| /> | |||||
| {/* } */} | |||||
| </> | </> | ||||
| ); | ); | ||||
| }; | }; | ||||
| GenerateProjectPandLReport.Loading = GenerateProjectPandLReportLoading; | |||||
| // GenerateProjectPandLReport.Loading = GenerateProjectPandLReportLoading; | |||||
| export default GenerateProjectPandLReport; | export default GenerateProjectPandLReport; | ||||