nf-tower
nf-tower copied to clipboard
Implement a better error feedback mechanism
Backend error should be visualised with error/warning box appearing just below the nav bar instead of a popup.
It should last more (configurable via an application setting) and there should be a cross icon (top-left corner) to close it.
![Screenshot 2019-05-29 at 11 12 59](https://user-images.githubusercontent.com/816968/58545270-3491e480-8203-11e9-9405-93beed799335.png)
Hi Paolo. I find Bootstrap toasts a good fit for this. Are you ok with them?
What about using an alert with a dismissing icon?
I'll check if it's possible to show an alert as a toast. I'll try to do that in order to leverage the builtin mechanism to hide the toast automatically after a configurable delay. If not, I'll implement a custom mechanism to show alerts in a toast-like manner.
What's special with a toast? Let's jump on gitter if you want.
The Bootstrap toasts have options to specify the fading behavior. Don't worry I sense an alert can be integrated with a toast without many problems.
My point is that I would like to avoid the popup or dialog effect. For this reason, I was suggesting the alert.
Yes, I know. I was thinking as you. In this case the toast would be like an invisible carrier for the alert.
OK
Done.
Has this change merged? I still see errors appear into a small red popup as the one in the top comment.
I haven't made any progress regarding the last change you proposed about this Paolo (the one with the error appearing in full width). My "Done" comment on 6 Jun was in fact the implementation of the current popup version.
OK, the idea here is to show a red rectangle on top of the page instead of a small toast/popup. The error should be visualised until the user navigate away, make another action (maybe using http interceptor?) or click a dismiss icon.
The bootstrap alert could serve as inspiration.
Some questions:
- Should the position of the notification be fixed (like the navbar)?
- I assume the position is below the navbar, but, should the position in the landing page change?
was thinking at this, would not be possible to define error areas (basically a two div
s), one when showing the main page. If does not exists fallback in a top one for the landing?
Do you mean having the current mechanism when the landing page is being shown and the new one otherwise?
I'm imagining a red box on top of the page (as a navbar) in case of the landing, and just below the navbar once logged.
Something like this?
And this?
Yes! text centred, thansk!
Ok, but fixed? Scrolls along with the content (like the navbar)?
umm, yes let's fixed as the navbar .. otherwise it could popup while the page is scrolled down and the user won't see it.
Done in branch notification_refactor
.
By the way, success messages (like the one showed when the user profile is saved) are also shown this way for consistency, but in this case they fade away after a specified time. You can do this per error basis in case you want to fade a specific error message but no others. Have a look at the code and let me know if you have any questions.
Makes sense. I'll check it out.