Allow workboards to be filtered with ApplicationSearch

Summary:
Ref T4673.

IMPORTANT: I had to break one thing (see TODO) to get this working. Not sure how you want to deal with that. I might be able to put the element //inside// the workboard, or I could write some JS. But I figured I'd get feedback first.

General areas for improvement:

  - It would be nice to give you some feedback that you have a filter applied.
  - It would be nice to let you save and quickly select common filters.
  - These would probably both be covered by a dropdown menu instead of a button, but that's more JS than I want to sign up for right now.
  - Managing custom filters is also a significant amount of extra UI to build.
  - Also, maybe these filters should be sticky per-board? Or across all boards? Or have a "make this my default view"? I tend to dislike implicit stickiness.

Test Plan:
Before:

{F157543}

Apply Filter:

{F157544}

Filtered:

{F157545}

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: qgil, swisspol, epriestley

Maniphest Tasks: T4673

Differential Revision: https://secure.phabricator.com/D9211
This commit is contained in:
epriestley
2014-05-20 11:42:05 -07:00
parent 8a429c51ac
commit f0147fd8ad
10 changed files with 297 additions and 45 deletions

View File

@@ -0,0 +1,35 @@
/**
* @provides javelin-behavior-boards-filter
* @requires javelin-behavior
* javelin-dom
* javelin-stratcom
* phuix-dropdown-menu
*/
JX.behavior('boards-filter', function(config) {
JX.Stratcom.listen('click', 'boards-filter-menu', function(e) {
var data = e.getNodeData('boards-filter-menu');
if (data.menu) {
return;
}
e.kill();
var list = JX.$H(data.items).getFragment().firstChild;
var button = e.getNode('boards-filter-menu');
data.menu = new JX.PHUIXDropdownMenu(button);
data.menu.setContent(list);
data.menu.open();
JX.DOM.listen(list, 'click', 'tag:a', function(e) {
if (!e.isNormalClick()) {
return;
}
data.menu.close();
});
});
});