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

Feature/my forest #1765

Merged
merged 524 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 241 commits
Commits
Show all changes
524 commits
Select commit Hold shift + click to select a range
f1da3a9
Log tenantConfig from _app
Shreyaschorge Dec 8, 2023
a868062
Show map
Shreyaschorge Dec 10, 2023
c9287b1
Update matcher path
Shreyaschorge Dec 10, 2023
1474ca8
use useCallback in /[slug]/[p]
Shreyaschorge Dec 10, 2023
e35033a
Update matcher
Shreyaschorge Dec 10, 2023
3fed043
Fix router.push
Shreyaschorge Dec 10, 2023
94b8a53
Send id in getReq
Shreyaschorge Dec 10, 2023
604199a
Remove redirect to /_sites
Shreyaschorge Dec 10, 2023
b81ab59
Rename index.tsx
Shreyaschorge Dec 10, 2023
4936c79
Pass tenantId in getReq
Shreyaschorge Dec 10, 2023
ee14f6c
Update matcher and pass tenantId in rest of the apis
Shreyaschorge Dec 10, 2023
cdd7682
Update matcher
Shreyaschorge Dec 10, 2023
0b20743
Remove content from useCallback
Shreyaschorge Dec 10, 2023
291f698
fix coservation marker icon issue
sunilsabatp Dec 11, 2023
10085e0
fix date for the gift in the pop up
sunilsabatp Dec 11, 2023
f5fdfe1
remove the console
sunilsabatp Dec 11, 2023
60bd282
Move and update /bulk-codes/[method]/[id]
Shreyaschorge Dec 11, 2023
55dfc7a
clean the profile name if it contain hyphen
sunilsabatp Dec 11, 2023
8c341d1
Move /bulk-codes/[method]/index.tsx, update getStaticProps types and …
Shreyaschorge Dec 11, 2023
f1bbbd4
Add appropriate types for getStaticProps
Shreyaschorge Dec 11, 2023
a2612d6
Move and update /bulk-codes/index.tsx
Shreyaschorge Dec 11, 2023
02567be
Update matcher config in middleware
Shreyaschorge Dec 11, 2023
c04aa5c
Add logs in files
Shreyaschorge Dec 11, 2023
89c2f80
Replaced process.env.TENANT with tenantConfig.config.slug
Shreyaschorge Dec 12, 2023
64f60d8
Add allowDonations field
Shreyaschorge Dec 12, 2023
1cb6604
Update NEXTAUTH_URL with window.location.origin
Shreyaschorge Dec 12, 2023
2884d56
Move /t/[id].tsx page in /_sites/[slug]
Shreyaschorge Dec 12, 2023
794cc3e
Add window checks
Shreyaschorge Dec 12, 2023
1f05738
remove unwanted folder and check allowdonation condition
sunilsabatp Dec 13, 2023
068f9df
fix chocolate code contribution
sunilsabatp Dec 13, 2023
99f4dd7
fix minor bugs
sunilsabatp Dec 14, 2023
2fa43ef
Add allowDonations in gift project
Shreyaschorge Dec 15, 2023
f49fa54
expose background image of conservation container
sunilsabatp Dec 15, 2023
48d90cf
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Dec 15, 2023
433f38d
enable donation option for gifts
sunilsabatp Dec 15, 2023
7bc5a11
Fix quantity for chocolate gift in contribution geojson
Shreyaschorge Dec 15, 2023
b7ba9e0
remove unuse variables
sunilsabatp Dec 15, 2023
d4a3174
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Dec 15, 2023
704befb
update profile if bulk code is created
sunilsabatp Dec 17, 2023
272def1
Sort by plantDate
Shreyaschorge Dec 20, 2023
8d4bd96
Fix redirect issue and repeated call for storeConfig function
Shreyaschorge Dec 20, 2023
6d1a735
Fix redirects
Shreyaschorge Dec 22, 2023
6df39b1
Resolve merge conflicts
Shreyaschorge Dec 25, 2023
b0c8794
Set tenant id in getAuthenticatedRequest
Shreyaschorge Dec 25, 2023
61182f1
localized format of the date
sunilsabatp Dec 25, 2023
649f693
Make /profile/history page tenant aware
Shreyaschorge Dec 25, 2023
880ae39
Make /profile/api-key page tenant aware
Shreyaschorge Dec 25, 2023
6e79299
Make /profile/delete-account page tenant aware
Shreyaschorge Dec 25, 2023
155f755
Flag to be removed pages
Shreyaschorge Dec 25, 2023
e2b7b4c
Make /profile/donation-link page tenant aware
Shreyaschorge Dec 25, 2023
40a4013
Make /profile/edit page tenant aware
Shreyaschorge Dec 25, 2023
733bca3
Make /profile/impersonate-user page tenant aware
Shreyaschorge Dec 25, 2023
59128f4
Make /profile/recurrency page tenant aware
Shreyaschorge Dec 25, 2023
b340c39
Make /profile/register-trees page tenant aware
Shreyaschorge Dec 25, 2023
75a1ad1
Make /profile/widgets page tenant aware
Shreyaschorge Dec 25, 2023
ba16b8e
Make /s/[id] page tenant aware
Shreyaschorge Dec 25, 2023
e089a25
remove unused vars
Shreyaschorge Dec 25, 2023
d414fe0
Make /profile/giftfund/index.tsx page tenant aware
Shreyaschorge Dec 25, 2023
1e97576
Make /profile/payouts/index.tsx page tenant aware
Shreyaschorge Dec 25, 2023
fbfc3b1
improved registered tree contribution layout
sunilsabatp Dec 26, 2023
ae7c48e
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Dec 26, 2023
c4f1ce7
Make /profile/payouts/schedule page tenant aware
Shreyaschorge Dec 27, 2023
61beb0b
code clean up
sunilsabatp Dec 27, 2023
fe29dfe
Make /profile/payouts/add-bank-details page tenant aware
Shreyaschorge Dec 27, 2023
e12c8c4
Make /profile/payouts/edit-bank-details/[id].tsx page tenant aware
Shreyaschorge Dec 27, 2023
8740a72
Remove unused variable
Shreyaschorge Dec 27, 2023
759e145
Make /profile/planetcash/index.tsx page tenant aware
Shreyaschorge Dec 27, 2023
50d2c4a
Make /profile/planetcash/transactions.tsx page tenant aware
Shreyaschorge Dec 27, 2023
09ef0b7
Make /profile/planetcash/new.tsx page tenant aware
Shreyaschorge Dec 27, 2023
a7655b1
Make /profile/projects/index.tsx page tenant aware
Shreyaschorge Dec 28, 2023
025957a
Make /profile/projects/new-project.tsx page tenant aware
Shreyaschorge Dec 28, 2023
0914981
Make /profile/projects/[id].tsx page tenant aware
Shreyaschorge Dec 28, 2023
4cd3f38
Make /profile/redeem/[code].tsx page tenant aware
Shreyaschorge Dec 28, 2023
07e9fa1
Make /profile/treemapper/index.tsx page tenant aware
Shreyaschorge Dec 28, 2023
75c8764
Make /profile/treemapper/import.tsx page tenant aware
Shreyaschorge Dec 28, 2023
c091800
Make /profile/treemapper/my-species.tsx page tenant aware
Shreyaschorge Dec 28, 2023
0f4fb51
Make /profile/treemapper/data-explorer.tsx page tenant aware
Shreyaschorge Dec 28, 2023
f6be3c3
create a seprate context for myForest and code clean up
sunilsabatp Dec 29, 2023
2f64fcf
complete cleaning up the myContribution component
sunilsabatp Dec 29, 2023
98c761f
Move File: share.tsx
sunilsabatp Dec 30, 2023
009adb9
remove registered tree feature from the public profile
sunilsabatp Dec 31, 2023
5930011
give padding to popUp
sunilsabatp Dec 31, 2023
1c53889
include treecounter in the tpo public profile
sunilsabatp Jan 2, 2024
c7f0f71
align project list toward left for tpo public profile
sunilsabatp Jan 2, 2024
792743d
Removed flagged pages
Shreyaschorge Jan 2, 2024
4b486e7
URL button for public profile
sunilsabatp Jan 3, 2024
555c872
Fix redirect logic for data-explorer
Shreyaschorge Jan 3, 2024
a069103
apply donation icon for donated project
sunilsabatp Jan 3, 2024
859f244
Clean up - remove console logs
Shreyaschorge Jan 3, 2024
95edb73
Clean up - remove the use of tenantConfig function in the code base
Shreyaschorge Jan 3, 2024
17d4a9b
Clean up - Remove unused helper functions
Shreyaschorge Jan 3, 2024
3f5a7c2
disable edit target button for public profile
sunilsabatp Jan 3, 2024
fe70cd1
typo
sunilsabatp Jan 3, 2024
fabd032
Fetch tenantConfig and set it in localstorage before using it within …
Shreyaschorge Jan 4, 2024
f1f933f
Update console message
Shreyaschorge Jan 4, 2024
7ef7205
Log tenant
Shreyaschorge Jan 4, 2024
5542828
Remove log
Shreyaschorge Jan 4, 2024
5dc0f61
PopUp for cluster marker
sunilsabatp Jan 4, 2024
dd94aef
manage the width of profile-map-container
sunilsabatp Jan 4, 2024
8c93b64
Remove comments
Shreyaschorge Jan 4, 2024
6d18bd0
Add debug logs
Shreyaschorge Jan 4, 2024
7d0f92a
Log host
Shreyaschorge Jan 4, 2024
4df6186
Default to where the most contributions are to open up counterdetails
sunilsabatp Jan 4, 2024
0be9dfc
increase the width of map and profile box
sunilsabatp Jan 5, 2024
a1cf96e
Render map
Shreyaschorge Jan 8, 2024
5e069b8
Test useEffect
Shreyaschorge Jan 8, 2024
94ab67c
Fix map not rendering issue
Shreyaschorge Jan 8, 2024
1352058
Remove hostURL props
Shreyaschorge Jan 9, 2024
f4d2f3d
log tenant
Shreyaschorge Jan 9, 2024
1e9e244
display message for cluster marker
sunilsabatp Jan 9, 2024
39a33c2
remove swipe icon
sunilsabatp Jan 9, 2024
3e92207
Add totalContributions and fix merging logic
Shreyaschorge Jan 9, 2024
1177efa
change the dimension of profile buttons
sunilsabatp Jan 10, 2024
94ccea2
change the styling of edit profile button
sunilsabatp Jan 10, 2024
6767d28
manage the maxWidth for profile page
sunilsabatp Jan 10, 2024
9546a14
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Jan 10, 2024
e12964f
manage width of the public profile
sunilsabatp Jan 10, 2024
b0286ce
[CodeFactor] Apply fixes
code-factor Jan 10, 2024
f37a8d6
resolve merge conflict
sunilsabatp Jan 10, 2024
eb5978d
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Jan 10, 2024
28c380f
remove unused variable
sunilsabatp Jan 10, 2024
b915ba6
show loader for the load more contribution button
sunilsabatp Jan 11, 2024
60b7d63
fix responsivness
sunilsabatp Jan 16, 2024
b557f72
fix eslint error
sunilsabatp Jan 16, 2024
7783fa4
Resolve merge conflict
Shreyaschorge Jan 16, 2024
020d6b4
Resolve merge conflicts
Shreyaschorge Jan 16, 2024
0937155
Get rid of redeem popup
Shreyaschorge Jan 16, 2024
05ce7dc
change the variable name totalcontribution
sunilsabatp Jan 16, 2024
8d86409
profile box for mobile verion
sunilsabatp Jan 17, 2024
9eba3f2
if user image is missing render default image
sunilsabatp Jan 17, 2024
fe0fa9a
translation for profile page
sunilsabatp Jan 17, 2024
cd55523
Send tenantId in getRequest
Shreyaschorge Jan 17, 2024
1619554
map credit icon
sunilsabatp Jan 18, 2024
2f77acb
Form donation url properly
Shreyaschorge Jan 18, 2024
2617b67
Remove force redirect
Shreyaschorge Jan 18, 2024
31f5e38
enable direct gift to the public profile user
sunilsabatp Jan 19, 2024
2aa96a7
Remove force redirect
Shreyaschorge Jan 19, 2024
8bfd7e7
Log Basic target
Shreyaschorge Jan 19, 2024
02f5527
Log Basic tenantScore
Shreyaschorge Jan 19, 2024
b9ea9ac
Move site selector towards right
Shreyaschorge Jan 19, 2024
8d0a04b
refactor: renames _sites folder to sites
mohitb35 Jan 19, 2024
1db71f7
feat: adds sample pages (app router)
mohitb35 Jan 19, 2024
1edff5d
Add more right margin
Shreyaschorge Jan 19, 2024
62c4d17
Adjust margins from right
Shreyaschorge Jan 19, 2024
fb27e58
Add additional check for target
Shreyaschorge Jan 19, 2024
f0ea166
Revert "feat: adds sample pages (app router)"
mohitb35 Jan 19, 2024
5cad362
Keep old project searchbar for salesforce
Shreyaschorge Jan 19, 2024
cf460cc
Negate the condition to show top project
Shreyaschorge Jan 19, 2024
74fa9e9
cluster marker popUp
sunilsabatp Jan 22, 2024
890ffd1
zoomIn if user has only one donation
sunilsabatp Jan 22, 2024
812b835
[CodeFactor] Apply fixes
code-factor Jan 22, 2024
ec128a0
Fix language selector
Shreyaschorge Jan 23, 2024
460f419
Remove merge conflict
Shreyaschorge Jan 23, 2024
800d9d0
Remove additional conditions
Shreyaschorge Jan 23, 2024
11b2306
Get tenant from context
Shreyaschorge Jan 23, 2024
b15f686
Clean up
Shreyaschorge Jan 23, 2024
da5e26e
Check auth
Shreyaschorge Jan 23, 2024
ca0d38a
Add &status=active param to burst cache
Shreyaschorge Jan 23, 2024
81a559e
Clean up
Shreyaschorge Jan 23, 2024
ec3b1ea
donate popUp
sunilsabatp Jan 24, 2024
108b5ae
Clean up
Shreyaschorge Jan 24, 2024
54a7427
resolved the merge conflict
sunilsabatp Jan 24, 2024
f021efa
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Jan 24, 2024
84f3cab
fix eslint error
sunilsabatp Jan 24, 2024
bc762f0
Resolve merge conflicts
Shreyaschorge Jan 24, 2024
0131b27
Update package-lock
Shreyaschorge Jan 25, 2024
627ac9c
Feature/multi tenancy
Shreyaschorge Jan 25, 2024
43ed9c9
added some translations for better testing
norbertschuler Jan 30, 2024
d8780ea
added further German resources
norbertschuler Jan 30, 2024
f6ddbee
Add project image to gift contribution in contributionsGeoJson
Shreyaschorge Jan 30, 2024
c0aa4c4
Handle edge case of pagination
Shreyaschorge Jan 30, 2024
4ef9762
enable donation pop-up for the gift contribution
sunilsabatp Jan 31, 2024
9cff6bd
resolve merge conflict
sunilsabatp Jan 31, 2024
310e0e6
Add image to invitation gift
Shreyaschorge Jan 31, 2024
e5a80f0
render correct user features for profile page
sunilsabatp Feb 1, 2024
c80bd09
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Feb 1, 2024
ad1861f
Include coupon gifts in response
Shreyaschorge Feb 1, 2024
9ecedf8
code clean up for donation popUp and debug minor issue
sunilsabatp Feb 1, 2024
eeaf330
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Feb 1, 2024
cf71eaa
Normalize geoJson response
Shreyaschorge Feb 1, 2024
5e09539
use translation for treecounter
sunilsabatp Feb 1, 2024
61d4fd5
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Feb 1, 2024
b6f738f
use translation for tree counter
sunilsabatp Feb 2, 2024
b33ee2c
manage decimal number
sunilsabatp Feb 2, 2024
d30a148
Add giftType coupon to contribution list
Shreyaschorge Feb 2, 2024
15fafa9
Remove redemptionDate from response
Shreyaschorge Feb 2, 2024
01a65c2
fix the chocolate decimal
sunilsabatp Feb 2, 2024
5c7955b
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Feb 2, 2024
90d567d
improve the visiblity of public profile box
sunilsabatp Feb 2, 2024
801a2c8
manage profile container
sunilsabatp Feb 5, 2024
a93e85c
improve file structure
sunilsabatp Feb 5, 2024
d9652dd
fix type errors
sunilsabatp Feb 5, 2024
3faa865
avoid direct gift feature by clicking donate from the private profile
sunilsabatp Feb 5, 2024
f3d9cb8
Add Redis config placeholders in .env.local.example file
Shreyaschorge Feb 5, 2024
538aa67
enable pagination
sunilsabatp Feb 6, 2024
9fea0e8
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Feb 6, 2024
6dda33b
minor refactor donation pop up
sunilsabatp Feb 6, 2024
6434f82
Add allowDonations in contributions geoJSON
Shreyaschorge Feb 6, 2024
02540ac
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Feb 6, 2024
9a26250
disable donate button for non donatable project
sunilsabatp Feb 6, 2024
6c68e04
Clean up
Shreyaschorge Feb 8, 2024
63dab69
replace translation resources with the profile translation resources
sunilsabatp Feb 8, 2024
e675377
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Feb 8, 2024
1dbd0df
Update matcher expression
Shreyaschorge Feb 9, 2024
a0daa44
get referrer rathen than host
Shreyaschorge Feb 9, 2024
c0aaa0b
Log referer
Shreyaschorge Feb 9, 2024
08048cf
Check if domain exists in referer
Shreyaschorge Feb 9, 2024
2fb73c8
Check for referrer
Shreyaschorge Feb 9, 2024
ebe9da7
updated German translations
norbertschuler Feb 11, 2024
d81d37e
added some number formatting for UI
norbertschuler Feb 11, 2024
0fdf9d8
missed one resource in German
norbertschuler Feb 11, 2024
16740da
Update matcher logic
Shreyaschorge Feb 12, 2024
5c8aa0b
Log slug
Shreyaschorge Feb 12, 2024
71f741b
Add logs
Shreyaschorge Feb 12, 2024
52c2e9b
Add logs
Shreyaschorge Feb 12, 2024
18fb316
Add pathname check and logs
Shreyaschorge Feb 12, 2024
288bba3
adjust the width of buttons
sunilsabatp Feb 12, 2024
1ec8c26
Remove logs
Shreyaschorge Feb 12, 2024
e2b007a
treecounter responsive
sunilsabatp Feb 12, 2024
bdf5ace
improve button alignment
sunilsabatp Feb 12, 2024
d14977d
Fix video container
Shreyaschorge Feb 12, 2024
80e60b3
fixed wrongly committed merge conflict
norbertschuler Feb 13, 2024
287ef7d
doc: adds jsdoc for _tenants
mohitb35 Feb 13, 2024
1481267
Add REDIS_URL and REDIS_TOKEN
Shreyaschorge Feb 13, 2024
2c40f62
Update regex doc
Shreyaschorge Feb 13, 2024
2c0280e
use new profile resources rather than me
norbertschuler Feb 13, 2024
2125d49
fix resource having to much brackets
norbertschuler Feb 14, 2024
c803239
fixed German resource name for plural form
norbertschuler Feb 14, 2024
de3422d
fix the layout of share button
sunilsabatp Feb 16, 2024
20fa093
rename variable and remove unwanted variable
sunilsabatp Feb 16, 2024
32a4723
remove unused variable
sunilsabatp Feb 17, 2024
c3b01cd
improve file structure
sunilsabatp Feb 17, 2024
32f6341
code cleanup
sunilsabatp Feb 19, 2024
e50ea92
minor check
sunilsabatp Feb 19, 2024
c8ffa4d
fix vercel issue
sunilsabatp Feb 19, 2024
c79dd49
rename folder into Pascal case
sunilsabatp Feb 19, 2024
958c6b4
fix import issue
sunilsabatp Feb 19, 2024
ca09f5d
rename file
sunilsabatp Feb 19, 2024
591642b
rename file name
sunilsabatp Feb 20, 2024
60e6e22
refactor: renames /ProfileV2 to /Profile
mohitb35 Feb 20, 2024
7a28078
manage background of public profile
sunilsabatp Feb 20, 2024
e242fcd
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Feb 20, 2024
9fa105c
protect undefined records
Shreyaschorge Feb 20, 2024
496c9fc
check undefined in the donation url
sunilsabatp Feb 22, 2024
43df1e4
Merge branch 'feature/my_forest' of https://github.com/Plant-for-the-…
sunilsabatp Feb 22, 2024
965f23c
fix the interpreatation error
sunilsabatp Feb 22, 2024
1a36ef4
encode url
sunilsabatp Feb 22, 2024
f264927
encode url
sunilsabatp Feb 22, 2024
627707b
disable darkmode feature
sunilsabatp Feb 23, 2024
a40ef14
fix: adds more robust checks for features available to verified/logge…
mohitb35 Feb 26, 2024
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
30,328 changes: 29,756 additions & 572 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"scripts": {
"dev": "next dev",
"build": "next build",
"build": "npx prisma generate && next build",
"analyze": "ANALYZE=true npm run build",
"export": "next export",
"start": "next start -p $PORT",
Expand Down Expand Up @@ -56,16 +56,23 @@
"@netlify/plugin-nextjs": "^4.33.0",
"@next/bundle-analyzer": "^10.2.3",
"@planet-sdk/common": "^0.1.27",
"@prisma/client": "^4.13.0",
"@sentry/browser": "^6.15.0",
"@sentry/integrations": "^6.19.2",
"@sentry/node": "^6.19.2",
"@sentry/webpack-plugin": "^1.20.1",
"@tanstack/react-query": "^4.29.5",
"@trpc/client": "^10.25.0",
"@trpc/next": "^10.25.0",
"@trpc/react-query": "^10.25.0",
"@trpc/server": "^10.25.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is using @prisma and @trpc possible with our Netlify and Heroku deployments of planet-webapp?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The aim is to move to a single deployment on Vercel (#1877 will come first)

Copy link
Collaborator

@norbertschuler norbertschuler Feb 11, 2024

Choose a reason for hiding this comment

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

So I guess we need to disable automatic deployment of the production branch main for Netlify and Heroku once we want to merge this in order to not break these deployments until they got migrated.

"@turf/turf": "^5.1.6",
"@types/geojson": "^7946.0.10",
"@types/papaparse": "^5.3.2",
"@types/qrcode": "^1.5.0",
"@types/react-gtm-module": "^2.0.1",
"@types/react-lazyload": "^2.6.0",
"@types/supercluster": "^7.1.0",
"apexcharts": "^3.37.0",
"connection-string": "^4.3.6",
"d3-ease": "^2.0.0",
Expand Down Expand Up @@ -108,6 +115,7 @@
"react-insta-stories": "^2.2.5",
"react-json-editor-ajrm": "^2.5.13",
"react-lazyload": "^3.2.0",
"react-loading-skeleton": "^3.3.1",
"react-map-gl": "5.3.21",
"react-mapbox-gl": "^5.1.0",
"react-mapbox-gl-draw": "^2.0.4",
Expand All @@ -116,6 +124,8 @@
"sass": "^1.62.1",
"serverless-mysql": "^1.5.4",
norbertschuler marked this conversation as resolved.
Show resolved Hide resolved
"styled-jsx": "^5.0.0",
"supercluster": "^8.0.1",
"superjson": "^1.12.3",
"uuid": "^8.3.2",
"vizzuality-components": "^3.0.3",
"xlsx": "^0.18.5",
Expand Down Expand Up @@ -165,6 +175,7 @@
"husky": "^8.0.3",
"next-unused": "0.0.6",
"prettier": "^2.0.5",
"prisma": "^4.13.0",
"storybook-addon-next": "^1.7.1",
"typescript": "^4.3.2",
"validate-branch-name": "^1.3.0",
Expand Down
4 changes: 2 additions & 2 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { PlanetCashProvider } from '../src/features/common/Layout/PlanetCashCont
import { PayoutsProvider } from '../src/features/common/Layout/PayoutsContext';
import { appWithTranslation } from 'next-i18next';
import nextI18NextConfig from '../next-i18next.config.js';
import { trpc } from '../src/utils/trpc';
import MapHolder from '../src/features/projects/components/maps/MapHolder';

const VideoContainer = dynamic(
Expand Down Expand Up @@ -288,5 +289,4 @@ const PlanetWeb = ({
);
}
};

export default appWithTranslation(PlanetWeb, nextI18NextConfig);
export default trpc.withTRPC(appWithTranslation(PlanetWeb, nextI18NextConfig));
7 changes: 7 additions & 0 deletions pages/api/trpc/[trpc].ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as trpcNext from '@trpc/server/adapters/next';
import { appRouter } from '../../../src/server/router/_app';

export default trpcNext.createNextApiHandler({
router: appRouter,
createContext: () => ({})
});
2 changes: 1 addition & 1 deletion pages/login.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactElement } from 'react';
import UserProfileLoader from '../src/features/common/ContentLoaders/UserProfile/UserProfile';
import { UserProfileLoader } from '../src/features/common/ContentLoaders/UserProfile/UserProfile';
import { useRouter } from 'next/router';
import { useUserProps } from '../src/features/common/Layout/UserPropsContext';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
Expand Down
74 changes: 0 additions & 74 deletions pages/profile/forest.tsx
mohitb35 marked this conversation as resolved.
Outdated
Show resolved Hide resolved
mohitb35 marked this conversation as resolved.
Outdated
Show resolved Hide resolved

