RESQUE-Framework / collector-app

A web app for applicants: Enter the RESQUE indicators for your 10 best papers.
https://resque-framework.github.io/collector-app/
MIT License
2 stars 0 forks source link

mode=print: add filter as option #16

Closed nicebread closed 1 month ago

nicebread commented 8 months ago

Print mode, but only select indicators.

For example, show all open data indicators from publications:

https://nicebread.github.io/RESQUE/web/?mode=print&filter=P_OpenData

alpkaanaksu commented 7 months ago

I think you mean P_Data_Open (this is the hierachical prefix for all open data items)

mode=print&details=false&filter=P_Data_Open gives us:

Screenshot 2024-03-10 at 17 29 42
alpkaanaksu commented 7 months ago

How I implemented it: filter is a comma separated list. It shows all indicators with IDs, that start with one of the filter IDs.

filter=P_Data_Open,P_Preregistration gives us everything that starts with P_Data_Open or P_Preregistration

nicebread commented 7 months ago

The result looks great!

Just one thing: I still first have to select a in the left sidebar (if I was at the meta-tab, and use the link, nothing is shown). My goal is to insert these exported/printable indicators into the RESQUE website - how can I do this?

nicebread commented 2 months ago

Ideally, we can show arbitrary version of the packs. We should store old versions as separate files (e.g., in a subfolders of packs), and the display/printing mode has a dropdown box which lists all available versions. Then users can select the desired version and display it. (See my email from 2024-08-08). We need version 0.3 (see releases/tags) as printed PDF for a BSc thesis.

alpkaanaksu commented 2 months ago

https://resque-framework.github.io/collector-app/preview

There is a dropdown to choose packs and a text field for filter. The filter works exactly the same as before. The top bar for input is hidden when printing.

Screenshot 2024-08-25 at 16 20 42

RESQUE Collector - Preview.pdf

nicebread commented 2 months ago

Great!

(A) Can you add the option to show the indicator labels as a checkbox? (Otherwise user do not know what to put into the filter box). Also write an info to the filter box that it filters the indicator labels.

(B) Can you add the capability to select the item from the dropdown box also via URL query strings? Such as: https://resque-framework.github.io/collector-app/preview?type=pubs&version=0.3.1&filter=P_Data&showmeta=true

(this needs to be intelligently resolved to the underlying pack file).

I need this feature to include the printing into the RESQUE main website. E.g., when I write a section on the new theory indicators, I want to show them on the website.

alpkaanaksu commented 2 months ago

(A) is complete.

(B) Now it works with type, version, filter and showLabels, you can try the link: https://resque-framework.github.io/collector-app/preview?type=pubs&version=0.3.1&filter=P_Data

I made it in a way that the selection menu disappears if we use query params (for embedding to the website?)

What does showmeta do?

nicebread commented 2 months ago

Great - this works already nicely on the website:

image
nicebread commented 2 months ago

What does showmeta do?

The same as the "Show indicator labels" checkbox does - show or hide the labels. Maybe we should call it show_labels.

Can you furthermore add this JS snippet to the preview:

<script>
  function sendHeight() {
    const height = document.documentElement.scrollHeight;
    window.parent.postMessage(height, '*');
  }

  window.onload = sendHeight;
  window.onresize = sendHeight;
</script>

This helps resizing the iFrame on the website.

alpkaanaksu commented 2 months ago

The same as the "Show indicator labels" checkbox does - show or hide the labels. Maybe we should call it show_labels.

We already have showLabels: https://resque-framework.github.io/collector-app/preview?type=pubs&version=0.3.1&filter=P_Data&showLabels=true

alpkaanaksu commented 2 months ago

I also copied your helper function

nicebread commented 2 months ago

Great! Can you add the preview options to the documentation? I think then we can close the issue.