mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-22 18:27:12 +00:00
cold
This commit is contained in:
@@ -186,7 +186,11 @@ export default function WorkflowDetailContent({ id }: { id: string }) {
|
|||||||
edges,
|
edges,
|
||||||
variables: workflow?.variables || {},
|
variables: workflow?.variables || {},
|
||||||
settings: workflow?.settings || {},
|
settings: workflow?.settings || {},
|
||||||
version: '1.0',
|
// Keep the exported version aligned with the (published) workflow version
|
||||||
|
// instead of a hard-coded placeholder.
|
||||||
|
version: workflow?.version ?? 1,
|
||||||
|
createdAt: workflow?.created_at,
|
||||||
|
updatedAt: workflow?.updated_at,
|
||||||
exportedAt: new Date().toISOString(),
|
exportedAt: new Date().toISOString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { Button } from '@/components/ui/button';
|
|||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { Textarea } from '@/components/ui/textarea';
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
import { Switch } from '@/components/ui/switch';
|
|
||||||
import { Workflow } from '@/app/infra/entities/api';
|
import { Workflow } from '@/app/infra/entities/api';
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
@@ -42,7 +41,6 @@ export default function WorkflowFormComponent({
|
|||||||
const [name, setName] = useState(workflow?.name || '');
|
const [name, setName] = useState(workflow?.name || '');
|
||||||
const [description, setDescription] = useState(workflow?.description || '');
|
const [description, setDescription] = useState(workflow?.description || '');
|
||||||
const [emoji, setEmoji] = useState(workflow?.emoji || '🔄');
|
const [emoji, setEmoji] = useState(workflow?.emoji || '🔄');
|
||||||
const [isEnabled, setIsEnabled] = useState(workflow?.is_enabled ?? true);
|
|
||||||
const isSyncingFromProp = useRef(false);
|
const isSyncingFromProp = useRef(false);
|
||||||
|
|
||||||
// Sync with workflow prop
|
// Sync with workflow prop
|
||||||
@@ -52,7 +50,6 @@ export default function WorkflowFormComponent({
|
|||||||
setName(workflow.name || '');
|
setName(workflow.name || '');
|
||||||
setDescription(workflow.description || '');
|
setDescription(workflow.description || '');
|
||||||
setEmoji(workflow.emoji || '🔄');
|
setEmoji(workflow.emoji || '🔄');
|
||||||
setIsEnabled(workflow.is_enabled ?? true);
|
|
||||||
}
|
}
|
||||||
}, [workflow?.uuid, workflow?.version]);
|
}, [workflow?.uuid, workflow?.version]);
|
||||||
|
|
||||||
@@ -68,10 +65,11 @@ export default function WorkflowFormComponent({
|
|||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
emoji,
|
emoji,
|
||||||
is_enabled: isEnabled,
|
// Workflows are always enabled; the toggle was removed as redundant.
|
||||||
|
is_enabled: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [name, description, emoji, isEnabled]);
|
}, [name, description, emoji]);
|
||||||
|
|
||||||
if (!workflow) {
|
if (!workflow) {
|
||||||
return (
|
return (
|
||||||
@@ -118,17 +116,6 @@ export default function WorkflowFormComponent({
|
|||||||
rows={3}
|
rows={3}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Enabled toggle */}
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<div className="space-y-0.5">
|
|
||||||
<Label>{t('workflows.enabled')}</Label>
|
|
||||||
<p className="text-sm text-muted-foreground">
|
|
||||||
{t('workflows.enabledDesc')}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Switch checked={isEnabled} onCheckedChange={setIsEnabled} />
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user