fix: not search plugin if marketplace enabled (#21880)

refactor/tanstack-form
Joel 11 months ago committed by GitHub
parent 06c3deff11
commit ed54bd5121
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -90,7 +90,7 @@ const AllTools = ({
const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures) const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures)
useEffect(() => { useEffect(() => {
if (enable_marketplace) return if (!enable_marketplace) return
if (searchText || tags.length > 0) { if (searchText || tags.length > 0) {
fetchPlugins({ fetchPlugins({
query: searchText, query: searchText,

@ -22,6 +22,7 @@ import type { ListRef } from '@/app/components/workflow/block-selector/market-pl
import PluginList, { type ListProps } from '@/app/components/workflow/block-selector/market-place-plugin/list' import PluginList, { type ListProps } from '@/app/components/workflow/block-selector/market-place-plugin/list'
import { useMarketplacePlugins } from '@/app/components/plugins/marketplace/hooks' import { useMarketplacePlugins } from '@/app/components/plugins/marketplace/hooks'
import { ToolTipContent } from '@/app/components/base/tooltip/content' import { ToolTipContent } from '@/app/components/base/tooltip/content'
import { useGlobalPublicStore } from '@/context/global-public-context'
const DEFAULT_TAGS: ListProps['tags'] = [] const DEFAULT_TAGS: ListProps['tags'] = []
@ -131,7 +132,10 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
plugins: notInstalledPlugins = [], plugins: notInstalledPlugins = [],
} = useMarketplacePlugins() } = useMarketplacePlugins()
const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures)
useEffect(() => { useEffect(() => {
if (!enable_marketplace) return
if (query) { if (query) {
fetchPlugins({ fetchPlugins({
query, query,
@ -158,7 +162,7 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
alt='icon' alt='icon'
/></div>} /></div>}
<p <p
className={classNames(value ? 'text-components-input-text-filled' : 'text-components-input-text-placeholder', 'text-xs px-1')} className={classNames(value ? 'text-components-input-text-filled' : 'text-components-input-text-placeholder', 'px-1 text-xs')}
> >
{value?.agent_strategy_label || t('workflow.nodes.agent.strategy.selectTip')} {value?.agent_strategy_label || t('workflow.nodes.agent.strategy.selectTip')}
</p> </p>
@ -215,7 +219,8 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
}} }}
className='h-full max-h-full max-w-none overflow-y-auto' className='h-full max-h-full max-w-none overflow-y-auto'
indexBarClassName='top-0 xl:top-36' showWorkflowEmpty={false} hasSearchText={false} /> indexBarClassName='top-0 xl:top-36' showWorkflowEmpty={false} hasSearchText={false} />
<PluginList {enable_marketplace
&& <PluginList
ref={pluginRef} ref={pluginRef}
wrapElemRef={wrapElemRef} wrapElemRef={wrapElemRef}
list={notInstalledPlugins} list={notInstalledPlugins}
@ -223,6 +228,7 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
tags={DEFAULT_TAGS} tags={DEFAULT_TAGS}
disableMaxWidth disableMaxWidth
/> />
}
</main> </main>
</div> </div>
</PortalToFollowElemContent> </PortalToFollowElemContent>

Loading…
Cancel
Save