-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Notifier] Allow to set block_id/value for SlackActionsBlock and SlackButtonBlockElement #60209
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
base: 7.3
Are you sure you want to change the base?
[Notifier] Allow to set block_id/value for SlackActionsBlock and SlackButtonBlockElement #60209
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Hey! Thanks for your PR. You are targeting branch "7.3" but it seems your PR description refers to branch "7.3 for features / 6.4, 7.1, and 7.2 for bug fixes". Cheers! Carsonbot |
92d6fdb
to
e687dff
Compare
…allow setting value in SlackButtonBlockElement
e687dff
to
6c2d27e
Compare
@@ -16,20 +16,27 @@ | ||
*/ | ||
final class SlackButtonBlockElement extends AbstractSlackBlockElement | ||
{ | ||
public function __construct(string $text, string $url, ?string $style = null) | ||
public function __construct(string $text, ?string $url = null, ?string $style = null, ?string $value = null) |
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.
I'm not sure this change makes sense. Buttons defined this way are legacy anyway?
What would the value be used for, for buttons?
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.
According to slack API docs:
The value to send along with the interaction payload. Maximum length is 2000 characters.
If you want to react for a callback upon button is pressed, you can get a value of the button that was pressed, what can be hard without the value set.
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.
Simple example would be buttons like Approve
& Decline
that are included in one message - without the value, you can not determine which one was pressed by the user by just looking at the callback payload.
Allow to pass
null
as$url
forSlackActionsBlock
as it is not requiredAllow to set
$value
as it is requiredAllow to set
block_id
toSlackActionsBlock
as it is required