In this PR, I updated the profit display so that it now shows 5 profits only.
Users also have the option of checking other profits by clicking next and previous buttons.
How I implmented it was that I merged Profits.js and ProfitsTable.js simply into one file: Profits.js
Before, it requires us to pass in a profits parameter manually.
Now, no parameters are needed, we call the API and backend directly.
I talked to a TA and we agreed that merging profits and profits table into one file might be a good practice since it will be easier to maintain.
However, I am still facing a lot of issues in the test file becuase I now need to change all the instances of how I called the Profits component.
I am not sure if the way I am doing it is a suitable way for this issue.
Future Possibilities (Optional)
Some possible points could be:
This is the beginning/part of (insert feature).
We can extend this to add (something beyond current functions).
This can make things easier to (insert project).
Validation (Optional)
Download this branch.
Run the project.
Go to this page.
Test this function.
Tests
[ ] Backend Unit tests (mvn test) pass
[ ] Backend Test coverage (mvn test jacoco:report) 100%
[ ] Backend Mutation tests (mvn test pitest:mutationCoverage) 100%
[ ] Frontend Unit tests (npm test) pass
[ ] Frontend Test coverage (npm run coverage) 100%
Overview
In this PR, I updated the profit display so that it now shows 5 profits only. Users also have the option of checking other profits by clicking next and previous buttons. How I implmented it was that I merged Profits.js and ProfitsTable.js simply into one file: Profits.js
Before, it requires us to pass in a profits parameter manually. Now, no parameters are needed, we call the API and backend directly.
Screenshots
Before making the change:
After the implementation:
https://github.com/ucsb-cs156-f23/proj-happycows-f23-5pm-1/assets/75823989/2a97b564-252c-485e-a31b-150d9090c78d
Feedback Request (Optional)
I talked to a TA and we agreed that merging profits and profits table into one file might be a good practice since it will be easier to maintain. However, I am still facing a lot of issues in the test file becuase I now need to change all the instances of how I called the Profits component. I am not sure if the way I am doing it is a suitable way for this issue.
Future Possibilities (Optional)
Some possible points could be:
Validation (Optional)
Tests
mvn test
) passmvn test jacoco:report
) 100%mvn test pitest:mutationCoverage
) 100%npm test
) passnpm run coverage
) 100%npx stryker run
) 100%npx eslint --fix src
)Linked Issues