Bulk Send Batch Progress UI #2305
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Replaces bulk send batch console logs with a progress UI as well as error handling in the client.
I also went ahead and just completely refactored this component to be functional w/ hooks. I figure it's probably best to write any new components this way if we can as this is the current standard way of creating doing things with React, and in this case it was pretty straightforward to convert it to be fully component-state-based and replace the while loop with a
useEffecthook.If there's an error it will show it as a snackbar alert for 6 seconds if not clicked off, then end sending and reset to be able to show the button again. I still can't figure out how to bubble up actual error messages to the client, and the docs for the old Apollo express package we're using are now offline. That's is something else to note: Apollo packages should be updated soon as we are on a version that is EOL as of this month.
Also noting, we might want to start adding some custom ESLint overrides as we have so many errors/warnings in the codebase they just get ignored. I added our first override in this PR to allow any
consoleoutput exceptlog, the reasoning being it's sometimes desirable to leave permanent logs in withinfo,warn, orerror, and with this setting it allows those but you can still get warnings if you have a temporary debugginglogin there that you actually want to remove, so you don't forget to do that, and any permanent non-error/warning logging can useinfo.Anyway, here are a couple screenshots showing how this UI implementation looks:
Checklist: