Skip to content

Commit

Permalink
Merge pull request #58 from openimis/feature/CM-987
Browse files Browse the repository at this point in the history
CM-987: added short summary of records uploaded
  • Loading branch information
jdolkowski authored Aug 7, 2024
2 parents e850387 + faf7de0 commit 516ff9d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const CSV_RECONCILIATION_PROJECTION = () => [
'fileName',
'status',
'error',
'jsonExt',
];

const PAYMENT_METHOD_PROJECTION = () => [
Expand Down
2 changes: 2 additions & 0 deletions src/components/payroll/BenefitConsumptionSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ function BenefitConsumptionSearcher({
(benefitConsumption) => (
<AdditionalFieldsDialog
jsonExt={benefitConsumption?.jsonExt}
buttonLabel="payroll.additonalFields.showAdditionalFields"
title="payroll.additonalFields.label"
/>
),
];
Expand Down
2 changes: 2 additions & 0 deletions src/components/payroll/BenefitConsumptionSearcherModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ function BenefitConsumptionSearcherModal({
(benefitAttachment) => (
<AdditionalFieldsDialog
jsonExt={benefitAttachment?.benefit?.jsonExt}
buttonLabel="payroll.additonalFields.showAdditionalFields"
title="payroll.additonalFields.label"
/>
),
(benefitAttachment) => (
Expand Down
9 changes: 9 additions & 0 deletions src/components/payroll/PayrollPaymentFilesSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '../../constants';
import { fetchPayrollPaymentFiles } from '../../actions';
import downloadPayroll from '../../utils/export';
import AdditionalFieldsDialog from './dialogs/AdditionalFieldsDialog';

function PayrollPaymentFilesSearcher({
fetchingPayrollFiles,
Expand All @@ -35,6 +36,7 @@ function PayrollPaymentFilesSearcher({
'payrollPaymentFile.status',
'payrollPaymentFile.error',
'payrollPaymentFile.download',
'',
];

const defaultFilters = () => {
Expand Down Expand Up @@ -76,6 +78,13 @@ function PayrollPaymentFilesSearcher({
</IconButton>
</Tooltip>
),
(file) => (
<AdditionalFieldsDialog
jsonExt={file?.jsonExt}
buttonLabel="payroll.summaryUpload"
title="payroll.summaryUpload"
/>
),
];

return (
Expand Down
6 changes: 4 additions & 2 deletions src/components/payroll/dialogs/AdditionalFieldsDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ function AdditionalFieldsDialog({
intl,
classes,
jsonExt,
buttonLabel,
title,
}) {
// eslint-disable-next-line no-param-reassign
if (!jsonExt) jsonExt = '{}';
Expand All @@ -50,7 +52,7 @@ function AdditionalFieldsDialog({
marginTop: '6px',
}}
>
{formatMessage(intl, 'payroll', 'payroll.additonalFields.showAdditionalFields')}
{formatMessage(intl, 'payroll', buttonLabel)}
</Button>
<Dialog
open={isOpen}
Expand All @@ -69,7 +71,7 @@ function AdditionalFieldsDialog({
marginTop: '10px',
}}
>
{formatMessage(intl, 'payroll', 'payroll.additonalFields.label')}
{formatMessage(intl, 'payroll', title)}
</DialogTitle>
<DialogContent>
<div
Expand Down
3 changes: 2 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,6 @@

"payroll.additonalFields.label": "Additional Fields",
"payroll.additonalFields.showAdditionalFields": "Show Additional Fields",
"payroll.additonalFields.close": "Close"
"payroll.additonalFields.close": "Close",
"payroll.summaryUpload": "Summary Upload"
}

0 comments on commit 516ff9d

Please sign in to comment.