Skip to content

Commit 03e2350

Browse files
committed
fixes
1 parent 1c05d16 commit 03e2350

File tree

5 files changed

+61
-5
lines changed

5 files changed

+61
-5
lines changed

components/settings/integration-form-dialog.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ function SecretField({
103103
</div>
104104
<Button
105105
onClick={() => setIsEditing(true)}
106-
size="sm"
107106
type="button"
108107
variant="outline"
109108
>

components/settings/integrations-dialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export function IntegrationsDialog({
8686
) : (
8787
<div className="mt-4">
8888
<IntegrationsManager
89+
onCreateDialogClose={() => setShowCreateDialog(false)}
8990
onIntegrationChange={handleIntegrationChange}
9091
showCreateDialog={showCreateDialog}
9192
/>

components/settings/integrations-manager.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ const SYSTEM_INTEGRATION_LABELS: Record<string, string> = {
2727

2828
type IntegrationsManagerProps = {
2929
showCreateDialog: boolean;
30+
onCreateDialogClose?: () => void;
3031
onIntegrationChange?: () => void;
3132
};
3233

3334
export function IntegrationsManager({
3435
showCreateDialog: externalShowCreateDialog,
36+
onCreateDialogClose,
3537
onIntegrationChange,
3638
}: IntegrationsManagerProps) {
3739
const [integrations, setIntegrations] = useState<Integration[]>([]);
@@ -121,6 +123,7 @@ export function IntegrationsManager({
121123
const handleDialogClose = () => {
122124
setShowCreateDialog(false);
123125
setEditingIntegration(null);
126+
onCreateDialogClose?.();
124127
};
125128

126129
const handleDialogSuccess = async () => {

components/ui/integration-selector.tsx

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,58 @@ export function IntegrationSelector({
147147
);
148148
}
149149

150-
// Show radio-style selection list
150+
// Single integration - show as outlined field (not radio-style)
151+
if (integrations.length === 1) {
152+
const integration = integrations[0];
153+
const displayName = integration.name || `${integrationLabel} API Key`;
154+
const isSelected = value === integration.id;
155+
156+
// Auto-select if not already selected
157+
if (!isSelected && !disabled) {
158+
onChange(integration.id);
159+
}
160+
161+
return (
162+
<>
163+
<div
164+
className={cn(
165+
"flex h-9 w-full items-center gap-2 rounded-md border px-3 text-sm",
166+
disabled && "cursor-not-allowed opacity-50"
167+
)}
168+
>
169+
<Check className="size-4 shrink-0 text-green-600" />
170+
<span className="flex-1 truncate">{displayName}</span>
171+
<Button
172+
className="size-6 shrink-0"
173+
disabled={disabled}
174+
onClick={() => setEditingIntegration(integration)}
175+
size="icon"
176+
variant="ghost"
177+
>
178+
<Pencil className="size-3" />
179+
</Button>
180+
</div>
181+
182+
{editingIntegration && (
183+
<IntegrationFormDialog
184+
integration={editingIntegration}
185+
mode="edit"
186+
onClose={() => setEditingIntegration(null)}
187+
onDelete={async () => {
188+
await loadIntegrations(true);
189+
setEditingIntegration(null);
190+
integrationsVersion.current += 1;
191+
setIntegrationsVersion((v) => v + 1);
192+
}}
193+
onSuccess={handleEditSuccess}
194+
open
195+
/>
196+
)}
197+
</>
198+
);
199+
}
200+
201+
// Multiple integrations - show radio-style selection list
151202
return (
152203
<>
153204
<div className="flex flex-col gap-1">
@@ -158,7 +209,7 @@ export function IntegrationSelector({
158209
return (
159210
<div
160211
className={cn(
161-
"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors",
212+
"flex w-full items-center gap-2 rounded-md px-[13px] py-1.5 text-sm transition-colors",
162213
isSelected
163214
? "bg-primary/10 text-primary"
164215
: "hover:bg-muted/50",

components/workflow/config/action-config.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
Select,
1111
SelectContent,
1212
SelectItem,
13+
SelectSeparator,
1314
SelectTrigger,
1415
SelectValue,
1516
} from "@/components/ui/select";
@@ -339,7 +340,7 @@ export function ActionConfig({
339340
<div className="grid grid-cols-2 gap-2">
340341
<div className="space-y-2">
341342
<Label className="ml-1" htmlFor="actionCategory">
342-
Category
343+
Service
343344
</Label>
344345
<Select
345346
disabled={disabled}
@@ -356,6 +357,7 @@ export function ActionConfig({
356357
<span>System</span>
357358
</div>
358359
</SelectItem>
360+
<SelectSeparator />
359361
{integrations.map((integration) => (
360362
<SelectItem key={integration.type} value={integration.label}>
361363
<div className="flex items-center gap-2">
@@ -405,7 +407,7 @@ export function ActionConfig({
405407
<HelpCircle className="size-3.5 text-muted-foreground" />
406408
</TooltipTrigger>
407409
<TooltipContent>
408-
<p>Required for this step to run</p>
410+
<p>API key or OAuth credentials for this service</p>
409411
</TooltipContent>
410412
</Tooltip>
411413
</TooltipProvider>

0 commit comments

Comments
 (0)