datalad / datalad-deprecated

DataLad extension for functionality that has been phased out of the core package
Other
0 stars 3 forks source link

Adding context menu and rendering options for certain files #27

Closed dereklu888 closed 3 years ago

dereklu888 commented 3 years ago

Currently, only the basic context menu is implemented, I'll be adding rendering functionality soon.

dereklu888 commented 3 years ago

Some issues I'll still need to clear up (not an exhaustive list, just some things I thought I'd note down):

yarikoptic commented 3 years ago

Thanks for posting preview to http://datasets-dev.datalad.org/ so I had chance to try it out. Here is what I think we should do:

dereklu888 commented 3 years ago

I implemented a 3dot menu for each row, with tags for opening the folder and external link -- should be up on the datasets-dev. Quick question, still mulling about rendering, do you think the renderer should open the file in the current window (like replacing what is rendered where README.md usually is), or should it lead to an external link with just the rendered object (like viewing a file on github)? For the latter, I think it's doable without further infrastructure stuff/routing (which would make things less lean), but it might be less elegant (probably like another query parameter, if we're staying with the current setup).

Also, I implemented the context menu natively instead (let me know if there's any styling issues or bugs encountered), so I won't need to host new files for it.

codecov-commenter commented 3 years ago

Codecov Report

Merging #27 (70c49eb) into master (425a8d0) will increase coverage by 3.65%. The diff coverage is 94.90%.

:exclamation: Current head 70c49eb differs from pull request most recent head 7bcb7d1. Consider uploading reports for the commit 7bcb7d1 to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master      #27      +/-   ##
==========================================
+ Coverage   84.43%   88.08%   +3.65%     
==========================================
  Files          13       15       +2     
  Lines        1246     1913     +667     
==========================================
+ Hits         1052     1685     +633     
- Misses        194      228      +34     
Impacted Files Coverage Δ
datalad_deprecated/__init__.py 100.00% <ø> (ø)
datalad_deprecated/publish.py 87.85% <87.85%> (ø)
datalad_deprecated/tests/test_publish.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 425a8d0...7bcb7d1. Read the comment docs.

yarikoptic commented 3 years ago

re styling: image

Let's

Re renderers: let's first just add links to the remote resource like Bioimagesuite ones for .nii(.gz)?$ files listed on https://github.com/dandi/dandiarchive/wiki/WiP:-dump-of-thoughts-on-%22services-registry%22 . Those, since regular links, could be opened by user in a new window or not as they like... although may be later we will provide a uniform new target so people could sequentially open different files in that viewer without breeding tabs - yet to decide. ATM going https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https://datasets-dev.datalad.org/dbic/QA/sub-emmet/ses-20180531/anat/sub-emmet_ses-20180531_acq-MPRAGE_T1w.nii.gz isn't working for me, but I will see if I just need to tune up CORS or report to bioimagesuite folks

yarikoptic commented 3 years ago

woohoo -- I have fixed web server setup to provide certificate for datasets-dev so it could be served over https, and https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https://datasets-dev.datalad.org/dbic/QA/sub-emmet/ses-20180531/anat/sub-emmet_ses-20180531_acq-MPRAGE_T1w.nii.gz works for me in brave browser (on chromium site whines "Your browser does not support WEBGL (even v1). We can not proceeed.")

yarikoptic commented 3 years ago

May be right away add that MetaCell/NWBExplorer link for .nwb files. I have made a sample file available under -dev in http://datasets-dev.datalad.org/?dir=/dandi/dandisets/000027/sub-RAT123 . Although ATM display there doesn't quite work (https://github.com/MetaCell/nwb-explorer/issues/261) but I hope it would get resolved soon.

dereklu888 commented 3 years ago

I added render options for the .nii/.nii.gz and .nwb files, also tweaked the styling as per your changes (though the font for the context menu I just changed to a dark gray, if that's enough).

I'll probably implement some testing as well, but after that is there anything else on the rendering side I should work on before moving on to whichever issue is next? Maybe adding the option to swap out the README.md file that is being rendered for another .md file?

yarikoptic commented 3 years ago

also styling wise, a minor comment image

if three dots could be aligned to text better (didn't check if font style/size differs from the text?) would be nice. Now it is bigger and a bit higher than text.

dereklu888 commented 3 years ago

As for the styling -- sorry, I thought you meant the font styling of the menu options themselves, not the 3 dots. I'll try to finish that up next.

dereklu888 commented 3 years ago

Alright, I updated the formatting of the 3dot menu, added an External Section separator in the menu, and added the rendering function -- let me know if the format of the rendering data looks good, I'm not sure yet if I should keep the extensions and use them as a key in a map, let me know your thoughts.

dereklu888 commented 3 years ago

For styling, I opted to make the External Services separator the same left indent as the copy/other operations, and increased the indent of the renderers (I just set it as a hard 15px). I added a few tests in (though they are currently fitted to the 3 rendering options available, might need to go update this when new rendering options are added?).

yarikoptic commented 3 years ago

Thank you @dereklu888 ! Let's proceed with this one. I will also deploy current state of the web ui to the main instance