diff --git a/.github/workflows/i18n-pull.yaml b/.github/workflows/i18n-pull.yaml index b45ab4a68..562f9feec 100644 --- a/.github/workflows/i18n-pull.yaml +++ b/.github/workflows/i18n-pull.yaml @@ -104,6 +104,9 @@ jobs: npx nx run twenty-emails:lingui:compile npx nx run twenty-front:lingui:compile + - name: Debug git status + run: git status + - name: Check and commit compiled files id: check_changes run: | diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx index 3192bd281..a02cf68bf 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx @@ -1,3 +1,4 @@ +import { useState } from 'react'; import { IconCalendarEvent, IconDotsVertical, @@ -16,6 +17,7 @@ import { SettingsPath } from '@/types/SettingsPath'; import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown'; import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer'; import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown'; +import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal'; import { useNavigateSettings } from '~/hooks/useNavigateSettings'; type SettingsAccountsRowDropdownMenuProps = { @@ -27,6 +29,9 @@ export const SettingsAccountsRowDropdownMenu = ({ }: SettingsAccountsRowDropdownMenuProps) => { const dropdownId = `settings-account-row-${account.id}`; + const [isDeleteAccountModalOpen, setIsDeleteAccountModalOpen] = + useState(false); + const navigate = useNavigateSettings(); const { closeDropdown } = useDropdown(dropdownId); @@ -35,54 +40,72 @@ export const SettingsAccountsRowDropdownMenu = ({ }); const { triggerApisOAuth } = useTriggerApisOAuth(); + const deleteAccount = async () => { + await destroyOneRecord(account.id); + setIsDeleteAccountModalOpen(false); + }; + return ( - - } - dropdownMenuWidth={160} - dropdownComponents={ - - { - navigate(SettingsPath.AccountsEmails); - closeDropdown(); - }} - /> - { - navigate(SettingsPath.AccountsCalendars); - closeDropdown(); - }} - /> - {account.authFailedAt && ( + <> + + } + dropdownMenuWidth={160} + dropdownComponents={ + { - triggerApisOAuth(account.provider); + navigate(SettingsPath.AccountsEmails); closeDropdown(); }} /> - )} - { - destroyOneRecord(account.id); - closeDropdown(); - }} - /> - - } - /> + { + navigate(SettingsPath.AccountsCalendars); + closeDropdown(); + }} + /> + {account.authFailedAt && ( + { + triggerApisOAuth(account.provider); + closeDropdown(); + }} + /> + )} + { + setIsDeleteAccountModalOpen(true); + closeDropdown(); + }} + /> + + } + /> + All emails and events linked to this account will be deleted + } + onConfirmClick={deleteAccount} + deleteButtonText="Delete account" + /> + ); };