slackapi / bolt-js

A framework to build Slack apps using JavaScript
https://tools.slack.dev/bolt-js/
MIT License
2.74k stars 393 forks source link

How to listen dialog_submission #1569

Closed dharmendrasha closed 2 years ago

dharmendrasha commented 2 years ago

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

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


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

seratch commented 2 years ago

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.

github-actions[bot] commented 2 years ago

👋 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] commented 2 years ago

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.