mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 16:45:43 -06:00
* feat(grafana-ui): badge can accept react node for text, add shield-exclamation to icons * feat(plugins): add PluginSignatureType type * feat(pluginpage): introduce PluginSignatureDetailsBadge. Fix sidebar icon margin * feat(pluginlistpage): update filterinput placeholder, introduce filter by plugin type
20 lines
543 B
TypeScript
20 lines
543 B
TypeScript
import { PluginsState } from 'app/types/plugins';
|
|
|
|
export const getPlugins = (state: PluginsState) => {
|
|
const regex = new RegExp(state.searchQuery, 'i');
|
|
|
|
return state.plugins.filter((item) => {
|
|
return (
|
|
regex.test(item.name) ||
|
|
regex.test(item.info.author.name) ||
|
|
regex.test(item.type) ||
|
|
regex.test(item.info.description)
|
|
);
|
|
});
|
|
};
|
|
export const getAllPluginsErrors = (state: PluginsState) => {
|
|
return state.errors;
|
|
};
|
|
|
|
export const getPluginsSearchQuery = (state: PluginsState) => state.searchQuery;
|