Plugins: Add fuzzy search to plugins catalogue (#81001)

* WIP add fuzzysearch to plugins catalog

* Add keywords to the plugins listing output

* add fuzzy search to plugin catalog, add keywords to plugins at frontend side

* refactor fuzzysearch function after review

* review changes

* change the version of uFuzzy library

* change reduce result object in getPluginDetailsForFuzzySearch

* fix yarn lock error

* fix helpers tests

* fix frontend searching test

* fix frontend linting issues

* fix tests

---------

Co-authored-by: Esteban Beltran <esteban@academo.me>
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
This commit is contained in:
Yulia Shanyrova
2024-02-14 14:30:24 +01:00
committed by GitHub
parent cf65d91ee9
commit 9dcb7800de
19 changed files with 314 additions and 164 deletions

View File

@ -154,7 +154,8 @@ func TestLoader_Load(t *testing.T) {
Class: plugins.ClassBundled,
},
},
}, {
},
{
name: "Load plugin with symbolic links",
class: plugins.ClassExternal,
cfg: &config.Cfg{Features: featuremgmt.WithFeatures()},
@ -183,8 +184,9 @@ func TestLoader_Load(t *testing.T) {
{Path: "public/plugins/test-app/img/screenshot1.png", Name: "img1"},
{Path: "public/plugins/test-app/img/screenshot2.png", Name: "img2"},
},
Version: "1.0.0",
Updated: "2015-02-10",
Version: "1.0.0",
Updated: "2015-02-10",
Keywords: []string{"test"},
},
Dependencies: plugins.Dependencies{
GrafanaVersion: "3.x.x",
@ -212,7 +214,8 @@ func TestLoader_Load(t *testing.T) {
Name: "Nginx Panel",
Type: string(plugins.TypePanel),
Role: org.RoleViewer,
Slug: "nginx-panel"},
Slug: "nginx-panel",
},
{
Name: "Nginx Datasource",
Type: string(plugins.TypeDataSource),
@ -230,7 +233,8 @@ func TestLoader_Load(t *testing.T) {
SignatureOrg: "Grafana Labs",
},
},
}, {
},
{
name: "Load an unsigned plugin (development)",
class: plugins.ClassExternal,
cfg: &config.Cfg{
@ -383,7 +387,8 @@ func TestLoader_Load(t *testing.T) {
Small: "public/img/icn-app.svg",
Large: "public/img/icn-app.svg",
},
Updated: "2015-02-10",
Updated: "2015-02-10",
Keywords: []string{"test"},
},
Dependencies: plugins.Dependencies{
GrafanaDependency: ">=8.0.0",