Skip to content
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

Add rich_text classes to slack_sdk.models module #1428

Closed
1 of 9 tasks
tj-smith47 opened this issue Nov 18, 2023 · 2 comments · Fixed by #1431
Closed
1 of 9 tasks

Add rich_text classes to slack_sdk.models module #1428

tj-smith47 opened this issue Nov 18, 2023 · 2 comments · Fixed by #1431
Assignees
Labels
enhancement M-T: A feature request for new functionality Version: 3x web-client
Milestone

Comments

@tj-smith47
Copy link

tj-smith47 commented Nov 18, 2023

I'm currently refactoring code using slack_sdk models, and most of my modals use RichText objects. I've noticed while available in Block Kit Builder and documented thoroughly, there is not a model for it. I created my own (I'd share, but the way it's constructed is significantly different than how I see it done in this project), but when I try to pass this through the View() constructor, it skips those blocks because it doesn't recognize the type, despite how well established and integrated into documentation that component appears to be.

I'm wondering if there is a plan to add a model for this in place, and if so, where that is on the priority scale? Also hoping to get clarity on what appears should be LinkTextObject for use inside a section or list of a RichTextElement. Passing subtype="link" to TextObject "works", but the url property gets discarded.

Category (place an x in each of the [ ])

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.models (UI component builders)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.rtm (RTM client)
  • slack_sdk.signature (Request Signature Verifier)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@seratch seratch added enhancement M-T: A feature request for new functionality web-client Version: 3x and removed untriaged labels Nov 20, 2023
@seratch seratch added this to the 3.25.0 milestone Nov 20, 2023
@seratch seratch self-assigned this Nov 20, 2023
@seratch
Copy link
Member

seratch commented Nov 20, 2023

Hi @tj-smith47, thanks for writing in!

'm wondering if there is a plan to add a model for this in place, and if so, where that is on the priority scale?

Since Slack's platform unlocked those rich_text blocks to 3rd party apps recently, this project has not yet supported it. However, we definitely plan to add it! (Actually it's already done for Node and Java SDKs).

I cannot tell the exact date to publish a new version yet, but it won't take weeks for sure. If everything goes well, a new version including it would be available by the end of this week.

Also hoping to get clarity on what appears should be LinkTextObject for use inside a section or list of a RichTextElement. Passing subtype="link" to TextObject "works", but the url property gets discarded.

I won't reuse the TextObject class for the link item in rich text list objects. The TextObject represents a typical property of a block, which possesses either a "plain_text" or "mrkdwn" type (and usually it is supposed to be used for label etc.). This object cannot be an item of "rich_text_section" block element. They are completely different ones. So, when we add rich_text block elements to the model module, we will introduce a new class for the link item.

@tj-smith47
Copy link
Author

@seratch This is great news! Thank you for your work on this, can't wait to see it!

seratch added a commit to seratch/python-slack-sdk that referenced this issue Nov 21, 2023
@seratch seratch changed the title Add RichTextBlock Model (rich_text Block type, RichTextSection, RichTextList, RichTextPreformatted) Add rich_text classes to slack_sdk.models module Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality Version: 3x web-client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants