Skip to content

DataTables load using AJAX, Search by metadata on studies page #1006

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

Merged
merged 29 commits into from
Apr 1, 2015

Conversation

squirrelo
Copy link
Contributor

This pull request lays the groundwork for selections by study on the study listing page. The following changes have happened:

  • New Study.get_info() function to get all information for a given list of studies and, optionally, columns. This allows for orders of magnitude faster loading of study data for the listings tables.
  • New SearchStudiesAJAX handler and page, for getting the DataTables json information to build the tables.
  • Merged the public and user studies tables and pages into a single table that can be sorted by status, and allows for a single listing page that can be searched over.
  • DataTables are now loaded from AJAX-derived json, meaning the page no longer has a wait logo and can reload the table as metadata searches are performed.
  • Minor DB changes - Renaming the description and title columns on study satellite tables to allow for easier joins.

@squirrelo
Copy link
Contributor Author

SciPy build is failing, causing the tests to register as failed. Not sure what to do.

 Command "/home/travis/miniconda3/envs/env_name/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-baUMF0/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-t4sETC-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-baUMF0/scipy

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1872555 on squirrelo:cart into * on biocore:master*.

@@ -176,6 +182,28 @@ def get_by_status(cls, status):
return {x[0] for x in conn_handler.execute_fetchall(sql, (status, ))}

@classmethod
def get_info(cls, study_ids, info_cols=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a docstring?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@squirrelo
Copy link
Contributor Author

This is failing because of qiime install issues, but is ready for review.

@josenavas
Copy link
Contributor

Since I've already faced 2 database merge conflicts on my previous PR #900 please, review that one and merge that one first...

@squirrelo
Copy link
Contributor Author

Single list for now, Issue #1019 opened for later multi-table support.

@josenavas
Copy link
Contributor

Thanks @squirrelo, baby steps works, so PR are smaller. Assigned to you and to alpha.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 79.05% when pulling 3a12f87 on squirrelo:cart into 54f63e9 on biocore:master.

@josenavas
Copy link
Contributor

BTW, this PR is not modifying the DB schema files neither the html. See this section on the contributing.md file for making database changes.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 79.05% when pulling 25ae8f2 on squirrelo:cart into 54f63e9 on biocore:master.

@squirrelo squirrelo added the GUI label Mar 31, 2015
@squirrelo
Copy link
Contributor Author

Ready for review/merge

@antgonza antgonza mentioned this pull request Apr 1, 2015
@antgonza
Copy link
Member

antgonza commented Apr 1, 2015

Some comments on code.

The GUI looks soooo much better, thanks! Anyway, when I try to search the button gets grayed out but nothing happens, not even python or JS errors, and never comes back. Also, not sure what the left checkbox column is for, there is no button to add or anything like that.

@squirrelo
Copy link
Contributor Author

Checkbox is a placeholder for sample selection, which will be added once all the initial bits are in place. Doesn't harm anything, and means there is less to change to get full functionality.

I'll take a look at the JS, sounds like browser compatibility issue.

@antgonza
Copy link
Member

antgonza commented Apr 1, 2015

What about adding the button(s) that will interact with the studies selected but when you click them you get a simple message like: "Not yet implemented" so we can review the distribution of the GUI.

BTW I'm using Chrome Version 41.0.2272.104 (64-bit)

@squirrelo
Copy link
Contributor Author

I'd rather wait and add the button when it works, that way we don't ever give the impression of being able to select studies on the page until you actually can. I don't want to confuse users.

@squirrelo
Copy link
Contributor Author

Also, if all goes well, there won't be a button. It will ajax-select the samples as the things rea clicked and unclicked.

@antgonza
Copy link
Member

antgonza commented Apr 1, 2015 via email

@squirrelo
Copy link
Contributor Author

I guess I can comment out the code and just return a blank line for those cells.

@antgonza
Copy link
Member

antgonza commented Apr 1, 2015 via email

@squirrelo
Copy link
Contributor Author

Changes made, ready for merge.

@antgonza
Copy link
Member

antgonza commented Apr 1, 2015 via email

@squirrelo
Copy link
Contributor Author

Just tested and I get the same results on both pages. Not sure how you're getting no results as it's all the same search object setup.

@antgonza
Copy link
Member

antgonza commented Apr 1, 2015 via email

@squirrelo
Copy link
Contributor Author

The checkboxes are too embedded in the code to safely hide them and re-add later. The textbox is cleared on search now though.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 79.13% when pulling e01e224 on squirrelo:cart into e1c7a7c on biocore:master.

antgonza added a commit that referenced this pull request Apr 1, 2015
DataTables load using AJAX, Search by metadata on studies page
@antgonza antgonza merged commit 9350269 into qiita-spots:master Apr 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants