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

Release July 4th #310

Merged
merged 53 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
a07a043
Add null checks
Shreyaschorge Jun 2, 2022
a2fc692
change bouquet project, added more waiting time, click on field befor…
norbertschuler Jun 11, 2022
d9e41a4
set translated description from paymentDetails api
Shreyaschorge Jun 14, 2022
20bdf02
load paymentDetails based on language
Shreyaschorge Jun 14, 2022
ba41fe6
set name of the project from paymentOptions api
Shreyaschorge Jun 14, 2022
aa9e3dd
Changed null check style
Shreyaschorge Jun 14, 2022
fd3e2be
fetch paymentOptions with provided locale
Shreyaschorge Jun 15, 2022
b386a1f
persist locale in url
Shreyaschorge Jun 15, 2022
0961c7e
don't do the browser check for Safari on Android devices
norbertschuler Jun 15, 2022
9adf19d
fix translation auto switching
Shreyaschorge Jun 16, 2022
a80d614
load Profile
Shreyaschorge Jun 16, 2022
96cb906
add and handle redirection to planetCash topup
Shreyaschorge Jun 17, 2022
bb39cc1
Language update from LingoHub 🤖
norbertschuler Jun 17, 2022
f996654
Restrict fetching paymentOptions in getSerserSideProps if to is plane…
Shreyaschorge Jun 20, 2022
901f658
Handle No PlanetCash Account Case
Shreyaschorge Jun 20, 2022
68069d3
Merge pull request #306 from Plant-for-the-Planet-org/feature/fix_bro…
sagararyal Jun 20, 2022
8246f7b
Merge pull request #308 from Plant-for-the-Planet-org/lingohub_langua…
sagararyal Jun 20, 2022
8f21b96
Fix CodeRefactor Issues
Shreyaschorge Jun 21, 2022
7777eba
make planetCash in to case insensitive
Shreyaschorge Jun 21, 2022
0c38def
fix profile check condition
Shreyaschorge Jun 21, 2022
e73b405
Static UI for Create PlanetCash Account
Shreyaschorge Jun 21, 2022
348ab85
Add Select country dropdown in planetCash create account
Shreyaschorge Jun 21, 2022
0fcae57
Integrate PlanetCash create and activate account API
Shreyaschorge Jun 23, 2022
28d207c
Remove CZ from allowedCountries
Shreyaschorge Jun 23, 2022
7c90bb6
fix flashing of PlanetCash signup screen after donation bug
Shreyaschorge Jun 23, 2022
d716653
Integrate updated donation API
Shreyaschorge Jun 24, 2022
aa5a7d1
fix eslint issue
Shreyaschorge Jun 24, 2022
5122d74
Set project details from getServerSideProps
Shreyaschorge Jun 24, 2022
cc9710b
test using some then statements
norbertschuler Jun 26, 2022
3501bae
Merge pull request #303 from Plant-for-the-Planet-org/feature/fix_cyp…
norbertschuler Jun 26, 2022
13b24d6
remove unnecessary null checks
Shreyaschorge Jun 27, 2022
532827f
remove unnecessary null checks
Shreyaschorge Jun 27, 2022
3fe03c9
Replace router with window
Shreyaschorge Jun 27, 2022
d772773
redirect user to login and add null checks
Shreyaschorge Jun 27, 2022
268335c
Update signup message and add link to t&c
Shreyaschorge Jun 27, 2022
a45efa9
Resolve merge conflicts
Shreyaschorge Jun 27, 2022
f97b528
Remove Activate PlanetCash Screen
Shreyaschorge Jun 28, 2022
68c8c0e
Remove redundant code
Shreyaschorge Jun 29, 2022
9df8d40
change variable name
Shreyaschorge Jun 29, 2022
bb868af
Rename onChange to onValueChange
Shreyaschorge Jun 30, 2022
f3ba67e
Merge pull request #299 from Plant-for-the-Planet-org/bugfix/donation…
mariahosfeld Jul 1, 2022
b2fc79a
Merge pull request #305 from Plant-for-the-Planet-org/bugfix/translat…
mariahosfeld Jul 1, 2022
20d8623
Merge pull request #311 from Plant-for-the-Planet-org/main
mariahosfeld Jul 1, 2022
4f9bddc
Language update from LingoHub 🤖
norbertschuler Jul 2, 2022
8b71f93
Merge pull request #312 from Plant-for-the-Planet-org/lingohub_langua…
norbertschuler Jul 2, 2022
6b3e0c8
Resolve merge conflict
Shreyaschorge Jul 4, 2022
d89dc9e
Fix Continue button reload issue
Shreyaschorge Jul 4, 2022
623bda7
Restrict loading anything with pcash_*
Shreyaschorge Jul 4, 2022
c586df1
Merge pull request #307 from Plant-for-the-Planet-org/feat/planetCash…
mariahosfeld Jul 5, 2022
4d21f2a
Fix showing blank screen after successful donation redirect
Shreyaschorge Jul 5, 2022
26e26e9
Merge pull request #316 from Plant-for-the-Planet-org/bugfix/blank-sc…
mariahosfeld Jul 5, 2022
7225e5a
Language update from LingoHub 🤖
norbertschuler Jul 7, 2022
dc56de1
Merge pull request #318 from Plant-for-the-Planet-org/lingohub_langua…
norbertschuler Jul 7, 2022
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
3 changes: 2 additions & 1 deletion cypress/integration/bouquetDonations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ describe("Bouquet Donations", () => {

it("Testing Restore bouquetDonation", () => {
// cy.bouquetDonation("proj_bAwk5Agpfj1xcG61tFXMqKbu", "Germany{enter}", "de", "ten_1e5WejOp")
cy.bouquetDonation("proj_6x3GTD5cMRv0OeQAiIlJZ0Au", "United States of America{enter}", "us", "ten_1e5WejOp")
// cy.bouquetDonation("proj_6x3GTD5cMRv0OeQAiIlJZ0Au", "United States of America{enter}", "us", "ten_1e5WejOp")
cy.bouquetDonation("proj_lZIhXOL00Pw4cRUMIlnDGPaQ", "United States of America{enter}", "us", "ten_NxJq55pm")
cy.cardPayment("4242424242424242", "424", "242")
});
})
32 changes: 19 additions & 13 deletions cypress/integration/formError.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("Form Error Tests", () => {
cy.get('[data-test-id="test-country"]').clear().type("Germany{enter}").get('body').click(0,0)
cy.get('[data-test-id="test-continueToPayment"]').click()
cy.get('.form-errors').should("have.text", "First Name is required")
cy.get('[data-test-id="test-firstName"]').type("Peter")
cy.get('[data-test-id="test-firstName"]').click().type("Peter")
cy.get('body').should("not.have.text", "First Name is required")
})

