AddProviderDialog -> AddDeployProviderDialog, refactor GitHub OAuth to be less hardcoded

This commit is contained in:
Alex Gleason committed 2026-01-04 12:44:27 -06:00
1 parent e23b5031ee
commit b327607be3
3 files changed
+11 -11

No files matched your search

@@ -28,7 +28,7 @@ interface OAuthHook {
initiateOAuth: () => void;
}
interface AddProviderDialogProps {
interface AddDeployProviderDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
preset: PresetDeployProvider;
@@ -39,7 +39,7 @@ interface AddProviderDialogProps {
onAdd: (apiKey: string, accountId?: string, organizationId?: string) => void;
}
export function AddProviderDialog({
export function AddDeployProviderDialog({
open,
onOpenChange,
preset,
@@ -48,7 +48,7 @@ export function AddProviderDialog({
forceManualEntry,
onSetForceManualEntry,
onAdd,
}: AddProviderDialogProps) {
}: AddDeployProviderDialogProps) {
const { t } = useTranslation();
const [apiKey, setApiKey] = useState('');
const [accountId, setAccountId] = useState('');
+6 -6
View File
@@ -84,8 +84,8 @@ export function AddGitCredentialDialog({
</DialogHeader>
<div className="space-y-4 py-4">
{preset.id === 'github' && isOAuthConfigured && !forceManualEntry ? (
// Special rendering for GitHub OAuth
{isOAuthConfigured && !forceManualEntry ? (
// Show OAuth button if OAuth is configured and not forced to manual
<div className="space-y-3">
<div className="flex gap-0">
<Button
@@ -101,7 +101,7 @@ export function AddGitCredentialDialog({
</>
) : (
<span className="truncate text-ellipsis overflow-hidden">
Connect to GitHub
Connect to {preset.name}
</span>
)}
</Button>
@@ -117,7 +117,7 @@ export function AddGitCredentialDialog({
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => onSetForceManualEntry(true)}>
Enter API key
Enter token manually
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -129,7 +129,7 @@ export function AddGitCredentialDialog({
)}
</div>
) : (
// Standard token input
// Show manual token input
<ExternalInput
type="password"
placeholder={t('enterToken')}
@@ -146,7 +146,7 @@ export function AddGitCredentialDialog({
)}
</div>
{!(preset.id === 'github' && isOAuthConfigured && !forceManualEntry) && (
{!(isOAuthConfigured && !forceManualEntry) && (
<DialogFooter>
<Button variant="outline" onClick={() => onOpenChange(false)}>
{t('cancel')}