gaepdit / complaint-tracking

Complaint Tracking System
The Unlicense
1 stars 3 forks source link

Adding Icons to Alert Messages #704

Closed AnukratiMehta closed 8 months ago

AnukratiMehta commented 8 months ago

Closes #686

Description

This pull request adds icons to all the alert messages in the application.

AnukratiMehta commented 8 months ago

Thanks for the detailed instructions @dougwaldron. Since I am not well-versed in .NET development, the second change was a little challenging for me. Please check and let me know if I was able to get it right. Thanks!

AnukratiMehta commented 8 months ago

This is great! Everything is working perfectly and I'm getting the correct icons in all places. There's just one detail that needs to be tidied up now.

I know that .NET Razor syntax can be odd since it switches between C# and HTML, and sometimes it doesn't work the way you expect. But in the switch statement in "_AlertPartial", you can just output the SVG code directly instead of saving everything to a string first:

case DisplayMessage.AlertContext.Success:
    <svg .../>
    break;

That way you can avoid the double quotation marks and Html.Raw, etc.

Thanks, @dougwaldron. Please check now.