Expand All @@ -31,7 +31,7 @@ describe("Form Error Tests", () => {
cy.get('[data-test-id="test-country"]').clear().type("Germany{enter}").get('body').click(0,0)
cy.get('[data-test-id="test-continueToPayment"]').click()
cy.get('.form-errors').should("have.text", "Last Name is required")
cy.get('[data-test-id="test-lastName"]').type("Payer")
cy.get('[data-test-id="test-lastName"]').click().type("Payer")
cy.get('body').should("not.have.text", "Last Name is required")
})

Expand Down Expand Up @@ -69,7 +69,7 @@ describe("Form Error Tests", () => {
cy.get('[data-test-id="test-country"]').clear().type("Germany{enter}").get('body').click(0, 0)
cy.get('[data-test-id="test-continueToPayment"]').click()
cy.get('.form-errors').should("have.text", "Address is required")
cy.get('[data-test-id="test-address"]').type("Unbekannt 1")
cy.get('[data-test-id="test-address"]').clear().type("Unbekannt 1")
cy.get('body').should("not.have.text", "Address is required")
})

Expand All @@ -83,11 +83,14 @@ describe("Form Error Tests", () => {
cy.get('[data-test-id="test-address"]').type("Unbekannt 1");
cy.get('[data-test-id="test-city"]').clear()
cy.get('[data-test-id="test-zipCode"]').clear().type("82449")
cy.get('[data-test-id="test-country"]').clear().type("Germany{enter}").get('body').click(0, 0)
cy.get('[data-test-id="test-continueToPayment"]').click()
cy.get('.form-errors').should("have.text", "City is required")
cy.get('[data-test-id="test-city"]').type("Uffing am Staffelsee")
cy.get('body').should("not.have.text", "City is required")
cy.get('[data-test-id="test-country"]').clear().type("Germany{enter}").get('body').click(0, 0).then(() => {
cy.get('[data-test-id="test-continueDisabled"]').click().then(() => {
cy.get('.form-errors').should("have.text", "City is required")
cy.get('[data-test-id="test-city"]').click().type("Uffing am Staffelsee").then(() => {
cy.get('body').should("not.have.text", "City is required")
})
})
})
})

