Skip to content

Commit 063d69e

Browse files
authored
Merge pull request #121 from openimis-wb/18-default-enrollment-criterial-ui-is-missing
## Summary - Fix BenefitPlanEligibilityCriteriaPanel not displaying - Move eligibility criteria panel from standalone to embedded within beneficiaries tab
2 parents 52e0a43 + 980011e commit 063d69e

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

src/components/BenefitPlanBeneficiariesTabPanel.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import {
1818
DEDUPLICATION_SELECT_FIELD_DIALOG_CONTRIBUTION_KEY,
1919
PAYROLL_CREATE_RIGHTS_PUB_REF,
2020
PAYROLL_PAYROLL_ROUTE,
21+
RIGHT_BENEFIT_PLAN_UPDATE,
2122
} from '../constants';
23+
import BenefitPlanEligibilityCriteriaPanel from './BenefitPlanEligibilityCriteriaPanel';
2224
import BenefitPlanBeneficiariesUploadDialog from '../dialogs/BenefitPlanBeneficiariesUploadDialog';
2325
import BenefitPlanBeneficiariesUploadHistoryDialog from '../dialogs/BenefitPlanBeneficiariesUploadHistoryDialog';
2426

@@ -37,7 +39,8 @@ function BenefitPlanBeneficiariesTabLabel({
3739
}
3840

3941
function BenefitPlanBeneficiariesTabPanel({
40-
intl, rights, benefitPlan, setConfirmedAction, value, classes,
42+
intl, rights, benefitPlan, setConfirmedAction, value, classes, confirmed,
43+
edited, onEditedChanged,
4144
}) {
4245
if (value !== BENEFIT_PLAN_BENEFICIARIES_TAB_WRAPPER_VALUE) {
4346
return null;
@@ -117,6 +120,15 @@ function BenefitPlanBeneficiariesTabPanel({
117120
</div>
118121
</Grid>
119122
<Grid item xs={12}>
123+
{rights.includes(RIGHT_BENEFIT_PLAN_UPDATE) && benefitPlan?.id && (
124+
<BenefitPlanEligibilityCriteriaPanel
125+
confirmed={confirmed}
126+
edited={edited}
127+
benefitPlan={benefitPlan}
128+
onEditedChanged={onEditedChanged}
129+
activeTab={activeTab}
130+
/>
131+
)}
120132
<Contributions
121133
contributionKey={BENEFIT_PLAN_BENEFICIARY_TABS_PANEL_CONTRIBUTION_KEY}
122134
rights={rights}

src/components/BenefitPlanTabPanel.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const useStyles = makeStyles((theme) => ({
3535
}));
3636

3737
function BenefitPlanTabPanel({
38-
intl, rights, benefitPlan, setConfirmedAction, onActiveTabChange,
38+
intl, rights, benefitPlan, setConfirmedAction, onActiveTabChange, confirmed,
39+
edited, onEditedChanged,
3940
}) {
4041
const classes = useStyles();
4142
const [activeTab, setActiveTab] = useState(BENEFIT_PLAN_BENEFICIARIES_TAB_WRAPPER_VALUE);
@@ -70,6 +71,9 @@ function BenefitPlanTabPanel({
7071
benefitPlan={benefitPlan}
7172
setConfirmedAction={setConfirmedAction}
7273
classes={classes}
74+
confirmed={confirmed}
75+
edited={edited}
76+
onEditedChanged={onEditedChanged}
7377
/>
7478
</Paper>
7579
);

src/pages/BenefitPlanPage.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {
2727
import BenefitPlanHeadPanel from '../components/BenefitPlanHeadPanel';
2828
import BenefitPlanTabPanel from '../components/BenefitPlanTabPanel';
2929
import { ACTION_TYPE } from '../reducer';
30-
import BenefitPlanEligibilityCriteriaPanel from '../components/BenefitPlanEligibilityCriteriaPanel';
3130

3231
const styles = (theme) => ({
3332
page: theme.page,
@@ -186,9 +185,6 @@ function BenefitPlanPage({
186185

187186
const getBenefitPlanPanels = () => {
188187
const panels = [];
189-
if (benefitPlan?.id && benefitPlan?.beneficiaryDataSchema) {
190-
panels.push(BenefitPlanEligibilityCriteriaPanel);
191-
}
192188
if (rights.includes(RIGHT_BENEFICIARY_SEARCH)) {
193189
panels.push(BenefitPlanTabPanel);
194190
}

0 commit comments

Comments
 (0)