Bläddra i källkod

BugFix: AgentCreateBUGFix:required argument are missing: dsl; (#8794)

### AgentCreateBUGFix
Because useFetchFlowTemplates is called both in the hooks and the
AgentTemplateModal, and the ID of the empty template is generated via
uuid, there may be cases where the IDs do not match.

Report a BUG as follows:
Prompt: 101
Required argument is missing: dsl;

<img width="472" height="121" alt="52d79682-4e50-4863-8486-f1e154003043"
src="https://github.com/user-attachments/assets/c5d217c9-b6cc-4ef2-866b-694c8b9ab3ae"
/>

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Co-authored-by: 海贼宅 <stu_xyx@163.com>
tags/v0.20.0
yungongzi 3 månader sedan
förälder
incheckning
504e453ae5
Inget konto är kopplat till bidragsgivarens mejladress

+ 12
- 4
web/src/pages/flow/list/agent-template-modal.tsx Visa fil

import { IModalManagerChildrenProps } from '@/components/modal-manager'; import { IModalManagerChildrenProps } from '@/components/modal-manager';
import { useSetModalState, useTranslate } from '@/hooks/common-hooks'; import { useSetModalState, useTranslate } from '@/hooks/common-hooks';
import { useFetchFlowTemplates } from '@/hooks/flow-hooks';
import { IFlowTemplate } from '@/interfaces/database/flow';
// import { useFetchFlowTemplates } from '@/hooks/flow-hooks';
import { useSelectItem } from '@/hooks/logic-hooks'; import { useSelectItem } from '@/hooks/logic-hooks';
import { Button, Card, Flex, List, Modal, Typography } from 'antd'; import { Button, Card, Flex, List, Modal, Typography } from 'antd';
import { useCallback, useState } from 'react'; import { useCallback, useState } from 'react';
loading: boolean; loading: boolean;
onOk: (name: string, templateId: string) => void; onOk: (name: string, templateId: string) => void;
showModal?(): void; showModal?(): void;
templateList: IFlowTemplate[];
} }


const AgentTemplateModal = ({ visible, hideModal, loading, onOk }: IProps) => {
const AgentTemplateModal = ({
visible,
hideModal,
loading,
onOk,
templateList,
}: IProps) => {
const { t } = useTranslate('common'); const { t } = useTranslate('common');
const { data: list } = useFetchFlowTemplates();
// const { data: list } = useFetchFlowTemplates();
const { selectedId, handleItemClick } = useSelectItem(''); const { selectedId, handleItemClick } = useSelectItem('');
const [checkedId, setCheckedId] = useState<string>(''); const [checkedId, setCheckedId] = useState<string>('');


</Title> </Title>
<List <List
grid={{ gutter: 16, column: 4 }} grid={{ gutter: 16, column: 4 }}
dataSource={list}
dataSource={templateList}
renderItem={(x) => ( renderItem={(x) => (
<List.Item> <List.Item>
<Card <Card

+ 1
- 0
web/src/pages/flow/list/hooks.ts Visa fil

onFlowOk, onFlowOk,
flowSettingVisible, flowSettingVisible,
hideFlowSettingModal, hideFlowSettingModal,
templateList: list,
showFlowSettingModal: showFileRenameModal, showFlowSettingModal: showFileRenameModal,
}; };
}; };

+ 2
- 0
web/src/pages/flow/list/index.tsx Visa fil

hideFlowSettingModal, hideFlowSettingModal,
flowSettingVisible, flowSettingVisible,
flowSettingLoading, flowSettingLoading,
templateList,
onFlowOk, onFlowOk,
} = useSaveFlow(); } = useSaveFlow();
const { t } = useTranslate('flow'); const { t } = useTranslate('flow');
onOk={onFlowOk} onOk={onFlowOk}
loading={flowSettingLoading} loading={flowSettingLoading}
hideModal={hideFlowSettingModal} hideModal={hideFlowSettingModal}
templateList={templateList}
></AgentTemplateModal> ></AgentTemplateModal>
)} )}
</Flex> </Flex>

Laddar…
Avbryt
Spara