Skip to content

Commit

Permalink
Merge pull request #45 from openimis/develop
Browse files Browse the repository at this point in the history
MERGING develop into release/24.04
  • Loading branch information
delcroip authored Mar 28, 2024
2 parents e3fccf6 + f6a6773 commit caae149
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/components/BillSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { bindActionCreators } from "redux";
import { connect } from "react-redux";
import { injectIntl } from "react-intl";

import { IconButton, Tooltip, Button, Dialog, DialogActions, DialogTitle } from "@material-ui/core";
import { IconButton, Tooltip, Button, Dialog, DialogActions, DialogTitle, DialogContent } from "@material-ui/core";
import EditIcon from "@material-ui/icons/Edit";
import DeleteIcon from "@material-ui/icons/Delete";

Expand Down Expand Up @@ -72,13 +72,17 @@ const BillSearcher = ({
}, [confirmed]);

useEffect(() => {
setFailedExport(true);
if (errorBillsExport) {
setFailedExport(true);
}
}, [errorBillsExport]);

useEffect(() => {
if (billsExport) {
downloadExport(billsExport, "bill_export.csv")();
}

return setFailedExport(false);
}, [billsExport]);

useEffect(() => {
Expand Down Expand Up @@ -250,12 +254,15 @@ const BillSearcher = ({
"status": "Status",
}}
/>

{failedExport && (
<Dialog fullWidth maxWidth="sm">
<DialogTitle>{errorBillsExport}</DialogTitle>
<Dialog open={failedExport} fullWidth maxWidth="sm">
<DialogTitle>{errorBillsExport?.message}</DialogTitle>
<DialogContent>
<strong>{`${errorBillsExport?.code}: `}</strong>
{errorBillsExport?.detail}
</DialogContent>
<DialogActions>
<Button onClick={setFailedExport(false)} variant="contained">
<Button onClick={() => setFailedExport(false)} color="primary" variant="contained">
{formatMessage(intl, "invoice", "ok")}
</Button>
</DialogActions>
Expand Down

0 comments on commit caae149

Please sign in to comment.