CenterForOpenScience / modular-file-renderer

A Python package for rendering files to HTML via an embeddable iframe
http://modular-file-renderer.readthedocs.io/en/latest/
Apache License 2.0
43 stars 67 forks source link

[SVCS-580] Collapsible Zip Rendering #331

Open cslzchen opened 6 years ago

cslzchen commented 6 years ago

Ticket

https://openscience.atlassian.net/browse/SVCS-580

Purpose

Replaces: https://github.com/CenterForOpenScience/modular-file-renderer/pull/299

Improve our zip rendering by adding a neater collapsible hierarchical structure.

Changes

Uses two new JavaScript libraries: jstree and jstree-table. The core algorithm is building the tree from a list of paths.

CR Notes

Most of the files are assets. Please focus on mfr/extensions/zip/render.py and mfr/extensions/zip/templates/viewer.mako for core functionality. The tests and fixtures also helps.

All image assets are optimized so they took 15% less than the original PR. No changes to any scripts and css files from the new jstree and jstree-table library. On exception is the style change for mfr/extensions/zip/static/js/jstreetable.js which was "eslint"ed due to min version not available.

Side effects

No

QA Notes

Upload a complex zip file and click through it contents. You may discover some hidden system files depending on what OS and what zip app you use which is expected.

Deployment Notes

TBD

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.6%) to 71.776% when pulling 098aa903e0e687adc3d00c6a0a29a690ef58c05c on cslzchen:feature/improve-zip-rendering into bf146948dbe3ebe696c42d91546440194726b1ca on CenterForOpenScience:develop.