zendesk / advanced_search

Nav bar app for Search. Provides advanced GUI for filters.
https://www.zendesk.com/apps/advanced-search
Other
2 stars 6 forks source link

Dpawluk/namecallback #1

Closed dpawluk closed 9 years ago

dpawluk commented 9 years ago

@jstjoe

Added support for pulling in Assignee name and utilizing it in the results UI as well as including it in the CSV. Risk of merging - low(ish) -If no name, link w/id will use ID instead of name -CSV will produce an assignee_name field with 'undefined' for name if no name (although I'm pretty sure this isn't possible, should always be something).

Please test and let me know what you think :smile:

dpawluk commented 9 years ago

@jstjoe In any case please consider merging https://github.com/zendesklabs/advanced_search/commit/4f1c7576e46c2299b10bc8bb2509b1c251646874 no matter what as it fixes an issue with CSV 'created_at' and 'updated_at' bug.

adammw commented 9 years ago

@dpawluk an alternative to doing a 1 query for every user ID is to use the /api/v2/users/show_many.json?ids={ids} endpoint (although it would likely need to be batched to a reasonable number).

dpawluk commented 9 years ago

Didn't think of it, will make sure to break arrays up 100 IDs/request.

Ty!

On Oct 15, 2014, at 5:43 PM, Adam Malcontenti-Wilson notifications@github.com wrote:

@dpawluk an alternative to doing a 1 query for every user ID is to use the /api/v2/users/show_many.json?ids={ids} endpoint (although it would likely need to be batched to a reasonable number).

— Reply to this email directly or view it on GitHub.

jstjoe commented 9 years ago
  1. I'd like to make this more general than just for assignee and apply it to requester as well.
  2. We need to add a condition for null values. Right now it makes a failed request to /users/(null).json
  3. Ultimately it would be good to have some caching of user ID - name pairs in a global variable so subsequent queries/pages don't have to look them up again. This can wait for a later version though.
  4. Switching to batching the requests would be a great improvement, especially for the all pages option. This can also wait for a later version.
jstjoe commented 9 years ago

Oh and a failed request to lookup a user ID should not be a blocker. Let's get error handling in here. Currently a 400 level error (when hitting /users/(null).json) prevents the results from loading in the UI.

jstjoe commented 9 years ago

So I went a different way on this a while back. Closing it out.