const { currentEdition, standaloneMode, pendingPlugins } = this.props;
const { loadingPlugins, plugins } = this.state;
const query = parseQuery(this.props.location.query);
- const filteredPlugins = query.search ? filterPlugins(plugins, query.search) : plugins;
+ const filteredPlugins = filterPlugins(plugins, query.search);
return (
<div className="page page-limited" id="marketplace-page">
return url;
}
-export function filterPlugins(plugins: Plugin[], search: string): Plugin[] {
+const EXCLUDED_PLUGINS = ['license'];
+export function filterPlugins(plugins: Plugin[], search?: string): Plugin[] {
+ if (!search) {
+ return plugins.filter(plugin => !EXCLUDED_PLUGINS.includes(plugin.key));
+ }
+
const s = search.toLowerCase();
return plugins.filter(plugin => {
return (
- plugin.name.toLowerCase().includes(s) ||
- (plugin.description || '').toLowerCase().includes(s) ||
- (plugin.category || '').toLowerCase().includes(s)
+ !EXCLUDED_PLUGINS.includes(plugin.key) &&
+ (plugin.name.toLowerCase().includes(s) ||
+ (plugin.description || '').toLowerCase().includes(s) ||
+ (plugin.category || '').toLowerCase().includes(s))
);
});
}