unepwcmc/SAPI — pull request #64 by agnessa (2013-07-30 08:26:25+00:00)
Title: auto complete taxon concepts as separate resource

This fix is intended for 2 problems with the autocomplete.

1. taxon concept page content changes as user types in the autocomplete box and the current taxon concept matches the query
This was caused by reloading the current taxon concept (if it happened to match the autocomplete query). Right now auto complete taxon concepts and regular taxn concepts are completely separate resources (separated even on the level of backend endpoints, as I figured if they have different serializers, they can be treated as different resources)

2. species links from the autocomplete on taxon concept page do not work
clicking on a higher taxon transitions to the search page correctly; however, clicking on a species causes this to happen:
Transitioned into 'taxon_concept.legal' ember.js?body=1:361
Error while loading route: TypeError {} ember.js?body=1:361
Uncaught TypeError: Cannot call method 'filterProperty' of undefined taxon_concept_controller.js?body=1:41
Uncaught TypeError: Cannot call method 'filterProperty' of undefined taxon_concept_controller.js?body=1:44

So this fix definitely helps for scenario 1, and in most cases helps for scenario 2. Sometimes weird things happen, e.g. you click on something from the autocomplete, the transition seemingly runs without errors, but sometimes the view is not fully refreshed (e.g. shows no cites listings where there should be...). also, sometimes the auto complete box doesn't want to go away.

A scenario to reproduce the missing listings case:
1. go to species page
2. type 'delph'
3. click 'delphinus'
4. click first result on results page
5. focus in the autocomplete
6. click 'delphinus delphis'
7. no errors, no listings either

On the other hand, this works:
1. go to species page
2. type 'delph'
3. click 'Delphinapterus leucas'
4. focus in the autocomplete
5. click 'delphinus delphis'
6. just works. wat.