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
Split up View type to improve TS linting #1276
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great pull request! Can you check my comment?
The `submit_disabled` field is only available to `workflow_step` views. Co-authored-by: Kazuhiro Sera <seratch@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Before merging this, I would like to wait for others' comments for a few days
I think we should be good to merge these changes in, unless there was further discussion to be had on this @seratch! |
Thanks @srajiang, yes, we can merge this PR 👍 |
Summary
There a
View
type. It has three subset typesmodal
,home
, andworkflow_step
. As I've discovered while consuming@slack/bolt
there is a benefit to split these three up. Specifically that themodal
subset requires thetitle
field but the other two subsets have no use for it. If a consumer of this attempts to send amodal
view without atitle
they will receive an error so by splitting up the singleinterface
into three we can prevent the consumer from having to make the same mistake as myself to learn that although thetitle
field is optional for aview
, whentype: "modal"
is the case thetitle
field is required.I had to rely on these two pieces of documentation to get all of the fields correct:
workflow_step
docshome
andmodal
docsRequirements (place an
x
in each[ ]
)