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

chore: add hidden field in component spec #1570

Merged
merged 2 commits into from
Jan 9, 2024
Merged
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
2 changes: 2 additions & 0 deletions api/v1/component_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type ComponentSpec struct {
Id *Template `json:"id,omitempty"` //nolint
Order int `json:"order,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
// If set to true, do not display in UI
Hidden bool `json:"hidden,omitempty"`
// The type of component, e.g. service, API, website, library, database, etc.
Type string `json:"type,omitempty"`
// The lifecycle state of the component e.g. production, staging, dev, etc.
Expand Down
6 changes: 6 additions & 0 deletions config/deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6860,6 +6860,9 @@ spec:
forEach:
description: Only applies when using lookup, when specified the components and properties specified under ForEach will be templated using the components returned by the lookup ${.properties} can be used to reference the properties of the component ${.component} can be used to reference the component itself
type: object
hidden:
description: If set to true, do not display in UI
type: boolean
icon:
type: string
id:
Expand Down Expand Up @@ -7180,6 +7183,9 @@ spec:
forEach:
description: Only applies when using lookup, when specified the components and properties specified under ForEach will be templated using the components returned by the lookup ${.properties} can be used to reference the properties of the component ${.component} can be used to reference the component itself
type: object
hidden:
description: If set to true, do not display in UI
type: boolean
icon:
type: string
id:
Expand Down
6 changes: 6 additions & 0 deletions config/deploy/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7128,6 +7128,9 @@ spec:
forEach:
description: Only applies when using lookup, when specified the components and properties specified under ForEach will be templated using the components returned by the lookup ${.properties} can be used to reference the properties of the component ${.component} can be used to reference the component itself
type: object
hidden:
description: If set to true, do not display in UI
type: boolean
icon:
type: string
id:
Expand Down Expand Up @@ -7448,6 +7451,9 @@ spec:
forEach:
description: Only applies when using lookup, when specified the components and properties specified under ForEach will be templated using the components returned by the lookup ${.properties} can be used to reference the properties of the component ${.component} can be used to reference the component itself
type: object
hidden:
description: If set to true, do not display in UI
type: boolean
icon:
type: string
id:
Expand Down
6 changes: 6 additions & 0 deletions config/schemas/component.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,9 @@
},
"type": "object"
},
"hidden": {
"type": "boolean"
},
"type": {
"type": "string"
},
Expand Down Expand Up @@ -898,6 +901,9 @@
},
"type": "object"
},
"hidden": {
"type": "boolean"
},
"type": {
"type": "string"
},
Expand Down
6 changes: 6 additions & 0 deletions config/schemas/topology.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,9 @@
},
"type": "object"
},
"hidden": {
"type": "boolean"
},
"type": {
"type": "string"
},
Expand Down Expand Up @@ -877,6 +880,9 @@
},
"type": "object"
},
"hidden": {
"type": "boolean"
},
"type": {
"type": "string"
},
Expand Down
23 changes: 13 additions & 10 deletions pkg/system_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,18 @@ func (components Components) Walk() Components {

// Component mirrors the models.Component struct except that instead of raw JSON serialized to the DB, it has the full CRD based spec.
type Component struct {
Name string `json:"name,omitempty"`
ID uuid.UUID `json:"id,omitempty" gorm:"default:generate_ulid()"` //nolint
Text string `json:"text,omitempty"`
Schedule string `json:"schedule,omitempty"`
TopologyType string `json:"topology_type,omitempty"`
Namespace string `json:"namespace,omitempty"`
Labels dutyTypes.JSONStringMap `json:"labels,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
Icon string `json:"icon,omitempty"`
Owner string `json:"owner,omitempty"`
Name string `json:"name,omitempty"`
ID uuid.UUID `json:"id,omitempty" gorm:"default:generate_ulid()"` //nolint
Text string `json:"text,omitempty"`
Schedule string `json:"schedule,omitempty"`
TopologyType string `json:"topology_type,omitempty"`
Namespace string `json:"namespace,omitempty"`
Labels dutyTypes.JSONStringMap `json:"labels,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
Icon string `json:"icon,omitempty"`
Owner string `json:"owner,omitempty"`
// If set to true, do not display in UI
Hidden bool `json:"hidden,omitempty"`
Status dutyTypes.ComponentStatus `json:"status,omitempty"`
StatusReason dutyTypes.NullString `json:"status_reason,omitempty"`
Path string `json:"path,omitempty"`
Expand Down Expand Up @@ -250,6 +252,7 @@ func NewComponent(c v1.ComponentSpec) *Component {
Owner: c.Owner,
Type: c.Type,
Order: c.Order,
Hidden: c.Hidden,
Lifecycle: c.Lifecycle,
Tooltip: c.Tooltip,
Icon: c.Icon,
Expand Down
Loading