ucsb-cs156-f23 / proj-happycows-f23-5pm-1

https://ucsb-cs156-f23.github.io/proj-happycows-f23-5pm-1/
0 stars 0 forks source link

FEATURE: Better Profits Display #6

Open github-actions[bot] opened 11 months ago

github-actions[bot] commented 11 months ago

User Story

Discussion

The profits table currently shows ALL profits from milking the cows during the game, which can result in a kind of sloppy user experience, since this table can go on for many more rows that the page design can accomodate.

What we want is to page the profits table in a similar way to how the jobs table is currently paged.

You could use the PagedJobsTable as a model.

What we want is for the user to be able to see the most recent profits at a glance on the main user commons page (for example, perhaps the "n" most recent records, where "n" is a constant defined in the page component, e.g. const PROFIT_PAGE_SIZE=5. )

A paged backend endpoint for profits was added by the M23 students at this endpoint:

/api/profits/paged/commonsid?commonsId=1&page=0&size=5

What's left to do is the frontend. Components to go forward and backwards through the pages can be added.

Note that the buttons in PagedJobsTable were a quick attempt at building an MVP, but since then we've discovered that React Bootstrap has components just for this purpose: see https://react-bootstrap.netlify.app/docs/components/pagination

You are encouraged to use those.

Acceptance Criteria