Skip to content
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

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

AMoreaux
Copy link
Contributor

@AMoreaux AMoreaux commented Dec 16, 2024

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.

  • Added checks for Google and Microsoft authentication enablement and used these conditions to display buttons dynamically in both components.
  • Updated SettingsAccountsConnectedAccountsListCard to dynamically enable the footer button based on workspace authentication settings.
  • Revised SettingsAccountsListEmptyStateCard to conditionally render account connection buttons depending on the availability of enabled authentication providers in the current workspace state.

@AMoreaux AMoreaux self-assigned this Dec 16, 2024
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 in SettingsAccountsListEmptyStateCard.tsx to only show Google/Microsoft buttons when respective auth is enabled
  • Added atLeastOneProviderAvailable check in SettingsAccountsConnectedAccountsListCard.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>
Copy link
Contributor

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

Comment on lines +11 to +13
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { useRecoilValue } from 'recoil';
import { isDefined } from '~/utils/isDefined';
Copy link
Contributor

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)

Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

LGTM

@Weiko Weiko merged commit 33b0286 into main Dec 16, 2024
19 checks passed
@Weiko Weiko deleted the fix/hide-google-and-microsoft-account-when-necessary branch December 16, 2024 17:44
Copy link
Contributor

Thanks @AMoreaux for your contribution!
This marks your 27th PR on the repo. You're top 2% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Don't show buttons to connect Google/Microsoft account if it's not enabled
3 participants