mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-13 06:00:58 +00:00
feat: open pipeline edit dialog after creating
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
|||||||
export default function PipelineFormComponent({
|
export default function PipelineFormComponent({
|
||||||
initValues,
|
initValues,
|
||||||
onFinish,
|
onFinish,
|
||||||
|
onNewPipelineCreated,
|
||||||
isEditMode,
|
isEditMode,
|
||||||
pipelineId,
|
pipelineId,
|
||||||
disableForm,
|
disableForm,
|
||||||
@@ -33,6 +34,7 @@ export default function PipelineFormComponent({
|
|||||||
// 这里的写法很不安全不规范,未来流水线需要重新整理
|
// 这里的写法很不安全不规范,未来流水线需要重新整理
|
||||||
initValues?: PipelineFormEntity;
|
initValues?: PipelineFormEntity;
|
||||||
onFinish: () => void;
|
onFinish: () => void;
|
||||||
|
onNewPipelineCreated: (pipelineId: string) => void;
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
const formSchema = isEditMode ? z.object({
|
const formSchema = isEditMode ? z.object({
|
||||||
@@ -136,7 +138,10 @@ export default function PipelineFormComponent({
|
|||||||
description: values.basic.description,
|
description: values.basic.description,
|
||||||
name: values.basic.name,
|
name: values.basic.name,
|
||||||
};
|
};
|
||||||
httpClient.createPipeline(pipeline).then(() => onFinish());
|
httpClient.createPipeline(pipeline).then((resp) => {
|
||||||
|
onFinish();
|
||||||
|
onNewPipelineCreated(resp.uuid);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleModify(values: FormValues) {
|
function handleModify(values: FormValues) {
|
||||||
|
|||||||
@@ -90,6 +90,13 @@ export default function PluginConfigPage() {
|
|||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<div className="flex-1 overflow-y-auto px-6">
|
<div className="flex-1 overflow-y-auto px-6">
|
||||||
<PipelineFormComponent
|
<PipelineFormComponent
|
||||||
|
onNewPipelineCreated={(pipelineId) => {
|
||||||
|
setDisableForm(true);
|
||||||
|
setIsEditForm(true);
|
||||||
|
setModalOpen(true);
|
||||||
|
setSelectedPipelineId(pipelineId);
|
||||||
|
getSelectedPipelineForm(pipelineId);
|
||||||
|
}}
|
||||||
onFinish={() => {
|
onFinish={() => {
|
||||||
getPipelines();
|
getPipelines();
|
||||||
setModalOpen(false);
|
setModalOpen(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user