From 9f19b40b2a9934e690d8bcca9d07e31fa84cf85e Mon Sep 17 00:00:00 2001 From: sniedzielski <52816247+sniedzielski@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:18:44 +0200 Subject: [PATCH] CM-919: added benefit tab for group (#88) --- src/actions.js | 2 +- src/components/BenefitsGroupTab.js | 44 ++++++++++++++++++++++++++++++ src/index.js | 3 ++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/components/BenefitsGroupTab.js diff --git a/src/actions.js b/src/actions.js index 715813b..ed1c7a7 100644 --- a/src/actions.js +++ b/src/actions.js @@ -77,7 +77,7 @@ const GROUP_FULL_PROJECTION = [ 'id', 'code', 'isDeleted', - 'head {firstName, lastName}', + 'head {firstName, lastName, uuid}', 'dateCreated', 'dateUpdated', 'jsonExt', diff --git a/src/components/BenefitsGroupTab.js b/src/components/BenefitsGroupTab.js new file mode 100644 index 0000000..de0b236 --- /dev/null +++ b/src/components/BenefitsGroupTab.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 BenefitsGroupTabLabel({ + intl, onChange, tabStyle, isSelected, group, +}) { + if (!group) return null; + return ( + + ); +} + +function BenefitsGroupTabPanel({ + value, group, rights, classes, +}) { + if (!group) return null; + return ( + + + + ); +} + +export { BenefitsGroupTabLabel, BenefitsGroupTabPanel }; diff --git a/src/index.js b/src/index.js index 8ab00e8..c477c3a 100644 --- a/src/index.js +++ b/src/index.js @@ -60,6 +60,7 @@ import { } from './components/tasks/GroupImportTasks'; import EnrollmentGroupPage from './pages/EnrollmentGroupPage'; import GroupMenu from './components/dialogs/GroupMenu'; +import { BenefitsGroupTabLabel, BenefitsGroupTabPanel } from './components/BenefitsGroupTab'; const ROUTE_INDIVIDUALS = 'individuals'; const ROUTE_INDIVIDUAL = 'individuals/individual'; @@ -136,12 +137,14 @@ const DEFAULT_CONFIG = { IndividualsListTabLabel, BenefitPlansListTabLabel, GroupChangelogTabLabel, + BenefitsGroupTabLabel, GroupTaskTabLabel, ], 'group.TabPanel.panel': [ IndividualsListTabPanel, BenefitPlansListTabPanel, GroupChangelogTabPanel, + BenefitsGroupTabPanel, GroupTaskTabPanel, ], 'individual.BenefitPlansListTabLabel': [BENEFIT_PLAN_TABS_LABEL_REF_KEY],