GlobalDataverseCommunityConsortium / dataverse-previewers

A collection of Datafile Previewers that can be configured to work with Dataverse
MIT License
13 stars 38 forks source link

add preview mode #24

Closed pdurbin closed 4 years ago

pdurbin commented 4 years ago

I picked up https://github.com/IQSS/dataverse/issues/6210 so this is a heads up that I'm hoping to add a boolean called "hasPreviewMode" (working title) to at least one tool.

The idea is that when a tool is called in "preview" mode (I recognize that the terminology is a bit confusing since this repo is called dataverse-previewers) the header (in red in the screenshot below) will be removed in a new "Preview" tab on a Dataverse file landing page.

test pdf_-_Eleni_Castro_Dataverse_-_2019-10-18_16 13 02

(We're still working on the UI for that new "Preview" tab, by the way. Please see https://github.com/IQSS/dataverse/issues/3758 to track our progress.)

I haven't even looked at the dataverse-previewers code yet but if @qqmyers or @anncie-pcss or @juancorr or any other dataverse-previewers want to guide me a bit, you can leave me a comment here or find me at http://chat.dataverse.org 😄

qqmyers commented 4 years ago

@pdurbin - I think if you look in the addStandardPreviewHeader() method of previewers/js/retriever.js, you can just turn off any of the header/footer material you want. You may have to hide/remove the

\<img id='logo'\>\</img\>and
\<H1 class="page-title"\>

elements as well - those are in the html files for the different previewers. (You just circled the title in red above, but I assume you want to get rid of the box with the download and close icons, etc. and probably the footer as well.) All of the previewers use the same retriever.js, so if you fix it there, you fix them all.

djbrooke commented 4 years ago

Thanks @qqmyers for the info (and for the previewers in general :))!

pdurbin commented 4 years ago

I assume you want to get rid of the box with the download and close icons, etc. and probably the footer as well

@qqmyers thanks for pointing this out (and the tips about the code, of course). We discussed this at design standup yesterday and you're right, we want all of the blue citation block to be hidden as well. Here's an updated screenshot of what we plan to hide (the red box is what we plan to hide):

data_users_document pdf_-_CMS_Dataverse_-_2019-10-22_11 43 41

We also discussed the footer but it's so small and subtle that we decided to leave it in. Here's a screenshot for anyone who is unfamiliar with it:

Screen Shot 2019-10-22 at 11 44 06 AM

We also agreed that I'd at least try to update all 15 or so previewers mentioned in the README.

Finally, I'd like to remind anyone reading this that the screenshot above is not at all final. Yesterday a new mockup of how the Preview tab might look was added to https://github.com/IQSS/dataverse/issues/3758#issuecomment-544606197

qqmyers commented 4 years ago

@pdurbin - It might also be worth checking to see if the api call to get metadata from Dataverse can be disabled when in preview mode. (in the same .js file). If I recall, it was only needed to populate the header.

pdurbin commented 4 years ago

Finally, I'd like to remind anyone reading this that the screenshot above is not at all final.

Screenshots of what we ultimately merged yesterday can be found at https://github.com/IQSS/dataverse-ansible/issues/129