-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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(workspace, users, billing): remove default workspace + rename #9360
Conversation
Replaced user-based parameterization with workspace-focused logic across seed scripts, mocks, and billing services. Removed redundant `user` references and standardized to `workspace` to align with updated business rules. Adjusted mock data and tests to reflect these changes.
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
This PR refactors the codebase to standardize workspace terminology and remove user-based parameterization in favor of workspace-focused logic.
- Renamed
mockDefaultWorkspace
tomockCurrentWorkspace
across front-end components and tests for consistent terminology - Removed
workspaceId
parameter fromseedUsers
function and updated user deletion logic to use workspace associations - Modified
BillingSubscriptionService
to acceptWorkspace
instead ofUser
parameter inapplyBillingSubscription
method - Updated billing resolver methods to use workspace-focused logic, removing unnecessary user parameters
- Simplified user-workspace relationship handling in database operations by removing direct workspace references
11 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
setCurrentWorkspace(mockCurrentWorkspace); | ||
setCurrentWorkspaceMember(mockedWorkspaceMemberData); | ||
setCurrentUser(mockedUserData); | ||
setSupportChat({ supportDriver: 'front', supportFrontChatId: '1234' }); |
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.
style: setCurrentWorkspace, setCurrentWorkspaceMember, and setCurrentUser are called in a potentially unsafe order. Consider wrapping these state updates in a useEffect to ensure consistent state updates across re-renders
packages/twenty-server/src/engine/core-modules/billing/billing.resolver.ts
Outdated
Show resolved
Hide resolved
Removed UserAuthGuard from the billingPortalSession query to fix improper authorization logic. WorkspaceAuthGuard alone ensures the correct level of access in this context.
Removed the unused workspaceId parameter from the seedUsers function call. This change aligns the function call with its definition and prevents potential issues caused by passing extraneous arguments.
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.
LGTM! (besides red test)
Log
|
Replaced user-based parameterization with workspace-focused logic across seed scripts, mocks, and billing services. Removed redundant
user
references and standardized toworkspace
to align with updated business rules. Adjusted mock data and tests to reflect these changes.Fix #9295