Skip to content

Commit

Permalink
fix(ui): prevent renaming integration with active connections
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Dec 2, 2024
1 parent db7f268 commit 7b92f54
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CopyButton } from '../../../../../components/ui/button/CopyButton';
import SecretInput from '../../../../../components/ui/input/SecretInput';
import type { EnvironmentAndAccount } from '@nangohq/server';
import { Info } from '../../../../../components/Info';
import { SimpleTooltip } from '../../../../../components/SimpleTooltip';

const FIELD_DISPLAY_NAMES: Record<string, Record<string, string>> = {
OAUTH1: {
Expand Down Expand Up @@ -139,9 +140,13 @@ export const SettingsGeneral: React.FC<{
) : (
<div className="flex items-center text-white text-sm">
<div className="mr-2">{integration.unique_key}</div>
<Button variant={'icon'} onClick={() => setShowEditIntegrationId(true)} size={'xs'}>
<Pencil1Icon />
</Button>
<SimpleTooltip
tooltipContent={meta.connectionsCount > 0 ? "You can't change an integration id when you have active connections" : ''}
>
<Button variant={'icon'} onClick={() => setShowEditIntegrationId(true)} size={'xs'} disabled={meta.connectionsCount > 0}>
<Pencil1Icon />
</Button>
</SimpleTooltip>
</div>
)}
</InfoBloc>
Expand Down

0 comments on commit 7b92f54

Please sign in to comment.