Skip to content

Commit

Permalink
[1/2] Affiliate program Integration v1 (podkrepi-bg#1627)
Browse files Browse the repository at this point in the history
* services/apiEndpoints: Change endpoint for registration
Endpoint for registration for individual users is now at /register/individual

* campaigns: Include guaranteed donations in reachedAmount

* donation.enums.ts: Add guaranteed DonationStatus
Match with the values on the backend

* donations: Use companyName when donation is made from corporate profile

* auth/register: Change register request to match latest changes in backend

* [SQUASH]: Donation improvements
src/one-step-donation: Allow for corporate donations
campaigns/InlineDonation: Limit the amount of donations on mobile to three
campaigns/ViewCampaignPage: Push InlineDonation from top, to prevent conflict with the navigation bar on mobile
campaigns/DonorsAndDonations: Handle different type of campaign donors

* one-time-donation/Steps.tsx Add session to donate's dependency array
Donate function needs to be redefined, with person's data in case user logs in on step two of donation flow.
Without this change any information coming from acccount/me response is considered undefined, even if user logs in during the second step, as this information was not available during the definition of donate

* one-time-donation/Steps.tsx: Add person to donation's dependency array
In some cases person remains undefined, even though user is logged in

* Allow  corporate registrations

* i18n: Add translations for new registration flow

* Fix horizontal scroll on smaller viewport width

* campaigns/DonationWishes.tsx: Show wishes from affiliate donations

* pdf/Certificate.tsx: Use companyName if donation is made by corporate profile

* pdf/Certificate: Move companyName condition out of the return statement
Looks a bit cleaner that way

* auth/profile: Changes for corporate profiles
- Person's data is now prefetched to prevent any layout shifts and errors until person's data has been loaded.
- Added new tab to summarize Affiliate's data which includes, as well as to cancel any guaranteed donations

* auth/Register: Fix signin attempt on corporate registration
-Sometimes the signin function is called before isSuccess state is switched to true. Use the response statusCode instead to check if the response is successfull
-Fixed translations on RegisterSuccess

* common/person: Allow for manual profile activation/deactivation
- Added a new column profile type, to separate individual from corporate profiles

* hooks/person: Fix cache not being invalidat on successfull active status response

* pages/admin: Add section to manage Affiliate program

* admin/affiliates: Remove unused import

* profile/AffiliateProgramTab: Fix crash when donation is undefined
In situations where affiliate record doesn't yet exist, donations is undefined, and it causes error

* hooks/affiliate: Invalidate affiliate data  when requesting to join affiliate program

This way there is no need to restart the page

* profile/affiliate: Add button to copy affiliate code
utils/useCopyToClipbaord.ts: Change hook to copy text passed to copyUrl as parameter

* AffiliateProgramTab: Summarize what is affiliate if user has not joined it
-Copybutton is now hidden if no affiliateCode is present

* CampaignDetails.tsx: Show campaign's summary data on page
Includes available amount, guaranteed amount, sent amount, and added expenses

* CampaignDetails.tsx: Remove unnnecessary Box component

* bg/auth: Change text on successfull corporate registration
Co-authored-by: Kalina Zhecheva <[email protected]>

* eslint: Resolve  errors
  • Loading branch information
sashko9807 authored and RalitsaIlieva committed Dec 14, 2023
1 parent 6ee38ae commit e4b8d31
Show file tree
Hide file tree
Showing 52 changed files with 1,678 additions and 241 deletions.
18 changes: 17 additions & 1 deletion public/locales/bg/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
"last-name": "Фамилия",
"phone": "Телефон",
"company": "Компания",
"message": "Съобщение"
"message": "Съобщение",
"company-name": "Име на организацията",
"company-number": "ЕИК/БУЛСТАТ",
"company-representitive-first-name": "Име на представляващо лице",
"company-representitive-last-name": "Фамилия на представляващо лице"
},
"pages": {
"forgotten-password": {
Expand All @@ -45,5 +49,17 @@
"phone": "Телефон",
"company": "Компания",
"message": "Съобщение"
},
"type": {
"individual": "Личен",
"corporate": "Организация"
},
"register": {
"individual": "Регистрация като физическо лице",
"individual-subtitle": "Дарения от този профил, ще се извършват от физическо лице ",
"corporate": "Регистрация като юридическо лице",
"corporate-subtitle": "Дарения от този профил, ще се извършват от името на организацията, която представлявате",
"success": "Регистрацията беше успешна",
"corporate-subtitle-success": "Член от екипа на Podkrepi.bg, ще се свърже с вас с цел финализиране на регистрацията на представляваната от Вас компания в платформата"
}
}
3 changes: 2 additions & 1 deletion public/locales/bg/campaigns.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@
"donations": {
"anonymous": "Анонимен",
"none": "Няма направени дарения",
"lv": "лв."
"lv": "лв.",
"corporate-donor": "Корпоративен дарител"
},
"campaign-status": {
"initial": "В начален етап",
Expand Down
5 changes: 4 additions & 1 deletion public/locales/bg/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
"login-with": "Вход с",
"logout": "Изход",
"register": "Регистрация",
"continue-with": "Продължете с",
"changePassword": "Смяна на парола",
"forgottenPassword": "Забравена парола?",
"go-back": "Назад"
"go-back": "Назад",
"go-back-to-index": "Обратно към начална страница"
},
"meta": {
"title": "Подкрепи.бг"
Expand Down Expand Up @@ -99,6 +101,7 @@
"email": "Имейл"
},
"cta": {
"more-information": "Повече информация",
"read-more": "Прочетете още",
"see-profile": "Вижте профил",
"question": "Имате въпрос?"
Expand Down
31 changes: 30 additions & 1 deletion public/locales/bg/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"header": "Личен профил",
"corporate-header": "Корпоративен профил",
"campaigns": "Подкрепени кампании",
"personalInfo": {
"index": "Лична информация",
Expand All @@ -13,8 +14,14 @@
"noBirthday": "не e наличен",
"delete": "изтриване на акаунт/ профил"
},
"corporateInfo": {
"index": "Корпоративни данни",
"name": "Име на компания",
"number": "БУЛСТАТ/ЕИК"
},
"donations": {
"index": "Дарения",
"donor": "Дарител",
"helpThanks": "благодарим за помощта Ви!",
"donateNow": "Подкрепи сега",
"totalDonations": "Всички дарения",
Expand All @@ -33,6 +40,8 @@
"sort": "Вид",
"cause": "Кауза",
"amount": "Сума",
"cancelDonation": "Откажи дарение",
"cancel": "Откажи",
"certificate": "Сертификат",
"download": "Свалете",
"lv": "лв",
Expand All @@ -43,8 +52,11 @@
"initial": "започнато",
"waiting": "чакащо",
"succeeded": "успешно",

"refund": "възстановено",
"cancelled": "отменено"
"cancelled": "отменено",
"guaranteed": "гарантирано"

}
},
"certificates-history": {
Expand Down Expand Up @@ -113,5 +125,22 @@
"saveAccount": "Запази моя акаунт",
"disableAccount": "Изтрий моя акаунт",
"disabled": "Акаунтът Ви е изтрит."
},
"affiliate": {
"summary": "Включвайки се в партньорската програма на Podkrepi.bg, получавате достъп до наша услуга за Корпоративни дарения, чрез която вашите служители или клиенти, могат да даряват с \"гарантирани\" от компанията ви дарения.",
"index": "Партньорска програма",
"join": "Включете се към програмата",
"data-summary": "Данни по партньорска програма",
"guaranteedDonationsList": "Списък с гарантирани дарения",
"code": "Код",
"status": {
"index": "Статус",
"active": "Активен",
"pending": "В изчакване",
"cancelled": "Отменен",
"rejected": "Отказан"
},
"guaranteedDonations": "Гарантирани дарения(общо)",
"guaranteedAmount": "Гарантирана сума(общо)"
}
}
22 changes: 21 additions & 1 deletion public/locales/en/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
"last-name": "Last name",
"phone": "Phone",
"company": "Company",
"message": "Message"
"message": "Message",
"company-name": "Company Name",
"company-number": "EIK/BULSTAT",
"company-representitive-first-name": "First name of company's representitive",
"company-representitive-last-name": "Last name of company's representitive"
},
"pages": {
"forgotten-password": {
Expand All @@ -44,5 +48,21 @@
"phone": "Phone",
"company": "Company",
"message": "Message"
},
"type": {
"individual": "Personal",
"corporate": "Organization"
},
"registration": {
"success": "Registration successfull",
"corporate-subtitle-success": "Member of Podkrepi.bg, will contact you, to verify the corporation you represent"
},
"register": {
"individual": "Register as individual",
"individual-subtitle": "Donations made by this account, will be done by the individual",
"corporate": "Register as corporation",
"corporate-subtitle": "Donations made by this account, will be done by the represented company",
"success": "Registration successfull",
"corporate-subtitle-success": "Member of Podkrepi.bg, will contact you, in order to finalize the registration of the company you represent"
}
}
3 changes: 2 additions & 1 deletion public/locales/en/campaigns.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@
"donations": {
"anonymous": "Anonymous",
"none": "No donations yet",
"lv": "lv."
"lv": "lv.",
"corporate-donor": "Corporate Donor"
},
"campaign-status": {
"initial": "Initial",
Expand Down
5 changes: 4 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
"login-with": "Login with",
"logout": "Logout",
"register": "Signup",
"continue-with": "Continue with",
"changePassword": "Change your password",
"forgottenPassword": "Forgotten password?",
"go-back": "Go back"
"go-back": "Go back",
"go-back-to-index": "Go back to index page"
},
"meta": {
"title": "Podkrepi.bg"
Expand Down Expand Up @@ -96,6 +98,7 @@
"targetCampaignId": "Target campaign"
},
"cta": {
"more-information": "More information",
"read-more": "Read more",
"see-profile": "See profile",
"question": "Have a question?"
Expand Down
55 changes: 54 additions & 1 deletion public/locales/en/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"header": "Personal profile",
"corporate-header": "Corporate Profile",
"personalInfo": {
"index": "Personal information",
"login": "Login information:",
Expand All @@ -12,8 +13,14 @@
"noBirthday": "not available",
"delete": "delete account/ profile"
},
"corporateInfo": {
"index": "Corporate information",
"name": "Corporate name",
"number": "BULSTAT/EIK"
},
"donations": {
"index": "Donations",
"donor": "Donor",
"helpThanks": "thank you for your help!",
"donateNow": "Donate now",
"totalDonations": "All donations",
Expand All @@ -28,6 +35,8 @@
"type": "Type",
"cause": "Cause",
"amount": "Amount",
"cancelDonation": "Cancel donation",
"cancel": "Cancel",
"certificate": "Certificate",
"download": "Download",
"lv": "lv",
Expand All @@ -36,7 +45,8 @@
"initial": "initial",
"waiting": "waiting",
"succeeded": "succeeded",
"cancelled": "cancelled"
"cancelled": "cancelled",
"guaranteed": "guaranteed"
}
},
"certificates-history": {
Expand All @@ -49,6 +59,33 @@
"noCampaigns": "You are not in organizer, coordinator or beneficiery role in any campaign",
"donatedTo": "Campaigns I donated to"
},
"myNotifications": {
"index": "My notifications",
"status-title": "Notification subscription status",
"status-msg": "Your subscription status is",
"modal": {
"title-subscribe": "Subscribe for receiving notifications from Podkrepi.bg",
"title-unsubscribe": "Unsubscribe for receiving notifications from Podkrepi.bg",
"campaign-title-unsubscribe": "Unsubscribe from receiving notifications from this campaign",
"cta": "Confirm",
"subscribe-msg": "You've successfully subscribed for receiving notifications",
"unsubscribe-msg": "You've successfully unsubscribed for receiving notifications",
"campaign-unsubscribe-msg": "You've successfully unsubscribed from receiving notifications regarding this campaign"
},
"status": {
"active": "Active",
"inactive": "Deactivated"
},
"cta": {
"activate": "Activate",
"deactivate": "Deactivate"
},
"campaign": {
"index": "Campaign notifications",
"noSubscriptions": "Към момента не сте се записали за получаване на известия по конкретни кампании",
"cta": "Unsubscribe"
}
},
"donationsContract": "Donation contract",
"certificates": "Certificates",
"birthdateModal": {
Expand Down Expand Up @@ -78,5 +115,21 @@
"saveAccount": "Save my account",
"disableAccount": "Delete my account",
"disabled": "Your account has been deleted."
},
"affiliate": {
"index": "Affiliate program",
"join": "Join the program",
"data-summary": "Affiliate program summary",
"guaranteedDonationsList": "List of guaranteed donations",
"code": "Code",
"status": {
"index": "Status",
"active": "Active",
"pending": "Pending",
"cancelled": "Cancelled",
"rejected": "Rejected"
},
"guaranteedDonations": "Guaranteed donations(total)",
"guaranteedAmount": "Guaranteed amount(total)"
}
}
Loading

0 comments on commit e4b8d31

Please sign in to comment.