This file was deleted.

29 changes: 8 additions & 21 deletions pages/profile/index.tsx
mohitb35 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useRouter } from 'next/router';
import React, { ReactElement, useEffect } from 'react';
import { useUserProps } from '../../src/features/common/Layout/UserPropsContext';
import Profile from '../../src/features/user/Profile';
import Profile from '../../src/features/user/ProfileV2/components/ProfileInfo';
import UserLayout from '../../src/features/common/Layout/UserLayout/UserLayout';
import MyTrees from '../../src/features/user/Profile/components/MyTrees/MyTrees';
import MyContributions from '../../src/features/user/ProfileV2/components/MyContributions/MyContributions';
import Head from 'next/head';
import { useTranslation } from 'next-i18next';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
Expand All @@ -18,13 +18,11 @@ function ProfilePage(): ReactElement {

// Internal states
const [profile, setProfile] = React.useState<null | User>();
const [authenticatedType, setAuthenticatedType] = React.useState('');

useEffect(() => {
if (contextLoaded) {
if (user) {
setProfile(user);
setAuthenticatedType('private');
}
}
}, [contextLoaded, user, router]);
Expand All @@ -36,15 +34,8 @@ function ProfilePage(): ReactElement {
</Head>
{profile && (
<>
<Profile
userprofile={profile}
authenticatedType={authenticatedType}
/>
<MyTrees
authenticatedType={authenticatedType}
profile={profile}
token={token}
/>
<Profile userProfile={profile} />
<MyContributions profile={profile} token={token} />
</>
)}
</UserLayout>
Expand All @@ -59,21 +50,17 @@ export async function getStaticProps({ locale }: GetStaticPropsContext) {
...(await serverSideTranslations(
locale || 'en',
[
'bulkCodes',
'me',
'donate',
'editProfile',
'redeem',
'common',
'country',
'donate',
'donationLink',
'editProfile',
'giftfunds',
'leaderboard',
'managePayouts',
'manageProjects',
'maps',
'me',
'planet',
'planetcash',
'redeem',
'registerTrees',
'tenants',
'treemapper',
Expand Down
22 changes: 8 additions & 14 deletions pages/t/[id].tsx
mohitb35 marked this conversation as resolved.
Show resolved Hide resolved
prachigarg19 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { useRouter } from 'next/router';
import React, { ReactElement, useEffect } from 'react';
import UserProfileLoader from '../../src/features/common/ContentLoaders/UserProfile/UserProfile';
import { UserProfileLoader } from '../../src/features/common/ContentLoaders/UserProfile/UserProfile';
import { useUserProps } from '../../src/features/common/Layout/UserPropsContext';
import { getRequest } from '../../src/utils/apiRequests/api';
import GetPublicUserProfileMeta from '../../src/utils/getMetaTags/GetPublicUserProfileMeta';
import Footer from '../../src/features/common/Layout/Footer';
import Profile from '../../src/features/user/Profile';
import MyTrees from '../../src/features/user/Profile/components/MyTrees/MyTrees';
import ProjectsContainer from '../../src/features/user/Profile/ProjectsContainer';
import Profile from '../../src/features/user/ProfileV2/components/ProfileInfo';
import ProjectsContainer from '../../src/features/user/ProfileV2/components/ProjectDetails/ProjectsContainer';
import { ErrorHandlingContext } from '../../src/features/common/Layout/ErrorHandlingContext';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { GetStaticPaths, GetStaticPropsContext } from 'next';
import { handleError, APIError, UserPublicProfile } from '@planet-sdk/common';
import MyContributions from '../../src/features/user/ProfileV2/components/MyContributions/MyContributions';

function User(): ReactElement {
function SingleUser(): ReactElement {
mohitb35 marked this conversation as resolved.
Show resolved Hide resolved
// External imports
const router = useRouter();
const { user, contextLoaded, token } = useUserProps();
Expand All @@ -21,7 +21,7 @@

// Internal states
const [profile, setProfile] = React.useState<null | UserPublicProfile>(null);
const [authenticatedType, setAuthenticatedType] = React.useState('');

Check notice on line 24 in pages/t/[id].tsx

View check run for this annotation

codefactor.io / CodeFactor

pages/t/[id].tsx#L24

'authenticatedType' is assigned a value but never used. Allowed unused vars must match /^_/u. (@typescript-eslint/no-unused-vars)

Check notice on line 24 in pages/t/[id].tsx

View check run for this annotation

codefactor.io / CodeFactor

pages/t/[id].tsx#L24

'setAuthenticatedType' is assigned a value but never used. Allowed unused vars must match /^_/u. (@typescript-eslint/no-unused-vars)

// Loads the public user profile
async function loadPublicProfile(id: string) {
Expand All @@ -30,7 +30,6 @@
`/app/profiles/${id}`
);
setProfile(profileData);
setAuthenticatedType('public');
} catch (err) {
setErrors(handleError(err as APIError));
redirect('/');
Expand All @@ -51,17 +50,12 @@
}
}
}, [contextLoaded, user, router]);

return profile ? (
<>
<GetPublicUserProfileMeta userprofile={profile} />
<Profile userprofile={profile} authenticatedType={authenticatedType} />
<Profile userProfile={profile} />
{profile && profile.type !== 'tpo' && (
<MyTrees
authenticatedType={authenticatedType}
profile={profile}
token={token}
/>
<MyContributions profile={profile} token={token} />
)}
{profile && profile.type === 'tpo' && (
<ProjectsContainer profile={profile} />
Expand Down Expand Up @@ -112,4 +106,4 @@
};
}

export default User;
export default SingleUser;
17 changes: 17 additions & 0 deletions prisma/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { PrismaClient } from '@prisma/client'

const prismaClientSingleton = () => {
return new PrismaClient()
}

type PrismaClientSingleton = ReturnType<typeof prismaClientSingleton>

const globalForPrisma = globalThis as unknown as {
prisma: PrismaClientSingleton | undefined
}

const prisma = globalForPrisma.prisma ?? prismaClientSingleton()

export default prisma

if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
83 changes: 83 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mysql"
url = env("DB_CONN_URL")
}

model contribution {
id Int @id @default(autoincrement())
guid String? @unique @db.VarChar(32)
purpose String? @db.VarChar(16)
treeCount Decimal? @map("tree_count") @db.Decimal(14, 2)
bouquetDonationId Int? @map("bouquet_donation_id")
quantity Float?
deletedAt DateTime? @map("deleted_at") @db.DateTime(0)
contributionType String @map("contribution_type") @db.VarChar(20)
isVerified Int? @map("is_verified")
paymentStatus String? @map("payment_status") @db.VarChar(20)
plantProjectId Int? @map("plant_project_id")
plantProject project? @relation(fields: [plantProjectId], references: [id], onDelete: NoAction, onUpdate: NoAction)
profile profile? @relation(fields: [profile_id], references: [id])
bouquet contribution? @relation("bouquet", fields: [bouquetDonationId], references: [id])
bouquetContributions contribution[] @relation("bouquet")
plantDate DateTime @map("plant_date") @db.DateTime(0)
profile_id Int?
gift gift[]
giftTo Json? @map("gift_data")
giftMethod String? @map("gift_method") @db.VarChar(20)
tenant tenant? @relation(fields: [tenantId], references: [id]) // Add a one-to-one relation to the tenant model
tenantId Int? @map("tenant_id")
created DateTime @unique @db.DateTime(0)
}

model tenant {
id Int @id @default(autoincrement())
guid String @unique(map: "UNIQ_4E59C4622B6FCFB2") @db.VarChar(32)
name String @db.VarChar(255)
contribution contribution[]
}

model project {
id Int @id @default(autoincrement())
guid String @db.VarChar(32)
name String? @db.VarChar(255)
allowDonations Boolean @map("accept_donations")
description String? @db.LongText
country String? @map("country") @db.VarChar(2)
unit String? @map("unit_type") @db.VarChar(255)
image String? @db.VarChar(255)
purpose String @db.VarChar(64)
location String? @db.LongText
geoLongitude Float? @map("geo_longitude")
geoLatitude Float? @map("geo_latitude")
contribution contribution[]
tpoId Int? @map("tpo_id")
bouquetPurpose String? @map("bouquet_purpose") @db.VarChar(16)
tpo profile? @relation(fields: [tpoId], references: [id])
}

model profile {
id Int @id @default(autoincrement())
guid String @db.VarChar(32)
name String? @db.VarChar(255)
contribution contribution[]
plantProject project[]
gift gift[]
}

model gift {
id Int @id @default(autoincrement())
donationId Int? @map("donation_id")
recipientId Int? @map("recipient_id")
guid String @unique(map: "UNIQ_A47C990D2B6FCFB2") @db.VarChar(32)
metadata Json?
contribution contribution? @relation(fields: [donationId], references: [id], onDelete: Restrict, onUpdate: Restrict, map: "FK_A47C990D4DC1279C")
recipient profile? @relation(fields: [recipientId], references: [id]) // Relation field to profile
created DateTime @db.DateTime(0)
value Int?
purpose String @db.VarChar(32)
type String @db.VarChar(50)
}
Loading