-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Refactor onboarding user vars to be absent when user is fully onboarded #6531
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Refactored onboarding user variables to be absent when the user is fully onboarded and introduced a new workspace activation status.
/packages/twenty-server/src/engine/core-modules/onboarding/onboarding.service.ts
: RefactoredisStepComplete
toisStepIncomplete
and simplified subscription checks usingBillingService
./packages/twenty-server/src/database/commands/upgrade-version/0-23/0-23-backfill-new-onboarding-user-vars.ts
: Simplified logic for fetching workspaces using object spread syntax./packages/twenty-server/src/engine/core-modules/billing/services/billing.service.ts
: IntroducedBillingService
for managing billing-related functionality./packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts
: Enhanced error handling by renaming methods to enforce stricter validation./packages/twenty-server/src/engine/core-modules/billing/stripe/stripe.service.ts
: RefactoredformatProductPrices
method for improved readability and efficiency.
7 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings
!isDefined(currentBillingSubscription) || | ||
currentBillingSubscription?.status === SubscriptionStatus.Incomplete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The logic here seems inverted. Shouldn't it return true if currentBillingSubscription
is defined and its status is not Incomplete
?
!isDefined(currentBillingSubscription) || | |
currentBillingSubscription?.status === SubscriptionStatus.Incomplete | |
return ( | |
isDefined(currentBillingSubscription) && | |
currentBillingSubscription.status !== SubscriptionStatus.Incomplete | |
); |
@@ -24,11 +24,20 @@ export const PrefetchRunQueriesEffect = () => { | |||
prefetchKey: PrefetchKey.AllFavorites, | |||
}); | |||
|
|||
const { objectMetadataItems } = useObjectMetadataItems(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor PrefetchQueries to make sure that they are leveraging operationSignatures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small comments, opening a PR to pass them
}); | ||
} | ||
|
||
async toggleOnboardingCreateProfileCompletion({ | ||
async setOnboardingCreateProfileCompletion({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setOnboardingCreateProfilePending
value: true, | ||
}); | ||
|
||
await this.onboardingService.setOnboardingCreateProfileCompletion({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be called if firstName!=='' && lastName!==''
value: true, | ||
}); | ||
|
||
await this.onboardingService.setOnboardingCreateProfileCompletion({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be called if firstName!=='' && lastName!==''
see comments in #6531 (review) - rename method - add check before setting create profile pending user var
In this PR:
I'm retesting the whole flow: