pipedream icon indicating copy to clipboard operation
pipedream copied to clipboard

feat(slack/send-block-kit-message): allow to set unfurl properties in block messages

Open joscha opened this issue 1 year ago • 9 comments

WHY

Adds unfurl_media and unfurl_links options to slack send-block-kit-message action.

Background

Contrary to send-custom-message which had this functionality for a while: https://github.com/PipedreamHQ/pipedream/blob/f2ea490cf78f3021ca875a2a46a53e0e1a6c4366/components/slack/actions/send-custom-message/send-custom-message.mjs#L36-L47 currently, it is not possible to define whether to unfurl links and media in block messages or not.

This adds the two optional properties to the send-block-kit-message action.

Note: there seem to be quite a few props that are not passed through to custom actions from https://github.com/PipedreamHQ/pipedream/blob/f2ea490cf78f3021ca875a2a46a53e0e1a6c4366/components/slack/slack.app.mjs#L7 - is there a specific reason for it? Otherwise we could all add them to send-message common module here: https://github.com/PipedreamHQ/pipedream/blob/f2ea490cf78f3021ca875a2a46a53e0e1a6c4366/components/slack/actions/common/send-message.mjs#L7 and they'd automatically inherited via https://github.com/PipedreamHQ/pipedream/blob/f2ea490cf78f3021ca875a2a46a53e0e1a6c4366/components/slack/actions/send-block-kit-message/send-block-kit-message.mjs#L38 in each of the consumers. That way all current supported options plus all future new options would automatically be supported by all slack action providers, which feels like is what we want?

joscha avatar May 20 '24 11:05 joscha

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview May 20, 2024 11:43am
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) May 20, 2024 11:43am

vercel[bot] avatar May 20 '24 11:05 vercel[bot]

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

Thank you for your contribution! Looks good, ready for QA

Thank you! Did you see my note? Would it make sense to pass through properties by default?

joscha avatar May 20 '24 15:05 joscha

Thank you for your contribution! Looks good, ready for QA

And one more question: is there an easy way for me to test such changes against my pipedream workspace?

joscha avatar May 20 '24 15:05 joscha

Thank you for your contribution! Looks good, ready for QA

Thank you! Did you see my note? Would it make sense to pass through properties by default?

Hi @joscha . I think it makes sense to pass through the available properties. We'll be making some updates to Slack components in the near future. @malexanderlim This is something to consider for the upcoming Slack Usability Audit.

To test changes you make to components, you can use the Pipedream CLI and pd publish actions to your workspace. They'll show up under "My Actions" when you're adding a step in the workflow.

michelle0927 avatar May 20 '24 19:05 michelle0927

Hi @joscha . I think it makes sense to pass through the available properties. We'll be making some updates to Slack components in the near future. @malexanderlim This is something to consider for the upcoming Slack Usability Audit.

After we merged this PR, I'd open another one that reuses the properties, is that okay?

To test changes you make to components, you can use the Pipedream CLI and pd publish actions to your workspace. They'll show up under "My Actions" when you're adding a step in the workflow.

Is there a special flow I can use in this component, especially because it references multiple files, etc.? The pipedream cli doesn't discover the dependency graph and uploads all needed references, does it?

joscha avatar May 20 '24 19:05 joscha

Hi everyone, all test cases are passed! Ready for release!

Test report https://vunguyenhung.notion.site/feat-slack-send-block-kit-message-allow-to-set-unfurl-properties-in-block-messages-12003-c26b617a60ec483e9c40c3a6f649f942

vunguyenhung avatar May 21 '24 02:05 vunguyenhung

Hi everyone, all test cases are passed! Ready for release!

Test report https://vunguyenhung.notion.site/feat-slack-send-block-kit-message-allow-to-set-unfurl-properties-in-block-messages-12003-c26b617a60ec483e9c40c3a6f649f942

Now I'm hungry 😋

joscha avatar May 21 '24 06:05 joscha

@joscha

Hi @joscha . I think it makes sense to pass through the available properties. We'll be making some updates to Slack components in the near future. @malexanderlim This is something to consider for the upcoming Slack Usability Audit.

After we merged this PR, I'd open another one that reuses the properties, is that okay?

Yes, you can open another PR with the additional changes.

To test changes you make to components, you can use the Pipedream CLI and pd publish actions to your workspace. They'll show up under "My Actions" when you're adding a step in the workflow.

Is there a special flow I can use in this component, especially because it references multiple files, etc.? The pipedream cli doesn't discover the dependency graph and uploads all needed references, does it?

You can git clone the pipedream repo or your forked repo. Then use the pipedream CLI to publish individual actions to your workspace. Publishing the action will include any dependencies that are needed.

michelle0927 avatar May 21 '24 14:05 michelle0927