Skip to content

chore: Types for FileUploader, FileUploaderButton, FileUploaderDropContainer, FileUploaderItem, FileUploaderSkeleton, Filename, Upload and ButtonSkeleton#13992

Merged
kodiakhq[bot] merged 9 commits into
carbon-design-system:mainfrom
imp-dance:12545-add-types-to-fileuploader
Jun 26, 2023

Conversation

@imp-dance

@imp-dance imp-dance commented Jun 13, 2023

Copy link
Copy Markdown
Contributor

Closes #12545
Part of #13229
Part of #13562

Changelog

New

  • Added types for the following components, and renamed to .tsx:
    • FileUploader
    • FileUploaderButton
    • FileUploaderDropContainer
    • FileUploaderItem
    • FileUploaderSkeleton
    • Filename
    • Upload
    • ButtonSkeleton

Changed

  • Filename.tabIndex changed from string -> number in type and PropType.

Additional notes
* Also added types to Loading and ButtonSkeleton components. (outside issue scope, but required for issue)
* We should probably share a ButtonKind type. Could be derived from the constant in prop-types/types.js.

@imp-dance imp-dance requested a review from a team as a code owner June 13, 2023 13:16
@netlify

netlify Bot commented Jun 13, 2023

Copy link
Copy Markdown

Deploy Preview for carbon-components-react ready!

Name Link
🔨 Latest commit 96da1b8
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/6499ad3a27c7e2000897e369
😎 Deploy Preview https://deploy-preview-13992--carbon-components-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify

netlify Bot commented Jun 13, 2023

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 96da1b8
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/6499ad3a5ba0a70008363c2c
😎 Deploy Preview https://deploy-preview-13992--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@tw15egan

Copy link
Copy Markdown
Contributor

@imp-dance looks like we have some test failures

@imp-dance

imp-dance commented Jun 13, 2023

Copy link
Copy Markdown
Contributor Author

@tw15egan Yeah I saw, seems related to this change:

  • Filename.tabIndex changed from string -> number in type and PropType.

What's the appropriate way to do/propose a breaking change like this?

An alternative method could be keeping it as a string but parsing it as an int internally.

So should I keep it as a string, or just update the test snapshot?

@tw15egan

Copy link
Copy Markdown
Contributor

@imp-dance if possible, let's keep it a string so it has less of an effect downstream. We could also add number as a valid propType along with string, if you think that would help

@imp-dance imp-dance requested a review from a team as a code owner June 13, 2023 20:10
@imp-dance

Copy link
Copy Markdown
Contributor Author

@tw15egan Sure thing, just pushed a commit that adds both as string & number as valid types, refactored the code to properly parse them and updated the snapshot.

@tay1orjones tay1orjones left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks pretty solid, thanks! I found just a couple minor items to address, let me know what you think

Comment thread packages/react/src/components/Button/Button.Skeleton.tsx Outdated
Comment thread packages/react/src/components/FileUploader/Filename.tsx
Comment thread packages/react/src/components/FileUploader/FileUploaderButton.tsx
Comment thread packages/react/src/components/FileUploader/FileUploaderButton.tsx
@tay1orjones

Copy link
Copy Markdown
Member

@tw15egan This is ready for a re-review

@imp-dance There's one minor conflict in button skeleton

@tw15egan tw15egan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍 ✅ Thanks for contributing! 🎉 💪🏻

@imp-dance

Copy link
Copy Markdown
Contributor Author

@tay1orjones Conflict should be fixed now, merged with latest main 👍

@kodiakhq kodiakhq Bot merged commit 033ecc7 into carbon-design-system:main Jun 26, 2023
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.

Add TypeScript types to FileUploader, FileUploaderButton, FileUploaderDropContainer, FileUploaderItem, FileUploaderSkeleton, Filename

3 participants