slackapi / node-slack-interactive-messages

Slack Buttons, Menus, and Dialogs made simpler for Node
MIT License
133 stars 41 forks source link

Confirmation Box Not Working #93

Closed buildgreatthings closed 5 years ago

buildgreatthings commented 5 years ago

Description

I'm trying to add a dialog box to confirm a button click / dropdown in interactive messages.

What type of issue is this? (place an x in one of the [ ])

Requirements

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

@slack/interactive-messages version: node version: OS version(s):

Steps to reproduce:

  1. Visit the interactive message builder featuring thai food.
  2. Try to add the confirm code in the elements section of the buttons:

"confirm": { "title": "Are you sure?", "text": "Wouldn't you prefer a good game of chess?", "ok_text": "Yes", "dismiss_text": "No" }

  1. Try to compile the interactive message

Expected result:

It should create an interactive message with a dialog confirmation box, but it doesn't 

Actual result:

Doesn't allow confirm

buildgreatthings commented 5 years ago

@shanedewael Any thoughts? cc. @aoberoi

shaydewael commented 5 years ago

@awcchungster There's two problems I see with your payload. ok_text and dismiss_text should be confirm and deny with Block Kit. The second is that all text should be text objects (so plain-text objects in this case). Here's a payload I got to work for confirm:

"confirm": {
    "title": {
        "type": "plain_text",
        "text": "Are you sure?"
    },
    "text": {
        "type": "plain_text",
        "text": "Wouldn't you prefer a good game of chess?"
    },
    "confirm": {
        "type": "plain_text",
        "text": "Ok"
    },
    "deny": {
        "type": "plain_text",
        "text": "No"
    }
}
buildgreatthings commented 5 years ago

Gotcha, thanks! I got the template from your documentation, so if it's wrong, I recommend updating it or clarifying.

buildgreatthings commented 5 years ago

https://github.com/slackapi/node-slack-sdk/issues/781

buildgreatthings commented 5 years ago

@shanedewael I tried reopening another case related to this.

shaydewael commented 5 years ago

Closing out this issue since it's duplicated in the main repository for this package (https://github.com/slackapi/node-slack-sdk/issues/781)