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

feat(earnings): Implement earnings tabular list UI #181

Merged
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
9cc4b0c
feat(appcontext): add earnining menu item to the side nav
Mloweedgar Oct 27, 2021
8c12049
feat(view): add earnings view component
Mloweedgar Oct 27, 2021
02290b4
feat(components): add earnings table component
Mloweedgar Oct 27, 2021
6074a7c
feat(earnings table): add navbar
Mloweedgar Oct 27, 2021
dd42b0c
feat(app context): add CreditCardIcon for the earnings side menu item
Mloweedgar Oct 27, 2021
be9d172
feat(earnings table): style side menu with css
Mloweedgar Oct 27, 2021
20189a2
feat(earnings table): move styles to a separate file
Mloweedgar Oct 27, 2021
f7aa910
feat(earnings top bar): add import and export buttons
Mloweedgar Oct 28, 2021
cf6e670
feat(earnings top bar): style the title
Mloweedgar Oct 28, 2021
85bd058
feat(earnings table): display earnings table filled with dummy data
Mloweedgar Oct 28, 2021
223764a
feat(earnings table): display earnings table with dummy data
Mloweedgar Oct 28, 2021
303c64e
feat(treetrackerapi): add getEarnings api
Mloweedgar Oct 29, 2021
97f48fa
feat(earnings table): style table header
Mloweedgar Oct 29, 2021
e02d554
refactor(earnings table): dynamically displaying growers header and rows
Mloweedgar Oct 31, 2021
d4e8361
feat(earnings table): make renderTableHeaderColumns function complete…
Mloweedgar Oct 31, 2021
369fbde
feat(earnings table): style infoIcon horizontally align with effectiv…
Mloweedgar Oct 31, 2021
4b8aaf9
feat(earnings table): customize earnings table pagination ui
Mloweedgar Oct 31, 2021
585da9f
feat(earnings table): remove full colon on rows per page text
Mloweedgar Nov 1, 2021
9f19aa9
feat(tree tracker api): change earnings api end point
Mloweedgar Nov 3, 2021
975eac7
refactor(earnings table component): rename growers to earnings
Mloweedgar Nov 3, 2021
b77baa1
feat(earning table top bar): add and style import export buttons
Mloweedgar Nov 3, 2021
487871a
feat(earnings table columns): relatively position infoIcon
Mloweedgar Nov 3, 2021
5379150
feat(earnings table): call earnings api inside useEffect
Mloweedgar Nov 5, 2021
ee319ad
Merge branch 'master' into feature/display_earnings_list_ui_only
Mloweedgar Nov 5, 2021
5bd2eab
feat(earnings view): move side navigation menu to earnings view
Mloweedgar Nov 8, 2021
40364b7
feat(earnings table): load earnings from mock api
Mloweedgar Nov 8, 2021
ad1e73a
refactor(earnings table): put table header and body into their own co…
Mloweedgar Nov 8, 2021
38d987b
chore(earnings table): rename totalCount to total
Mloweedgar Nov 8, 2021
2355d82
chore(earnings table): remove unsude MENU_WIDTH contant
Mloweedgar Nov 8, 2021
bd5b0e2
chore(earnings view): remove unused classes object
Mloweedgar Nov 8, 2021
14a240b
feat(earnings table): add filter button
Mloweedgar Nov 9, 2021
739c282
feat(earnings table): add date filter button
Mloweedgar Nov 10, 2021
b9739f9
feat(earnings table): style filter button
Mloweedgar Nov 11, 2021
d722cd2
feat(earnings table ): add filter earnings button
Mloweedgar Nov 11, 2021
bf7ee21
feat(earnings table top bar): arrage well top bar actions
Mloweedgar Nov 11, 2021
d3cd978
feat(earnings table): add sort icon on table header
Mloweedgar Nov 11, 2021
3b81790
feat: enable capture matching for dev deployment
ZavenArra Nov 11, 2021
6a4f8f2
feat(earnings table filter): add filter and style filter header
Mloweedgar Nov 12, 2021
0cb8052
feat(earnings table filter): add funder and payment system select fil…
Mloweedgar Nov 12, 2021
69c1828
feat(earnings filter): adding action buttons
Mloweedgar Nov 12, 2021
aea8a3c
Merge branch 'feature/display_earnings_list_ui_only' of github.com:Ml…
Mloweedgar Nov 12, 2021
b3fc22d
feat(earnings table filter): styled filters according to the designs
Mloweedgar Nov 13, 2021
674200e
feat(earnings filters): toggle open filter
Mloweedgar Nov 13, 2021
d3642ba
feat(earnigs table): add payment date column
Mloweedgar Nov 13, 2021
433d7c2
feat(earnings table): made earnings table top bar buttons responsive
Mloweedgar Nov 13, 2021
8016b6c
feat(earnings tool): add env variable to hide/show earnings tool
Mloweedgar Nov 13, 2021
c77bb0a
build(packages): add react-csv libary for exporting data to csv
Mloweedgar Nov 13, 2021
3f09f32
feat(earnings table): export earnings to csv
Mloweedgar Nov 13, 2021
32d2f78
Merge branch 'master' into feature/display_earnings_list_ui_only
Mloweedgar Nov 13, 2021
5e0b4ec
feat(earnings table): put earnings meta data in an array of objects
Mloweedgar Nov 13, 2021
aaa0524
Merge branch 'feature/display_earnings_list_ui_only' of github.com:Ml…
Mloweedgar Nov 13, 2021
2ef8094
Merge branch 'master' into feature/display_earnings_list_ui_only
Mloweedgar Nov 17, 2021
506bf90
feat(earnings table): display earning details
Mloweedgar Nov 18, 2021
5e7973a
feat(theme): move all colors to the theme
Mloweedgar Nov 18, 2021
7914789
feat(earnings details): render details page when when earning is not …
Mloweedgar Nov 18, 2021
9b2b4a3
feat(earnings table): use them spacing for all spacing in styles
Mloweedgar Nov 18, 2021
d3c9021
Merge branch 'feature/display_earnings_list_ui_only' of github.com:Ml…
Mloweedgar Nov 18, 2021
f8bad91
feat(earnings table): change rows per page options
Mloweedgar Nov 18, 2021
2b91264
feat(earnings table): use ernings table metadata to handle show/hide …
Mloweedgar Nov 18, 2021
29a1602
chore(app context): remove unused GrowerProvider variable
Mloweedgar Nov 18, 2021
8a3d987
feat(earnings details): implement earning details UI
Mloweedgar Nov 18, 2021
7b74826
feat(earnings table): highligh select raw
Mloweedgar Nov 23, 2021
4c79697
Merge branch 'master' into feature/display_earnings_list_ui_only
Mloweedgar Nov 24, 2021
e826c96
Merge branch 'master' of https://github.com/Greenstand/treetracker-ad…
nmcharlton Dec 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ REACT_APP_WEBMAP_DOMAIN=http://dev.treetracker.org
REACT_APP_API_ROOT=https://dev-k8s.treetracker.org/api/admin
REACT_APP_TREETRACKER_API_ROOT=https://dev-k8s.treetracker.org/treetracker
REACT_APP_ENABLE_CAPTURE_MATCHING=true
REACT_APP_ENABLE_EARNINGS=true
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REACT_APP_WEBMAP_DOMAIN=http://test.treetracker.org

