{"action":"created","issue":{"url":"https://api.github.com/repos/djaodjin/djaodjin-saas/issues/26","labels_url":"https://api.github.com/repos/djaodjin/djaodjin-saas/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/djaodjin/djaodjin-saas/issues/26/comments","events_url":"https://api.github.com/repos/djaodjin/djaodjin-saas/issues/26/events","html_url":"https://github.com/djaodjin/djaodjin-saas/issues/26","id":68792417,"number":26,"title":"Coupon admin's filter feature usability problems","user":{"login":"marmida","id":420896,"avatar_url":"https://avatars.githubusercontent.com/u/420896?v=3","gravatar_id":"","url":"https://api.github.com/users/marmida","html_url":"https://github.com/marmida","followers_url":"https://api.github.com/users/marmida/followers","following_url":"https://api.github.com/users/marmida/following{/other_user}","gists_url":"https://api.github.com/users/marmida/gists{/gist_id}","starred_url":"https://api.github.com/users/marmida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmida/subscriptions","organizations_url":"https://api.github.com/users/marmida/orgs","repos_url":"https://api.github.com/users/marmida/repos","events_url":"https://api.github.com/users/marmida/events{/privacy}","received_events_url":"https://api.github.com/users/marmida/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/djaodjin/djaodjin-saas/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-15T21:36:13Z","updated_at":"2015-04-15T23:37:25Z","closed_at":null,"body":"The filter's auto-refresh on the coupon admin page fires off too eagerly. I made a short video of this behavior:\r\nhttps://www.dropbox.com/sc/1hs0fpfp36agnuq/AAAlY-schXOxmYx0CLe5u9UQa\r\n\r\nThis has some negative effects:\r\n\r\n1. it interrupts the user's typing, forcing them to type only one character per refresh\r\n1. it loses focus, causing the user to re-focus on the text box after each refresh\r\n\r\nIn addition, it's confusing because:\r\n\r\n1. the filter matches unexpected rows. I tried some number input that I figured should not match, and yet, it still found some rows with nothing obviously matched.\r\n1. it's on the same line as the data-entry form for adding a new coupon. It's not immediately clear that one of these adds a row, while one filters the current results.\r\n1. if no results are found, the display loses the input control for the filter expression, forcing the user to reload or hit back."},"comment":{"url":"https://api.github.com/repos/djaodjin/djaodjin-saas/issues/comments/93598377","html_url":"https://github.com/djaodjin/djaodjin-saas/issues/26#issuecomment-93598377","issue_url":"https://api.github.com/repos/djaodjin/djaodjin-saas/issues/26","id":93598377,"user":{"login":"smirolo","id":3732869,"avatar_url":"https://avatars.githubusercontent.com/u/3732869?v=3","gravatar_id":"","url":"https://api.github.com/users/smirolo","html_url":"https://github.com/smirolo","followers_url":"https://api.github.com/users/smirolo/followers","following_url":"https://api.github.com/users/smirolo/following{/other_user}","gists_url":"https://api.github.com/users/smirolo/gists{/gist_id}","starred_url":"https://api.github.com/users/smirolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smirolo/subscriptions","organizations_url":"https://api.github.com/users/smirolo/orgs","repos_url":"https://api.github.com/users/smirolo/repos","events_url":"https://api.github.com/users/smirolo/events{/privacy}","received_events_url":"https://api.github.com/users/smirolo/received_events","type":"User","site_admin":false},"created_at":"2015-04-15T23:37:25Z","updated_at":"2015-04-15T23:37:25Z","body":"Eager refresh and flow interruption\r\n--\r\nAngularJS might have a settings to slow down the eager API calls. The flow interruption, I never noticed. Is it a browser related issue or was I just blind?\r\n\r\nThe filter matches unexpected rows\r\n--\r\nIn [saas/api/coupons.py](https://github.com/djaodjin/djaodjin-saas/blob/ef1f530af345755bf03022fc7210b46c33a7c283/saas/api/coupons.py), the following code picks up what is searched:\r\n\r\n    class SmartCouponListMixin(SearchableListMixin, SortableListMixin):\r\n    \"\"\"\r\n    Subscriber list which is also searchable and sortable.\r\n    \"\"\"\r\n    search_fields = ['created_at',\r\n                     'code',\r\n                     'description',\r\n                     'percent',\r\n                     'ends_at',\r\n                     'organization__full_name']\r\n\r\nThe non-obvious matches might come from the `JOIN` to retrieve `organization__full_name`. It turns out customers really love this feature. It might though be good to have some documentation on the page (coupon_list.html template) of what is the expected behavior of filter is and make sure it matches :).\r\n\r\nThe filter is on the same line as the data-entry form for adding a new coupon. It's not immediately clear that one of these adds a row, while one filters the current results.\r\n--\r\nThat seemed like a good idea to pack `Add Coupon` and `Filter` tight on the screen ... but maybe not. If there are UI best practices for these sort of things, I am a taker.\r\n\r\nIf no results are found, the display loses the input control for the filter expression, forcing the user to reload or hit back.\r\n--\r\nObviously a bug.\r\n"}}