Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAINT: add get_active_samples(); abstract code
get_active_samples() is based on autocomplete_search_samples(), so I abstracted some of the code for processing responses into its own function that can be shared. This seems to work alright! Would really like to test this with multiple studies, though (biocore#437). For future reference: you can get the value of a promise returned by get_active_samples() as follows: get_active_samples().then( function(v) { // Now, v is the array of active sample IDs console.log(v); } ); This is 1/3 of the work towards multi-select (just gonna tag biocore#520). What remains are the following: 2. On a paste operation when the multi-select checkbox is checked, identify all "new" specimen IDs. Get an array or something of these, preferably. (Or we can do this on a specimen-ID-by-specimen-ID basis, doesn't really matter.) 3. For each new specimen ID, attempt to match it with the active samples. Color cells / update values accordingly based on the following cases: * 0 matches (color cell red) * 1 match (leave cell uncolored, and change text to matching ID) * >=2 matches (color cell yellow) And ...I think that should be it, knock on wood.
- Loading branch information