diff --git a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx index 673231c06d..a4dd8ce529 100644 --- a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx @@ -359,79 +359,79 @@ const ComponentPicker = ({ > {isAgentTrigger ? ( - ({ - ...node, - type: BlockEnum.Agent || BlockEnum.LLM, - }))} - onSelect={handleSelectAgent} - onClose={handleClose} - onBlur={handleClose} - maxHeightClass="max-h-[34vh]" - autoFocus={false} - hideSearch={useExternalSearch} - externalSearchText={useExternalSearch ? (queryString ?? '') : undefined} - enableKeyboardNavigation={useExternalSearch} - /> - ) + ({ + ...node, + type: BlockEnum.Agent || BlockEnum.LLM, + }))} + onSelect={handleSelectAgent} + onClose={handleClose} + onBlur={handleClose} + maxHeightClass="max-h-[34vh]" + autoFocus={false} + hideSearch={useExternalSearch} + externalSearchText={useExternalSearch ? (queryString ?? '') : undefined} + enableKeyboardNavigation={useExternalSearch} + /> + ) : ( - <> - { - workflowVariableBlock?.show && ( -
- { - handleSelectWorkflowVariable(variables) - }} - maxHeightClass="max-h-[34vh]" - isSupportFileVar={isSupportFileVar} - onClose={handleClose} - onBlur={handleClose} - showManageInputField={workflowVariableBlock.showManageInputField} - onManageInputField={workflowVariableBlock.onManageInputField} - showAssembleVariables={showAssembleVariables} - onAssembleVariables={showAssembleVariables ? handleSelectAssembleVariables : undefined} - autoFocus={false} - isInCodeGeneratorInstructionEditor={currentBlock?.generatorType === GeneratorType.code} - hideSearch={useExternalSearch} - externalSearchText={useExternalSearch ? (queryString ?? '') : undefined} - enableKeyboardNavigation={useExternalSearch} - /> -
- ) - } - { - workflowVariableBlock?.show && !!options.length && ( -
- ) - } -
+ <> { - options.map((option, index) => ( - - { - index !== 0 && options.at(index - 1)?.group !== option.group && ( -
- ) - } - {option.renderMenuOption({ - queryString, - isSelected: selectedIndex === index, - onSelect: () => { - selectOptionAndCleanUp(option) - }, - onSetHighlight: () => { - setHighlightedIndex(index) - }, - })} -
- )) + workflowVariableBlock?.show && ( +
+ { + handleSelectWorkflowVariable(variables) + }} + maxHeightClass="max-h-[34vh]" + isSupportFileVar={isSupportFileVar} + onClose={handleClose} + onBlur={handleClose} + showManageInputField={workflowVariableBlock.showManageInputField} + onManageInputField={workflowVariableBlock.onManageInputField} + showAssembleVariables={showAssembleVariables} + onAssembleVariables={showAssembleVariables ? handleSelectAssembleVariables : undefined} + autoFocus={false} + isInCodeGeneratorInstructionEditor={currentBlock?.generatorType === GeneratorType.code} + hideSearch={useExternalSearch} + externalSearchText={useExternalSearch ? (queryString ?? '') : undefined} + enableKeyboardNavigation={useExternalSearch} + /> +
+ ) } -
- - )} + { + workflowVariableBlock?.show && !!options.length && ( +
+ ) + } +
+ { + options.map((option, index) => ( + + { + index !== 0 && options.at(index - 1)?.group !== option.group && ( +
+ ) + } + {option.renderMenuOption({ + queryString, + isSelected: selectedIndex === index, + onSelect: () => { + selectOptionAndCleanUp(option) + }, + onSetHighlight: () => { + setHighlightedIndex(index) + }, + })} +
+ )) + } +
+ + )} , anchorElementRef.current, diff --git a/web/app/components/workflow/nodes/_base/components/form-input-item.tsx b/web/app/components/workflow/nodes/_base/components/form-input-item.tsx index 2000af5d5a..a8c525a9b0 100644 --- a/web/app/components/workflow/nodes/_base/components/form-input-item.tsx +++ b/web/app/components/workflow/nodes/_base/components/form-input-item.tsx @@ -327,11 +327,11 @@ const FormInputItem: FC = ({ : newType ?? (varInput?.type === VarKindType.mention ? VarKindType.mention : getVarKindType()) const resolvedMentionConfig = resolvedType === VarKindType.mention ? (mentionConfig ?? varInput?.mention_config ?? { - extractor_node_id: '', - output_selector: [], - null_strategy: 'use_default', - default_value: '', - }) + extractor_node_id: '', + output_selector: [], + null_strategy: 'use_default', + default_value: '', + }) : undefined onChange({ @@ -504,13 +504,13 @@ const FormInputItem: FC = ({ placeholder={placeholder?.[language] || placeholder?.en_US} renderOption={options.some((opt: any) => opt.icon) ? ({ item }) => ( -
- {item.icon && ( - - )} - {item.name} -
- ) +
+ {item.icon && ( + + )} + {item.name} +
+ ) : undefined} /> )} @@ -615,14 +615,14 @@ const FormInputItem: FC = ({ {isLoadingOptions ? ( - - ) + + ) : ( - diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsx index a1f97fdf83..7df4bd3c50 100644 --- a/web/app/components/workflow/nodes/llm/panel.tsx +++ b/web/app/components/workflow/nodes/llm/panel.tsx @@ -5,7 +5,6 @@ import { RiAlertFill, RiQuestionLine } from '@remixicon/react' import * as React from 'react' import { useCallback } from 'react' import { useTranslation } from 'react-i18next' -import Badge from '@/app/components/base/badge' import AddButton2 from '@/app/components/base/button/add-button' import Switch from '@/app/components/base/switch' import Toast from '@/app/components/base/toast' diff --git a/web/eslint-suppressions.json b/web/eslint-suppressions.json index a69972cc58..4103daae8f 100644 --- a/web/eslint-suppressions.json +++ b/web/eslint-suppressions.json @@ -3049,9 +3049,6 @@ } }, "app/components/workflow/nodes/_base/components/form-input-item.tsx": { - "style/indent": { - "count": 19 - }, "ts/no-explicit-any": { "count": 34 } @@ -3510,11 +3507,6 @@ "count": 1 } }, - "app/components/workflow/nodes/llm/panel.tsx": { - "unused-imports/no-unused-imports": { - "count": 1 - } - }, "app/components/workflow/nodes/llm/types.ts": { "ts/no-explicit-any": { "count": 3 @@ -4200,11 +4192,6 @@ "count": 1 } }, - "eslint-suppressions.json": { - "style/eol-last": { - "count": 1 - } - }, "hooks/use-async-window-open.spec.ts": { "ts/no-explicit-any": { "count": 6 @@ -4579,4 +4566,4 @@ "count": 2 } } -} \ No newline at end of file +}