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
Adding Input Block Support for Modals #519
Comments
I'd love to be able to use this with interactive as well! Thanks for the great library all :) |
* Fix slackapi#639 Missing blocks & block elements * blocks * file blocks (for remote files) * rich-text blocks (out-of-scope in this commit) * block elements * multi-select elements * checkboxes * radio buttons * input block's elements slackapi#519 * rich text elements (out-of-scope in this commit) * filtering options for conversations * Fix slackapi#519 as mentioned above * Fix slackapi#632 DatePickerElement - missing placeholder causes TypeError
* Fix slackapi#639 Missing blocks & block elements * blocks * file blocks (for remote files) * rich-text blocks (out-of-scope in this commit) * block elements * multi-select elements * checkboxes * radio buttons * input block's elements slackapi#519 * rich text elements (out-of-scope in this commit) * filtering options for conversations * Fix slackapi#519 as mentioned above * Fix slackapi#632 DatePickerElement - missing placeholder causes TypeError
* Fix slackapi#639 Missing blocks & block elements * blocks * file blocks (for remote files) * rich-text blocks (out-of-scope in this commit) * block elements * multi-select elements * checkboxes * radio buttons * input block's elements slackapi#519 * rich text elements (out-of-scope in this commit) * filtering options for conversations * Fix slackapi#519 as mentioned above * Fix slackapi#632 DatePickerElement - missing placeholder causes TypeError
* Fix slackapi#639 Missing blocks & block elements * blocks * file blocks (for remote files) * rich-text blocks (out-of-scope in this commit) * block elements * multi-select elements * checkboxes * radio buttons * input block's elements slackapi#519 * rich text elements (out-of-scope in this commit) * filtering options for conversations * Fix slackapi#519 as mentioned above * Fix slackapi#632 DatePickerElement - missing placeholder causes TypeError
* Fix slackapi#639 Missing blocks & block elements * blocks * file blocks (for remote files) * rich-text blocks (out-of-scope in this commit) * block elements * multi-select elements * checkboxes * radio buttons * input block's elements slackapi#519 * rich text elements (out-of-scope in this commit) * filtering options for conversations * Fix slackapi#519 as mentioned above * Fix slackapi#632 DatePickerElement - missing placeholder causes TypeError
* Fix slackapi#639 Missing blocks & block elements * blocks * file blocks (for remote files) * rich-text blocks (out-of-scope in this commit) * block elements * multi-select elements * checkboxes * radio buttons * input block's elements slackapi#519 * rich text elements (out-of-scope in this commit) * filtering options for conversations * Fix slackapi#519 as mentioned above * Fix slackapi#632 DatePickerElement - missing placeholder causes TypeError * Add view support for modals and Home tabs ref slackapi#519 * Move parser methods to class methods, add more tests for view.state * Rename validation methods and fix backward incompatibilities * Add a test case for slackapi#623 and revise subtype getter * Fix slackapi#628 text length validation in SectionBlock * Add a sample using native Block Kit builders ref slackapi#500
* Fix slackapi#639 Missing blocks & block elements * blocks * file blocks (for remote files) * rich-text blocks (out-of-scope in this commit) * block elements * multi-select elements * checkboxes * radio buttons * input block's elements slackapi#519 * rich text elements (out-of-scope in this commit) * filtering options for conversations * Fix slackapi#519 as mentioned above * Fix slackapi#632 DatePickerElement - missing placeholder causes TypeError * Add view support for modals and Home tabs ref slackapi#519 * Move parser methods to class methods, add more tests for view.state * Rename validation methods and fix backward incompatibilities * Add a test case for slackapi#623 and revise subtype getter * Fix slackapi#628 text length validation in SectionBlock * Add a sample using native Block Kit builders ref slackapi#500
👋 slackclient 2.6.0rc1 is out. The pre-release version contains fixes for your issue described here. One week later from now, we'll be releasing version 2.6.0 to PyPI. If you have a chance, could you try the release candidate version out and let us know your feedback? Thank you very much for being patient with this issue. |
Sounds good, I'll try to give it a go this weekend. I looked over the source and it looked good to me. Thanks so much. |
I was able to get it working, I'll drop the code snippet I used to test it below. def open_modal(command: SlashCommandInteractiveEvent):
title = PlainTextObject(text="Color Survey")
color_input_blocks = [InputBlock(label=PlainTextObject(text="What is your favorite color?"),
element=PlainTextInputElement(placeholder="Green")),
InputBlock(label=PlainTextObject(text="Why is that your favorite color?"),
element=PlainTextInputElement(placeholder="It reminds me of my childhood home"),
optional=True)]
modal = views.View(type="modal", title=title, blocks=color_input_blocks, submit="Submit")
slack_client.views_open(trigger_id=command.trigger_id, view=modal.to_dict()) If this looks like good usage I wouldn't mind adding it to the documentation for the usage of the message and dialog builders. I did have some problems getting started at first. The only suggestion I have is to make the I'm also unsure about when I would use Overall I'm very happy with the additions and I'm excited to use it to implement App Homes or Modals. |
@ruberVulpes Thanks! I've revisited the
If you have more feedback, access my pull request #689 and feel free to leave comments there. I will be merging the PR within a few days.
I'm not going to maintain the README file. We'll be removing those files and will update the documents much more. |
Add more validation rules for view construction (thanks to feedback in #519)
Description
Describe your issue here.
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Enhancement
Slack just announced modals today. With these came input blocks. I was hoping to get support for the creation of these blocks in /slack/web/classes/blocks.py or possibly a new
/slack/web/classes/modals.py
similar to /slack/web/classes/dialogs.py.The text was updated successfully, but these errors were encountered: