mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-02 01:02:05 +08:00
compatible with old enums (#5219)
* compatible with old enums\ * add id
This commit is contained in:
+4
@@ -174,6 +174,7 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
|
||||
return (
|
||||
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
|
||||
key: item.key,
|
||||
id: item.key,
|
||||
label: item.name
|
||||
})) || []
|
||||
);
|
||||
@@ -294,6 +295,7 @@ export function RenderHttpProps({
|
||||
return (
|
||||
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
|
||||
key: item.key,
|
||||
id: item.key,
|
||||
label: item.name
|
||||
})) || []
|
||||
);
|
||||
@@ -498,6 +500,7 @@ const RenderForm = ({
|
||||
input: FlowNodeInputItemType;
|
||||
variables: EditorVariableLabelPickerType[];
|
||||
externalProviderWorkflowVariables: {
|
||||
id: string;
|
||||
key: string;
|
||||
label: string;
|
||||
}[];
|
||||
@@ -684,6 +687,7 @@ const RenderBody = ({
|
||||
typeInput: FlowNodeInputItemType | undefined;
|
||||
variables: EditorVariableLabelPickerType[];
|
||||
externalProviderWorkflowVariables: {
|
||||
id: string;
|
||||
key: string;
|
||||
label: string;
|
||||
}[];
|
||||
|
||||
+1
@@ -67,6 +67,7 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
|
||||
const externalProviderWorkflowVariables = useMemo(() => {
|
||||
return (
|
||||
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
|
||||
id: item.key,
|
||||
key: item.key,
|
||||
label: item.name
|
||||
})) || []
|
||||
|
||||
+1
@@ -51,6 +51,7 @@ const CommonInputForm = ({ item, nodeId }: RenderInputProps) => {
|
||||
const externalVariables = useMemo(() => {
|
||||
return (
|
||||
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
|
||||
id: item.key,
|
||||
key: item.key,
|
||||
label: item.name
|
||||
})) || []
|
||||
|
||||
+8
-2
@@ -247,7 +247,10 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
|
||||
</Flex>
|
||||
|
||||
<PromptEditor
|
||||
variables={quoteTemplateVariables}
|
||||
variables={quoteTemplateVariables.map((item) => ({
|
||||
...item,
|
||||
id: item.key
|
||||
}))}
|
||||
minH={160}
|
||||
title={t('common:core.app.Quote templates')}
|
||||
placeholder={t('workflow:quote_content_placeholder')}
|
||||
@@ -268,7 +271,10 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
|
||||
/>
|
||||
</Flex>
|
||||
<PromptEditor
|
||||
variables={quotePromptVariables}
|
||||
variables={quotePromptVariables.map((item) => ({
|
||||
...item,
|
||||
id: item.key
|
||||
}))}
|
||||
title={t('common:core.app.Quote prompt')}
|
||||
minH={300}
|
||||
placeholder={t('workflow:quote_prompt_tip', {
|
||||
|
||||
@@ -107,6 +107,7 @@ export const getEditorVariables = ({
|
||||
const nodeVariables = currentNode.inputs
|
||||
.filter((input) => input.canEdit)
|
||||
.map((item) => ({
|
||||
id: item.key,
|
||||
key: item.key,
|
||||
label: item.label,
|
||||
parent: {
|
||||
@@ -137,6 +138,7 @@ export const getEditorVariables = ({
|
||||
)
|
||||
.map((output) => {
|
||||
return {
|
||||
id: output.id,
|
||||
label: t((output.label as any) || ''),
|
||||
key: output.id,
|
||||
parent: {
|
||||
|
||||
Reference in New Issue
Block a user