yalla-coop / curenetics

A platform enabling medical professionals to more quickly find relevant clinical trials for their patients
2 stars 0 forks source link

Feature/exports #96

Closed wright1 closed 4 years ago

martinbagshaw commented 4 years ago

Explanation

I have set this up to be scalable - we need another pdf export in the matches index screen (screenshot below).

Screenshot 2019-10-13 at 23 41 30

Dummy data is mapped over in the match trial page. This can be used to display results, but the same data also needs to be passed to the pdf through PDFDownloadLink, a button from '@react-pdf/renderer'. The data hits PdfTemplate, and the type prop passed in determines which layout template to handle the display of data.


Todo / to bear in mind:

@wright1 this is nearly complete - just need to add the locations.

To register multiple font weights, i pulled in the .ttf files, giving a family name for each weight, as suggested here. Fonts are referenced in a similar way to images.

@othman-shamla a dummy data structure is used here that should be shared with your latest piece of work - as this is pretty much the pdf equivalent.

I have an error in the console that we should try and figure out at some point:

Screenshot 2019-10-13 at 23 36 13
wright1 commented 4 years ago

I will add the locations this evening please don't merge until the locations are added.

wright1 commented 4 years ago

I've added locations to the pdf, please review.

martinbagshaw commented 4 years ago

@wright1 I added markers for location, and also removed Roboto font.

Errors in the font import seems to be a known issue, and I noticed this was causing the previously mentioned error, as well as preventing the 2nd pdf from downloading.

I have commented out all references to the font, and the import, until we find a fix. Will try out stuff in this thread:

https://github.com/diegomura/react-pdf/issues/310

...Tried out stuff, it didn't work. If you read the issues, it seems there are a fair amount of people having similar problems with this module. I suggest we work on something of higher priority, as getting layout and colours sorted in this is probably good enough