Revert "compatible with old enums (#5219)" (#5222)

This reverts commit f000fbb19d.
This commit is contained in:
Archer
2025-07-16 14:35:18 +08:00
committed by GitHub
parent d102adca59
commit 4275de96fd
12 changed files with 7 additions and 40 deletions

View File

@@ -341,13 +341,7 @@ export const toolSetData2FlowNodeIO = ({
};
export const formatEditorVariablePickerIcon = (
variables: {
id: string;
key: string;
label: string;
type?: `${VariableInputEnum}`;
required?: boolean;
}[]
variables: { key: string; label: string; type?: `${VariableInputEnum}`; required?: boolean }[]
): EditorVariablePickerType[] => {
return variables.map((item) => ({
...item,

View File

@@ -1,7 +1,6 @@
import type { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants';
export type EditorVariablePickerType = {
id: string;
key: string;
label: string;
required?: boolean;

View File

@@ -385,7 +385,7 @@ const TableItem = ({
onClick={() => {
const formattedItem = {
...item,
list: item.enums?.map((item) => ({ label: item.value, value: item.value })) || []
list: item.enums || []
};
reset(formattedItem);
}}

View File

@@ -100,14 +100,11 @@ const InputRender = (props: InputRenderProps) => {
}
if (inputType === InputTypeEnum.select) {
const list =
props.list || props.enums?.map((item) => ({ label: item.value, value: item.value })) || [];
return <MySelect {...commonProps} list={list} h={10} />;
return <MySelect {...commonProps} list={props.list || []} h={10} />;
}
if (inputType === InputTypeEnum.multipleSelect) {
const list =
props.list || props.enums?.map((item) => ({ label: item.value, value: item.value })) || [];
const { list = [] } = props;
return (
<MultipleSelect<string>
{...commonProps}

View File

@@ -40,9 +40,6 @@ type SpecificProps =
// select & multipleSelect
inputType: InputTypeEnum.select | InputTypeEnum.multipleSelect;
list?: { label: string; value: string }[];
// old version
enums?: { value: string }[];
}
| {
// JSONEditor

View File

@@ -174,7 +174,6 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
return (
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
key: item.key,
id: item.key,
label: item.name
})) || []
);
@@ -295,7 +294,6 @@ export function RenderHttpProps({
return (
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
key: item.key,
id: item.key,
label: item.name
})) || []
);
@@ -500,7 +498,6 @@ const RenderForm = ({
input: FlowNodeInputItemType;
variables: EditorVariableLabelPickerType[];
externalProviderWorkflowVariables: {
id: string;
key: string;
label: string;
}[];
@@ -687,7 +684,6 @@ const RenderBody = ({
typeInput: FlowNodeInputItemType | undefined;
variables: EditorVariableLabelPickerType[];
externalProviderWorkflowVariables: {
id: string;
key: string;
label: string;
}[];

View File

@@ -67,7 +67,6 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
const externalProviderWorkflowVariables = useMemo(() => {
return (
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
id: item.key,
key: item.key,
label: item.name
})) || []

View File

@@ -51,7 +51,6 @@ const CommonInputForm = ({ item, nodeId }: RenderInputProps) => {
const externalVariables = useMemo(() => {
return (
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
id: item.key,
key: item.key,
label: item.name
})) || []

View File

@@ -247,10 +247,7 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
</Flex>
<PromptEditor
variables={quoteTemplateVariables.map((item) => ({
...item,
id: item.key
}))}
variables={quoteTemplateVariables}
minH={160}
title={t('common:core.app.Quote templates')}
placeholder={t('workflow:quote_content_placeholder')}
@@ -271,10 +268,7 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
/>
</Flex>
<PromptEditor
variables={quotePromptVariables.map((item) => ({
...item,
id: item.key
}))}
variables={quotePromptVariables}
title={t('common:core.app.Quote prompt')}
minH={300}
placeholder={t('workflow:quote_prompt_tip', {

View File

@@ -107,7 +107,6 @@ export const getEditorVariables = ({
const nodeVariables = currentNode.inputs
.filter((input) => input.canEdit)
.map((item) => ({
id: item.key,
key: item.key,
label: item.label,
parent: {
@@ -138,7 +137,6 @@ export const getEditorVariables = ({
)
.map((output) => {
return {
id: output.id,
label: t((output.label as any) || ''),
key: output.id,
parent: {

View File

@@ -582,35 +582,30 @@ export function filterSensitiveFormData(appForm: AppSimpleEditFormType) {
export const workflowSystemVariables: EditorVariablePickerType[] = [
{
id: 'userId',
key: 'userId',
label: i18nT('workflow:use_user_id'),
required: true,
valueType: WorkflowIOValueTypeEnum.string
},
{
id: 'appId',
key: 'appId',
label: i18nT('common:core.module.http.AppId'),
required: true,
valueType: WorkflowIOValueTypeEnum.string
},
{
id: 'chatId',
key: 'chatId',
label: i18nT('common:core.module.http.ChatId'),
valueType: WorkflowIOValueTypeEnum.string,
required: true
},
{
id: 'responseChatItemId',
key: 'responseChatItemId',
label: i18nT('common:core.module.http.ResponseChatItemId'),
valueType: WorkflowIOValueTypeEnum.string,
required: true
},
{
id: 'histories',
key: 'histories',
label: i18nT('common:core.module.http.Histories'),
required: true,
@@ -618,7 +613,6 @@ export const workflowSystemVariables: EditorVariablePickerType[] = [
valueDesc: chatHistoryValueDesc
},
{
id: 'cTime',
key: 'cTime',
label: i18nT('common:core.module.http.Current time'),
required: true,

View File

@@ -54,7 +54,7 @@ export const getGlobalVariableNode = ({
nodeId: VARIABLE_NODE_ID,
...template,
outputs: globalVariables.map((item) => ({
id: item.id,
id: item.key,
type: FlowNodeOutputTypeEnum.static,
label: item.label,
key: item.key,