it("ZipCode error", () => {
Expand All @@ -104,10 +107,13 @@ describe("Form Error Tests", () => {
cy.get('[data-test-id="test-address"]').type("Unbekannt 1");
cy.get('[data-test-id="test-city"]').clear().type("Uffing am Staffelsee")
cy.get('[data-test-id="test-zipCode"]').clear()
cy.get('[data-test-id="test-country"]').clear().type(`${selectedCountry}{enter}`).get('body').click(0, 0)
cy.get('[data-test-id="test-continueToPayment"]').click()
cy.get('.form-errors').should("have.text", "ZipCode is invalid")
cy.get('[data-test-id="test-zipCode"]').type(new RandExp(fiteredCountry[0].postal).gen())
cy.get('body').should("not.have.text", "ZipCode is invalid")
cy.get('[data-test-id="test-country"]').clear().type(`${selectedCountry}{enter}`).get('body').click(0, 0).then (() => {
cy.get('[data-test-id="test-continueDisabled"]').click().then(() => {
cy.get('.form-errors').should("have.text", "ZipCode is invalid")
cy.get('[data-test-id="test-zipCode"]').click().type(new RandExp(fiteredCountry[0].postal).gen()).then(() => {
cy.get('body').should("not.have.text", "ZipCode is invalid")
})
})
})
})
})
15 changes: 9 additions & 6 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,15 @@ Cypress.Commands.add('bankTransfer', () => {
cy.wait(5000)
// cy.get('.frequency-selection-option').eq(0).should("have.text", "Once").click()
cy.contactForm("Peter", "Payer", "[email protected]", "Unbekannt 1", "Uffing am Staffelsee", "Germany{enter}", "82449")
cy.wait(10000)
cy.get('[data-test-id="bankTransfer"]').click()
cy.get('[data-test-id="bankDonateContinue"]').click()
cy.wait(10000)
cy.get('[data-test-id="test-thankYou"]').should("exist")

cy.wait(15000).then(() => {
cy.get('[data-test-id="bankTransfer"]').click().then(() => {
cy.get('[data-test-id="bankDonateContinue"]').click().then(() => {
cy.wait(15000).then(() => {
cy.get('[data-test-id="test-thankYou"]').should("exist")
})
})
})
})
})


Expand Down
63 changes: 33 additions & 30 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import { setCountryCode } from "src/Utils/setCountryCode";
import { DONATE } from "src/Utils/donationStepConstants";

