-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d3dbbc
commit 3c8bb64
Showing
4 changed files
with
129 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
src/components/dialogs/DeduplicationFieldSelectionDialog.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import React, { useState } from "react"; | ||
import { injectIntl } from "react-intl"; | ||
import Button from "@material-ui/core/Button"; | ||
import Dialog from "@material-ui/core/Dialog"; | ||
import DialogActions from "@material-ui/core/DialogActions"; | ||
import DialogContent from "@material-ui/core/DialogContent"; | ||
import DialogTitle from "@material-ui/core/DialogTitle"; | ||
import { | ||
formatMessage, | ||
formatMessageWithValues, | ||
} from "@openimis/fe-core"; | ||
import { withTheme, withStyles } from "@material-ui/core/styles"; | ||
import { connect } from "react-redux"; | ||
import { bindActionCreators } from "redux"; | ||
|
||
const styles = (theme) => ({ | ||
item: theme.paper.item, | ||
}); | ||
|
||
const DeduplicationFieldSelectionDialog = ({ | ||
intl, | ||
classes, | ||
benefitPlan, | ||
}) => { | ||
console.log('intl', intl); | ||
|
||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const handleOpen = () => { | ||
setIsOpen(true); | ||
}; | ||
|
||
const handleClose = () => { | ||
setIsOpen(false); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Button | ||
onClick={handleOpen} | ||
variant="outlined" | ||
color="#DFEDEF" | ||
className={classes.button} | ||
style={{ | ||
border: "0px", | ||
textAlign: "right", | ||
display: "block", | ||
marginLeft: "auto", | ||
marginRight: 0 | ||
}} | ||
> | ||
{formatMessage(intl, "deduplication", "deduplicate")} | ||
</Button> | ||
<Dialog | ||
open={isOpen} | ||
onClose={handleClose} | ||
PaperProps={{ | ||
style: { | ||
width: 900, | ||
maxWidth: 900, | ||
}, | ||
}} | ||
> | ||
<DialogTitle | ||
style={{ | ||
marginTop: "10px", | ||
}} | ||
> | ||
Pr | ||
</DialogTitle> | ||
<DialogContent> | ||
<></> | ||
</DialogContent> | ||
<DialogActions | ||
style={{ | ||
display: "inline", | ||
paddingLeft: "10px", | ||
marginTop: "25px", | ||
marginBottom: "15px" | ||
}} | ||
> | ||
<div> | ||
<div style={{ float: "left" }}> | ||
</div> | ||
<div style={{ | ||
float: "right", | ||
paddingRight: "16px" | ||
}} | ||
> | ||
<Button | ||
onClick={handleClose} | ||
variant="outlined" | ||
autoFocus | ||
style={{ margin: "0 16px" }} | ||
> | ||
{formatMessage(intl, "deduplication", "deduplicate.button.cancel")} | ||
</Button> | ||
</div> | ||
</div> | ||
</DialogActions> | ||
</Dialog> | ||
</> | ||
); | ||
}; | ||
|
||
const mapStateToProps = (state, props) => ({ | ||
rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [], | ||
confirmed: state.core.confirmed, | ||
}); | ||
|
||
const mapDispatchToProps = (dispatch) => bindActionCreators({ | ||
}, dispatch); | ||
|
||
export default injectIntl(withTheme(withStyles(styles)(connect(mapStateToProps, mapDispatchToProps)(DeduplicationFieldSelectionDialog)))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import messages_en from "./translations/en.json"; | ||
import DeduplicationFieldSelectionDialog from "./components/dialogs/DeduplicationFieldSelectionDialog"; | ||
|
||
const DEFAULT_CONFIG = { | ||
"translations": [{ key: "en", messages: messages_en }], | ||
translations: [{ key: "en", messages: messages_en }], | ||
'deduplication.deduplicationFieldSelectionDialog': [ | ||
DeduplicationFieldSelectionDialog | ||
] | ||
} | ||
|
||
export const DeduplicationModule = (cfg) => { | ||
return { ...DEFAULT_CONFIG, ...cfg }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
{ | ||
"deduplication.deduplicate": "Deduplicate", | ||
"deduplication.deduplicate.title": "Deduplication - {benefitPlanName}", | ||
"dedulication.deduplicate.button.cancel": "Cancel" | ||
} |