Repository: vmware-tanzu/octant
Pull request #2517 (2021-06-01 15:55:02)

Rename Expandable Row Detail TS Component Config Variable
**What this PR does / why we need it**:

This PR is part of a larger update to the TypeScript Plugin library. While attempting to update the TypeScript components available in the library, a specific component (`ExpandableRowDetail`) failed to build, specifically because its configuration name did not match the format that the generator expected (it was looking for `Config ExpandableRowDetailConfig` when the config was actually just named `ExpandableDetailConfig`). Merging this PR will allow us to update the TypeScript component library such that it works correctly in new TypeScript-based plugins going forward. 

[Relevant comment](https://github.com/vmware-tanzu/plugin-library-for-octant/pull/21#issuecomment-852148257
) in `vmware-tanzu/plugin-library-for-octant` by @GuessWhoSamFoo

**Which issue(s) this PR fixes**
- Fixes https://github.com/vmware-tanzu/plugin-library-for-octant/issues/20

**Special notes for your reviewer**:

I investigated adding some additional error handling to better inform developers when these naming conflicts emerge, but realized that this could be somewhat complicated because the template generating process involves running commands, so the error message might need to be passed through a standard input and then parsed. 

**Release note**:
```
release-note
```

☝️ not sure if this section needs to be filled out, please let me know if there's info I should put here 


liamrathke: Also, not sure what is going on with the DCO, I followed the steps the workflow told me to take to resolve the issue, but somehow it's still failing, is there a way to re-trigger the GitHub checks?