interface Props {
projectDetails: Object;
projectDetails?: Object;
donationStep: any;
giftDetails: Object;
isGift: boolean;
resolvedUrl: any;
resolvedUrl?: any;
isDirectDonation: boolean;
hideTaxDeduction: boolean;
isTaxDeductible: boolean;
Expand All @@ -28,7 +28,7 @@ interface Props {
allowTaxDeductionChange: boolean;
currency: any;
paymentSetup: any;
treecount: any;
treecount?: any;
amount: any;
meta: { title: string; description: string; image: string; url: string };
frequency: string;
Expand All @@ -38,11 +38,9 @@ interface Props {
}

function index({
projectDetails,
donationStep,
giftDetails,
isGift,
resolvedUrl,
isDirectDonation,
hideTaxDeduction,
isTaxDeductible,
Expand All @@ -53,16 +51,15 @@ function index({
allowTaxDeductionChange,
currency,
paymentSetup,
treecount,
amount,
meta,
frequency,
tenant,
callbackUrl,
callbackMethod,
projectDetails,
}: Props): ReactElement {
const {
setprojectDetails,
setdonationStep,
loadselectedProjects,
setgiftDetails,
Expand All @@ -82,6 +79,7 @@ function index({
settenant,
setcallbackUrl,
setCallbackMethod,
setprojectDetails,
} = React.useContext(QueryParamContext);

const router = useRouter();
Expand Down Expand Up @@ -116,6 +114,8 @@ function index({
}, []);

// If project details are present set project details
// This will be set from getServerSideProps.

React.useEffect(() => {
if (projectDetails) {
setprojectDetails(projectDetails);
Expand Down Expand Up @@ -250,30 +250,33 @@ export async function getServerSideProps(context: any) {
) {
const to = context.query?.to?.replace(/\//g, "") || "";
donationStep = 1;
try {
const requestParams = {
url: `/app/paymentOptions/${to}?country=${country}`,
setshowErrorCard,
tenant,
};
const paymentOptionsResponse = await apiRequest(requestParams);
if (paymentOptionsResponse.data) {
projectDetails = {
id: paymentOptionsResponse.data.id,
name: paymentOptionsResponse.data.name,
description: paymentOptionsResponse.data.description,
purpose: paymentOptionsResponse.data.purpose,
ownerName: paymentOptionsResponse.data.ownerName,
taxDeductionCountries:
paymentOptionsResponse.data.taxDeductionCountries,
projectImage: paymentOptionsResponse.data.image,
ownerAvatar: paymentOptionsResponse.data.ownerAvatar,
if (to !== "planetCash") {
try {
const requestParams = {
url: `/app/paymentOptions/${to}?country=${country}`,
setshowErrorCard,
tenant,
locale,
};
donationStep = 1;
const paymentOptionsResponse = await apiRequest(requestParams);
if (paymentOptionsResponse.data) {
projectDetails = {
id: paymentOptionsResponse.data.id,
name: paymentOptionsResponse.data.name,
description: paymentOptionsResponse.data.description,
purpose: paymentOptionsResponse.data.purpose,
ownerName: paymentOptionsResponse.data.ownerName,
taxDeductionCountries:
paymentOptionsResponse.data.taxDeductionCountries,
projectImage: paymentOptionsResponse.data.image,
ownerAvatar: paymentOptionsResponse.data.ownerAvatar,
};
donationStep = 1;
}
} catch (err) {
donationStep = 0;
console.log("err", err);
}
} catch (err) {
donationStep = 0;
console.log("err", err);
}
} else {
if (!context.query.context) {
Expand Down Expand Up @@ -321,7 +324,7 @@ export async function getServerSideProps(context: any) {
// This will fetch the payment options
try {
const requestParams = {
url: `/app/paymentOptions/${donation.data.project.id}?country=${country}`,
url: `/app/paymentOptions/${donation.data.destination.id}?country=${country}`,
setshowErrorCard,
tenant,
locale,
Expand Down
2 changes: 1 addition & 1 deletion public/locales/cs/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"contact": "Kontakt",
"faqs": "FAQ",
"selectLanguage": "Zvolit jazyk",
"trees": "stromy",
"trees": "stromy",
"logout": "Odhlásit se",
"directGiftRecipient": "Tento dar podporuje Les od {{name}}",
"saveGiftDetails": "Uloži darovací údaje",
Expand Down
11 changes: 9 additions & 2 deletions public/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"expDate": "Gültigkeitsdatum (MM/JJJJ)",
"donate": "Spenden",
"noPaymentMethodError": "Deine Zahlung konnte nicht verarbeitet werden, bitte versuche es erneut.",
"sofortDisclaimer": "SOFORT Zahlungen dauern in der Regel 1-3 Werktage. Sobald wir den Zahlungseingang verbucht haben, vervollständigen wir die Spende und schicken wir dir eine Bestätigungs-Mail.",
"sofortDisclaimer": "SOFORT Zahlungen dauern in der Regel 1-3 Werktage. Sobald wir den Zahlungseingang verbucht haben, vervollständigen wir die Spende und schicken dir eine Bestätigungs-Mail.",
"payWithSofort": "Spende mit SOFORT",
"payWithGiroPay": "Spende mit GiroPay",
"sepaDisclaimer": "SEPA-Bankeinzüge dauern in der Regel 1-4 Werktage. Sobald der Zahlungseingang verarbeitet wurde, vervollständigen wir die Spende und schicken wir dir eine Bestätigungs-E-Mail.",
Expand Down Expand Up @@ -167,5 +167,12 @@
"fundsPurpose": "Spende",
"bouquetPurpose": "Spende",
"conservationPurpose": "Naturschutzspende",
"planet-cashPurpose": "PlanetCash-Spende"
"planet-cashPurpose": "PlanetCash-Spende",
"pfpSupportsUNEP": "Plant-for-the-Planet unterstützt das Umweltprogramm der Vereinten Nationen",
"noPlanetCashAccount": "Du hast noch kein PlanetCash-Konto, kannst dich aber unten für eines anmelden",
"planetCashSignup": "Anmeldung für PlanetCash",
"planetCashTC": "Indem ich auf \"PlanetCash-Konto erstellen\" klicke, erkläre ich mich mit den <0>Allgemeinen Geschäftsbedingungen</0> der Plant-for-the-Planet-Plattform und von PlanetCash einverstanden.",
"planetCashIUnderstand": "Ich verstehe, dass PlanetCash Spenden/Zahlungen nicht zurückerstattet werden können, und dass nicht zugewiesene Zahlungen nach sechs Monaten automatisch Projekten auf der Plattform zugewiesen werden.",
"createPlanetCashAccount": "PlanetCash Konto erstellen",
"myContributionIsPartOfThat": "Und meine Spende ist Teil davon."
}
8 changes: 7 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,11 @@
"bouquetPurpose": "donation",
"conservationPurpose": "conservation donation",
"planet-cashPurpose": "PlanetCash donation",
"pfpSupportsUNEP": "Plant-for-the-Planet Supports the United Nations Environment Program"
"pfpSupportsUNEP": "Plant-for-the-Planet Supports the United Nations Environment Program",
"noPlanetCashAccount": "You do not have a PlanetCash account, however you can signup for one below",
"planetCashSignup": "Sign Up for PlanetCash",
"planetCashTC": "By clicking \"Create PlanetCash Account\", I agree to the <0>Terms and Conditions</0> of Plant-for-the-Planet Platform, and PlanetCash.",
"planetCashIUnderstand": "I understand that PlanetCash donation/payments are non-refundable, and unallocated payments will be auto allocated to projects on the Platform after six months of Payment.",
"createPlanetCashAccount": "Create PlanetCash Account",
"myContributionIsPartOfThat": "And my contribution is a part of that."
}
Loading