Revert "console: allow to put filters into folders"

This reverts commit 1238dfc552. No need
for folders. Description may contain a `/` if we want.
This commit is contained in:
Vincent Bernat
2022-06-18 12:00:37 +02:00
parent b2ffc5b8cd
commit 3d7df92c62
3 changed files with 8 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ import (
type SavedFilter struct {
ID uint `json:"id"`
User string `gorm:"index" json:"user"`
Folder string `json:"folder"`
Shared bool `json:"shared"`
Description string `json:"description" binding:"required"`
Content string `json:"content" binding:"required"`
}

View File

@@ -16,6 +16,7 @@ func TestSavedFilter(t *testing.T) {
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
ID: 17,
User: "marty",
Shared: false,
Description: "marty's filter",
Content: "SrcAS = 12322",
}); err != nil {
@@ -23,7 +24,7 @@ func TestSavedFilter(t *testing.T) {
}
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
User: "judith",
Folder: "something",
Shared: true,
Description: "judith's filter",
Content: "InIfBoundary = external",
}); err != nil {
@@ -31,7 +32,7 @@ func TestSavedFilter(t *testing.T) {
}
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
User: "marty",
Folder: "else",
Shared: true,
Description: "marty's second filter",
Content: "InIfBoundary = internal",
}); err != nil {
@@ -47,12 +48,13 @@ func TestSavedFilter(t *testing.T) {
{
ID: 1,
User: "marty",
Shared: false,
Description: "marty's filter",
Content: "SrcAS = 12322",
}, {
ID: 3,
User: "marty",
Folder: "else",
Shared: true,
Description: "marty's second filter",
Content: "InIfBoundary = internal",
},
@@ -69,7 +71,7 @@ func TestSavedFilter(t *testing.T) {
{
ID: 3,
User: "marty",
Folder: "else",
Shared: true,
Description: "marty's second filter",
Content: "InIfBoundary = internal",
},

View File

@@ -197,7 +197,6 @@ UNION DISTINCT
StatusCode: 204,
JSONInput: gin.H{
"description": "test 1",
"folder": "here",
"content": "InIfBoundary = external",
},
ContentType: "application/json; charset=utf-8",
@@ -207,8 +206,8 @@ UNION DISTINCT
JSONOutput: gin.H{"filters": []gin.H{
{
"id": 1,
"shared": false,
"user": "__default",
"folder": "here",
"description": "test 1",
"content": "InIfBoundary = external",
},