segeeslice / Meetify-UI

This is the React-driven UI for the Meetify program
GNU General Public License v3.0
2 stars 1 forks source link

Add app-wide alert system #10

Closed segeeslice closed 3 years ago

segeeslice commented 3 years ago

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)
segeeslice commented 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.

jsteuver commented 3 years ago

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?

segeeslice commented 3 years ago

@jsteuver nope no backend dependencies, it's completely agnostic about the data it gets.

segeeslice commented 3 years ago

... 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

jsteuver commented 3 years ago

Not currently, but I can update the API docs with those.

segeeslice commented 3 years ago

I'll make an issue for it