Skip to content

Commit 59c357e

Browse files
remove category and subcategory from components
Signed-off-by: CodeAhmedJamil <[email protected]>
1 parent 07b9d23 commit 59c357e

File tree

2 files changed

+30
-32
lines changed

2 files changed

+30
-32
lines changed

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxU
416416
github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM=
417417
github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
418418
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
419+
github.com/meshery/schemas v0.8.22 h1:JQ7PoEheiXdkIG/h965L+DB7p/JdGEgs3i5r0EniSt4=
420+
github.com/meshery/schemas v0.8.22/go.mod h1:tuAmsG9WJRjZ0Iv12HIAhKZbWpfpkTRjfPNThKbr7HA=
419421
github.com/miekg/dns v1.1.57 h1:Jzi7ApEIzwEPLHWRcafCN9LZSBbqQpxjt/wpgvg7wcM=
420422
github.com/miekg/dns v1.1.57/go.mod h1:uqRjCRUuEAA6qsOiJvDd+CFo/vW+y5WR6SNmHE55hZk=
421423
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=

registry/component.go

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ import (
1515
"github.com/meshery/meshkit/utils/manifests"
1616
"github.com/meshery/schemas/models/v1alpha1/capability"
1717
schmeaVersion "github.com/meshery/schemas/models/v1beta1"
18-
"github.com/meshery/schemas/models/v1beta1/category"
1918
"github.com/meshery/schemas/models/v1beta1/component"
20-
"github.com/meshery/schemas/models/v1beta1/subcategory"
2119
)
2220

2321
const (
@@ -26,29 +24,29 @@ const (
2624
)
2725

2826
type ComponentCSV struct {
29-
Registrant string `json:"registrant" csv:"registrant"`
30-
Model string `json:"model" csv:"model"`
31-
Component string `json:"component" csv:"component"`
32-
Category category.CategoryDefinitionName `json:"category" csv:"category"`
33-
SubCategory subcategory.SubCategoryDefinition `json:"subCategory" csv:"subCategory"`
34-
Description string `json:"description" csv:"description"`
35-
Shape string `json:"shape" csv:"shape"`
36-
PrimaryColor string `json:"primaryColor" csv:"primaryColor"`
37-
SecondaryColor string `json:"secondaryColor" csv:"secondaryColor"`
38-
SVGColor string `json:"svgColor" csv:"svgColor"`
39-
SVGWhite string `json:"svgWhite" csv:"svgWhite"`
40-
SVGComplete string `json:"svgComplete" csv:"svgComplete"`
41-
Schema string `json:"schema" csv:"schema"`
42-
Docs string `json:"docs" csv:"docs"`
43-
StyleOverrides string `json:"styleOverrides" csv:"styleOverrides"`
44-
Styles string `json:"styles" csv:"styles"`
45-
ShapePolygonPoints string `json:"shapePolygonPoints" csv:"shapePolygonPoints"`
46-
DefaultData string `json:"defaultData" csv:"defaultData"`
47-
Capabilities string `json:"capabilities" csv:"capabilities"`
48-
LogoURL string `json:"logoURL" csv:"logoURL"`
49-
Genealogy string `json:"genealogy" csv:"genealogy"`
50-
IsAnnotation string `json:"isAnnotation" csv:"isAnnotation"`
51-
Version string `json:"version" csv:"version"`
27+
Registrant string `json:"registrant" csv:"registrant"`
28+
Model string `json:"model" csv:"model"`
29+
Component string `json:"component" csv:"component"`
30+
// Category category.CategoryDefinitionName `json:"category" csv:"category"`
31+
// SubCategory subcategory.SubCategoryDefinition `json:"subCategory" csv:"subCategory"`
32+
Description string `json:"description" csv:"description"`
33+
Shape string `json:"shape" csv:"shape"`
34+
PrimaryColor string `json:"primaryColor" csv:"primaryColor"`
35+
SecondaryColor string `json:"secondaryColor" csv:"secondaryColor"`
36+
SVGColor string `json:"svgColor" csv:"svgColor"`
37+
SVGWhite string `json:"svgWhite" csv:"svgWhite"`
38+
SVGComplete string `json:"svgComplete" csv:"svgComplete"`
39+
Schema string `json:"schema" csv:"schema"`
40+
Docs string `json:"docs" csv:"docs"`
41+
StyleOverrides string `json:"styleOverrides" csv:"styleOverrides"`
42+
Styles string `json:"styles" csv:"styles"`
43+
ShapePolygonPoints string `json:"shapePolygonPoints" csv:"shapePolygonPoints"`
44+
DefaultData string `json:"defaultData" csv:"defaultData"`
45+
Capabilities string `json:"capabilities" csv:"capabilities"`
46+
LogoURL string `json:"logoURL" csv:"logoURL"`
47+
Genealogy string `json:"genealogy" csv:"genealogy"`
48+
IsAnnotation string `json:"isAnnotation" csv:"isAnnotation"`
49+
Version string `json:"version" csv:"version"`
5250

5351
ModelDisplayName string `json:"modelDisplayName" csv:"-"`
5452

@@ -211,15 +209,15 @@ func NewComponentCSVHelper(sheetURL, spreadsheetName string, spreadsheetID int64
211209
if localCsvPath == "" {
212210
dirPath := filepath.Join(utils.GetHome(), ".meshery", "content")
213211
err := os.MkdirAll(dirPath, 0755)
214-
if err != nil{
212+
if err != nil {
215213
return nil, utils.ErrCreateDir(err, dirPath)
216214
}
217215

218216
csvPath = filepath.Join(dirPath, "components.csv")
219-
220-
sheetURL,err = DownloadCSVAndGetDownloadURL(sheetURL,csvPath,spreadsheetID)
221-
if err !=nil{
222-
return nil,err
217+
218+
sheetURL, err = DownloadCSVAndGetDownloadURL(sheetURL, csvPath, spreadsheetID)
219+
if err != nil {
220+
return nil, err
223221
}
224222

225223
} else {
@@ -425,8 +423,6 @@ func ConvertCompDefToCompCSV(modelcsv *ModelCSV, compDef component.ComponentDefi
425423
compCSV.Model = modelcsv.Model
426424
compCSV.Component = compDef.Component.Kind
427425
compCSV.ModelDisplayName = modelcsv.ModelDisplayName
428-
compCSV.Category = modelcsv.Category
429-
compCSV.SubCategory = modelcsv.SubCategory
430426
compCSV.Capabilities = modelcsv.Capabilities
431427
compCSV.Shape = modelcsv.Shape
432428
compCSV.PrimaryColor = modelcsv.PrimaryColor

0 commit comments

Comments
 (0)