bolt-js icon indicating copy to clipboard operation
bolt-js copied to clipboard

How to listen dialog_submission

Open dharmendrasha opened this issue 3 years ago • 1 comments

Description

I am trying listen the dialog_submission type. I can see i am getting the event when i submit the dialog created via this.

      client.dialog.open({
        trigger_id: body.trigger_id,
        dialog: {
          title: 'Add your task.',
          callback_id: interactiveEnums.TASK_VIEW_SUBMIT,
          notify_on_cancel: true,
          elements: [
            {
              type: 'textarea',
              name: 'taday_task',
              placeholder: 'Place you daily task in detail form.',
              label: 'Enter your task here in detail form.',
              min_length: 40,
              max_length: 3000,
            },
            {
              type: 'text',
              name: 'hours_spend',
              subtype: 'number',
              label: 'How much hours did you spend on above tasks.',
              value: '8',
            },
          ],
        },
      });

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

  • [x] bug
  • [x] enhancement (feature request)
  • [x] question
  • [x] documentation related
  • [x] example code related
  • [ ] testing related
  • [x] discussion

Requirements (place an x in each of the [ ])

  • [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:

package version: ^3.12.1

node version: 18

OS version(s): bulls eye dev container

Steps to reproduce:

  1. Open the dialog on the interactive command

Expected result:

What you expect to happen

When I try to listen to the view

app.view('call_back_id', action())

The action closure function should be called.

Actual result:

What actually happened

I am not getting any event call back of any type when i intercept the call back via app.use I can see the logs are coming.

Attachments:

Logs, screenshots, screencast, sample project, funny gif, etc.

Screenshot 2022-08-28 at 17 04 26 Screenshot 2022-08-28 at 17 05 04 Screenshot 2022-08-28 at 17 05 19 Screenshot 2022-08-28 at 17 05 36

dharmendrasha avatar Aug 28 '22 11:08 dharmendrasha

Hi @dharmendrasha, thanks for asking the question!

We generally don't recommend using dialogs over modals because we won't add any new features to dialogs. That being said, if you have a certain reason to still use dialogs, checking my comment at https://github.com/slackapi/bolt-js/issues/265#issuecomment-537449896 can be helpful. More specifically, something like this should work for you:

app.action({ callback_id: interactiveEnums.TASK_VIEW_SUBMIT }, async ({ ack }) => {
  await ack();
});

I hope this was helpful to you.

seratch avatar Aug 29 '22 02:08 seratch

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

github-actions[bot] avatar Oct 03 '22 00:10 github-actions[bot]

As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.

github-actions[bot] avatar Oct 17 '22 00:10 github-actions[bot]