From 236a5d7dd23f26a2595611caad820c6302903b2c Mon Sep 17 00:00:00 2001 From: big-vi Date: Wed, 26 Jul 2023 08:10:24 +0530 Subject: [PATCH] avro schema fixes fixed ui filter removed util module better error handling --- server/memphis_handlers_schemas.go | 2 +- server/memphis_handlers_user_mgmt.go | 2 +- ui_src/package.json | 1 - ui_src/src/domain/schema/components/createSchema/index.js | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/server/memphis_handlers_schemas.go b/server/memphis_handlers_schemas.go index 118e03e78..3139aefe8 100644 --- a/server/memphis_handlers_schemas.go +++ b/server/memphis_handlers_schemas.go @@ -79,7 +79,7 @@ func validateGraphqlSchemaContent(schemaContent string) error { func validateAvroSchemaContent(schemaContent string) error { _, err := avro.Parse(schemaContent) if err != nil { - return err + return fmt.Errorf("your Avro file is invalid: %v", err.Error()) } return nil } diff --git a/server/memphis_handlers_user_mgmt.go b/server/memphis_handlers_user_mgmt.go index 8efc09399..e8b4dadfb 100644 --- a/server/memphis_handlers_user_mgmt.go +++ b/server/memphis_handlers_user_mgmt.go @@ -738,7 +738,7 @@ func (umh UserMgmtHandler) GetFilterDetails(c *gin.Context) { return } - schemaType := []string{"protobuf", "json", "graphql"} + schemaType := []string{"protobuf", "json", "graphql", "avro"} usage := []string{"used", "not used"} c.IndentedJSON(200, gin.H{"tags": tags, "users": users, "type": schemaType, "usage": usage}) return diff --git a/ui_src/package.json b/ui_src/package.json index e68b40848..c495600a3 100644 --- a/ui_src/package.json +++ b/ui_src/package.json @@ -42,7 +42,6 @@ "reaflow": "5.0.6", "recharts": "^2.1.16", "sass": "^1.49.0", - "util": "^0.12.5", "uuid": "^9.0.0", "web-vitals": "^2.1.4", "rdk":"6.4.4" diff --git a/ui_src/src/domain/schema/components/createSchema/index.js b/ui_src/src/domain/schema/components/createSchema/index.js index 1a58097a3..7525b8044 100644 --- a/ui_src/src/domain/schema/components/createSchema/index.js +++ b/ui_src/src/domain/schema/components/createSchema/index.js @@ -75,7 +75,7 @@ const schemaTypes = [ { id: 4, value: 'Avro', - label: 'Avro (New)', + label: 'Avro', description: ( The popular. Apache Avro™ is the leading serialization format for record data, and first choice for streaming data pipelines. It offers excellent schema