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

types: Add "slack_file" object to "image" block/element types #1783

Merged
merged 11 commits into from
May 1, 2024

Conversation

hi1280
Copy link
Contributor

@hi1280 hi1280 commented Apr 30, 2024

Summary

Add "slack_file" object to the types package.

fix: #1734, #1738

Requirements (place an x in each [ ])

cfeeney5 and others added 10 commits April 30, 2024 13:37
This update adds the newly available slack_file object to the imageBlock and sets the image_url to be optional
…ImageBlock and ImageElement

The new slack_file object must contain and id or a url so we use a union type to ensure either id or url is used.
ImageBlock and ImageElement have also been updated. ImageBlock has been changed to a type so a union can be used
Copy link

Thanks for the contribution! Before we can merge this, we need @hi1280 to sign the Salesforce Inc. Contributor License Agreement.

@hi1280
Copy link
Contributor Author

hi1280 commented Apr 30, 2024

The following pull request has not been updated for a while, so I have made an additional fix.
#1738

@hi1280 hi1280 marked this pull request as ready for review April 30, 2024 05:57
@seratch seratch added area:typescript issues that specifically impact using the package from typescript projects pkg:types applies to `@slack/types` labels Apr 30, 2024
@seratch seratch added this to the [email protected] milestone Apr 30, 2024
@seratch
Copy link
Member

seratch commented Apr 30, 2024

@hi1280 Thanks for taking the time to send this PR!
@filmaj The additional change in this PR resolves the remaining code formatting issue in #1738 and it looks good to me. Can you take a look?

@seratch seratch requested a review from filmaj April 30, 2024 06:13
Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for the PR! I left two minor comments, just need to slightly move a couple of JSDocs but LGTM otherwise!

slack_file: SlackFile;
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this JSDoc comment right above the url property, so that devs with Type/JavaScript language server support see the doc and link directly in their IDE!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have fixed this. Please confirm.

interface SlackFileViaUrl {
url: string;
}
/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: let's move this JSDoc directly above the id property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have fixed this. Please confirm.

Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you so much!

@filmaj filmaj merged commit aea11d0 into slackapi:main May 1, 2024
17 checks passed
@filmaj
Copy link
Contributor

filmaj commented Jun 5, 2024

FYI the fix for this has been released to npm as @slack/types v2.12.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typescript issues that specifically impact using the package from typescript projects cla:signed pkg:types applies to `@slack/types`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "slack_file" object to "image" block/element types
4 participants