Skip to content

Commit

Permalink
CM-406: add change log fe for group (#34)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan <j.dolkowski@soldevelo.com>
  • Loading branch information
jdolkowski and Jan authored Dec 30, 2023
1 parent 387742e commit 0409574
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/components/GroupChangelogTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { formatMessage, PublishedComponent } from '@openimis/fe-core';
import { GROUP_CHANGELOG_TAB_VALUE } from '../constants';

function GroupChangelogTabLabel({
intl, onChange, tabStyle, isSelected,
intl, onChange, tabStyle, isSelected, group,
}) {
if (!group) return null;
return (
<Tab
onChange={onChange}
Expand All @@ -20,6 +21,7 @@ function GroupChangelogTabLabel({
function GroupChangelogTabPanel({
value, group,
}) {
if (!group) return null;
return (
<PublishedComponent
pubRef="policyHolder.TabPanel"
Expand Down
4 changes: 2 additions & 2 deletions src/components/GroupHistorySearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function GroupHistorySearcher({

const itemFormatters = () => [
(groupHistory) => groupHistory.id,
(groupHistory) => groupHistory.head,
(groupHistory) => `${groupHistory?.head?.firstName} ${groupHistory?.head?.lastName}`,
(groupHistory) => (groupHistory.dateUpdated
? formatDateFromISO(groupHistory.dateUpdated) : EMPTY_STRING
),
Expand All @@ -49,7 +49,7 @@ function GroupHistorySearcher({

const sorts = () => [
['id', false],
['head', true],
['head', false],
['dateUpdated', true],
['version', true],
];
Expand Down
4 changes: 3 additions & 1 deletion src/components/IndividualChangelogTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { formatMessage, PublishedComponent } from '@openimis/fe-core';
import { INDIVIDUAL_CHANGELOG_TAB_VALUE } from '../constants';

function IndividalChangelogTabLabel({
intl, onChange, tabStyle, isSelected,
intl, onChange, tabStyle, isSelected, individual,
}) {
if (!individual) return null;
return (
<Tab
onChange={onChange}
Expand All @@ -20,6 +21,7 @@ function IndividalChangelogTabLabel({
function IndividalChangelogTabPanel({
value, individual,
}) {
if (!individual) return null;
return (
<PublishedComponent
pubRef="policyHolder.TabPanel"
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ const DEFAULT_CONFIG = {
IndividualsListTabLabel,
BenefitPlansListTabLabel,
IndividalChangelogTabLabel,
GroupChangelogTabLabel,
],
'individual.TabPanel.panel': [
IndividualsListTabPanel,
BenefitPlansListTabPanel,
GroupChangelogTabPanel,
IndividalChangelogTabPanel,
],
'individual.BenefitPlansListTabLabel': [BENEFIT_PLAN_TABS_LABEL_REF_KEY],
Expand Down

0 comments on commit 0409574

Please sign in to comment.