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

fix: implement unique dynamic id generation for FileUploader component #17651

Merged

Conversation

Shankar-CodeJunkie
Copy link
Contributor

Closes #17556

[{{short description}}](fix: implement unique dynamic id generation for FileUploader component)

  • Replaced the Class component for FileUploader with functional component to use useId internal react hook

Changed
src/components/FileUploader/FileUploader.tsx

Testing / Reviewing

  1. I have ran yarn storybook and confirmed that the FileUploader component now generates a unique id and it is being used in the component.

Image

Copy link

netlify bot commented Oct 4, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 0e5c7ab
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/670900b6d899690008ebbbdc
😎 Deploy Preview https://deploy-preview-17651--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 configuration.

Copy link

netlify bot commented Oct 4, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 0e5c7ab
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/670900b6cfe1bf0009a23b9d
😎 Deploy Preview https://deploy-preview-17651--v11-carbon-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 configuration.

@Shankar-CodeJunkie
Copy link
Contributor Author

I am working on to resolve the unit test failures for FileUploader component .. I will fix the issue and push the changes by tomorrow

FAIL packages/react/src/components/FileUploader/__tests__/FileUploader-test.js
  ● FileUploader › should clear all uploaded files when `clearFiles` is called on a ref

    TypeError: Cannot read properties of null (reading 'clearFiles')
    ```

@Shankar-CodeJunkie
Copy link
Contributor Author

  • I have fixed the above unit test failure, and now I am getting test failure on snapshot

    expect(received).toMatchSnapshot()

    Snapshot name: `Public API should only change with a semver change 1`

    - Snapshot  - 3
    + Received  + 2

    @@ -3262,13 +3262,11 @@
            },

I will fix the above as well and push the updates to the PR

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 79.00%. Comparing base (993fb9c) to head (0e5c7ab).

Files with missing lines Patch % Lines
...react/src/components/FileUploader/FileUploader.tsx 80.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17651      +/-   ##
==========================================
+ Coverage   78.96%   79.00%   +0.03%     
==========================================
  Files         408      408              
  Lines       14020    14008      -12     
  Branches     4381     4319      -62     
==========================================
- Hits        11071    11067       -4     
+ Misses       2782     2775       -7     
+ Partials      167      166       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! LGTM

Copy link
Contributor

@guidari guidari left a comment

Choose a reason for hiding this comment

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

Awesome change! Thanks!

@guidari guidari added this pull request to the merge queue Oct 11, 2024
Merged via the queue into carbon-design-system:main with commit 261d33c Oct 11, 2024
23 checks passed
annawen1 pushed a commit to annawen1/carbon that referenced this pull request Oct 11, 2024
carbon-design-system#17651)

* fix: implement unique dynamic id generation for FileUploader component

* test(FileUploader): fix failing tests and update snapshot
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.

[a11y]: File uploader has static id that can cause conflicts
3 participants