mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
console/database: fix synchronization of saved filters
This commit is contained in:
@@ -14,6 +14,7 @@ identified with a specific icon:
|
||||
## Unreleased
|
||||
|
||||
- 🔒 *docker*: do not expose the /debug endpoint on the public entrypoint
|
||||
- 🩹 *console*: fix synchronization of saved filters from configuration file
|
||||
|
||||
## 1.11.2 - 2024-11-01
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ outer:
|
||||
for _, result := range results {
|
||||
for _, filter := range c.config.SavedFilters {
|
||||
if filter.Description == result.Description && filter.Content == result.Content {
|
||||
break outer
|
||||
continue outer
|
||||
}
|
||||
}
|
||||
c.r.Info().Msgf("remove old builtin filter %q", result.Description)
|
||||
|
||||
@@ -230,16 +230,16 @@ func TestPopulateSavedFilters(t *testing.T) {
|
||||
t.Fatalf("ListSavedFilters() (-got, +want):\n%s", diff)
|
||||
}
|
||||
|
||||
c.config.SavedFilters = c.config.SavedFilters[1:]
|
||||
c.config.SavedFilters = c.config.SavedFilters[:1]
|
||||
c.populate()
|
||||
got, _ = c.ListSavedFilters(context.Background(), "marty")
|
||||
if diff := helpers.Diff(got, []SavedFilter{
|
||||
{
|
||||
ID: 2,
|
||||
ID: 1,
|
||||
User: "__system",
|
||||
Shared: true,
|
||||
Description: "second filter",
|
||||
Content: "content of second filter",
|
||||
Description: "first filter",
|
||||
Content: "content of first filter",
|
||||
},
|
||||
}); diff != "" {
|
||||
t.Fatalf("ListSavedFilters() (-got, +want):\n%s", diff)
|
||||
|
||||
Reference in New Issue
Block a user