visdesignlab / upset2

UpSet - Visualizing Intersecting Sets
https://upset.multinet.app/
BSD 3-Clause "New" or "Revised" License
41 stars 7 forks source link

Add error handling for alt text API #330

Closed NateLanza closed 3 months ago

NateLanza commented 4 months ago

Does this PR close any open issues?

Closes #324

Give a longer description of what this PR addresses and why it's needed

This PR adds error handling for aggregated plots which we can't generate alttxts for. Previously, Upset would silently refuse to update an alttxt for an aggregated plot without informing the user. Now, an error message is displayed when attempting to generate an alttxt for an aggregated plot. Additionally, more error handling was added for errors from the alttxt API; appropriate error messages are displayed if the API fails with a 400 code, 500 code, or other code. Finally, a test was added to Playwright to ensure that the error message displays for aggregated alttxt generation.

Provide pictures/videos of the behavior before and after these changes (optional)

Before:

Screenshot 2024-03-28 at 10 01 53 PM

After:

Screenshot 2024-03-28 at 10 02 21 PM

Have you added or updated relevant tests?

Have you added or updated relevant documentation?

Are there any additional TODOs before this PR is ready to go?

TODOs:

netlify[bot] commented 4 months ago

Deploy Preview for upset2 ready!

Name Link
Latest commit 44c87b8c08951864748792db5584068f118d006d
Latest deploy log https://app.netlify.com/sites/upset2/deploys/660b2f5c4d7ebb0008c2bfe3
Deploy Preview https://deploy-preview-330--upset2.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.