Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop unused code #793

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions api/handle_ast_expression.go

This file was deleted.

17 changes: 0 additions & 17 deletions api/handle_editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,3 @@ func handleGetEditorIdentifiers(uc usecases.Usecases) func(c *gin.Context) {
})
}
}

func handleGetEditorOperators(uc usecases.Usecases) func(c *gin.Context) {
return func(c *gin.Context) {
ctx := c.Request.Context()
usecase := usecasesWithCreds(ctx, uc).AstExpressionUsecase()
result := usecase.EditorOperators()

var functions []dto.FuncAttributesDto

for _, attributes := range result.OperatorAccessors {
functions = append(functions, dto.AdaptFuncAttributesDto(attributes))
}
c.JSON(http.StatusOK, gin.H{
"operators_accessors": functions,
})
}
}
3 changes: 0 additions & 3 deletions api/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ func addRoutes(r *gin.Engine, conf Configuration, uc usecases.Usecases, auth Aut

router.GET("/credentials", tom, handleGetCredentials())

router.GET("/ast-expression/available-functions", tom, handleAvailableFunctions)

router.GET("/decisions",
timeoutMiddleware(conf.DecisionTimeout),
handleListDecisions(uc, conf.MarbleAppHost))
Expand Down Expand Up @@ -114,7 +112,6 @@ func addRoutes(r *gin.Engine, conf Configuration, uc usecases.Usecases, auth Aut
router.DELETE("/custom-lists/:list_id/values/:value_id", tom, handleDeleteCustomListValue(uc))

router.GET("/editor/:scenario_id/identifiers", tom, handleGetEditorIdentifiers(uc))
router.GET("/editor/:scenario_id/operators", tom, handleGetEditorOperators(uc))

router.GET("/users", tom, handleListUsers(uc))
router.POST("/users", tom, handlePostUser(uc))
Expand Down
15 changes: 0 additions & 15 deletions dto/func_attributes_dto.go

This file was deleted.

23 changes: 0 additions & 23 deletions models/ast/ast_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,6 @@ import (

type Function int

var FuncOperators = []Function{
FUNC_ADD,
FUNC_SUBTRACT,
FUNC_MULTIPLY,
FUNC_DIVIDE,
FUNC_GREATER,
FUNC_GREATER_OR_EQUAL,
FUNC_LESS,
FUNC_LESS_OR_EQUAL,
FUNC_EQUAL,
FUNC_NOT_EQUAL,
FUNC_IS_IN_LIST,
FUNC_IS_NOT_IN_LIST,
FUNC_STRING_CONTAINS,
FUNC_STRING_NOT_CONTAIN,
FUNC_CONTAINS_ANY,
FUNC_CONTAINS_NONE,
FUNC_STRING_STARTS_WITH,
FUNC_STRING_ENDS_WITH,
FUNC_IS_EMPTY,
FUNC_IS_NOT_EMPTY,
}

const (
FUNC_CONSTANT Function = iota
FUNC_ADD
Expand Down
18 changes: 0 additions & 18 deletions usecases/ast_expression_usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ type EditorIdentifiers struct {
DatabaseAccessors []ast.Node `json:"database_accessors"`
}

type EditorOperators struct {
OperatorAccessors []ast.FuncAttributes `json:"operator_accessors"`
}

func (usecase *AstExpressionUsecase) getLinkedDatabaseIdentifiers(scenario models.Scenario, dataModel models.DataModel) ([]ast.Node, error) {
dataAccessors := []ast.Node{}
var recursiveDatabaseAccessor func(path []string, links map[string]models.LinkToSingle) error
Expand Down Expand Up @@ -135,17 +131,3 @@ func (usecase *AstExpressionUsecase) EditorIdentifiers(ctx context.Context, scen
DatabaseAccessors: databaseAccessors,
}, nil
}

func (usecase *AstExpressionUsecase) EditorOperators() EditorOperators {
if err := usecase.EnforceSecurity.Permission(models.SCENARIO_READ); err != nil {
return EditorOperators{}
}

var operatorAccessors []ast.FuncAttributes
for _, functionType := range ast.FuncOperators {
operatorAccessors = append(operatorAccessors, ast.FuncAttributesMap[functionType])
}
return EditorOperators{
OperatorAccessors: operatorAccessors,
}
}
Loading