Skip to content

Commit

Permalink
OP-1822: add possibility to disable policy selection (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
olewandowski1 authored Mar 1, 2024
1 parent 3ba883b commit 2c0748d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/FamilyOrInsureePoliciesSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,13 @@ class FamilyOrInsureePoliciesSummary extends PagedDataHandler {
}

onChangeSelection = (i) => {
this.props.selectPolicy(i[0] || null);
const { selectPolicy, disableSelection } = this.props;

if (disableSelection) {
return;
}

selectPolicy(i[0] || null);
};

toggleCheckbox = (key) => {
Expand Down Expand Up @@ -353,6 +359,7 @@ class FamilyOrInsureePoliciesSummary extends PagedDataHandler {
readOnly,
className,
hideAddPolicyButton = false,
disableSelection,
} = this.props;
if ((!family || !family.uuid) && (!insuree || !insuree.uuid)) {
return null;
Expand Down Expand Up @@ -417,7 +424,7 @@ class FamilyOrInsureePoliciesSummary extends PagedDataHandler {
items={policies}
fetching={fetchingPolicies}
error={errorPolicies}
withSelection={"single"}
withSelection={disableSelection ? false : "single"}
onChangeSelection={this.onChangeSelection}
onDoubleClick={this.onDoubleClick}
withPagination={true}
Expand Down

0 comments on commit 2c0748d

Please sign in to comment.