instedd / cdx

Connected Diagnostics Platform
https://cdx.io
9 stars 7 forks source link

Samples reports generated in the backend #1982

Closed leandroradusky closed 1 year ago

leandroradusky commented 1 year ago

Closes #1843 and #1900

Now, the samples reports are generated in the backend.

There are some slight changes in the look. The first page looks now like this:

image

Then the other two pages just contain the SVG files as they are downloaded.

image

For the sake of completeness, the ROC plot is also rendered OK, here is how it looks.

image

Some commentaries:

Important (cc @julien, I need help in solving this): I'm posting the data in a newly created form, but I systematically get an Invalid Authenticity Token error which I don't know how to solve. I'm sure is a silly error but I didn't manage to solve it. Then I had to add the line skip_before_action :verify_authenticity_token which is only a transitory solution to make the feature to work.

I've tested with a lot of different conditions:

All of them worked correctly for me, but this issue needs in-depth testing.

CC @diegoliberman

diegoliberman commented 1 year ago

There are no mockups for the reports and they were not used yet by users, said that the first table with the summary was modified to look like this since it looks better than before.

I don't quite get this. The design (better than mockups) for the table and reports is here and it had been already implemented. I'm not sure if it looks better... Anyhow, I say ship it as is, my observation is no blocker at all.

leandroradusky commented 1 year ago

Hi @diegoliberman. Sorry because the name was misleading, here we're talking about the PDF exported for the samples report.

The second and third page looks quite the same, the first page now looks like this

image

As I mentioned above, what I decided to change is the summary, the first section. The Confussion Matrix section now looks slightly different than in the webpage because of the library that we use to generate the PDF report on the backend.

Let's chat if I'm not clarifying with this message :)

leandroradusky commented 1 year ago

Made the fixes to display the confusion matrix exactly as on the website (as for the SVGs, the grays are not handled with transparencies ─as in the project's CSSs─ but with grey colors, which is a limitation of prawn but looks super similar). The styling now is made in subclasses of Prawn::Table::Cell.

image

Also, the authenticity token problem was fixed with the form_tag tag thanks to the guidance of @ysbaddaden (Thanks!! :bowing_man:)

leandroradusky commented 1 year ago

I think I've addressed all the commentaries, if not, now let's sync :)

Thanks a lot for the guidance !!