Skip to content

Commit

Permalink
chore: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed May 10, 2023
1 parent d8f6de3 commit 13d1929
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
12 changes: 1 addition & 11 deletions models/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,6 @@ func (c *Component) Summarize() types.Summary {
return s
}

func (component Component) GetID() string {
if component.ID != uuid.Nil {
return component.ID.String()
}
if component.Text != "" {
return component.Text
}
return component.Name
}

func (component Component) Clone() Component {
clone := Component{
Name: component.Name,
Expand Down Expand Up @@ -204,7 +194,7 @@ func (components Components) Debug(prefix string) string {
status = types.ComponentStatus(console.Redf(string(status)))
}

s += fmt.Sprintf("%s%s (%s) => %s\n", prefix, component, component.GetID(), status)
s += fmt.Sprintf("%s%s (id=%s, text=%s, name=%s) => %s\n", prefix, component, component.ID, component.Text, component.Name, status)
s += component.Components.Debug(prefix + "\t")
}

Expand Down
23 changes: 9 additions & 14 deletions types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,15 @@ type ConfigQuery struct {
}

func (c ConfigQuery) String() string {
s := c.Type
if c.Namespace != "" {
s += "/" + c.Namespace
}

if c.Name != "" {
s += "/" + c.Name
}

if len(c.Tags) > 0 {
s += " " + fmt.Sprintf("%+v", c.Tags)
}

return s
return fmt.Sprintf("id=%v, type=%s, class=%s, external_id=%s, name=%s, namespace=%s, tags=%v",
c.ID,
c.Type,
c.Class,
c.ExternalID,
c.Name,
c.Namespace,
c.Tags,
)
}

type ConfigQueries []*ConfigQuery
Expand Down

0 comments on commit 13d1929

Please sign in to comment.