Patch:
diff --git a/pkg/view/component/row_detail.go b/pkg/view/component/row_detail.go
index 5cdb1683..9ea7b44e 100644
--- a/pkg/view/component/row_detail.go
+++ b/pkg/view/component/row_detail.go
@@ -20,17 +20,17 @@ func (t TableRow) AddExpandableDetail(details *ExpandableRowDetail) {
 type ExpandableRowDetail struct {
 	Base
 
-	Config ExpandableDetailConfig `json:"config"`
+	Config ExpandableRowDetailConfig `json:"config"`
 }
 
-// ExpandableDetailConfig is a configuration for an expandable row detail.
-type ExpandableDetailConfig struct {
+// ExpandableRowDetailConfig is a configuration for an expandable row detail.
+type ExpandableRowDetailConfig struct {
 	Replace bool        `json:"replace"`
 	Body    []Component `json:"body"`
 }
 
 // UnmarshalJSON unmarshals an expandable row detail config from JSON.
-func (e *ExpandableDetailConfig) UnmarshalJSON(data []byte) error {
+func (e *ExpandableRowDetailConfig) UnmarshalJSON(data []byte) error {
 	x := struct {
 		Body    []TypedObject `json:"body"`
 		Replace bool          `json:"replace"`
@@ -63,7 +63,7 @@ var _ Component = &ExpandableRowDetail{}
 func NewExpandableRowDetail(body ...Component) *ExpandableRowDetail {
 	e := ExpandableRowDetail{
 		Base: newBase(TypeExpandableRowDetail, nil),
-		Config: ExpandableDetailConfig{
+		Config: ExpandableRowDetailConfig{
 			Body:    body,
 			Replace: false,
 		},
diff --git a/web/package-lock.json b/web/package-lock.json
index 172df9e7..fbdedf10 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -9230,9 +9230,9 @@
       }
     },
     "@types/jasmine": {
-      "version": "3.7.6",
-      "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.7.6.tgz",
-      "integrity": "sha512-7Z6PZskqJZL7grgTg6L0JYLqaP6rEAecBZvHz3bzVZVMeun2kQ3QZ6Wx+cFjvjAR7le9p066WBDzLDobz9rlyQ==",
+      "version": "3.6.10",
+      "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.6.10.tgz",
+      "integrity": "sha512-yfCl7JGtIc5LjScFpeIGBBNhJFkJdAAcsAnAd9ZRHwzh+sR2zkt257BKkTCF5VpJ8wMPnzzZ8QatRdXM8tqpKA==",
       "dev": true
     },
     "@types/jasminewd2": {
@@ -9296,9 +9296,9 @@
       "dev": true
     },
     "@types/node": {
-      "version": "14.17.1",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.1.tgz",
-      "integrity": "sha512-/tpUyFD7meeooTRwl3sYlihx2BrJE7q9XF71EguPFIySj9B7qgnRtHsHTho+0AUm4m1SvWGm6uSncrR94q6Vtw==",
+      "version": "14.14.43",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.43.tgz",
+      "integrity": "sha512-3pwDJjp1PWacPTpH0LcfhgjvurQvrZFBrC6xxjaUEZ7ifUtT32jtjPxEMMblpqd2Mvx+k8haqQJLQxolyGN/cQ==",
       "dev": true
     },
     "@types/node-fetch": {
@@ -13265,9 +13265,9 @@
       }
     },
     "core-js": {
-      "version": "3.13.1",
-      "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.13.1.tgz",
-      "integrity": "sha512-JqveUc4igkqwStL2RTRn/EPFGBOfEZHxJl/8ej1mXJR75V3go2mFF4bmUYkEIT1rveHKnkUlcJX/c+f1TyIovQ=="
+      "version": "3.11.2",
+      "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.11.2.tgz",
+      "integrity": "sha512-3tfrrO1JpJSYGKnd9LKTBPqgUES/UYiCzMKeqwR1+jF16q4kD1BY2NvqkfuzXwQ6+CIWm55V9cjD7PQd+hijdw=="
     },
     "core-js-compat": {
       "version": "3.9.0",
@@ -14429,9 +14429,9 @@
       "dev": true
     },
     "dayjs": {
-      "version": "1.10.5",
-      "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.5.tgz",
-      "integrity": "sha512-BUFis41ikLz+65iH6LHQCDm4YPMj5r1YFLdupPIyM4SGcXMmtiLQ7U37i+hGS8urIuqe7I/ou3IS1jVc4nbN4g==",
+      "version": "1.10.4",
+      "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.4.tgz",
+      "integrity": "sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw==",
       "dev": true
     },
     "debounce-fn": {


Test patch:
diff --git a/pkg/view/component/row_detail_test.go b/pkg/view/component/row_detail_test.go
index f14f26c7..b7ac4016 100644
--- a/pkg/view/component/row_detail_test.go
+++ b/pkg/view/component/row_detail_test.go
@@ -52,7 +52,7 @@ func TestTableTow_ExpandableDetail_Marshal(t *testing.T) {
 			name: "in general",
 			input: &ExpandableRowDetail{
 				Base: newBase(TypeExpandableRowDetail, nil),
-				Config: ExpandableDetailConfig{
+				Config: ExpandableRowDetailConfig{
 					Body: []Component{
 						NewText("test"),
 					},
@@ -64,7 +64,7 @@ func TestTableTow_ExpandableDetail_Marshal(t *testing.T) {
 			name: "in general",
 			input: &ExpandableRowDetail{
 				Base: newBase(TypeExpandableRowDetail, nil),
-				Config: ExpandableDetailConfig{
+				Config: ExpandableRowDetailConfig{
 					Body: []Component{
 						NewText("test"),
 						NewText("test2"),
diff --git a/pkg/view/component/unmarshal_test.go b/pkg/view/component/unmarshal_test.go
index 5ebf69ea..4548ee17 100644
--- a/pkg/view/component/unmarshal_test.go
+++ b/pkg/view/component/unmarshal_test.go
@@ -186,7 +186,7 @@ func Test_unmarshal(t *testing.T) {
 			configFile: "config_expandable_row_detail.json",
 			objectType: "expandableRowDetail",
 			expected: &ExpandableRowDetail{
-				Config: ExpandableDetailConfig{
+				Config: ExpandableRowDetailConfig{
 					Body:    []Component{NewText("test")},
 					Replace: true,
 				},