-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Added BeforeChunk and AfterChunk events #3634
Conversation
use Maatwebsite\Excel\Tests\Data\Stubs\Database\User; | ||
use Maatwebsite\Excel\Tests\Data\Stubs\QueuedExportWithChunkEvents; | ||
|
||
class QueuedExportWithChunkEventsTest extends TestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow this test seems to be failing in GH Actions, can you have a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it. Sorry, didn't saw the GH actions.
Can you already draft up a PR to the docs as well? Thanks! |
Sure, added it! Another point I noticed is, that all other events have some sort of context / payload e.g |
This bug report has been automatically closed because it has not had recent activity. If this is still an active bug, please comment to reopen. Thank you for your contributions. |
Hi, any reason to not merge this PR? it's a nice feature to have for all the people that want to handle the export progress. Thanks |
+1 on merging the PR. I see no other reason for closing than inactivity. |
Can we reopen this? It is a very much missed feature. |
1️⃣ Why should it be added? What are the benefits of this change?
This PR adds two new events: BeforeChunk and AfterChunk.
These are triggered when exporting in chunks. With this it is possible to
Related issue: #3606
2️⃣ Does it contain multiple, unrelated changes? Please separate the PRs out.
No.
3️⃣ Does it include tests, if possible?
It includes tests, but I don't know if you are quite happy with it. The test should cover, that the events are called exactly for the number of chunks. For this purpose, groups are created in the callback and counted at the end. Unfortunately I couldn't put in a callback because it can't be serialized.
If you have a better idea, let me know. I'm happy to change it.
4️⃣ Any drawbacks? Possible breaking changes?
No breaking changes.
5️⃣ Mark the following tasks as done:
6️⃣ Thanks for contributing! 🙌
🙌