josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
814 stars 108 forks source link

Feat: Pass validation severity into UI #416

Closed anlinguist closed 3 months ago

anlinguist commented 3 months ago

This PR addresses the following discussion and issues:

Allows the validation error severity to be warning (yellow), error (red), or info(blue).

If the validation error table is collapsed, it uses the first validation error to determine the color to show. If the validation error table is opened, each validation error will be the assigned color from the validator. Also updated the hover color for each validation error.

josdejong commented 3 months ago

Thanks Andrew! I'll review your PR next week.

josdejong commented 3 months ago

Thanks for the updates, this looks really good, both the code and the UI!

josdejong commented 3 months ago

I see there is a linting issue, I'll fix that right after merging.

josdejong commented 3 months ago

After merging I thought it would be neat to rename the helper function getValidationClass to getMaxSeverity, I've changed that in 2c88d93648b25b193f9052ae365d9cd7152c0fa6 and 8a6a1def4ac7c0b3150d7ca657f1ae43e15ab2ed. I hope you don't mind.

josdejong commented 3 months ago

Published now in v0.23.1, thanks again!