-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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(): add IS_MULTIWORKSPACE_ENABLE flag #8656
base: main
Are you sure you want to change the base?
Conversation
Replaced the 'IS_SIGN_UP_DISABLED' flag with 'IS_MULTIWORKSPACE_ENABLED' to control workspace creation. This change allows for conditional workspace setup based on the new environment variable. Also updated related service, resolver, and entity files.
Updated the IS_MULTIWORKSPACE_ENABLED setting description to indicate support for multiple workspaces. This update clarifies that a web server capable of managing subdomain wildcards is required.
Updated the .env.example file to replace the IS_SIGN_UP_DISABLED variable with IS_MULTIWORKSPACE_ENABLED. Removed the IS_SIGN_UP_DISABLED property from environment-variables.ts as it is no longer needed.
…nabled Removed isSignUpDisabledState and associated references, and replaced them with isMultiworkspaceEnabledState. Updated GraphQL queries and related components to reflect this change, and ensured multi-workspace functionality is enabled where applicable.
Corrected the casing of the `isMultiWorkspaceEnabled` variable in the NavigationDrawerHeader component. This ensures consistent naming conventions and avoids potential bugs related to variable misnaming.
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 introduces multi-workspace functionality by replacing the sign-up disabled flag with a multi-workspace enabled flag across the application.
- Inconsistent casing in state key naming (
isMultiworkspaceEnabled
vsisMultiWorkspaceEnabled
) in/packages/twenty-front/src/modules/client-config/states/isMultiWorkspaceEnabledState.ts
- Default value mismatch between frontend (true) and server (false) for
isMultiWorkspaceEnabled
could cause inconsistent behavior - Removal of
signUpDisabled
state without clear alternative mechanism needs review for impact on user registration flows - Added note in documentation about wildcard subdomain requirement for multi-workspace feature
- Server-side logic in
sign-in-up.service.ts
now blocks creation of additional workspaces when multi-workspace is disabled
12 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-front/src/modules/client-config/components/ClientConfigProviderEffect.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/client-config/states/isMultiWorkspaceEnabledState.ts
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/client-config/states/isMultiWorkspaceEnabledState.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
Show resolved
Hide resolved
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, one comment about default value
packages/twenty-server/src/engine/core-modules/environment/environment-variables.ts
Show resolved
Hide resolved
Corrected the typo from isMultiworkspaceEnabled to isMultiWorkspaceEnabled. This change affects multiple files to ensure consistency across the codebase, including GraphQL queries, state management, and server configurations.
|
AuthExceptionCode.FORBIDDEN_EXCEPTION, | ||
); | ||
if (!this.environmentService.get('IS_MULTIWORKSPACE_ENABLED')) { | ||
const numberOfWorkspaces = await this.workspaceRepository.count(); |
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.
workspacesCount
Summary
Add support for multi-workspace feature and adjust configurations and states accordingly.