Closed 22a closed 7 years ago
ah ye, I've snapped a cucumber, will fix in the morning
I've changed it so that the pml file is pulled from the file input, should correct any line number errors caused by the PML-TX parsing stripping comments / whitespace.
This brought up the discussion that it may be worthwhile decommissioning the AST->PML endpoint entirely in favour of triggering the file download with the original file provided by the user. We had some dirty code to do that a few pr's ago: https://github.com/tom-and-the-toothfairies/pathways/blob/6dbda89fe1e3c1507770d37d22c3a3ad41a1077e/panacea/web/static/js/app.js#L122-L130 which would work now that we have the raw file contents again.
I've added a function that takes a source file and a line number (and optionally a number to indicate the number of surrounding lines to display above and below the highlighted line), and returns a pre-formatted DOM element.
It looks like this:
To show it in use I've modified the
displayClashes
anddisplayUnnamed
view functions to use it, those look like this:I've done it this way to try and decouple the error highlighting logic from the bootstrap panels in order to make it easy to port to whatever UI we decide to go with because I don't like how it looks at the moment, much too bulky.