Skip to content

Commit

Permalink
UIU-1407 and UIU-1408 - Fees Fines check-all checkboxes not working. (#…
Browse files Browse the repository at this point in the history
…1099)

* add rowUpdater to warning modal

* add rowUpdater to fee fine listing
  • Loading branch information
JohnC-80 authored and zburke committed Jan 6, 2020
1 parent bd2002d commit 71717cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/components/Accounts/Actions/WarningModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ class WarningModal extends React.Component {
};
}

rowUpdater = (a) => {
const { checkedAccounts } = this.state;
return !!(checkedAccounts[a.id]);
}

onClickContinue() {
const { checkedAccounts } = this.state;
const values = Object.values(checkedAccounts);
Expand Down Expand Up @@ -201,6 +206,7 @@ class WarningModal extends React.Component {
sortOrder={sortOrder[0]}
sortDirection={`${sortDirection[0]}ending`}
contentData={accountOrdered}
rowUpdater={this.rowUpdater}
/>
</Col>
</Row>
Expand Down
9 changes: 8 additions & 1 deletion src/components/Accounts/ViewFeesFines/ViewFeesFines.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class ViewFeesFines extends React.Component {
return {
' ': f => (
<input
checked={accounts.find(a => a.id === f.id)}
checked={(accounts.findIndex(a => a.id === f.id) !== -1)}
onClick={e => this.toggleItem(e, f)}
type="checkbox"
/>
Expand Down Expand Up @@ -286,6 +286,12 @@ class ViewFeesFines extends React.Component {
}));
}

rowUpdater = (f) => {
const accounts = this.props.selectedAccounts;
return this.state.allChecked ||
(accounts.findIndex(a => a.id === f.id) !== -1);
};

handleOptionsChange(itemMeta, e) {
e.preventDefault();
e.stopPropagation();
Expand Down Expand Up @@ -439,6 +445,7 @@ class ViewFeesFines extends React.Component {
sortOrder={sortOrder[0]}
sortDirection={`${sortDirection[0]}ending`}
onRowClick={this.onRowClick}
rowUpdater={this.rowUpdater}
/>
);
}
Expand Down

0 comments on commit 71717cf

Please sign in to comment.