Skip to content

Commit

Permalink
Merge branch 'hotfix/3.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
LLKennedy committed Jun 20, 2019
2 parents eefa536 + e6c69c1 commit ed7ce38
Show file tree
Hide file tree
Showing 11 changed files with 576 additions and 33 deletions.
12 changes: 6 additions & 6 deletions components/barcode/barcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (component Component) SetNamedProperties(properties render.NamedProperties)
c.Extra.QRLevel = qr.Q
c.Extra.QRMode = qr.Unicode
}
c.Type = render.BarcodeType(stringVal)
c.Type = stringVal
return nil
}
if strings.Contains("dRdGdBdAbRbGbBbA", name) && len(name) == 2 {
Expand Down Expand Up @@ -189,7 +189,10 @@ func (component Component) VerifyAndSetJSONData(data interface{}) (render.Compon
return component, props, err
}
if newVal != nil {
c.Type = render.BarcodeType(newVal.(string))
c.Type, err = render.ToBarcodeType(newVal.(string))
if err != nil {
return component, props, fmt.Errorf("for barcode type %s: %v", newVal, err)
}
}
c.NamedPropertiesMap, newVal, err = render.ExtractSingleProp(stringStruct.Content, "content", render.StringType, c.NamedPropertiesMap)
if err != nil {
Expand Down Expand Up @@ -282,11 +285,8 @@ func (component Component) VerifyAndSetJSONData(data interface{}) (render.Compon
if newVal != nil {
c.BackgroundColour.A = newVal.(uint8)
}
type invalidStruct struct {
Message string
}
for key := range c.NamedPropertiesMap {
props[key] = invalidStruct{Message: "Please replace me with real data"}
props[key] = struct{ Message string }{Message: "Please replace me with real data"}
}
return c, props, nil
}
Expand Down

0 comments on commit ed7ce38

Please sign in to comment.