Skip to content

Add support for response_urls in modals - #405

Merged
seratch merged 1 commit into
slackapi:masterfrom
seratch:response_urls_modal
Mar 19, 2020
Merged

seratch merged 1 commit into
slackapi:masterfrom
seratch:response_urls_modal

Conversation

@seratch

@seratch seratch commented Mar 19, 2020

Copy link
Copy Markdown
Contributor

Summary

This pull request adds full support for response_urls in modals.

Having response_url_enabled flag as true in input block elements enables Slack apps to acquire response_urls bound to the chosen channel in modals. The response_url_enabled flag has been already added to the payload class by #404.

Developers can easily utilize response_urls in the payload as below:

app.viewSubmission(callbackId, (req, ctx) -> {
  ctx.respond("[ephemeral] Thank you for submitting the data!");
  ctx.respond(r -> r.responseType("in_channel").text("[in_channel] Thank you for submitting the data!"));
  return ctx.ack();
});

app.viewSubmission(callbackId, (req, ctx) -> {
  ctx.getResponder("b1", "a").send("This message was sent via response_url given by channels_select block element (block_id: b1, action_id: a)");
  return ctx.ack();
});

Requirements (place an x in each [ ])

@codecov

codecov Bot commented Mar 19, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #405 into master will decrease coverage by 0.02%.
The diff coverage is 80%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #405      +/-   ##
============================================
- Coverage     83.88%   83.85%   -0.03%     
- Complexity     2345     2366      +21     
============================================
  Files           247      249       +2     
  Lines          6317     6368      +51     
  Branches        571      577       +6     
============================================
+ Hits           5299     5340      +41     
- Misses          670      674       +4     
- Partials        348      354       +6
Impacted Files Coverage Δ Complexity Δ
...pi/app_backend/views/InputBlockResponseSender.java 100% <100%> (ø) 8 <8> (?)
...in/java/com/slack/api/bolt/response/Responder.java 100% <100%> (ø) 7 <4> (+2) ⬆️
...ack/api/bolt/context/InputBlockRespondUtility.java 100% <100%> (ø) 5 <5> (?)
...pi/bolt/context/builtin/ViewSubmissionContext.java 77.77% <46.15%> (-17.88%) 13 <4> (+4)
...pi/bolt/request/builtin/ViewSubmissionRequest.java 81.81% <55.55%> (-11.52%) 8 <3> (+2)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1663c7c...7f73c60. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant