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

feat(file-uploader): add drag and drop file uploader #3175

Closed

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Jun 25, 2019

Closes #2088
Closes #2288
Closes #2916
Closes #2917
Closes #3252

refs #2848 #3016

This PR adds drag and drop support to the vanilla and React file uploader component, along with various bugfixes

Changelog

New

  • <FileUploaderDropContainer> component to represent drop area for file uploads
  • <FileUploaderItem> component to represented uploaded items
  • example application showing drag and drop file uploader workflow, error handling, etc

Changed

  • correct file upload status icons
  • match invalid file upload markup structure with loading and success upload structures
  • deprecate legacy styles
  • convert <Filename> to stateless functional component

Removed

Testing / Reviewing

Ensure the new file uploader functions as expected and ensure the existing file loader does not have any regressions

@netlify
Copy link

netlify bot commented Jun 25, 2019

Deploy preview for carbon-elements ready!

Built with commit 09db8a5

https://deploy-preview-3175--carbon-elements.netlify.com

@netlify
Copy link

netlify bot commented Jun 25, 2019

Deploy preview for the-carbon-components ready!

Built with commit 09db8a5

https://deploy-preview-3175--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Jun 25, 2019

Deploy preview for carbon-components-react ready!

Built with commit 09db8a5

https://deploy-preview-3175--carbon-components-react.netlify.com

Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

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

🎉 - Just one comment. Thanks @emyarod!

packages/components/docs/sass.md Outdated Show resolved Hide resolved
@joshblack
Copy link
Contributor

Does this supersede #2848?

Copy link
Contributor

@shixiedesign shixiedesign left a comment

Choose a reason for hiding this comment

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

Great! Only a few details I noticed. And thanks to @asudoh 's theme switcher, now I can review in all themes!

  • file name is the wrong color in error state. Should be $text-01 or Gray100
    image

  • Dark themes, success icon's inside checkmark should be a white fill. Also success icon's blue color should be coming from token interactive-04, which would have Blue50 for dark themes.
    image

  • Dark theme, error state's close X might have the wrong color token? Should be $icon-02
    image
    image

Specific for react:

  • the little green plus sign on user's cursor should only show when the cursor dragging a file is inside the drop zone. Cursor should remain default when dragging outside the drop zone.
    Jun-25-2019 23-12-28

  • the blue success icon is on for too long before turning into an X. Vanilla's version is okay, probably about 1 second is good.
    Jun-25-2019 23-11-07

@shixiedesign
Copy link
Contributor

shixiedesign commented Jun 26, 2019

Side note, I'd love to add some motion design to this component, but I'm not sure how it impacts @asudoh and @emyarod your works. Maybe this is what Josh is asking too. Does one need to be updated before another? Are the two PR dependent on each other?

Specifically, I'm thinking it would be great to add motion to the file list item (appearance & error state), and, transition of loading spinner to success icon to X. I will post a prototype tomorrow.

@asudoh
Copy link
Contributor

asudoh commented Jun 26, 2019

Thank you for the heads-up @shixiedesign! This PR contains my earlier work (#2848).

@emyarod
Copy link
Member Author

emyarod commented Jun 26, 2019

@shixiedesign all points have been addressed except for the React cursor changing/not changing. I will need to look more into this

@emyarod emyarod force-pushed the drag-and-drop-file-uploader branch from 2d689b2 to 810b079 Compare June 26, 2019 22:00
@emyarod
Copy link
Member Author

emyarod commented Jun 26, 2019

React component cursor changes should now be resolved

Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

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

Great to see this PR in ready-for-review state @emyarod!

@joshblack joshblack requested a review from a team June 28, 2019 15:14
@ghost ghost requested review from abbeyhrt and aledavila and removed request for a team June 28, 2019 15:14
@emyarod emyarod force-pushed the drag-and-drop-file-uploader branch 2 times, most recently from d2db92f to 2e80764 Compare June 28, 2019 16:29
shixiedesign
shixiedesign previously approved these changes Jun 28, 2019
Copy link
Contributor

@shixiedesign shixiedesign left a comment

Choose a reason for hiding this comment

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

Looks good! 💯Thanks for making the fix!

@joshblack
Copy link
Contributor

Should we close this one in favor of #3872?

@emyarod emyarod closed this Sep 5, 2019
@emyarod emyarod deleted the drag-and-drop-file-uploader branch September 5, 2019 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet