From 2b6691e5ccc38b36e9a6113657ba5e53196e650d Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Mon, 22 Apr 2019 11:57:54 -0400 Subject: [PATCH] MM-14741 Add default option to post action dropdown (#10659) --- model/integration_action.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/model/integration_action.go b/model/integration_action.go index 58741788a8..4490e4fde0 100644 --- a/model/integration_action.go +++ b/model/integration_action.go @@ -47,8 +47,16 @@ type PostAction struct { // DataSource indicates the data source for the select action. If left // empty, the select is populated from Options. Other supported values // are "users" and "channels". - DataSource string `json:"data_source,omitempty"` - Options []*PostActionOptions `json:"options,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"` + + // 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. // Integration contains Context, which is private plugin data; @@ -75,6 +83,10 @@ func (p *PostAction) Equals(input *PostAction) bool { return false } + if p.DefaultOption != input.DefaultOption { + return false + } + if p.Cookie != input.Cookie { return false }