Skip to content

feat: create new organization #4513

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

Merged
merged 20 commits into from
May 26, 2025

Conversation

omBratteng
Copy link
Member

@omBratteng omBratteng commented May 22, 2025

Changes

  • Add new settings page for viewing organizations
  • Updates checkout page to toggle between personal and team (organization) product

API

dailydotdev/daily-api#2828

Jira ticket

AS-1117

Preview domain

https://as-1117-create-new-organisation.preview.app.daily.dev

@omBratteng omBratteng requested a review from Copilot May 22, 2025 09:13
Copy link

vercel bot commented May 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview May 26, 2025 9:41am
1 Skipped Deployment
Name Status Preview Updated (UTC)
storybook ⬜️ Ignored (Inspect) May 26, 2025 9:41am

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a new organization feature that integrates organization-specific checkout flows and UI updates in the payment and Plus subscription flows. Key changes include:

  • Adding new organization-related types, queries, and context fields.
  • Updating Paddle payment and Plus subscription components to support organization (team) checkouts.
  • Enhancing UI components (e.g. PlusInfo, PlusProductToggle, ProfileSettingsMenu) to differentiate between personal and team subscriptions.

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/shared/src/hooks/usePaddlePayment.ts Introduces state for tracking checkout item loading and a new event handler for item updates.
packages/shared/src/graphql/squads.ts Extends role checking to include organization roles.
packages/shared/src/graphql/paddle.ts Adds a new pricing type for organization subscriptions.
packages/shared/src/graphql/organization.ts Adds a new query to fetch organization data.
packages/shared/src/features/organizations/types.ts Defines organization member roles and types.
packages/shared/src/features/organizations/hooks/useOrganizations.ts Implements a hook to query organizations.
packages/shared/src/contexts/payment/context.ts Updates PaymentContext to include organization settings and quantity state.
packages/shared/src/contexts/payment/Paddle.tsx Propagates the new checkoutItemsLoading state to the payment provider.
packages/shared/src/contexts/payment/BasePaymentProvider.tsx Introduces price type state and determines organization mode based on pricing type.
packages/shared/src/components/utilities/common.tsx Modifies getRoleName to accept organization roles.
packages/shared/src/components/profile/ProfileSettingsMenu.tsx Adds an organization menu item to the profile settings.
packages/shared/src/components/plus/* Multiple Plus components have been updated to support organization/team subscriptions (e.g. team size input, updated pricing, feature list).
packages/shared/src/components/image/Image.tsx Adds a fallback image for organizations.
packages/shared/src/components/UserBadge.tsx Updates badge rendering to support organization roles.
packages/shared/src/components/ProfileMenu/sections/AccountSection.tsx Adds an organizations option to the account section.
Comments suppressed due to low confidence (1)

packages/shared/src/components/plus/PlusCheckoutContainer.tsx:38

  • [nitpick] Review the organization checkout logic: returning early when isOrganization is true may bypass expected UI rendering. Confirm that the subsequent logic (e.g. shouldRenderCheckout) is aligned with the intended behavior for organization checkouts.
if (isOrganization) { return null; }

@omBratteng omBratteng marked this pull request as ready for review May 22, 2025 10:19
@omBratteng omBratteng requested a review from a team as a code owner May 22, 2025 10:19
@omBratteng omBratteng requested review from rebelchris, ilasw, capJavert, sshanzel, nensidosari and AmarTrebinjac and removed request for a team May 22, 2025 10:19
Copy link
Member

@sshanzel sshanzel left a comment

Choose a reason for hiding this comment

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

Looks good code-wise, haven't checked the page yet 👀

@@ -19,6 +24,11 @@ export const AccountSection = (): ReactElement => {
href: `${settingsUrl}/subscription`,
icon: CreditCardIcon,
},
{
title: 'Organizations',
href: `${settingsUrl}/organization`,
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it be plural ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Asked product

Copy link
Member Author

Choose a reason for hiding this comment

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

Will change later if they want to

@omBratteng omBratteng force-pushed the AS-1117-create-new-organisation branch from ffd1f39 to df09b96 Compare May 26, 2025 09:20
@omBratteng omBratteng merged commit cca8d97 into feat-organisations-AS-1100 May 26, 2025
4 of 10 checks passed
@omBratteng omBratteng deleted the AS-1117-create-new-organisation branch May 26, 2025 09:22
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