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(ui): prevent renaming integration with active connections #3092

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading