Skip to content

Commit

Permalink
fix: import flow save version error
Browse files Browse the repository at this point in the history
  • Loading branch information
dolphin0618 committed May 17, 2024
1 parent 8eaf64b commit 9e8001a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/frontend/public/locales/zh/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@
"addTool": "添加工具",
"search": "搜索",
"empty": "空空如也",
"onlineSA": "Go online skills&assistants",
"onlineSA": "上线技能&助手",
"params": "参数",
"added": "已添加",
"add": "添加",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function Component({ compId, options, disables, version, classNam

// 保留当前compId和上游组件
const nodes = useMemo(() => {
if (!version) return [];
if (!version?.data) return [];
const showNodes = {}
const edges = version.data.edges

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/pages/DiffFlowPage/components/RunTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function RunTest({ nodeId }) {
return cur ? count + 1 : count
}, 0) + 1 // +1 测试用例列

return 100 / (count + 1)
return 100 / (count === 2 ? 2 : count + 1) // hack 两个 按 45% 分
}, [mulitVersionFlow])

const handleUploadTxt = () => {
Expand Down Expand Up @@ -173,7 +173,7 @@ export default function RunTest({ nodeId }) {
</TableHead>
)
}
<TableHead className="text-right max-w-[135px]" style={{ width: '10%' }}>
<TableHead className="text-right min-w-[135px]" style={{ width: 135 }}>
<Button variant="link" disabled={runningType !== '' || !running} onClick={handleDownExcle}><DownloadIcon className="mr-1" />{t('test.downloadResults')}</Button>
</TableHead>
</TableRow>
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/pages/FlowPage/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default function Header({ flow }) {
// 更新版本列表
await refrenshVersions()
// 切换到最新版本

setVersionId(res.id)
}
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { Badge } from "@/components/bs-ui/badge";
import { LayersIcon } from "@radix-ui/react-icons";
import { Button } from "@/components/bs-ui/button";
import { updateVersion } from "@/controllers/API/flow";
import { captureAndAlertRequestErrorHoc } from "@/controllers/request";

const nodeTypes = {
genericNode: GenericNode,
Expand Down Expand Up @@ -308,7 +309,7 @@ export default function Page({ flow, preFlow }: { flow: FlowType, preFlow: strin

// 离开并保存
const handleSaveAndClose = async () => {
await updateVersion(version.id, { name: version.name, description: '', data: flow.data })
await captureAndAlertRequestErrorHoc(updateVersion(version.id, { name: version.name, description: '', data: flow.data }))
blocker.proceed?.()
}

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/pages/FlowPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function FlowPage() {
getFlowApi(id).then(_flow => setFlow('flow_init', _flow))
}

return () => setFlow('destroy', null)
// return () => setFlow('destroy', null)
}, [])

const [copyFlow, preFlow] = useMemo(() => {
Expand Down

0 comments on commit 9e8001a

Please sign in to comment.