{"action":"created","comment":{"url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/comments/37085327","id":37085327,"diff_hunk":"@@ -16,67 +16,54 @@\n           termRequest.done(function(data) {\n               var terms = data.enrollment_terms;\n               var newSelect = document.getElementById('termsSelect');\n-              var label = document.createElement('label');\n-              label.setAttribute('for', 'termsSelect');\n               var selectHTML = '';\n               $.each(terms, function(index, term) {\n                   selectHTML += '<option id=\"term' + term.id + '\" value=\"' + term.id + '\">' + term.name + '</option>';\n               });\n               newSelect.innerHTML = selectHTML;\n-              newSelect.appendChild(label);\n               $('#termsSelect').on('change', function() {\n+              \t $('.spinner').show();\n                   var courseReportRequest = $.ajax({\n                       url: 'report?action=getCoursesPublished&term=' + $(this).val() + '&termName=' + $('#termsSelect option:selected').text(),\n                       type: 'GET',\n                   });\n                   courseReportRequest.done(function(response, status, xhr) {\n-                      var filename = '';\n-                      var disposition = xhr.getResponseHeader('Content-Disposition');\n-                      if (disposition && disposition.indexOf('attachment') !== -1) {\n-                          var filenameRegex = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/;\n-                          var matches = filenameRegex.exec(disposition);\n-                          if (matches !== null && matches[1]) filename = matches[1].replace(/['\"]/g, '');\n-                      }\n-\n-                      var type = xhr.getResponseHeader('Content-Type');\n-                      var blob = new Blob([response], {\n-                          type: type\n-                      });\n-\n-                      if (typeof window.navigator.msSaveBlob !== 'undefined') {\n-                          // IE workaround for \"HTML7007: One or more blob URLs were revoked by closing the blob for which they were created. These URLs will no longer resolve as the data backing the URL has been freed.\"\n-                          window.navigator.msSaveBlob(blob, filename);\n-                      } else {\n-                          var URL = window.URL || window.webkitURL;\n-                          var downloadUrl = URL.createObjectURL(blob);\n+                      var reportIntervId = setInterval(function() {\n+                          reportTimer(response);\n+                      }, reportPollInterv);\n \n-                          if (filename) {\n-                              // use HTML5 a[download] attribute to specify filename\n-                              var a = document.createElement('a');\n-                              // safari doesn't support this yet\n-                              if (typeof a.download === 'undefined') {\n-                                  window.location = downloadUrl;\n-                              } else {\n-                                  a.href = downloadUrl;\n-                                  a.download = filename;\n-                                  document.body.appendChild(a);\n-                                  a.click();\n+                      function reportTimer(response) {\n+                      \t $('.spinner').show();\n+                          var resultsMsg = $.ajax({\n+                              url: 'report?action=polling&thrdId=' + response,\n+                              type: 'get',\n+                          }).done(function(response, status, xhr) {\n+                              if (response !== \"working\") {","path":"src/main/webapp/assets/js/analytics.js","position":69,"original_position":69,"commit_id":"26edae34b0d42db09e9fd4fd116aff62d81e4622","original_commit_id":"26edae34b0d42db09e9fd4fd116aff62d81e4622","user":{"login":"lsloan","id":20786,"avatar_url":"https://avatars.githubusercontent.com/u/20786?v=3","gravatar_id":"","url":"https://api.github.com/users/lsloan","html_url":"https://github.com/lsloan","followers_url":"https://api.github.com/users/lsloan/followers","following_url":"https://api.github.com/users/lsloan/following{/other_user}","gists_url":"https://api.github.com/users/lsloan/gists{/gist_id}","starred_url":"https://api.github.com/users/lsloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsloan/subscriptions","organizations_url":"https://api.github.com/users/lsloan/orgs","repos_url":"https://api.github.com/users/lsloan/repos","events_url":"https://api.github.com/users/lsloan/events{/privacy}","received_events_url":"https://api.github.com/users/lsloan/received_events","type":"User","site_admin":false},"body":"Since the `WORKING` symbol is defined above and has the value \"working\", it should be used here, too.","created_at":"2015-08-14T15:07:13Z","updated_at":"2015-08-14T15:07:13Z","html_url":"https://github.com/tl-its-umich-edu/canvas_courses_report/pull/6#discussion_r37085327","pull_request_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/comments/37085327"},"html":{"href":"https://github.com/tl-its-umich-edu/canvas_courses_report/pull/6#discussion_r37085327"},"pull_request":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/6","id":42452661,"html_url":"https://github.com/tl-its-umich-edu/canvas_courses_report/pull/6","diff_url":"https://github.com/tl-its-umich-edu/canvas_courses_report/pull/6.diff","patch_url":"https://github.com/tl-its-umich-edu/canvas_courses_report/pull/6.patch","issue_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/issues/6","number":6,"state":"open","locked":false,"title":"TLUNIZIN-661 fixing the browser time out issue with large reports","user":{"login":"pushyamig","id":8579775,"avatar_url":"https://avatars.githubusercontent.com/u/8579775?v=3","gravatar_id":"","url":"https://api.github.com/users/pushyamig","html_url":"https://github.com/pushyamig","followers_url":"https://api.github.com/users/pushyamig/followers","following_url":"https://api.github.com/users/pushyamig/following{/other_user}","gists_url":"https://api.github.com/users/pushyamig/gists{/gist_id}","starred_url":"https://api.github.com/users/pushyamig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pushyamig/subscriptions","organizations_url":"https://api.github.com/users/pushyamig/orgs","repos_url":"https://api.github.com/users/pushyamig/repos","events_url":"https://api.github.com/users/pushyamig/events{/privacy}","received_events_url":"https://api.github.com/users/pushyamig/received_events","type":"User","site_admin":false},"body":"The Application flow is the user select a term and the expected out come is a report in .csv format that has list of courses for that particular time. The issue is with large course list browser times out when the server is working hard to generate the report. The idea implemented here is putting the report generating call on a separate thread and let the through javascript polling checking if the issue job is done. If done will present the user with a downloadable file from the browser","created_at":"2015-08-14T12:53:48Z","updated_at":"2015-08-14T15:07:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f53aed7bd53a4ed333b23a5b1a4d43aaa90ffa38","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/6/commits","review_comments_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/6/comments","review_comment_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/issues/6/comments","statuses_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/statuses/26edae34b0d42db09e9fd4fd116aff62d81e4622","head":{"label":"tl-its-umich-edu:TLUNIZIN-661","ref":"TLUNIZIN-661","sha":"26edae34b0d42db09e9fd4fd116aff62d81e4622","user":{"login":"tl-its-umich-edu","id":8292960,"avatar_url":"https://avatars.githubusercontent.com/u/8292960?v=3","gravatar_id":"","url":"https://api.github.com/users/tl-its-umich-edu","html_url":"https://github.com/tl-its-umich-edu","followers_url":"https://api.github.com/users/tl-its-umich-edu/followers","following_url":"https://api.github.com/users/tl-its-umich-edu/following{/other_user}","gists_url":"https://api.github.com/users/tl-its-umich-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/tl-its-umich-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tl-its-umich-edu/subscriptions","organizations_url":"https://api.github.com/users/tl-its-umich-edu/orgs","repos_url":"https://api.github.com/users/tl-its-umich-edu/repos","events_url":"https://api.github.com/users/tl-its-umich-edu/events{/privacy}","received_events_url":"https://api.github.com/users/tl-its-umich-edu/received_events","type":"Organization","site_admin":false},"repo":{"id":39967587,"name":"canvas_courses_report","full_name":"tl-its-umich-edu/canvas_courses_report","owner":{"login":"tl-its-umich-edu","id":8292960,"avatar_url":"https://avatars.githubusercontent.com/u/8292960?v=3","gravatar_id":"","url":"https://api.github.com/users/tl-its-umich-edu","html_url":"https://github.com/tl-its-umich-edu","followers_url":"https://api.github.com/users/tl-its-umich-edu/followers","following_url":"https://api.github.com/users/tl-its-umich-edu/following{/other_user}","gists_url":"https://api.github.com/users/tl-its-umich-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/tl-its-umich-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tl-its-umich-edu/subscriptions","organizations_url":"https://api.github.com/users/tl-its-umich-edu/orgs","repos_url":"https://api.github.com/users/tl-its-umich-edu/repos","events_url":"https://api.github.com/users/tl-its-umich-edu/events{/privacy}","received_events_url":"https://api.github.com/users/tl-its-umich-edu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tl-its-umich-edu/canvas_courses_report","description":"","fork":false,"url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report","forks_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/forks","keys_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/teams","hooks_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/hooks","issue_events_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/issues/events{/number}","events_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/events","assignees_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/assignees{/user}","branches_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/branches{/branch}","tags_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/tags","blobs_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/git/refs{/sha}","trees_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/statuses/{sha}","languages_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/languages","stargazers_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/stargazers","contributors_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/contributors","subscribers_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/subscribers","subscription_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/subscription","commits_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/commits{/sha}","git_commits_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/git/commits{/sha}","comments_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/comments{/number}","issue_comment_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/issues/comments{/number}","contents_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/contents/{+path}","compare_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/merges","archive_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/downloads","issues_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/issues{/number}","pulls_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls{/number}","milestones_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/milestones{/number}","notifications_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/labels{/name}","releases_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/releases{/id}","created_at":"2015-07-30T19:04:11Z","updated_at":"2015-08-11T12:26:36Z","pushed_at":"2015-08-14T12:53:48Z","git_url":"git://github.com/tl-its-umich-edu/canvas_courses_report.git","ssh_url":"git@github.com:tl-its-umich-edu/canvas_courses_report.git","clone_url":"https://github.com/tl-its-umich-edu/canvas_courses_report.git","svn_url":"https://github.com/tl-its-umich-edu/canvas_courses_report","homepage":null,"size":312,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"tl-its-umich-edu:master","ref":"master","sha":"044cd189b90c6b290fd5535bfc77a2753e561af5","user":{"login":"tl-its-umich-edu","id":8292960,"avatar_url":"https://avatars.githubusercontent.com/u/8292960?v=3","gravatar_id":"","url":"https://api.github.com/users/tl-its-umich-edu","html_url":"https://github.com/tl-its-umich-edu","followers_url":"https://api.github.com/users/tl-its-umich-edu/followers","following_url":"https://api.github.com/users/tl-its-umich-edu/following{/other_user}","gists_url":"https://api.github.com/users/tl-its-umich-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/tl-its-umich-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tl-its-umich-edu/subscriptions","organizations_url":"https://api.github.com/users/tl-its-umich-edu/orgs","repos_url":"https://api.github.com/users/tl-its-umich-edu/repos","events_url":"https://api.github.com/users/tl-its-umich-edu/events{/privacy}","received_events_url":"https://api.github.com/users/tl-its-umich-edu/received_events","type":"Organization","site_admin":false},"repo":{"id":39967587,"name":"canvas_courses_report","full_name":"tl-its-umich-edu/canvas_courses_report","owner":{"login":"tl-its-umich-edu","id":8292960,"avatar_url":"https://avatars.githubusercontent.com/u/8292960?v=3","gravatar_id":"","url":"https://api.github.com/users/tl-its-umich-edu","html_url":"https://github.com/tl-its-umich-edu","followers_url":"https://api.github.com/users/tl-its-umich-edu/followers","following_url":"https://api.github.com/users/tl-its-umich-edu/following{/other_user}","gists_url":"https://api.github.com/users/tl-its-umich-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/tl-its-umich-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tl-its-umich-edu/subscriptions","organizations_url":"https://api.github.com/users/tl-its-umich-edu/orgs","repos_url":"https://api.github.com/users/tl-its-umich-edu/repos","events_url":"https://api.github.com/users/tl-its-umich-edu/events{/privacy}","received_events_url":"https://api.github.com/users/tl-its-umich-edu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tl-its-umich-edu/canvas_courses_report","description":"","fork":false,"url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report","forks_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/forks","keys_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/teams","hooks_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/hooks","issue_events_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/issues/events{/number}","events_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/events","assignees_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/assignees{/user}","branches_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/branches{/branch}","tags_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/tags","blobs_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/git/refs{/sha}","trees_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/statuses/{sha}","languages_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/languages","stargazers_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/stargazers","contributors_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/contributors","subscribers_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/subscribers","subscription_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/subscription","commits_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/commits{/sha}","git_commits_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/git/commits{/sha}","comments_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/comments{/number}","issue_comment_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/issues/comments{/number}","contents_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/contents/{+path}","compare_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/merges","archive_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/downloads","issues_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/issues{/number}","pulls_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls{/number}","milestones_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/milestones{/number}","notifications_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/labels{/name}","releases_url":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/releases{/id}","created_at":"2015-07-30T19:04:11Z","updated_at":"2015-08-11T12:26:36Z","pushed_at":"2015-08-14T12:53:48Z","git_url":"git://github.com/tl-its-umich-edu/canvas_courses_report.git","ssh_url":"git@github.com:tl-its-umich-edu/canvas_courses_report.git","clone_url":"https://github.com/tl-its-umich-edu/canvas_courses_report.git","svn_url":"https://github.com/tl-its-umich-edu/canvas_courses_report","homepage":null,"size":312,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/6"},"html":{"href":"https://github.com/tl-its-umich-edu/canvas_courses_report/pull/6"},"issue":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/issues/6"},"comments":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas_courses_report/statuses/26edae34b0d42db09e9fd4fd116aff62d81e4622"}}}}