MM-14741 Add default option to post action dropdown (#10659)

Этот коммит содержится в:
Harrison Healey
2019-04-22 11:57:54 -04:00
коммит произвёл Lev
родитель 7031846243
Коммит 2b6691e5cc

Просмотреть файл

@@ -48,8 +48,16 @@ type PostAction struct {
// empty, the select is populated from Options. Other supported values // empty, the select is populated from Options. Other supported values
// are "users" and "channels". // are "users" and "channels".
DataSource string `json:"data_source,omitempty"` DataSource string `json:"data_source,omitempty"`
// Options contains either the buttons that will be displayed on the post
// or the values listed in a select dropdowon on the post.
Options []*PostActionOptions `json:"options,omitempty"` Options []*PostActionOptions `json:"options,omitempty"`
// DefaultOption contains the option, if any, that will appear as the
// default selection in a select box. It has no effect when used with
// other types of actions.
DefaultOption string `json:"default_option,omitempty"`
// Defines the interaction with the backend upon a user action. // Defines the interaction with the backend upon a user action.
// Integration contains Context, which is private plugin data; // Integration contains Context, which is private plugin data;
// Integrations are stripped from Posts when they are sent to the // Integrations are stripped from Posts when they are sent to the
@@ -75,6 +83,10 @@ func (p *PostAction) Equals(input *PostAction) bool {
return false return false
} }
if p.DefaultOption != input.DefaultOption {
return false
}
if p.Cookie != input.Cookie { if p.Cookie != input.Cookie {
return false return false
} }