compatible with old enums (#5219)

* compatible with old enums\

* add id
This commit is contained in:
heheer
2025-07-16 13:09:16 +08:00
committed by GitHub
parent 4e2ab1f63b
commit f000fbb19d
12 changed files with 40 additions and 7 deletions
@@ -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;
}[];
@@ -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
})) || []
@@ -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
})) || []
@@ -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: {