From 81266b274456b99fd7a2f6c03ebc261e9b6200ec Mon Sep 17 00:00:00 2001 From: sniedzielski Date: Wed, 7 Aug 2024 13:46:54 +0200 Subject: [PATCH] CM-986: added viewing extra data on benefit level --- .../payroll/BenefitConsumptionSearcher.js | 7 + .../BenefitConsumptionSearcherModal.js | 7 + .../payroll/dialogs/AdditionalFieldsDialog.js | 131 ++++++++++++++++++ src/translations/en.json | 6 +- 4 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 src/components/payroll/dialogs/AdditionalFieldsDialog.js diff --git a/src/components/payroll/BenefitConsumptionSearcher.js b/src/components/payroll/BenefitConsumptionSearcher.js index 8f78aec..1893acd 100644 --- a/src/components/payroll/BenefitConsumptionSearcher.js +++ b/src/components/payroll/BenefitConsumptionSearcher.js @@ -10,6 +10,7 @@ import PhotoCameraOutlinedIcon from '@material-ui/icons/PhotoCameraOutlined'; import { fetchBenefitConsumptions } from '../../actions'; import { BENEFIT_CONSUMPTION_STATUS, DEFAULT_PAGE_SIZE, ROWS_PER_PAGE_OPTIONS } from '../../constants'; import BenefitConsumptionFilter from './BenefitConsumptionFilter'; +import AdditionalFieldsDialog from './dialogs/AdditionalFieldsDialog'; function BenefitConsumptionSearcher({ fetchBenefitConsumptions, @@ -39,6 +40,7 @@ function BenefitConsumptionSearcher({ 'benefitConsumption.status', 'benefitConsumption.payedOnTime', 'benefitConsumption.paymentDate', + '', ]; const checkBenefitDueDate = (benefitConsumption) => { @@ -74,6 +76,11 @@ function BenefitConsumptionSearcher({ ? '' : benefitConsumption?.benefitAttachment[0]?.bill?.datePayed ), + (benefitConsumption) => ( + + ), ]; const rowIdentifier = (benefitConsumption) => benefitConsumption.id; diff --git a/src/components/payroll/BenefitConsumptionSearcherModal.js b/src/components/payroll/BenefitConsumptionSearcherModal.js index e5cde6d..7e99d94 100644 --- a/src/components/payroll/BenefitConsumptionSearcherModal.js +++ b/src/components/payroll/BenefitConsumptionSearcherModal.js @@ -19,6 +19,7 @@ import { import BenefitConsumptionFilterModal from './BenefitConsumptionFilterModal'; import ErrorSummaryModal from './dialogs/ErrorSummaryModal'; import { mutationLabel } from '../../utils/string-utils'; +import AdditionalFieldsDialog from './dialogs/AdditionalFieldsDialog'; function BenefitConsumptionSearcherModal({ fetchBenefitAttachments, @@ -86,6 +87,7 @@ function BenefitConsumptionSearcherModal({ 'benefitConsumption.paymentDate', 'benefitConsumption.status', '', + '', ]; const confirmDeleteBenefitConsumption = (benefit) => { @@ -132,6 +134,11 @@ function BenefitConsumptionSearcherModal({ : benefitAttachment?.bill?.datePayed ), (benefitAttachment) => benefitAttachment?.benefit?.status, + (benefitAttachment) => ( + + ), (benefitAttachment) => ( + +
+ + {formatMessage(intl, 'payroll', 'payroll.additonalFields.label')} + + +
+ + {jsonExtFields?.map((jsonExtField) => ( + + {renderInputComponent(MODULE_NAME, jsonExtField)} + + ))} + +
+
+ +
+
+ +
+
+
+ + +
+ + ); +} + +const mapStateToProps = (state) => ({ + rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [], +}); + +const mapDispatchToProps = (dispatch) => bindActionCreators({ +}, dispatch); + +export default injectIntl( + withTheme( + withStyles(styles)( + connect(mapStateToProps, mapDispatchToProps)(AdditionalFieldsDialog), + ), + ), +); diff --git a/src/translations/en.json b/src/translations/en.json index de2537d..f95a468 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -147,5 +147,9 @@ "payroll.benefitConsumption.confirm": "Confirm", "payroll.benefitConsumption.cancel": "Cancel", "payroll.benefitConsumption.delete.confirm.title": "Delete Benefit Consumption", - "payroll.benefitConsumption.delete.confirm.message": "Are you sure you want to delete the Benefit Consumption? Once you click confirm, additional approval on the task level is required to permanently delete it." + "payroll.benefitConsumption.delete.confirm.message": "Are you sure you want to delete the Benefit Consumption? Once you click confirm, additional approval on the task level is required to permanently delete it.", + + "payroll.additonalFields.label": "Additional Fields", + "payroll.additonalFields.showAdditionalFields": "Show Additional Fields", + "payroll.additonalFields.close": "Close" } \ No newline at end of file