Closed segeeslice closed 3 years ago
@RobBoeckermann @jsteuver Feel free to check out the UI screenshots and lmk what you think! This will be app-wide so it's very important that the UI and code are clean.
Looks solid to me. Is there anything special that needs to be added to the Django server responses in order to trigger the alerts?
For example, on the /user/login
endpoint, we are currently returning a 401 for an invalid login. Will this alert system be able to handle this response as is? Or is there any additional information that should be added to the response?
@jsteuver nope no backend dependencies, it's completely agnostic about the data it gets.
... For example, on the
/user/login
endpoint, we are currently returning a 401 for an invalid login. Will this alert system be able to handle this response as is? Or is there any additional information that should be added to the response?
@jsteuver speaking of this, do we have documentation on what codes are returned when? It would be nice for the front-end to expect any of them and know exactly what it's supposed to mean
Not currently, but I can update the API docs with those.
I'll make an issue for it
Overview
This PR creates a global alert for use across the application. Instead of defining new logic in each dialog to show individual errors, I can now report alerts anywhere via a simple importable
addAlert(...)
method.This can be used for positive feedback, errors, warnings, information, etc.
Stories
Screenshots
Show Screenshots
### Variable modes: Snackbar or Dialog ![image](https://user-images.githubusercontent.com/32147527/107865734-cf977b80-6e37-11eb-8592-2a5701c1db8d.png) ![image](https://user-images.githubusercontent.com/32147527/107865764-1e451580-6e38-11eb-9c4e-dee857f22362.png) ### Three other "Severities" ![image](https://user-images.githubusercontent.com/32147527/107865798-59474900-6e38-11eb-9f15-87212db622d7.png) ![image](https://user-images.githubusercontent.com/32147527/107865825-8a277e00-6e38-11eb-89de-977d974105f2.png) ![image](https://user-images.githubusercontent.com/32147527/107865871-f4402300-6e38-11eb-8af9-2c624973f886.png)