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

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

Closed
wants to merge 4 commits into from

Conversation

franmc01
Copy link
Contributor

@franmc01 franmc01 commented Aug 22, 2024

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

feat(fileupload): add file removal functionality in basic mode
Copy link

vercel bot commented Aug 22, 2024

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

Copy link

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>.

1 similar comment
Copy link

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>.

@franmc01 franmc01 changed the title FileUpload: Ability to remove file in basic mode FileUpload: Ability to remove file in basic mode (#2991) Aug 22, 2024
@franmc01 franmc01 changed the title FileUpload: Ability to remove file in basic mode (#2991) FileUpload: Ability to remove file in basic mode - #2991 Aug 22, 2024
Copy link

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>.

1 similar comment
Copy link

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>.

@melloware
Copy link
Member

Looks like the build is failing?

@melloware melloware added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Aug 22, 2024
Copy link

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>.

@franmc01
Copy link
Contributor Author

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

@nitrogenous
Copy link
Contributor

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 nitrogenous closed this Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FileUpload: Ability to remove file in basic mode
3 participants