symfony icon indicating copy to clipboard operation
symfony copied to clipboard

[Notifier] [Slack] Add button block element and `emoji`/`verbatim` options to section block

Open cvergne opened this issue 1 year ago • 1 comments

Q A
Branch? 7.2
Bug fix? no
New feature? yes
Deprecations? no
Issues -
License MIT

Hi,

When using the Slack Notifier bridge, I've noticed it wasn't possible to add a button as accessory to a section because button is only managed in the SlackActionsBlock, which is not allowed as an accessory in a Section block. So the first purpose of this PR is add a SlackButtonBlockElement we can use as accessory into a section block (and use that block into SlackActionsBlock as it follows the same structure).

Then, I noticed verbatim (for markdown) and emoji (for plain text) options were not available in SectionBlock (but available in ContextBlock), so I've added them. Note that originally, I was going to add them as optional arguments (?bool $verbatim = null) to avoid adding them if not explicitly given and keep the Slack default value, but the ContextBlock adds a default value (the same as Slack) for them, so I kept the same argument signature.

You can see an example of both use of button as accessory and verbatim param with the following link on Slack Block Kit Builder (must be logged in to a Slack Account).

These minor additions are in the same PR, but tell me if I should split them into two PRs.

Thanks :)

cvergne avatar Apr 26 '24 07:04 cvergne

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.1 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 avatar Apr 26 '24 07:04 carsonbot

Thank you @cvergne.

fabpot avatar May 31 '24 06:05 fabpot