primereact icon indicating copy to clipboard operation
primereact copied to clipboard

FileUpload: Ability to remove file in basic mode - #2991

Open franmc01 opened this issue 1 year ago • 8 comments

This PR adds a feature to the FileUpload component that allows the basic variant to support file removal (clear functionality). To ensure backward compatibility for existing users, a new prop, showRemoveButton, has been introduced. This prop enables this new file removal capability when set to true.

In addition to this, we've introduced the removeButtonSeverity prop to allow customization of the remove button's color. This is particularly useful for aligning with different design systems and color schemes, as the default "danger" color may not always be preferred. By using the library's own Button component, users can take full advantage of its features, including severity customization.

Key Changes:

  1. Feature Addition:

    • showRemoveButton: A new prop that controls the visibility of the remove button in the basic mode. Default is true.
    • removeButtonSeverity: A new prop to customize the severity (color) of the remove button. Valid values are "secondary", "success", "info", "warning", "danger", "help", and "contrast". Default is "danger".
  2. Documentation:

    • Updated the documentation to include the new props and their usage scenarios.
  3. Testing:

    • Conducted testing to ensure that the new functionality works as expected without impacting existing behavior for users who do not opt into this new feature.

Tasks Completed:

  • Implemented the showRemoveButton and removeButtonSeverity props.
  • Updated TypeScript definitions to include the new props.
  • Adjusted the FileUpload component to support these features.
  • Updated documentation accordingly.
  • Performed testing to validate the changes.

I’m open to any feedback or changes needed. Please let me know how I can further assist in this process.

Fixes #2991

franmc01 avatar Aug 22 '24 05:08 franmc01

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Aug 22, 2024 4:56pm
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Aug 22, 2024 4:56pm

vercel[bot] avatar Aug 22 '24 05:08 vercel[bot]

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

github-actions[bot] avatar Aug 22 '24 05:08 github-actions[bot]

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

github-actions[bot] avatar Aug 22 '24 05:08 github-actions[bot]

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

github-actions[bot] avatar Aug 22 '24 05:08 github-actions[bot]

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

github-actions[bot] avatar Aug 22 '24 05:08 github-actions[bot]

Looks like the build is failing?

melloware avatar Aug 22 '24 10:08 melloware

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

github-actions[bot] avatar Aug 22 '24 16:08 github-actions[bot]

Looks like the build is failing?

It was a format problem, I already corrected the linking issue, it makes me feel bad, not because what the format is or because it doesn't detect it

franmc01 avatar Aug 22 '24 16:08 franmc01

I'm sorry, but after discussing with my colleagues, we have decided not to approve this proposal. We appreciate your effort, but we believe users can achieve similar functionality through custom or advanced versions.

https://primereact.org/fileupload/#advanced https://primereact.org/fileupload/#template https://primereact.org/fileupload/#custom

nitrogenous avatar Sep 06 '24 10:09 nitrogenous