{"action":"created","issue":{"url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/1525","labels_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/1525/labels{/name}","comments_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/1525/comments","events_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/1525/events","html_url":"https://github.com/learning-unlimited/ESP-Website/pull/1525","id":53154871,"number":1525,"title":"Flag search rewrite","user":{"login":"benjaminjkraft","id":111238,"avatar_url":"https://avatars.githubusercontent.com/u/111238?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminjkraft","html_url":"https://github.com/benjaminjkraft","followers_url":"https://api.github.com/users/benjaminjkraft/followers","following_url":"https://api.github.com/users/benjaminjkraft/following{/other_user}","gists_url":"https://api.github.com/users/benjaminjkraft/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminjkraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminjkraft/subscriptions","organizations_url":"https://api.github.com/users/benjaminjkraft/orgs","repos_url":"https://api.github.com/users/benjaminjkraft/repos","events_url":"https://api.github.com/users/benjaminjkraft/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminjkraft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2014-12-30T23:05:14Z","updated_at":"2015-03-09T22:46:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/learning-unlimited/ESP-Website/pulls/1525","html_url":"https://github.com/learning-unlimited/ESP-Website/pull/1525","diff_url":"https://github.com/learning-unlimited/ESP-Website/pull/1525.diff","patch_url":"https://github.com/learning-unlimited/ESP-Website/pull/1525.patch"},"body":"~~This isn't done yet (so don't merge), but I figured I'd put the code up if anyone has comments.~~  I rewrote what was formerly the class flag search with a much more general backend, which is in `esp.utils.query_builder`.  This should be a lot easier to extend to add new fields and make other modifications, and it's general enough that we should be able to build other search interfaces without too much trouble.\r\n\r\nNotes:\r\n* I might eventually put it into a separate library -- the query builder core is not very tightly bound to the ESP website or even django really -- but for now it's here.\r\n* The client-side part is all in React; I also added another JS library called [lodash](http://lodash.com/) which gives various useful functional primitives like `_.map` that work in all browsers.\r\n* Fixes #1359.  Also fixes #1360, #1366, #1316, and makes #1364 moot.  #1352 should be solvable but will be a bit tricky; I'll probably try to convert ajax_autocomplete to a React component.\r\n* I wrote python tests, both for the query builder core and the module that uses it to make a class search.  I do intend to write JS tests sometime, but I might wait until the new scheduler gets merged, and then we can use the same testing tools for all our JS.\r\n\r\nKnown TODOs:\r\n- [x] fix styling because it's unusably ugly right now\r\n- [x] add documentation\r\n  - [x] docstrings, docstrings everywhere (add some, update some)\r\n  - [x] documentation of data interchange formats\r\n  - [x] documentation of how to write a new input\r\n  - [x] documentation of the interface of the QueryBuilder class\r\n- [x] remove old class flag search page and redirect to this one\r\n- [x] add new features including various open class flags issues\r\n  - [x] Fix #1366\r\n  - [x] Fix #1316\r\n  - [x] teacher's username\r\n- [x] tests\r\n  - [x] python\r\n  - ~~JS?~~"},"comment":{"url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/comments/77961045","html_url":"https://github.com/learning-unlimited/ESP-Website/pull/1525#issuecomment-77961045","issue_url":"https://api.github.com/repos/learning-unlimited/ESP-Website/issues/1525","id":77961045,"user":{"login":"benjaminjkraft","id":111238,"avatar_url":"https://avatars.githubusercontent.com/u/111238?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminjkraft","html_url":"https://github.com/benjaminjkraft","followers_url":"https://api.github.com/users/benjaminjkraft/followers","following_url":"https://api.github.com/users/benjaminjkraft/following{/other_user}","gists_url":"https://api.github.com/users/benjaminjkraft/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminjkraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminjkraft/subscriptions","organizations_url":"https://api.github.com/users/benjaminjkraft/orgs","repos_url":"https://api.github.com/users/benjaminjkraft/repos","events_url":"https://api.github.com/users/benjaminjkraft/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminjkraft/received_events","type":"User","site_admin":false},"created_at":"2015-03-09T22:46:41Z","updated_at":"2015-03-09T22:46:41Z","body":"I'll take a look at the button.  I think for the English text as long as it's vaguely comprehensible, I'm not going to worry about it since it will be moot when I get around to #1620."}}