From 98928b0d3b52cf413ef42f4dc35afa27e97c8bcd Mon Sep 17 00:00:00 2001 From: sniedzielski <52816247+sniedzielski@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:27:57 +0100 Subject: [PATCH] CM-715: added benefits tab (#51) --- src/components/BenefitsTab.js | 44 +++++++++++++++++++++++++++++++++++ src/constants.js | 3 +++ src/index.js | 3 +++ src/translations/en.json | 3 +++ 4 files changed, 53 insertions(+) create mode 100644 src/components/BenefitsTab.js diff --git a/src/components/BenefitsTab.js b/src/components/BenefitsTab.js new file mode 100644 index 0000000..ac51352 --- /dev/null +++ b/src/components/BenefitsTab.js @@ -0,0 +1,44 @@ +import React from 'react'; +import { Tab } from '@material-ui/core'; +import { + formatMessage, PublishedComponent, +} from '@openimis/fe-core'; +import { BENEFITS_TAB_VALUE, BENEFITS_CONTRIBUTION_KEY } from '../constants'; + +function BenefitsTabLabel({ + intl, onChange, tabStyle, isSelected, individual, +}) { + if (!individual) return null; + return ( + + ); +} + +function BenefitsTabPanel({ + value, individual, rights, classes, +}) { + if (!individual) return null; + return ( + + + + ); +} + +export { BenefitsTabLabel, BenefitsTabPanel }; diff --git a/src/constants.js b/src/constants.js index fe598a1..13ff83b 100644 --- a/src/constants.js +++ b/src/constants.js @@ -28,12 +28,14 @@ export const INDIVIDUAL_CHANGELOG_TAB_VALUE = 'IndividualChangelogTab'; export const INDIVIDUAL_TASK_TAB_VALUE = 'IndividualTaskTab'; export const GROUP_CHANGELOG_TAB_VALUE = 'GroupChangelogTab'; export const GROUP_TASK_TAB_VALUE = 'GroupTaskTab'; +export const BENEFITS_TAB_VALUE = 'BenefitTaskTab'; export const INDIVIDUAL_TABS_LABEL_CONTRIBUTION_KEY = 'individual.TabPanel.label'; export const INDIVIDUAL_TABS_PANEL_CONTRIBUTION_KEY = 'individual.TabPanel.panel'; export const BENEFIT_PLAN_TABS_LABEL_CONTRIBUTION_KEY = 'individual.BenefitPlansListTabLabel'; export const BENEFIT_PLAN_TABS_PANEL_CONTRIBUTION_KEY = 'individual.BenefitPlansListTabPanel'; export const TASK_CONTRIBUTION_KEY = 'tasksManagement.tasks'; +export const BENEFITS_CONTRIBUTION_KEY = 'payroll.benefitConsumptionPayrollSearcher'; export const BENEFICIARY_STATUS = { POTENTIAL: 'POTENTIAL', @@ -54,6 +56,7 @@ export const GROUP_INDIVIDUAL_ROLES_LIST = [ export const BENEFIT_PLAN_LABEL = 'BenefitPlan'; export const INDIVIDUAL_LABEL = 'Individual'; export const GROUP_LABEL = 'Group'; +export const BENEFITS_LABEL = 'Benefits'; export const INDIVIDUAL_MODULE_NAME = 'individual'; diff --git a/src/index.js b/src/index.js index 27c95c9..9112400 100644 --- a/src/index.js +++ b/src/index.js @@ -39,6 +39,7 @@ import { import { GROUP_LABEL, INDIVIDUAL_LABEL } from './constants'; import { GroupCreateTaskItemFormatters, GroupCreateTaskTableHeaders } from './components/tasks/GroupCreateTasks'; import IndividualsUploadDialog from './components/dialogs/IndividualsUploadDialog'; +import { BenefitsTabLabel, BenefitsTabPanel } from './components/BenefitsTab'; const ROUTE_INDIVIDUALS = 'individuals'; const ROUTE_INDIVIDUAL = 'individuals/individual'; @@ -83,6 +84,7 @@ const DEFAULT_CONFIG = { GroupChangelogTabLabel, GroupTaskTabLabel, IndividalTaskTabLabel, + BenefitsTabLabel, ], 'individual.TabPanel.panel': [ IndividualsListTabPanel, @@ -91,6 +93,7 @@ const DEFAULT_CONFIG = { IndividalChangelogTabPanel, GroupTaskTabPanel, IndividalTaskTabPanel, + BenefitsTabPanel, ], 'individual.BenefitPlansListTabLabel': [BENEFIT_PLAN_TABS_LABEL_REF_KEY], 'individual.BenefitPlansListTabPanel': [BENEFIT_PLAN_TABS_PANEL_REF_KEY], diff --git a/src/translations/en.json b/src/translations/en.json index a79d15b..6cc59c3 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -20,6 +20,9 @@ "lastName": "Last Name", "dob": "Day of birth", "mandatoryFieldsEmptyError": "* These fields are required", + "benefits": { + "label": "Benefits" + }, "delete": { "confirm": { "title": "Delete {firstName} {lastName}?",