{"action":"created","comment":{"url":"https://api.github.com/repos/opf/openproject/pulls/comments/29150833","id":29150833,"diff_hunk":"@@ -0,0 +1,75 @@\n+//-- copyright\n+// OpenProject is a project management system.\n+// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)\n+//\n+// This program is free software; you can redistribute it and/or\n+// modify it under the terms of the GNU General Public License version 3.\n+//\n+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:\n+// Copyright (C) 2006-2013 Jean-Philippe Lang\n+// Copyright (C) 2010-2013 the ChiliProject Team\n+//\n+// This program is free software; you can redistribute it and/or\n+// modify it under the terms of the GNU General Public License\n+// as published by the Free Software Foundation; either version 2\n+// of the License, or (at your option) any later version.\n+//\n+// This program is distributed in the hope that it will be useful,\n+// but WITHOUT ANY WARRANTY; without even the implied warranty of\n+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+// GNU General Public License for more details.\n+//\n+// You should have received a copy of the GNU General Public License\n+// along with this program; if not, write to the Free Software\n+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n+//\n+// See doc/COPYRIGHT.rdoc for more details.\n+//++\n+\n+/*jshint expr: true*/\n+\n+describe('CategoryService', function() {\n+\n+  var CategoryService, $httpBackend;\n+  var projectIdentifier = 'ocarina',\n+      apiPath = '/api/v3/projects/' + projectIdentifier + '/categories';\n+\n+  beforeEach(module('openproject.services'));\n+\n+  beforeEach(inject(function(_$httpBackend_, _CategoryService_){\n+    $httpBackend   = _$httpBackend_;\n+    CategoryService = _CategoryService_;\n+  }));\n+\n+  afterEach(function() {\n+    $httpBackend.verifyNoOutstandingExpectation();\n+    $httpBackend.verifyNoOutstandingRequest();\n+  });\n+\n+  describe('getCategories', function() {\n+\n+    var categories = [\n+      { id: 1, name: 'Happy Mask' },\n+      { id: 2, name: 'A Salesman' }\n+    ];\n+\n+    beforeEach(function() {\n+      $httpBackend.when('GET', apiPath)\n+        .respond({ _embedded: { elements: categories } });\n+    });\n+\n+    it('loads the categories sorted by their name', function() {\n+      $httpBackend.expectGET(apiPath);\n+\n+      var callback = sinon.spy(),\n+          requestedCategories = CategoryService.getCategories(projectIdentifier).then(callback);","path":"frontend/tests/unit/tests/services/category-service-test.js","position":65,"original_position":65,"commit_id":"289d1e8230de3510b5ad78f35f7cbba7fe7724ac","original_commit_id":"ff75f55f21be44ce9d8bf709688779a6a7de6d3f","user":{"login":"NobodysNightmare","id":453584,"avatar_url":"https://avatars.githubusercontent.com/u/453584?v=3","gravatar_id":"","url":"https://api.github.com/users/NobodysNightmare","html_url":"https://github.com/NobodysNightmare","followers_url":"https://api.github.com/users/NobodysNightmare/followers","following_url":"https://api.github.com/users/NobodysNightmare/following{/other_user}","gists_url":"https://api.github.com/users/NobodysNightmare/gists{/gist_id}","starred_url":"https://api.github.com/users/NobodysNightmare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NobodysNightmare/subscriptions","organizations_url":"https://api.github.com/users/NobodysNightmare/orgs","repos_url":"https://api.github.com/users/NobodysNightmare/repos","events_url":"https://api.github.com/users/NobodysNightmare/events{/privacy}","received_events_url":"https://api.github.com/users/NobodysNightmare/received_events","type":"User","site_admin":false},"body":"@floriank The time has come ;-)","created_at":"2015-04-27T14:30:11Z","updated_at":"2015-04-27T14:30:11Z","html_url":"https://github.com/opf/openproject/pull/2911#discussion_r29150833","pull_request_url":"https://api.github.com/repos/opf/openproject/pulls/2911","_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments/29150833"},"html":{"href":"https://github.com/opf/openproject/pull/2911#discussion_r29150833"},"pull_request":{"href":"https://api.github.com/repos/opf/openproject/pulls/2911"}}},"pull_request":{"url":"https://api.github.com/repos/opf/openproject/pulls/2911","id":33973992,"html_url":"https://github.com/opf/openproject/pull/2911","diff_url":"https://github.com/opf/openproject/pull/2911.diff","patch_url":"https://github.com/opf/openproject/pull/2911.patch","issue_url":"https://api.github.com/repos/opf/openproject/issues/2911","number":2911,"state":"open","locked":false,"title":"[19759] Port category filter to OP 4.1+","user":{"login":"floriank","id":498241,"avatar_url":"https://avatars.githubusercontent.com/u/498241?v=3","gravatar_id":"","url":"https://api.github.com/users/floriank","html_url":"https://github.com/floriank","followers_url":"https://api.github.com/users/floriank/followers","following_url":"https://api.github.com/users/floriank/following{/other_user}","gists_url":"https://api.github.com/users/floriank/gists{/gist_id}","starred_url":"https://api.github.com/users/floriank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floriank/subscriptions","organizations_url":"https://api.github.com/users/floriank/orgs","repos_url":"https://api.github.com/users/floriank/repos","events_url":"https://api.github.com/users/floriank/events{/privacy}","received_events_url":"https://api.github.com/users/floriank/received_events","type":"User","site_admin":false},"body":"This will port the work @NobodysNightmare put into backporting a missing feature to the `release/4.0` branch into `release/4.1` while accommodating the new file structure for the frontend. \r\n\r\nTests have been added where necessary, I am not yet sure if we should add some integration tests for filtering the work package list.\r\n\r\nThe feature to filter by category originally got lost while developing version 4.0 and is now back through the efforts in #2908.\r\n\r\nThis should meet the requirements of https://community.openproject.org/work_packages/19759.\r\n\r\npublic WP: https://community.openproject.org/work_packages/19809","created_at":"2015-04-23T16:43:23Z","updated_at":"2015-04-27T14:30:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26f07484ee3906cf79a9cfb34a69cacac4cfb551","assignee":{"login":"NobodysNightmare","id":453584,"avatar_url":"https://avatars.githubusercontent.com/u/453584?v=3","gravatar_id":"","url":"https://api.github.com/users/NobodysNightmare","html_url":"https://github.com/NobodysNightmare","followers_url":"https://api.github.com/users/NobodysNightmare/followers","following_url":"https://api.github.com/users/NobodysNightmare/following{/other_user}","gists_url":"https://api.github.com/users/NobodysNightmare/gists{/gist_id}","starred_url":"https://api.github.com/users/NobodysNightmare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NobodysNightmare/subscriptions","organizations_url":"https://api.github.com/users/NobodysNightmare/orgs","repos_url":"https://api.github.com/users/NobodysNightmare/repos","events_url":"https://api.github.com/users/NobodysNightmare/events{/privacy}","received_events_url":"https://api.github.com/users/NobodysNightmare/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/opf/openproject/milestones/1","html_url":"https://github.com/opf/openproject/milestones/4.1","labels_url":"https://api.github.com/repos/opf/openproject/milestones/1/labels","id":1063126,"number":1,"title":"4.1","description":"","creator":{"login":"myabc","id":755,"avatar_url":"https://avatars.githubusercontent.com/u/755?v=3","gravatar_id":"","url":"https://api.github.com/users/myabc","html_url":"https://github.com/myabc","followers_url":"https://api.github.com/users/myabc/followers","following_url":"https://api.github.com/users/myabc/following{/other_user}","gists_url":"https://api.github.com/users/myabc/gists{/gist_id}","starred_url":"https://api.github.com/users/myabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myabc/subscriptions","organizations_url":"https://api.github.com/users/myabc/orgs","repos_url":"https://api.github.com/users/myabc/repos","events_url":"https://api.github.com/users/myabc/events{/privacy}","received_events_url":"https://api.github.com/users/myabc/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":33,"state":"open","created_at":"2015-04-11T14:25:25Z","updated_at":"2015-04-27T13:38:43Z","due_on":"2015-04-29T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/opf/openproject/pulls/2911/commits","review_comments_url":"https://api.github.com/repos/opf/openproject/pulls/2911/comments","review_comment_url":"https://api.github.com/repos/opf/openproject/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opf/openproject/issues/2911/comments","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/289d1e8230de3510b5ad78f35f7cbba7fe7724ac","head":{"label":"floriank:feature/19759-fix-category-filter","ref":"feature/19759-fix-category-filter","sha":"289d1e8230de3510b5ad78f35f7cbba7fe7724ac","user":{"login":"floriank","id":498241,"avatar_url":"https://avatars.githubusercontent.com/u/498241?v=3","gravatar_id":"","url":"https://api.github.com/users/floriank","html_url":"https://github.com/floriank","followers_url":"https://api.github.com/users/floriank/followers","following_url":"https://api.github.com/users/floriank/following{/other_user}","gists_url":"https://api.github.com/users/floriank/gists{/gist_id}","starred_url":"https://api.github.com/users/floriank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floriank/subscriptions","organizations_url":"https://api.github.com/users/floriank/orgs","repos_url":"https://api.github.com/users/floriank/repos","events_url":"https://api.github.com/users/floriank/events{/privacy}","received_events_url":"https://api.github.com/users/floriank/received_events","type":"User","site_admin":false},"repo":{"id":29468662,"name":"openproject","full_name":"floriank/openproject","owner":{"login":"floriank","id":498241,"avatar_url":"https://avatars.githubusercontent.com/u/498241?v=3","gravatar_id":"","url":"https://api.github.com/users/floriank","html_url":"https://github.com/floriank","followers_url":"https://api.github.com/users/floriank/followers","following_url":"https://api.github.com/users/floriank/following{/other_user}","gists_url":"https://api.github.com/users/floriank/gists{/gist_id}","starred_url":"https://api.github.com/users/floriank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floriank/subscriptions","organizations_url":"https://api.github.com/users/floriank/orgs","repos_url":"https://api.github.com/users/floriank/repos","events_url":"https://api.github.com/users/floriank/events{/privacy}","received_events_url":"https://api.github.com/users/floriank/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/floriank/openproject","description":"OpenProject is a web based project management system built on Ruby on Rails","fork":true,"url":"https://api.github.com/repos/floriank/openproject","forks_url":"https://api.github.com/repos/floriank/openproject/forks","keys_url":"https://api.github.com/repos/floriank/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/floriank/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/floriank/openproject/teams","hooks_url":"https://api.github.com/repos/floriank/openproject/hooks","issue_events_url":"https://api.github.com/repos/floriank/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/floriank/openproject/events","assignees_url":"https://api.github.com/repos/floriank/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/floriank/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/floriank/openproject/tags","blobs_url":"https://api.github.com/repos/floriank/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/floriank/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/floriank/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/floriank/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/floriank/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/floriank/openproject/languages","stargazers_url":"https://api.github.com/repos/floriank/openproject/stargazers","contributors_url":"https://api.github.com/repos/floriank/openproject/contributors","subscribers_url":"https://api.github.com/repos/floriank/openproject/subscribers","subscription_url":"https://api.github.com/repos/floriank/openproject/subscription","commits_url":"https://api.github.com/repos/floriank/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/floriank/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/floriank/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/floriank/openproject/issues/comments{/number}","contents_url":"https://api.github.com/repos/floriank/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/floriank/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/floriank/openproject/merges","archive_url":"https://api.github.com/repos/floriank/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/floriank/openproject/downloads","issues_url":"https://api.github.com/repos/floriank/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/floriank/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/floriank/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/floriank/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/floriank/openproject/labels{/name}","releases_url":"https://api.github.com/repos/floriank/openproject/releases{/id}","created_at":"2015-01-19T11:56:20Z","updated_at":"2015-04-20T08:53:16Z","pushed_at":"2015-04-27T09:37:40Z","git_url":"git://github.com/floriank/openproject.git","ssh_url":"git@github.com:floriank/openproject.git","clone_url":"https://github.com/floriank/openproject.git","svn_url":"https://github.com/floriank/openproject","homepage":"https://www.openproject.org","size":67854,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"opf:release/4.1","ref":"release/4.1","sha":"88b223edd5f1b1897db36f492aa28c51ae06730b","user":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=3","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"repo":{"id":6899875,"name":"openproject","full_name":"opf/openproject","owner":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=3","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opf/openproject","description":"OpenProject is a web-based project management system built on Ruby on Rails","fork":false,"url":"https://api.github.com/repos/opf/openproject","forks_url":"https://api.github.com/repos/opf/openproject/forks","keys_url":"https://api.github.com/repos/opf/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opf/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opf/openproject/teams","hooks_url":"https://api.github.com/repos/opf/openproject/hooks","issue_events_url":"https://api.github.com/repos/opf/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/opf/openproject/events","assignees_url":"https://api.github.com/repos/opf/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/opf/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/opf/openproject/tags","blobs_url":"https://api.github.com/repos/opf/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opf/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opf/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/opf/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/opf/openproject/languages","stargazers_url":"https://api.github.com/repos/opf/openproject/stargazers","contributors_url":"https://api.github.com/repos/opf/openproject/contributors","subscribers_url":"https://api.github.com/repos/opf/openproject/subscribers","subscription_url":"https://api.github.com/repos/opf/openproject/subscription","commits_url":"https://api.github.com/repos/opf/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/opf/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/opf/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/opf/openproject/issues/comments{/number}","contents_url":"https://api.github.com/repos/opf/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/opf/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opf/openproject/merges","archive_url":"https://api.github.com/repos/opf/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opf/openproject/downloads","issues_url":"https://api.github.com/repos/opf/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/opf/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/opf/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/opf/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opf/openproject/labels{/name}","releases_url":"https://api.github.com/repos/opf/openproject/releases{/id}","created_at":"2012-11-28T09:59:11Z","updated_at":"2015-04-27T12:24:09Z","pushed_at":"2015-04-27T14:08:43Z","git_url":"git://github.com/opf/openproject.git","ssh_url":"git@github.com:opf/openproject.git","clone_url":"https://github.com/opf/openproject.git","svn_url":"https://github.com/opf/openproject","homepage":"https://www.openproject.org","size":192829,"stargazers_count":593,"watchers_count":593,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":261,"mirror_url":null,"open_issues_count":58,"forks":261,"open_issues":58,"watchers":593,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/2911"},"html":{"href":"https://github.com/opf/openproject/pull/2911"},"issue":{"href":"https://api.github.com/repos/opf/openproject/issues/2911"},"comments":{"href":"https://api.github.com/repos/opf/openproject/issues/2911/comments"},"review_comments":{"href":"https://api.github.com/repos/opf/openproject/pulls/2911/comments"},"review_comment":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opf/openproject/pulls/2911/commits"},"statuses":{"href":"https://api.github.com/repos/opf/openproject/statuses/289d1e8230de3510b5ad78f35f7cbba7fe7724ac"}}}}