Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirmation Box Not Working #781

Closed
buildgreatthings opened this issue Apr 21, 2019 · 6 comments
Closed

Confirmation Box Not Working #781

buildgreatthings opened this issue Apr 21, 2019 · 6 comments
Labels
pkg:interactive-messages (deprecated) applies to `@slack/interactive-messages` question M-T: User needs support to use the project

Comments

@buildgreatthings
Copy link

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 [ ])

  • [ x ] question

Requirements

  • [ x ] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [ x ] I've read and agree to the Code of Conduct.
  • [ x ] I've searched for any related issues and avoided creating a duplicate issue.

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 one of the blocks section where actions are done

{
"type":"section",
"text":{
"type":"mrkdwn",
"text":"Action:"
},
"accessory":{
"type":"static_select",
"placeholder":{
"type":"plain_text",
"emoji":true,
"text":"Select an option"
},
"options":[
{
"text":{
"type":"plain_text",
"emoji":true,
"text":"Approve"
},
"value":"-approve",
"confirm":{
"title":{
"type":"plain_text",
"text":"Are you sure?"
},
"text":{
"type":"plain_text",
"text":"You're about to approve."
},
"confirm":{
"type":"plain_text",
"text":"Yes"
},
"deny":{
"type":"plain_text",
"text":"No"
}
}
},
{
"text":{
"type":"plain_text",
"emoji":true,
"text":"Block - Fraud"
},
"value":"-block_fraud",
"confirm":{
"title":{
"type":"plain_text",
"text":"Are you sure?"
},
"text":{
"type":"plain_text",
"text":"You're about to block for fraud."
},
"confirm":{
"type":"plain_text",
"text":"Yes"
},
"deny":{
"type":"plain_text",
"text":"No"
}
}
},
{
"text":{
"type":"plain_text",
"emoji":true,
"text":"Block - Wrong Info"
},
"value":"-block_wrong_info",
"confirm":{
"title":{
"type":"plain_text",
"text":"Are you sure?"
},
"text":{
"type":"plain_text",
"text":"You're about to block for wrong info."
},
"confirm":{
"type":"plain_text",
"text":"Yes"
},
"deny":{
"type":"plain_text",
"text":"No"
}
}
}
],
"action_id":"escalation_response"
}
}

  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
Copy link
Author

@shanedewael @aoberoi Reopening this from Issue because it failed in testing.

@buildgreatthings
Copy link
Author

bump. @shanedewael @aoberoi

@shaydewael
Copy link
Contributor

shaydewael commented Apr 24, 2019

Hey @awcchungster 👋the problem you're reporting would be an issue with Block Kit, not any of our developer tools. In the future, issues like this should be sent to developers@slack.com — they'll be a lot faster to respond to platform issues like this.

I tested out your payload and you placed the confirm object in the wrong spot. It should always be at the top level of an action element (on the same level as the action_id) rather than associated with each option in the select menu. There's a bit more information about the structure of block elements on our API site at https://api.slack.com/reference/messaging/block-elements

Here's a link to a working version of your payload in the Builder.

@buildgreatthings
Copy link
Author

@shanedewael This doesn't work. When I do a reject, it gives the same dialogue box of approve, rather than showing block.

@shaydewael
Copy link
Contributor

shaydewael commented Apr 24, 2019

@awcchungster As of right now, it's not possible to have different confirmation text based on what the user selected in a select. I see how updating the confirmation text based on the user's choice could be valuable — I can definitely send the feedback along to our product team.

For now, you could use two buttons since they can each have their own confirm dialog, or broaden the select's confirm dialog to say something like "Are you sure? The action you select is final". Sorry this has been causing trouble.

@seratch seratch added pkg:interactive-messages (deprecated) applies to `@slack/interactive-messages` question M-T: User needs support to use the project labels Jun 9, 2020
@seratch
Copy link
Member

seratch commented Jun 9, 2020

Hi, I know probably this is very late but let me add a bit more information here.

As Shay described above, the confirm component has only simple functionalities. But if you utilize multiple modal views (updating a single modal view by response_action: update in a view_submission response or calling views.update when receiving block_actions requests), it may be possible to realize a better user experience with richer UI components. Please refer to https://api.slack.com/surfaces/modals/using for details.

If you don't mind, I would like to close this issue as there is no further information we can share with you at this moment. Please allow me to close this after waiting for your response for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:interactive-messages (deprecated) applies to `@slack/interactive-messages` question M-T: User needs support to use the project
Projects
None yet
Development

No branches or pull requests

4 participants