Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[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

Open
wants to merge 1 commit into
base: 7.3
Choose a base branch
Loading
from

Conversation

miloszowi
Copy link

@miloszowi miloszowi commented Apr 13, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
License MIT

Allow to pass null as $url for SlackActionsBlock as it is not required

Allow to set$value as it is required

Allow to set block_id to SlackActionsBlock as it is required

@carsonbot
Copy link

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:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.3 branch.

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!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

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".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@miloszowi miloszowi force-pushed the slack-notifier-actions-and-button-blocks-improvements branch from 92d6fdb to e687dff Compare April 13, 2025 11:40
…allow setting value in SlackButtonBlockElement
@miloszowi miloszowi force-pushed the slack-notifier-actions-and-button-blocks-improvements branch from e687dff to 6c2d27e Compare April 13, 2025 12:17
@carsonbot carsonbot changed the title Allow to set block_id for SlackActionsBlock and set url to nullable, … [Notifier] Allow to set block_id for SlackActionsBlock and set url to nullable, … Apr 13, 2025
@nicolas-grekas nicolas-grekas changed the title [Notifier] Allow to set block_id for SlackActionsBlock and set url to nullable, … [Notifier] Allow to set block_id for SlackActionsBlock and set url to nullable, allow setting value in SlackButtonBlockElement Apr 16, 2025
@@ -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)
Copy link
Member

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?

Copy link
Author

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.

Copy link
Author

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.

@nicolas-grekas nicolas-grekas changed the title [Notifier] Allow to set block_id for SlackActionsBlock and set url to nullable, allow setting value in SlackButtonBlockElement [Notifier] Allow to set block_id and value for SlackActionsBlock Apr 16, 2025
@nicolas-grekas nicolas-grekas changed the title [Notifier] Allow to set block_id and value for SlackActionsBlock [Notifier] Allow to set block_id/value for SlackActionsBlock and SlackButtonBlockElement Apr 16, 2025
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.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.