From ca5a95cdd43010dd07f21f0e7b75b76336a55c9e Mon Sep 17 00:00:00 2001 From: ricoberger Date: Tue, 14 Jun 2022 21:04:03 +0200 Subject: [PATCH] [app] Fix plugin filter This commit fixes the filter on the plugin instances page. We didn't used the plugin id as key for rendering the plugin gallery items, which lead to some strange behaviour, so that plugins were still shown also when the filter was changed. This should be fixed now. It is now also possible to filter the list of plugins by the name of a satellite, so that only plugins are shown that are configured at the specific satellite instance. --- CHANGELOG.md | 1 + .../components/plugins/PluginInstances.tsx | 39 +++++++++++++++++-- plugins/app/src/context/PluginsContext.tsx | 20 ++++++++-- 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5263cee7f..fd7d022dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ NOTE: As semantic versioning states all 0.y.z releases can contain breaking chan - [#349](https://github.com/kobsio/kobs/pull/#349): [app] Fix the creation of a VirtualService in the Helm chart when no `additionalRoutes` are set. - [#350](https://github.com/kobsio/kobs/pull/#350): [app] Fix Docker image and request proxy. - [#351](https://github.com/kobsio/kobs/pull/#351): [jaeger] Fix links and colors in Jaeger plugin. +- [#352](https://github.com/kobsio/kobs/pull/#352): [app] Fix plugin filter and allow filtering by the name of a satellite. ### Changed diff --git a/plugins/app/src/components/plugins/PluginInstances.tsx b/plugins/app/src/components/plugins/PluginInstances.tsx index 424ef7d18..7e247f7e9 100644 --- a/plugins/app/src/components/plugins/PluginInstances.tsx +++ b/plugins/app/src/components/plugins/PluginInstances.tsx @@ -29,10 +29,20 @@ const PluginInstances: React.FunctionComponent = () => { const [state, setState] = useState<{ page: number; perPage: number; + pluginSatellite: string; + pluginSatelliteIsOpen: boolean; pluginType: string; pluginTypeIsOpen: boolean; searchTerm: string; - }>({ page: 1, perPage: 10, pluginType: '', pluginTypeIsOpen: false, searchTerm: '' }); + }>({ + page: 1, + perPage: 10, + pluginSatellite: '', + pluginSatelliteIsOpen: false, + pluginType: '', + pluginTypeIsOpen: false, + searchTerm: '', + }); const debouncedSearchTerm = useDebounce(state.searchTerm, 500); return ( @@ -47,6 +57,27 @@ const PluginInstances: React.FunctionComponent = () => { toolbarContent={ + + +