-
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.
Merge pull request #3 from openimis/feature/OM-83
OM-83: create details page of voucher
- Loading branch information
Showing
9 changed files
with
334 additions
and
7 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
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,35 @@ | ||
import React from 'react'; | ||
|
||
import { Grid, Divider } from '@material-ui/core'; | ||
|
||
import { TextInput } from '@openimis/fe-core'; | ||
|
||
function VoucherDetailsEmployer({ | ||
workerVoucher, classes, readOnly, | ||
}) { | ||
return ( | ||
<> | ||
<Grid container> | ||
<Grid item xs={3} className={classes.item}> | ||
<TextInput | ||
module="workerVoucher" | ||
label="workerVoucher.employer.code" | ||
value={workerVoucher?.policyholder?.code} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
<Grid item xs={3} className={classes.item}> | ||
<TextInput | ||
module="workerVoucher" | ||
label="workerVoucher.employer.tradename" | ||
value={workerVoucher?.policyholder?.tradeName} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
</Grid> | ||
<Divider style={{ margin: '12px 0' }} /> | ||
</> | ||
); | ||
} | ||
|
||
export default VoucherDetailsEmployer; |
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,60 @@ | ||
import React from 'react'; | ||
|
||
import { Divider, Grid, Typography } from '@material-ui/core'; | ||
import { makeStyles } from '@material-ui/styles'; | ||
|
||
import { FormattedMessage } from '@openimis/fe-core'; | ||
import VoucherDetailsEmployer from './VoucherDetailsEmployer'; | ||
import VoucherDetailsVoucher from './VoucherDetailsVoucher'; | ||
import VoucherDetailsWorker from './VoucherDetailsWorker'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
tableTitle: theme.table.title, | ||
item: theme.paper.item, | ||
fullHeight: { | ||
height: '100%', | ||
}, | ||
})); | ||
|
||
function VoucherDetailsPanel({ workerVoucher, readOnly = true, formatMessage }) { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<> | ||
<Grid container className={classes.tableTitle}> | ||
<Grid | ||
container | ||
align="start" | ||
justify="center" | ||
direction="column" | ||
className={classes.fullHeight} | ||
> | ||
<Grid item> | ||
<Typography> | ||
<FormattedMessage module="workerVoucher" id="workerVoucher.VoucherDetailsPanel.subtitle" /> | ||
</Typography> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
<Divider /> | ||
<VoucherDetailsVoucher | ||
workerVoucher={workerVoucher} | ||
readOnly={readOnly} | ||
classes={classes} | ||
formatMessage={formatMessage} | ||
/> | ||
<VoucherDetailsWorker | ||
workerVoucher={workerVoucher} | ||
readOnly={readOnly} | ||
classes={classes} | ||
/> | ||
<VoucherDetailsEmployer | ||
workerVoucher={workerVoucher} | ||
readOnly={readOnly} | ||
classes={classes} | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
export default VoucherDetailsPanel; |
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,63 @@ | ||
import React from 'react'; | ||
|
||
import { Grid, Divider } from '@material-ui/core'; | ||
|
||
import { PublishedComponent, TextInput } from '@openimis/fe-core'; | ||
import WorkerVoucherStatusPicker from '../pickers/WorkerVoucherStatusPicker'; | ||
|
||
function VoucherDetailsVoucher({ | ||
workerVoucher, classes, readOnly, formatMessage, | ||
}) { | ||
return ( | ||
<> | ||
<Grid container> | ||
<Grid item xs={3} className={classes.item}> | ||
<TextInput | ||
module="workerVoucher" | ||
label="workerVoucher.code" | ||
value={workerVoucher?.code} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
<Grid item xs={3} className={classes.item}> | ||
<WorkerVoucherStatusPicker | ||
nullLabel={formatMessage('workerVoucher.placeholder.any')} | ||
withLabel | ||
value={workerVoucher?.status} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
<Grid item xs={3} className={classes.item}> | ||
<PublishedComponent | ||
pubRef="core.DatePicker" | ||
module="workerVoucher" | ||
label="workerVoucher.assignedDate" | ||
value={workerVoucher?.assignedDate} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
<Grid item xs={3} className={classes.item}> | ||
<PublishedComponent | ||
pubRef="core.DatePicker" | ||
module="workerVoucher" | ||
label="workerVoucher.expiryDate" | ||
value={workerVoucher?.expiryDate} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
<Grid item xs={3} className={classes.item}> | ||
<PublishedComponent | ||
pubRef="core.DatePicker" | ||
module="workerVoucher" | ||
label="workerVoucher.createdDate" | ||
value={workerVoucher?.dateCreated} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
</Grid> | ||
<Divider style={{ margin: '12px 0' }} /> | ||
</> | ||
); | ||
} | ||
|
||
export default VoucherDetailsVoucher; |
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,52 @@ | ||
import React from 'react'; | ||
|
||
import { Grid, Divider } from '@material-ui/core'; | ||
|
||
import { PublishedComponent, TextInput } from '@openimis/fe-core'; | ||
|
||
function VoucherDetailsWorker({ | ||
workerVoucher, classes, readOnly, | ||
}) { | ||
return ( | ||
<> | ||
<Grid container> | ||
<Grid item xs={3} className={classes.item}> | ||
<TextInput | ||
module="workerVoucher" | ||
label="workerVoucher.worker.code" | ||
value={workerVoucher?.insuree?.chfId} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
<Grid item xs={3} className={classes.item}> | ||
<TextInput | ||
module="workerVoucher" | ||
label="workerVoucher.worker.lastName" | ||
value={workerVoucher?.insuree?.lastName} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
<Grid item xs={3} className={classes.item}> | ||
<TextInput | ||
module="workerVoucher" | ||
label="workerVoucher.worker.otherNames" | ||
value={workerVoucher?.insuree?.otherNames} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
<Grid item xs={3} className={classes.item}> | ||
<PublishedComponent | ||
pubRef="core.DatePicker" | ||
module="workerVoucher" | ||
label="workerVoucher.worker.dob" | ||
value={workerVoucher?.insuree?.dob} | ||
readOnly={readOnly} | ||
/> | ||
</Grid> | ||
</Grid> | ||
<Divider style={{ margin: '12px 0' }} /> | ||
</> | ||
); | ||
} | ||
|
||
export default VoucherDetailsWorker; |
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
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
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
Oops, something went wrong.