Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup pagination for dtt #49

Merged
merged 7 commits into from
Mar 4, 2024
Merged

Setup pagination for dtt #49

merged 7 commits into from
Mar 4, 2024

Conversation

Xire7
Copy link
Contributor

@Xire7 Xire7 commented Feb 29, 2024

Fixes #44 : pagination, search, and css done for donation tracking table

}
};
getData();
}, [currentTab, currentPageNum, searchTerm]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <react-hooks/exhaustive-deps> reported by reviewdog 🐶
React Hook useEffect has a missing dependency: 'loadInfo'. Either include it or remove the dependency array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add load info to dependency array

Copy link
Contributor

@MaanPatel2005 MaanPatel2005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good, just some minor changes that can be done when we do merges @srukelman

@@ -50,6 +50,7 @@ const AdminFilterBusinesses = () => {

return (
<div>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you run yarn format


const DonationSite = ({ donation_site, checkSet, setCheck, topCheckBox }) => {
const [individualCheckBox, setIndividualCheckBox] = useState(topCheckBox);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change var name from individual checkbox to selectAllCheckBox

);
setCurrentDonationsNum(donationNumResponse.data[0]['count']);
setPageLimit(Math.ceil(donationNumResponse.data[0]['count'] / 10));
// console.log(donationNumResponse.data.length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of this line

}
};
getData();
}, [currentTab, currentPageNum, searchTerm]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add load info to dependency array

setCheckedSet(newCheckedSet);
} else {
const newCheckedSet = new Set();
setCheckedSet(newCheckedSet);
}
};

const handleSearch = event => {
setSearchTerm(event.target.value.split(' ').join('+'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job jit!

@Madhu2244
Copy link
Member

Looks great, I tried some test cases and ran into this issue:

image

I went to the last page, then utilized the search, which then caused the page numbering to get messed up. Make sure you are resetting the page numbers and everything when the user uses the search.

@srukelman srukelman merged commit e7ada61 into main Mar 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pagination, Search, CSS for Admin Donation Tracking Table
5 participants