@@ -15,9 +15,7 @@ import (
15
15
"github.com/meshery/meshkit/utils/manifests"
16
16
"github.com/meshery/schemas/models/v1alpha1/capability"
17
17
schmeaVersion "github.com/meshery/schemas/models/v1beta1"
18
- "github.com/meshery/schemas/models/v1beta1/category"
19
18
"github.com/meshery/schemas/models/v1beta1/component"
20
- "github.com/meshery/schemas/models/v1beta1/subcategory"
21
19
)
22
20
23
21
const (
@@ -26,29 +24,29 @@ const (
26
24
)
27
25
28
26
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"`
52
50
53
51
ModelDisplayName string `json:"modelDisplayName" csv:"-"`
54
52
@@ -211,15 +209,15 @@ func NewComponentCSVHelper(sheetURL, spreadsheetName string, spreadsheetID int64
211
209
if localCsvPath == "" {
212
210
dirPath := filepath .Join (utils .GetHome (), ".meshery" , "content" )
213
211
err := os .MkdirAll (dirPath , 0755 )
214
- if err != nil {
212
+ if err != nil {
215
213
return nil , utils .ErrCreateDir (err , dirPath )
216
214
}
217
215
218
216
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
223
221
}
224
222
225
223
} else {
@@ -425,8 +423,6 @@ func ConvertCompDefToCompCSV(modelcsv *ModelCSV, compDef component.ComponentDefi
425
423
compCSV .Model = modelcsv .Model
426
424
compCSV .Component = compDef .Component .Kind
427
425
compCSV .ModelDisplayName = modelcsv .ModelDisplayName
428
- compCSV .Category = modelcsv .Category
429
- compCSV .SubCategory = modelcsv .SubCategory
430
426
compCSV .Capabilities = modelcsv .Capabilities
431
427
compCSV .Shape = modelcsv .Shape
432
428
compCSV .PrimaryColor = modelcsv .PrimaryColor
0 commit comments