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: Customer Portal v2 #1784

Merged
merged 64 commits into from
Oct 14, 2024
Merged

feat: Customer Portal v2 #1784

merged 64 commits into from
Oct 14, 2024

Conversation

stephenlago99
Copy link
Collaborator

@stephenlago99 stephenlago99 commented Oct 2, 2024

Context

This pull request contains the new version of the Customer Portal.

Goals for the new version of the Customer Portal:

  • Make it accessible to everyone (goal solved in another PR that was already merged)
  • Expose subscription and usage data (UsagePage, UsageSection)
  • Expose customer information and edit customer information (Customer information section already existed, so it was only polished and a page with a form was created)
  • Expose wallet information and top-up workflow (WalletPage, WalletSection)

It also includes fixes after the first round of QA testing (commits starting with LAGO-).

Description

Since this implementation required a refactoring of the existing CustomerPortal, this couldn't be split in multiple merge requests. There are new components that are used in multiple places, and separating it would have made the development process harder.

New components

Since the old Customer portal was missing some sections, some new components were developed for this:

  • Wallet section / Wallet page
  • Usage section / Usage page
  • Customer information page (for editing the customer information)

To aid code share between them, some helper components were also created:

  • PageTitle
  • SectionContainer
  • SectionError
  • SectionLoading
  • SectionTitle
  • TextButton

The design also facilitated the creation of reusable components, since design bits were re-used between sections and pages.

Refactoring of existing components

SearchInput

A new className param was added to aid tailwind styling.

Subscription usage table / graph

src/components/subscriptions/SubscriptionCurrentUsageTable.tsx

src/components/subscriptions/SubscriptionUsageLifetimeGraph.tsx

Since the Usage part required us to display the usage table / graph, the existing components were refactored and de-coupled from the graphql queries.

New routes

The Customer Portal now includes a way to navigate between pages (in the previous implementation, we didn't have separate pages).

Besides the existing CUSTOMER_PORTAL_ROUTE, some new routes were added:

For general pages:

export const CUSTOMER_PORTAL_ROUTE_PAGE = '/customer-portal/:token/:page'

For pages with items (like the usage section):

export const CUSTOMER_PORTAL_ROUTE_PAGE_ITEMID = '/customer-portal/:token/:page/:itemId'

@stephenlago99 stephenlago99 force-pushed the feat-customer-portal-v2 branch 3 times, most recently from c93bcde to d4ecf06 Compare October 8, 2024 11:03
@stephenlago99 stephenlago99 self-assigned this Oct 8, 2024
@stephenlago99 stephenlago99 force-pushed the feat-customer-portal-v2 branch 3 times, most recently from 09457da to 257fd6d Compare October 10, 2024 10:10
@stephenlago99 stephenlago99 changed the title Customer Portal v2 feat: Customer Portal v2 Oct 11, 2024
Copy link
Collaborator

@ansmonjol ansmonjol left a comment

Choose a reason for hiding this comment

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

Thank for handling all our comments! 🙌

Copy link
Collaborator

@keellyp keellyp left a comment

Choose a reason for hiding this comment

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

LGTM so far! Huge PR congrats for the work!

@stephenlago99 stephenlago99 merged commit 532b564 into main Oct 14, 2024
6 checks passed
@stephenlago99 stephenlago99 deleted the feat-customer-portal-v2 branch October 14, 2024 15:10
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