Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NF: rudimentary web interface #738

Merged

Conversation

debanjum
Copy link
Contributor

@debanjum debanjum commented Aug 29, 2016

yoh: supersedes original #541
since over 100 commits, buildbot tests were ran in #759 and passed

debanjum and others added 30 commits June 14, 2016 01:28
datalad ls -w results in filesystem traversal at
mentioned location. stores data in list with a flat
sublist of files, directories per git/annex submodule.
can handle recursive case too.

Next: format to json for web UI consumption
reduce code in fsmodel class by inheriting from dsmodel
fix bugs in list flattening

date not working, parent submodule incorrect after first,
symlink unicode coercion error in non datalad modules
modify DsModel for usability in FsModel after inheritance
work on issue datalad#520
prints json as it computes each directory node information.
not storing json in variable/memory as expect a lot of files in annex.

this json is to be consumed by the web UI for the datasets.
refer issue datalad#520.
Add DOC-strings to _ls_web class, follow convention
Based on comments on pull#541
use dicts to allow json.dumps to handle conversion to json
refactor to traverse complete directory tree only once
improve node names using leaf_node function
remove redundant parent repo extraction code
Each subdirectory has a json containing the metadata on
files etc available in that subdirectory only, no deeper

standardizes json to simplify rendering dirs for website
adds search for file at each directory level,
adds css styling based on file/folder type(i.e annex, git etc)
uses datatables library for rendering json as table and dir traversal
no need to unwrap each submodule before passing to fs_traverse
ignored index.html, ignore root's parent for web publish
handle GET parameters in URL to specify directory to load
useful for adding permalink feature
remove local assets, caching should take care of asset load speed
update browser url to reflect current directory being visualized
use the dir argument passed in url to find and load dir metadata json
allows accessing previous location in dataset with browser back button
passing file, display, delete option explicitly prevents users
from inadvertently populating their dataset with json metadata files

minor bug fix in column rendering of html
automatically update dataset metadata post-update
scp web interface html from local datalad repository
while initialising publication target
hardcoded path to datalad virtualenv on datalad.org server,
so just works for our use-case currently, fix will require
post-update hook to know location of datalad on server automagically/etc
datatable sorted by node.type, datatable doesn't support custom order
need sorter to create custom ordering with directories at the top
Removes '../' parent row from top dataset in html
instead of datalad ls.
…rely in the future

We might not bother with those relative paths until we are actually printing those
models and they might all get "relpath" property if they are provided "toppath"
@yarikoptic
Copy link
Member

Thank you @aqw in advance. Indeed PR is somewhat sizeable although majority is just 3rd party pieces, but yes, there is dune python and JavaScript ( with tests) to consider.

<span style="font-weight:bold">Javascript is not enabled!</span>
</div>
</noscript>
<script type="text/javascript" charset="utf8" src=".git/datalad/web/assets/js/jquery-1.12.3.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be charset="utf-8" to validate properly.

@aqw
Copy link
Contributor

aqw commented Sep 7, 2016

@debanjum Just got done taking a look at the web bits of the PR. Overall, it looks good. Most of my comments came from simply running the page through the HTML validator.

Is there any reason in particular that you're choosing to use jQuery 1.x? I know it's still supported, but it seems like an odd choice for a new project. Data Tables works with both 1.x and 2.x. The only difference I can see is for IE6-8 support, but if that's the case, I'm all for bumping to 2.x, dropping those browsers, and saving ~10KB in the process. The next version in 1.x drops < IE8 anyway, so it seems there's little to gain here.

jQuery 1.x isn't a show stopper for me, but it does merit consideration.

@yarikoptic Once the small changes I suggested are addressed, it LGTM.

---Alex

@debanjum
Copy link
Contributor Author

debanjum commented Sep 7, 2016

@aqw Hey, thanks a ton for the review of the HTML and JS stuff! It really needed it ;)
I'll enable some kind of HTML validator on my setup to help out. The JS linter proved really helpful while coding the js up.

No particular reason that I can remember of for using jQuery 1.x so i'll move it to 2.x and hopefully everything should work fine.

@aqw
Copy link
Contributor

aqw commented Sep 7, 2016

@debanjum Glad I could be of some help.

Nice work!

---Alex

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.9%) to 87.043% when pulling 7d952fc on debanjum:bk-webinterface-bisect-ssh-test-fail into 5ff2165 on datalad:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.9%) to 87.043% when pulling 7d952fc on debanjum:bk-webinterface-bisect-ssh-test-fail into 5ff2165 on datalad:master.

@coveralls
Copy link

coveralls commented Sep 7, 2016

Coverage Status

Coverage decreased (-1.9%) to 87.043% when pulling 7f3d54a on debanjum:bk-webinterface-bisect-ssh-test-fail into 5ff2165 on datalad:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.9%) to 87.047% when pulling 6e9ca7d on debanjum:bk-webinterface-bisect-ssh-test-fail into 5ff2165 on datalad:master.

@debanjum debanjum force-pushed the bk-webinterface-bisect-ssh-test-fail branch from 6e9ca7d to 40318e8 Compare September 7, 2016 21:04
@debanjum debanjum closed this Sep 7, 2016
@debanjum debanjum force-pushed the bk-webinterface-bisect-ssh-test-fail branch from 40318e8 to 5bbbe2f Compare September 7, 2016 21:05
@debanjum debanjum reopened this Sep 7, 2016
@coveralls
Copy link

coveralls commented Sep 7, 2016

Coverage Status

Coverage decreased (-1.9%) to 87.047% when pulling 6e9ca7d on debanjum:bk-webinterface-bisect-ssh-test-fail into 5ff2165 on datalad:master.

@yarikoptic
Copy link
Member

please merge current master and push! watchout for conflicts

…ace-bisect-ssh-test-fail

 Conflicts:
	.travis.yml
 Resolved:
        Combined diffs
@coveralls
Copy link

coveralls commented Sep 8, 2016

Coverage Status

Coverage decreased (-1.9%) to 87.031% when pulling 64b5381 on debanjum:bk-webinterface-bisect-ssh-test-fail into 511f3be on datalad:master.

hook_content = '\n'.join(['#!/bin/bash', 'git update-server-info', json_command])

# make datalad logs directory
ssh(['mkdir', '-p', logs_remote_target])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could've added this to hook itself... Make a separate PR since this I've hopefully will get merged!:-)

@yarikoptic yarikoptic merged commit fa6e6af into datalad:master Sep 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants