Skip to content

[PB-5984]: integrate Cello referral program with refer-and-earn UI#1887

Open
terrerox wants to merge 3 commits intomasterfrom
feature/cello-referral
Open

[PB-5984]: integrate Cello referral program with refer-and-earn UI#1887
terrerox wants to merge 3 commits intomasterfrom
feature/cello-referral

Conversation

@terrerox
Copy link
Contributor

Description

Add referral service powered by Cello SDK for refer-a-friend functionality. Include referral panel triggers in the navbar and account popover, capture UCC tracking codes during checkout, and pass referral metadata when creating customers. Add i18n translations for all 8 supported languages.

Related Issues

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

Additional Notes

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 13, 2026

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 96137c5
Status: ✅  Deploy successful!
Preview URL: https://df7c1b68.drive-web.pages.dev
Branch Preview URL: https://feature-cello-referral.drive-web.pages.dev

View logs

@terrerox terrerox self-assigned this Mar 13, 2026
@terrerox
Copy link
Contributor Author

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: f1150a8
Status: 🚫  Build failed.
View logs

Need to merge this one internxt/sdk#374 to solve it

@terrerox
Copy link
Contributor Author

Quality Gate Failed Quality Gate failed

Failed conditions 0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Tests will be added in another PR


declare global {
interface Window {
cello?: {
Copy link
Contributor

Choose a reason for hiding this comment

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

@terrerox terrerox requested a review from larryrider March 15, 2026 21:23
Add referral service powered by Cello SDK for refer-a-friend functionality. Include referral panel triggers in the navbar and account popover, capture UCC tracking codes during checkout, and pass referral metadata when creating customers. Add i18n translations for all 8 supported languages.
  Consolidate Window augmentations (cello, Cello, CelloAttribution) and
  ReferralBootOptions into the shared type declaration file instead of
  using declare global in the referral service.
@terrerox terrerox force-pushed the feature/cello-referral branch from 36c9850 to bf60349 Compare March 16, 2026 13:19
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

"desktop": "Desktop"
"desktop": "Desktop",
"referralBanner": {
"message": "Remember! Earn up to €1,000 by refering a friend",
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo: refering -> referring

"trash": "Papierkorb",
"desktop": "Desktop"
"desktop": "Desktop",
"referralBanner": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do these texts go in the side menu section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

impactApiUrl: 'REACT_APP_IMPACT_API',
dontRedirect: 'REACT_APP_DONT_REDIRECT',
celloProductId: 'REACT_APP_CELLO_PRODUCT_ID',
celloAssetsUrl: 'REACT_APP_CELLO_ASSETS_URL',
Copy link
Collaborator

Choose a reason for hiding this comment

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

have someone added this env vars to Cloudflare?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

token: string,
productId: string,
language?: string,
): ReferralBootOptions => ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

where is this type ReferralBootOptions?

Copy link
Contributor Author

@terrerox terrerox Mar 17, 2026

Choose a reason for hiding this comment

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

in src/react-app-env.d.ts

return uccFromUrl;
}

return localStorageService.get(UCC_STORAGE_KEY) ?? null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Whiy if it’s supposed to capture it from the URL, and as a fallback returns the one from storage if it’s not in the URL, isn’t that a bit odd? I might remove it


const customerToken = await generateCaptchaToken();
const ucc = referralService.getStoredUcc();
const currentUser = store.getState().user.user;
Copy link
Collaborator

Choose a reason for hiding this comment

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

store.getState() is generally an anti-pattern in component code since it bypasses React's reactivity because if user changes, this won't re-render. Can use useAppSelector((state) => state.user.user) at the component level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants