Skip to content

Commit

Permalink
Merge pull request #208 from devangel/master
Browse files Browse the repository at this point in the history
add url field support #205
  • Loading branch information
dcarroll committed Oct 19, 2015
2 parents 9cc1a45 + 64282eb commit d676feb
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,20 @@ type PhoneField struct {
DefaultValue string `xml:"defaultValue"`
}

type UrlFieldRequired struct {
}

type UrlField struct {
Label string `xml:"label"`
Name string `xml:"fullName"`
Required bool `xml:"required"`
Description string `xml:"description"`
HelpText string `xml:"helpText"`
DefaultValue string `xml:"defaultValue"`
Formula string `xml:"formula"`
FormulaTreatBlanksAs string `xml:"formulaTreatBlanksAs"`
}

type EmailFieldRequired struct {
}

Expand Down Expand Up @@ -527,10 +541,14 @@ func (fm *ForceMetadata) ValidateFieldOptions(typ string, options map[string]str
attrs = getAttributes(&PhoneField{})
s = reflect.ValueOf(&PhoneFieldRequired{}).Elem()
break
case "email", "url":
case "email":
attrs = getAttributes(&StringField{})
s = reflect.ValueOf(&EmailFieldRequired{}).Elem()
break
case "url":
attrs = getAttributes(&UrlField{})
s = reflect.ValueOf(&UrlFieldRequired{}).Elem()
break
case "encryptedtext":
attrs = getAttributes(&EncryptedField{})
s = reflect.ValueOf(&EncryptedFieldRequired{175, "all", "asterisk"}).Elem()
Expand Down

0 comments on commit d676feb

Please sign in to comment.