15 changes: 13 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"prop-types": "*",
"react": "*",
"react-autosuggest": "^10.0.2",
"react-csv": "^2.0.3",
"react-dom": "*",
"react-fast-compare": "^3.2.0",
"react-infinite": "*",
Expand Down
73 changes: 73 additions & 0 deletions public/earnings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"earnings": [
{
"grower": "Mohamed Sankoh",
"funder": "Environment for Africa",
"amount": "$2.34",
"paymentSystem": "Visa",
"effectiveDate": "Aug 10,2021",
"paymentDate": "Aug 11,2021"
},
{
"grower": "Mohamed Sankoh",
"funder": "Environment for Africa",
"amount": "$2.34",
"paymentSystem": "Visa",
"effectiveDate": "Aug 10,2021",
"paymentDate": "Aug 11,2021"
},
{
"grower": "Mohamed Sankoh",
"funder": "Environment for Africa",
"amount": "$2.34",
"paymentSystem": "Visa",
"effectiveDate": "Aug 10,2021",
"paymentDate": "Aug 11,2021"
},
{
"grower": "Mohamed Sankoh",
"funder": "Environment for Africa",
"amount": "$2.34",
"paymentSystem": "Visa",
"effectiveDate": "Aug 10,2021",
"paymentDate": "Aug 11,2021"
},
{
"grower": "Mohamed Sankoh",
"funder": "Environment for Africa",
"amount": "$2.34",
"paymentSystem": "Visa",
"effectiveDate": "Aug 10,2021",
"paymentDate": "Aug 11,2021"
},
{
"grower": "Mohamed Sankoh",
"funder": "Environment for Africa",
"amount": "$2.34",
"paymentSystem": "Visa",
"effectiveDate": "Aug 10,2021",
"paymentDate": "Aug 11,2021"
},
{
"grower": "Mohamed Sankoh",
"funder": "Environment for Africa",
"amount": "$2.34",
"paymentSystem": "Visa",
"effectiveDate": "Aug 10,2021",
"paymentDate": "Aug 11,2021"
},
{
"grower": "Mohamed Sankoh",
"funder": "Environment for Africa",
"amount": "$2.34",
"paymentSystem": "Visa",
"effectiveDate": "Aug 10,2021",
"paymentDate": "Aug 11,2021"
}
],
"totalCount": 8,
"links": {
"prev": null,
"next": "http://dev-k8s.treetracker.org/earnings?&offset=1"
}
}
54 changes: 20 additions & 34 deletions src/api/treeTrackerApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,40 +98,6 @@ export default {
.then(handleResponse)
.catch(handleError);
},
/*
* to rollback from a wrong approving
*/
// undoCaptureImage(id) {
// const query = `${
// process.env.REACT_APP_API_ROOT
// }/api/${getOrganization()}trees/${id}`;
// return fetch(query, {
// method: 'PATCH',
// headers: {
// 'content-type': 'application/json',
// Authorization: session.token,
// },
// body: JSON.stringify({
// id: id,
// active: true,
// approved: false,
// }),
// })
// .then(handleResponse)
// .catch(handleError);
// },
// getUnverifiedCaptureCount() {
// const query = `${
// process.env.REACT_APP_API_ROOT
// }/api/${getOrganization()}trees/count?where[approved]=false&where[active]=true`;
// return fetch(query, {
// headers: {
// Authorization: session.token,
// },
// })
// .then(handleResponse)
// .catch(handleError);
// },
getCaptureCount(filter) {
const query = `${
process.env.REACT_APP_API_ROOT
Expand Down Expand Up @@ -174,6 +140,26 @@ export default {
.then(handleResponse)
.catch(handleError);
},

/**
* @function
* @name getEarnings
* @description get earnings
*
* @returns {Array} - list of earnings
*/
getEarnings() {
const query = `earnings.json`;
return fetch(query, {
method: 'GET',
headers: {
'content-type': 'application/json',
Authorization: session.token,
},
})
.then(handleResponse)
.catch(handleError);
},
/*
* get species by id
*/
Expand Down
Loading