-
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
fix(twenty-front): allow to connect available provider only #9080
fix(twenty-front): allow to connect available provider only #9080
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
This PR adds conditional rendering of account connection buttons and footer based on workspace authentication settings to prevent server crashes when Google/Microsoft auth is not properly configured.
- Added
currentWorkspaceState
checks inSettingsAccountsListEmptyStateCard.tsx
to only show Google/Microsoft buttons when respective auth is enabled - Added
atLeastOneProviderAvailable
check inSettingsAccountsConnectedAccountsListCard.tsx
to conditionally render "Add account" footer - Updated setup documentation formatting for Microsoft auth environment variables for better readability
3 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
@@ -38,13 +41,15 @@ export const SettingsAccountsListEmptyStateCard = ({ | |||
<Card> | |||
<StyledHeader>{label || 'No connected account'}</StyledHeader> |
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: Consider adding explanatory text when auth methods are disabled to guide users on setup
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState'; | ||
import { useRecoilValue } from 'recoil'; | ||
import { isDefined } from '~/utils/isDefined'; |
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: consider grouping related imports together (all recoil imports, all utility imports, etc)
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
Thanks @AMoreaux for your contribution! |
Fix #8710
Summary
The Pull Request updates components related to the settings account management feature. The changes ensure the behavior of buttons and the UI dynamically adapts based on the availability of authentication providers retrieved from the current workspace state.
SettingsAccountsConnectedAccountsListCard
to dynamically enable the footer button based on workspace authentication settings.SettingsAccountsListEmptyStateCard
to conditionally render account connection buttons depending on the availability of enabled authentication providers in the current workspace state.