diff --git a/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx b/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx index 88d1e1774d..4ae0bccdab 100644 --- a/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx +++ b/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx @@ -89,17 +89,17 @@ const InstallByDSLList: FC = ({ }, [isFetchingMarketplaceDataFromDSL]) useEffect(() => { - if (!isFetchingMarketplaceDataFromLocal && marketplaceResFromLocalRes?.data.versions) { - const payloads = marketplaceResFromLocalRes?.data.versions + if (!isFetchingMarketplaceDataFromLocal && marketplaceResFromLocalRes?.data.list) { + const payloads = marketplaceResFromLocalRes?.data.list const failedIndex: number[] = [] const nextPlugins = produce(getPlugins(), (draft) => { marketPlaceInDSLIndex.forEach((index, i) => { if (payloads[i]) { const item = payloads[i] - draft[index] = { // TODO: wait for api change - name: 'xxx', - plugin_id: item.unique_identifier, - } as Plugin + draft[index] = { + ...item.plugin, + plugin_id: item.version.unique_identifier, + } } else { failedIndex.push(index) diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index db684b37ce..34cd0c7308 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -311,10 +311,13 @@ export type PluginsFromMarketplaceResponse = { plugins: Plugin[] } export type PluginsFromMarketplaceByInfoResponse = { - versions: { - plugin_name: string - plugin_org: string - unique_identifier: string + list: { + plugin: Plugin + version: { + plugin_name: string + plugin_org: string + unique_identifier: string + } }[] } diff --git a/web/app/components/workflow/block-selector/index.tsx b/web/app/components/workflow/block-selector/index.tsx index 6cb68ea383..7cc0a336db 100644 --- a/web/app/components/workflow/block-selector/index.tsx +++ b/web/app/components/workflow/block-selector/index.tsx @@ -22,11 +22,13 @@ import { PortalToFollowElemTrigger, } from '@/app/components/base/portal-to-follow-elem' import Input from '@/app/components/base/input' +import SearchBox from '@/app/components/plugins/marketplace/search-box' + import { Plus02, } from '@/app/components/base/icons/src/vender/line/general' -interface NodeSelectorProps { +type NodeSelectorProps = { open?: boolean onOpenChange?: (open: boolean) => void onSelect: OnSelectBlock @@ -60,6 +62,7 @@ const NodeSelector: FC = ({ }) => { const { t } = useTranslation() const [searchText, setSearchText] = useState('') + const [tags, setTags] = useState([]) const [localOpen, setLocalOpen] = useState(false) const open = openFromProps === undefined ? localOpen : openFromProps const handleOpenChange = useCallback((newOpen: boolean) => { @@ -127,15 +130,28 @@ const NodeSelector: FC = ({
e.stopPropagation()}> - setSearchText(e.target.value)} - onClear={() => setSearchText('')} - /> + {activeTab === TabsEnum.Blocks && ( + setSearchText(e.target.value)} + onClear={() => setSearchText('')} + /> + )} + {activeTab === TabsEnum.Tools && ( + + )} +
[]) => { return useQuery({ queryKey: [NAME_SPACE, 'fetchPluginsInMarketPlaceByInfo', infos], - queryFn: () => postMarketplace<{ data: PluginsFromMarketplaceByInfoResponse }>('/plugins/versions', { + queryFn: () => postMarketplace<{ data: PluginsFromMarketplaceByInfoResponse }>('/plugins/versions/batch', { body: { plugin_tuples: infos.map(info => ({ org: info.organization,