{"action":"created","comment":{"url":"https://api.github.com/repos/slash-testing/backslash/pulls/comments/23128429","id":23128429,"diff_hunk":"@@ -0,0 +1,95 @@\n+import Ember from 'ember';\n+\n+export default Ember.ArrayController.extend({\n+  queryParams: [\"page\",\"perPage\"],\n+  page: 1,\n+  perPage: 10,\n+  perPageChanged: function(){\n+    this.set('page', 1);\n+  }.observes('perPage'),\n+\n+  pageBinding: \"content.page\",\n+  perPageBinding: \"content.perPage\",\n+  totalPagesBinding: \"content.totalPages\",\n+\n+  showRunning: false,\n+  selectedStatus: null,\n+  sortProperties: ['nId'],\n+  sortAscending: false,\n+  filteredSessions: function() {\n+    var sessions = this.get('arrangedContent');\n+\n+    if (!sessions || !this.get('showRunning')) {\n+      return sessions;\n+    }\n+\n+    return sessions.filter(function(item) {\n+      return item.get('isRunning');\n+    });\n+  }.property('showRunning','arrangedContent', 'model.[]'),\n+\n+  sessionStatuses: ['', 'SUCCESS', 'FAILURE', 'RUNNING'],\n+  resultsPerPage: [10, 20, 50, 100],\n+  actions: {\n+    querySessions: function () {\n+      var arr_simple_params = {};\n+      if ((typeof FilterlogicalID !== \"undefined\") && (FilterlogicalID !== \"\")) {\n+        arr_simple_params[\"logical_id\"] = FilterlogicalID;\n+      }\n+      if ((typeof FilterUserName !== \"undefined\") && (FilterUserName !== \"\")) {\n+        arr_simple_params[\"user_name\"] = FilterUserName;\n+      }\n+      if ((typeof FilterProductName !== \"undefined\") && (FilterProductName !== \"\")) {\n+        arr_simple_params[\"product_name\"] = FilterProductName;\n+      }\n+      if ((typeof FilterProductVersion !== \"undefined\") && (FilterProductVersion !== \"\")) {\n+        arr_simple_params[\"product_version\"] = FilterProductVersion;\n+      }\n+\n+      var query_params = {};\n+      for (var key in arr_simple_params) {\n+        if (arr_simple_params.hasOwnProperty(key)) {\n+          if (arr_simple_params[key]) {\n+            query_params[key] = 'contains:' + encodeURIComponent(arr_simple_params[key]);\n+          }\n+        }\n+      }\n+\n+      if (this.selectedStatus !== \"\") {\n+        query_params['status'] = this.selectedStatus;\n+      }\n+\n+      if ((this.queryStartDate !== undefined) && (this.queryStartDate !== null))\n+      {\n+        var momentDate = moment(this.queryStartDate, \"DD-MM-YYYY\");\n+        query_params['start_time'] = 'gt:' + momentDate.unix();\n+      }\n+\n+      if (Object.keys(query_params).length > 0) {\n+        this.transitionToRoute(\"search-sessions\", Ember.$.param( query_params ));\n+      }\n+      else\n+      {\n+        this.transitionToRoute(\"sessions\");\n+      }\n+    },\n+\n+    sortBy: function(property) {\n+      this.set('sortProperties', [property]);\n+      this.set('sortAscending', !this.get('sortAscending'));\n+      Ember.$(\"#sessions-header\").children().removeClass('headerSortDown');","path":"webapp/app/controllers/sessions.js","position":80,"original_position":80,"commit_id":"f1e4998778125eac2f48e2ad89250a033ebc0a3a","original_commit_id":"f1e4998778125eac2f48e2ad89250a033ebc0a3a","user":{"login":"vmalloc","id":28710,"avatar_url":"https://avatars.githubusercontent.com/u/28710?v=3","gravatar_id":"","url":"https://api.github.com/users/vmalloc","html_url":"https://github.com/vmalloc","followers_url":"https://api.github.com/users/vmalloc/followers","following_url":"https://api.github.com/users/vmalloc/following{/other_user}","gists_url":"https://api.github.com/users/vmalloc/gists{/gist_id}","starred_url":"https://api.github.com/users/vmalloc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmalloc/subscriptions","organizations_url":"https://api.github.com/users/vmalloc/orgs","repos_url":"https://api.github.com/users/vmalloc/repos","events_url":"https://api.github.com/users/vmalloc/events{/privacy}","received_events_url":"https://api.github.com/users/vmalloc/received_events","type":"User","site_admin":false},"body":"This is better off as a bind-attr in the template, bound to something like 'sortedBy' property on the controller.\r\n\r\nIn general, using jQuery in controllers is a bad smell, because controllers should not directly interface with the DOM...","created_at":"2015-01-17T20:45:00Z","updated_at":"2015-01-17T20:45:00Z","html_url":"https://github.com/slash-testing/backslash/pull/7#discussion_r23128429","pull_request_url":"https://api.github.com/repos/slash-testing/backslash/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/slash-testing/backslash/pulls/comments/23128429"},"html":{"href":"https://github.com/slash-testing/backslash/pull/7#discussion_r23128429"},"pull_request":{"href":"https://api.github.com/repos/slash-testing/backslash/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/slash-testing/backslash/pulls/7","id":27418192,"html_url":"https://github.com/slash-testing/backslash/pull/7","diff_url":"https://github.com/slash-testing/backslash/pull/7.diff","patch_url":"https://github.com/slash-testing/backslash/pull/7.patch","issue_url":"https://api.github.com/repos/slash-testing/backslash/issues/7","number":7,"state":"open","locked":false,"title":"A descent front-end","user":{"login":"boazin","id":5410799,"avatar_url":"https://avatars.githubusercontent.com/u/5410799?v=3","gravatar_id":"","url":"https://api.github.com/users/boazin","html_url":"https://github.com/boazin","followers_url":"https://api.github.com/users/boazin/followers","following_url":"https://api.github.com/users/boazin/following{/other_user}","gists_url":"https://api.github.com/users/boazin/gists{/gist_id}","starred_url":"https://api.github.com/users/boazin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boazin/subscriptions","organizations_url":"https://api.github.com/users/boazin/orgs","repos_url":"https://api.github.com/users/boazin/repos","events_url":"https://api.github.com/users/boazin/events{/privacy}","received_events_url":"https://api.github.com/users/boazin/received_events","type":"User","site_admin":false},"body":"It seems like a good point to merge up.\r\n\r\nStill without JSONB and searching in metadata\r\n","created_at":"2015-01-15T10:22:40Z","updated_at":"2015-01-17T20:45:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1be20454aa9a1de4da02441771b003528a73ed1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/slash-testing/backslash/pulls/7/commits","review_comments_url":"https://api.github.com/repos/slash-testing/backslash/pulls/7/comments","review_comment_url":"https://api.github.com/repos/slash-testing/backslash/pulls/comments/{number}","comments_url":"https://api.github.com/repos/slash-testing/backslash/issues/7/comments","statuses_url":"https://api.github.com/repos/slash-testing/backslash/statuses/f1e4998778125eac2f48e2ad89250a033ebc0a3a","head":{"label":"boazin:master","ref":"master","sha":"f1e4998778125eac2f48e2ad89250a033ebc0a3a","user":{"login":"boazin","id":5410799,"avatar_url":"https://avatars.githubusercontent.com/u/5410799?v=3","gravatar_id":"","url":"https://api.github.com/users/boazin","html_url":"https://github.com/boazin","followers_url":"https://api.github.com/users/boazin/followers","following_url":"https://api.github.com/users/boazin/following{/other_user}","gists_url":"https://api.github.com/users/boazin/gists{/gist_id}","starred_url":"https://api.github.com/users/boazin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boazin/subscriptions","organizations_url":"https://api.github.com/users/boazin/orgs","repos_url":"https://api.github.com/users/boazin/repos","events_url":"https://api.github.com/users/boazin/events{/privacy}","received_events_url":"https://api.github.com/users/boazin/received_events","type":"User","site_admin":false},"repo":{"id":23731234,"name":"backslash","full_name":"boazin/backslash","owner":{"login":"boazin","id":5410799,"avatar_url":"https://avatars.githubusercontent.com/u/5410799?v=3","gravatar_id":"","url":"https://api.github.com/users/boazin","html_url":"https://github.com/boazin","followers_url":"https://api.github.com/users/boazin/followers","following_url":"https://api.github.com/users/boazin/following{/other_user}","gists_url":"https://api.github.com/users/boazin/gists{/gist_id}","starred_url":"https://api.github.com/users/boazin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boazin/subscriptions","organizations_url":"https://api.github.com/users/boazin/orgs","repos_url":"https://api.github.com/users/boazin/repos","events_url":"https://api.github.com/users/boazin/events{/privacy}","received_events_url":"https://api.github.com/users/boazin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/boazin/backslash","description":"Centralized test reporting and monitoring service","fork":true,"url":"https://api.github.com/repos/boazin/backslash","forks_url":"https://api.github.com/repos/boazin/backslash/forks","keys_url":"https://api.github.com/repos/boazin/backslash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boazin/backslash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boazin/backslash/teams","hooks_url":"https://api.github.com/repos/boazin/backslash/hooks","issue_events_url":"https://api.github.com/repos/boazin/backslash/issues/events{/number}","events_url":"https://api.github.com/repos/boazin/backslash/events","assignees_url":"https://api.github.com/repos/boazin/backslash/assignees{/user}","branches_url":"https://api.github.com/repos/boazin/backslash/branches{/branch}","tags_url":"https://api.github.com/repos/boazin/backslash/tags","blobs_url":"https://api.github.com/repos/boazin/backslash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boazin/backslash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boazin/backslash/git/refs{/sha}","trees_url":"https://api.github.com/repos/boazin/backslash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boazin/backslash/statuses/{sha}","languages_url":"https://api.github.com/repos/boazin/backslash/languages","stargazers_url":"https://api.github.com/repos/boazin/backslash/stargazers","contributors_url":"https://api.github.com/repos/boazin/backslash/contributors","subscribers_url":"https://api.github.com/repos/boazin/backslash/subscribers","subscription_url":"https://api.github.com/repos/boazin/backslash/subscription","commits_url":"https://api.github.com/repos/boazin/backslash/commits{/sha}","git_commits_url":"https://api.github.com/repos/boazin/backslash/git/commits{/sha}","comments_url":"https://api.github.com/repos/boazin/backslash/comments{/number}","issue_comment_url":"https://api.github.com/repos/boazin/backslash/issues/comments/{number}","contents_url":"https://api.github.com/repos/boazin/backslash/contents/{+path}","compare_url":"https://api.github.com/repos/boazin/backslash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boazin/backslash/merges","archive_url":"https://api.github.com/repos/boazin/backslash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boazin/backslash/downloads","issues_url":"https://api.github.com/repos/boazin/backslash/issues{/number}","pulls_url":"https://api.github.com/repos/boazin/backslash/pulls{/number}","milestones_url":"https://api.github.com/repos/boazin/backslash/milestones{/number}","notifications_url":"https://api.github.com/repos/boazin/backslash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boazin/backslash/labels{/name}","releases_url":"https://api.github.com/repos/boazin/backslash/releases{/id}","created_at":"2014-09-06T09:27:50Z","updated_at":"2015-01-15T10:16:58Z","pushed_at":"2015-01-15T10:16:58Z","git_url":"git://github.com/boazin/backslash.git","ssh_url":"git@github.com:boazin/backslash.git","clone_url":"https://github.com/boazin/backslash.git","svn_url":"https://github.com/boazin/backslash","homepage":null,"size":919,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"slash-testing:master","ref":"master","sha":"5b1109205e167aab4ad1b4a4cccdafffe163d0b8","user":{"login":"slash-testing","id":10515451,"avatar_url":"https://avatars.githubusercontent.com/u/10515451?v=3","gravatar_id":"","url":"https://api.github.com/users/slash-testing","html_url":"https://github.com/slash-testing","followers_url":"https://api.github.com/users/slash-testing/followers","following_url":"https://api.github.com/users/slash-testing/following{/other_user}","gists_url":"https://api.github.com/users/slash-testing/gists{/gist_id}","starred_url":"https://api.github.com/users/slash-testing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slash-testing/subscriptions","organizations_url":"https://api.github.com/users/slash-testing/orgs","repos_url":"https://api.github.com/users/slash-testing/repos","events_url":"https://api.github.com/users/slash-testing/events{/privacy}","received_events_url":"https://api.github.com/users/slash-testing/received_events","type":"Organization","site_admin":false},"repo":{"id":23376788,"name":"backslash","full_name":"slash-testing/backslash","owner":{"login":"slash-testing","id":10515451,"avatar_url":"https://avatars.githubusercontent.com/u/10515451?v=3","gravatar_id":"","url":"https://api.github.com/users/slash-testing","html_url":"https://github.com/slash-testing","followers_url":"https://api.github.com/users/slash-testing/followers","following_url":"https://api.github.com/users/slash-testing/following{/other_user}","gists_url":"https://api.github.com/users/slash-testing/gists{/gist_id}","starred_url":"https://api.github.com/users/slash-testing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slash-testing/subscriptions","organizations_url":"https://api.github.com/users/slash-testing/orgs","repos_url":"https://api.github.com/users/slash-testing/repos","events_url":"https://api.github.com/users/slash-testing/events{/privacy}","received_events_url":"https://api.github.com/users/slash-testing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slash-testing/backslash","description":"Centralized test reporting and monitoring service","fork":false,"url":"https://api.github.com/repos/slash-testing/backslash","forks_url":"https://api.github.com/repos/slash-testing/backslash/forks","keys_url":"https://api.github.com/repos/slash-testing/backslash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slash-testing/backslash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slash-testing/backslash/teams","hooks_url":"https://api.github.com/repos/slash-testing/backslash/hooks","issue_events_url":"https://api.github.com/repos/slash-testing/backslash/issues/events{/number}","events_url":"https://api.github.com/repos/slash-testing/backslash/events","assignees_url":"https://api.github.com/repos/slash-testing/backslash/assignees{/user}","branches_url":"https://api.github.com/repos/slash-testing/backslash/branches{/branch}","tags_url":"https://api.github.com/repos/slash-testing/backslash/tags","blobs_url":"https://api.github.com/repos/slash-testing/backslash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slash-testing/backslash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slash-testing/backslash/git/refs{/sha}","trees_url":"https://api.github.com/repos/slash-testing/backslash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slash-testing/backslash/statuses/{sha}","languages_url":"https://api.github.com/repos/slash-testing/backslash/languages","stargazers_url":"https://api.github.com/repos/slash-testing/backslash/stargazers","contributors_url":"https://api.github.com/repos/slash-testing/backslash/contributors","subscribers_url":"https://api.github.com/repos/slash-testing/backslash/subscribers","subscription_url":"https://api.github.com/repos/slash-testing/backslash/subscription","commits_url":"https://api.github.com/repos/slash-testing/backslash/commits{/sha}","git_commits_url":"https://api.github.com/repos/slash-testing/backslash/git/commits{/sha}","comments_url":"https://api.github.com/repos/slash-testing/backslash/comments{/number}","issue_comment_url":"https://api.github.com/repos/slash-testing/backslash/issues/comments/{number}","contents_url":"https://api.github.com/repos/slash-testing/backslash/contents/{+path}","compare_url":"https://api.github.com/repos/slash-testing/backslash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slash-testing/backslash/merges","archive_url":"https://api.github.com/repos/slash-testing/backslash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slash-testing/backslash/downloads","issues_url":"https://api.github.com/repos/slash-testing/backslash/issues{/number}","pulls_url":"https://api.github.com/repos/slash-testing/backslash/pulls{/number}","milestones_url":"https://api.github.com/repos/slash-testing/backslash/milestones{/number}","notifications_url":"https://api.github.com/repos/slash-testing/backslash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slash-testing/backslash/labels{/name}","releases_url":"https://api.github.com/repos/slash-testing/backslash/releases{/id}","created_at":"2014-08-27T04:30:58Z","updated_at":"2015-01-13T21:08:52Z","pushed_at":"2014-12-30T20:03:51Z","git_url":"git://github.com/slash-testing/backslash.git","ssh_url":"git@github.com:slash-testing/backslash.git","clone_url":"https://github.com/slash-testing/backslash.git","svn_url":"https://github.com/slash-testing/backslash","homepage":null,"size":950,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slash-testing/backslash/pulls/7"},"html":{"href":"https://github.com/slash-testing/backslash/pull/7"},"issue":{"href":"https://api.github.com/repos/slash-testing/backslash/issues/7"},"comments":{"href":"https://api.github.com/repos/slash-testing/backslash/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/slash-testing/backslash/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/slash-testing/backslash/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/slash-testing/backslash/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/slash-testing/backslash/statuses/f1e4998778125eac2f48e2ad89250a033ebc0a3a"}}}}