Skip to content

Commit dfd25de

Browse files
committed
feat(web): hide deprecated KnowledgeRetriever plugins from marketplace
KnowledgeRetriever has been superseded by KnowledgeEngine. Filter out plugins that only contain KnowledgeRetriever components from both the main plugin list and recommendation lists, and remove the now-unused deprecated badge UI.
1 parent f4db53b commit dfd25de

3 files changed

Lines changed: 14 additions & 40 deletions

File tree

web/src/app/home/plugins/components/plugin-market/PluginMarketComponent.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,15 @@ function MarketPageContent({
152152
);
153153

154154
const data: ApiRespMarketplacePlugins = response;
155-
const newPlugins = data.plugins.map(transformToVO);
155+
const newPlugins = data.plugins
156+
.filter((plugin) => {
157+
// Hide plugins that only contain deprecated KnowledgeRetriever components
158+
const keys = Object.keys(plugin.components || {});
159+
return !(
160+
keys.length > 0 && keys.every((k) => k === 'KnowledgeRetriever')
161+
);
162+
})
163+
.map(transformToVO);
156164
const total = data.total;
157165

158166
if (reset || page === 1) {

web/src/app/home/plugins/components/plugin-market/RecommendationLists.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ function RecommendationListRow({
5959
const [perPage, setPerPage] = useState(4);
6060
const gridRef = useRef<HTMLDivElement>(null);
6161

62-
const plugins = list.plugins || [];
62+
const plugins = (list.plugins || []).filter((plugin) => {
63+
// Hide plugins that only contain deprecated KnowledgeRetriever components
64+
const keys = Object.keys(plugin.components || {});
65+
return !(keys.length > 0 && keys.every((k) => k === 'KnowledgeRetriever'));
66+
});
6367

6468
// Measure how many columns the CSS grid actually renders
6569
const measureCols = useCallback(() => {

web/src/app/home/plugins/components/plugin-market/plugin-market-card/PluginMarketCardComponent.tsx

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { PluginMarketCardVO } from './PluginMarketCardVO';
22
import { useTranslation } from 'react-i18next';
33
import { Badge } from '@/components/ui/badge';
4-
import {
5-
Tooltip,
6-
TooltipContent,
7-
TooltipProvider,
8-
TooltipTrigger,
9-
} from '@/components/ui/tooltip';
104
import {
115
Wrench,
126
AudioWaveform,
@@ -15,7 +9,6 @@ import {
159
ExternalLink,
1610
Book,
1711
FileText,
18-
Info,
1912
} from 'lucide-react';
2013
import { useState, useRef, useEffect } from 'react';
2114
import { Button } from '@/components/ui/button';
@@ -90,13 +83,6 @@ export default function PluginMarketCardComponent({
9083
Parser: <FileText className="w-4 h-4" />,
9184
};
9285

93-
// Plugins that only contain KnowledgeRetriever components are deprecated
94-
const isDeprecated = (() => {
95-
if (!cardVO.components) return false;
96-
const keys = Object.keys(cardVO.components);
97-
return keys.length > 0 && keys.every((k) => k === 'KnowledgeRetriever');
98-
})();
99-
10086
return (
10187
<div
10288
className="w-[100%] h-auto min-h-[8rem] sm:min-h-[9rem] bg-white rounded-[10px] shadow-[0px_0px_4px_0_rgba(0,0,0,0.2)] p-3 sm:p-[1rem] hover:shadow-[0px_3px_6px_0_rgba(0,0,0,0.12)] transition-all duration-200 hover:scale-[1.005] dark:bg-[#1f1f22] relative"
@@ -121,30 +107,6 @@ export default function PluginMarketCardComponent({
121107
<div className="text-base sm:text-[1.2rem] text-black dark:text-[#f0f0f0] truncate">
122108
{cardVO.label}
123109
</div>
124-
{isDeprecated && (
125-
<TooltipProvider delayDuration={200}>
126-
<Tooltip>
127-
<TooltipTrigger
128-
asChild
129-
onClick={(e) => e.preventDefault()}
130-
>
131-
<Badge
132-
variant="outline"
133-
className="text-[0.6rem] px-1.5 py-0 h-4 flex-shrink-0 border-red-400 text-red-500 dark:border-red-500 dark:text-red-400 gap-0.5 cursor-help"
134-
>
135-
{t('market.deprecated')}
136-
<Info className="w-2.5 h-2.5" />
137-
</Badge>
138-
</TooltipTrigger>
139-
<TooltipContent
140-
side="top"
141-
className="max-w-[240px] text-xs"
142-
>
143-
{t('market.deprecatedTooltip')}
144-
</TooltipContent>
145-
</Tooltip>
146-
</TooltipProvider>
147-
)}
148110
</div>
149111
</div>
150112

0 commit comments

Comments
 (0)