From 98489b9e67d97488f4c04732e8eb18e7ccd3d75a Mon Sep 17 00:00:00 2001 From: Theo Gkourasas Date: Wed, 11 Sep 2019 11:31:51 -0400 Subject: [PATCH] =?UTF-8?q?MM-15219=20Add=20support=20for=20introduction?= =?UTF-8?q?=20text=20in=20interactive=20dial=E2=80=A6=20(#12029)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api4/integration_action_test.go | 14 +++++++++++++- model/integration_action.go | 15 ++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/api4/integration_action_test.go b/api4/integration_action_test.go index a28ab51fb7..3838d321fb 100644 --- a/api4/integration_action_test.go +++ b/api4/integration_action_test.go @@ -142,8 +142,20 @@ func TestOpenDialog(t *testing.T) { CheckBadRequestStatus(t, resp) assert.False(t, pass) - // Should pass with no elements + // Should pass with markdown formatted introduction text request.URL = "http://localhost:8065" + request.Dialog.IntroductionText = "**Some** _introduction text" + pass, resp = Client.OpenInteractiveDialog(request) + CheckNoError(t, resp) + assert.True(t, pass) + + // Should pass with empty introduction text + request.Dialog.IntroductionText = "" + pass, resp = Client.OpenInteractiveDialog(request) + CheckNoError(t, resp) + assert.True(t, pass) + + // Should pass with no elements request.Dialog.Elements = nil pass, resp = Client.OpenInteractiveDialog(request) CheckNoError(t, resp) diff --git a/model/integration_action.go b/model/integration_action.go index 4490e4fde0..82e402b531 100644 --- a/model/integration_action.go +++ b/model/integration_action.go @@ -178,13 +178,14 @@ type PostActionAPIResponse struct { } type Dialog struct { - CallbackId string `json:"callback_id"` - Title string `json:"title"` - IconURL string `json:"icon_url"` - Elements []DialogElement `json:"elements"` - SubmitLabel string `json:"submit_label"` - NotifyOnCancel bool `json:"notify_on_cancel"` - State string `json:"state"` + CallbackId string `json:"callback_id"` + Title string `json:"title"` + IntroductionText string `json:"introduction_text"` + IconURL string `json:"icon_url"` + Elements []DialogElement `json:"elements"` + SubmitLabel string `json:"submit_label"` + NotifyOnCancel bool `json:"notify_on_cancel"` + State string `json:"state"` } type DialogElement struct {