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(module:upload): send event when file is not authorize #9034

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nicoss54
Copy link
Collaborator

@Nicoss54 Nicoss54 commented Mar 6, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

When file doest not respect the criteria filter like accept, or fileType, no event emitter is sent. This behavior prevent the developer to do something with the file rejected, like display a notification

Issue Number: 8907

What is the new behavior?

When file doest not respect the criteria filter like accept, or fileType, an event emitter is sent

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link

zorro-bot bot commented Mar 6, 2025

This preview will be available after the AzureCI is passed.

Copy link

codecov bot commented Mar 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.96%. Comparing base (58e87a3) to head (54ea21b).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9034      +/-   ##
==========================================
- Coverage   91.96%   91.96%   -0.01%     
==========================================
  Files         559      559              
  Lines       19772    19800      +28     
  Branches     2954     3058     +104     
==========================================
+ Hits        18184    18209      +25     
- Misses       1262     1264       +2     
- Partials      326      327       +1     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HyperLife1119
Copy link
Collaborator

Can you take a look at this, antd doesn't seem to provide a counterpart either, do we need to add that functionality?
@Laffery

@HyperLife1119 HyperLife1119 requested a review from Laffery March 12, 2025 08:16
@Nicoss54
Copy link
Collaborator Author

Can you take a look at this, antd doesn't seem to provide a counterpart either, do we need to add that functionality?

In fact, the feature does not return the number of files that are not authorized as a result of the filters.
The aim of the feature is to return all files that have not passed the various filters.

This feature may make sense, as the developer may wish to display the list of files that have not been uploaded following the application of filters.

@Laffery
Copy link
Collaborator

Laffery commented Mar 12, 2025

Can you take a look at this, antd doesn't seem to provide a counterpart either, do we need to add that functionality? @Laffery

I just lookup and found there is a related issue with antd ant-design/ant-design#36318, but there are no associated resolution or plan yet.
I suggest hold on this PR tilll antd provides a similar api.
WDYT @HyperLife1119 @Nicoss54

@HyperLife1119
Copy link
Collaborator

I agree. As far as getting files that don't meet the rules, I guess that could be accomplished with nzBeforeUpload?

@Nicoss54
Copy link
Collaborator Author

Agree too, let's wait the implementation in andt design, keep this PR with putting the tag blocked by andt and the rework if it's needed.

NzbeforeUpload is call for each file to upload, if we send an eventEmitter in this part, event emitter will be emit more than 1 time. I had in mind to send an event with all file not accepted.

Like this if user upload a directory or multiple file, he will received just one event with a list of file that not match criteria filters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants