{"action":"created","comment":{"url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/comments/68007543","id":68007543,"diff_hunk":"@@ -345,6 +345,69 @@ YUI.add('ez-locationmodel', function (Y) {\n             return attrs;\n         },\n \n+        /**\n+         * Returns the REST API sort order based on the sortOrder attribute\n+         *\n+         * @method _getSortDirection\n+         * @protected\n+         * @return 'ascending' or 'descending'\n+         */\n+        _getSortDirection: function () {\n+            return this.get('sortOrder') === 'ASC' ? 'ascending' : 'descending';\n+        },\n+\n+        /**\n+         * Returns the REST API sort clause identifier based on the sortField\n+         * attribute.\n+         *\n+         * @method _getSortClauseIdentifier\n+         * @protected\n+         * @return {String|Null}\n+         */\n+        _getSortClauseIdentifier: function () {\n+            var sortField = this.get('sortField');\n+\n+            switch(sortField) {\n+                case 'MODIFIED':\n+                    return 'DateModified';\n+                case 'PUBLISHED':\n+                    return 'DatePublished';\n+                case 'PATH':\n+                    return 'LocationPath';\n+                case 'SECTION':\n+                    return 'SectionIdentifier';\n+                case 'DEPTH':\n+                    return 'LocationDepth';\n+                case 'CLASS_IDENTIFIER':\n+                case 'CLASS_NAME':\n+                    console.warn(sortField + ' sort order is unsupported at the moment');\n+                    return null;","path":"Resources/public/js/models/ez-locationmodel.js","position":40,"original_position":40,"commit_id":"83664e493f1cfce18022ce930c298b5f0dd33308","original_commit_id":"83664e493f1cfce18022ce930c298b5f0dd33308","user":{"login":"andrerom","id":289757,"avatar_url":"https://avatars.githubusercontent.com/u/289757?v=3","gravatar_id":"","url":"https://api.github.com/users/andrerom","html_url":"https://github.com/andrerom","followers_url":"https://api.github.com/users/andrerom/followers","following_url":"https://api.github.com/users/andrerom/following{/other_user}","gists_url":"https://api.github.com/users/andrerom/gists{/gist_id}","starred_url":"https://api.github.com/users/andrerom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrerom/subscriptions","organizations_url":"https://api.github.com/users/andrerom/orgs","repos_url":"https://api.github.com/users/andrerom/repos","events_url":"https://api.github.com/users/andrerom/events{/privacy}","received_events_url":"https://api.github.com/users/andrerom/received_events","type":"User","site_admin":false},"body":"see: https://github.com/ezsystems/PlatformUIBundle/pull/622#discussion_r68007200","created_at":"2016-06-22T07:43:41Z","updated_at":"2016-06-22T07:43:41Z","html_url":"https://github.com/ezsystems/PlatformUIBundle/pull/622#discussion_r68007543","pull_request_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/622","_links":{"self":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/comments/68007543"},"html":{"href":"https://github.com/ezsystems/PlatformUIBundle/pull/622#discussion_r68007543"},"pull_request":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/622"}}},"pull_request":{"url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/622","id":74451763,"html_url":"https://github.com/ezsystems/PlatformUIBundle/pull/622","diff_url":"https://github.com/ezsystems/PlatformUIBundle/pull/622.diff","patch_url":"https://github.com/ezsystems/PlatformUIBundle/pull/622.patch","issue_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/622","number":622,"state":"open","locked":false,"title":"EZP-24998: Order of the elements when doing a search is wrong (and random)","user":{"login":"dpobel","id":305563,"avatar_url":"https://avatars.githubusercontent.com/u/305563?v=3","gravatar_id":"","url":"https://api.github.com/users/dpobel","html_url":"https://github.com/dpobel","followers_url":"https://api.github.com/users/dpobel/followers","following_url":"https://api.github.com/users/dpobel/following{/other_user}","gists_url":"https://api.github.com/users/dpobel/gists{/gist_id}","starred_url":"https://api.github.com/users/dpobel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpobel/subscriptions","organizations_url":"https://api.github.com/users/dpobel/orgs","repos_url":"https://api.github.com/users/dpobel/repos","events_url":"https://api.github.com/users/dpobel/events{/privacy}","received_events_url":"https://api.github.com/users/dpobel/received_events","type":"User","site_admin":false},"body":"JIRA: https://jira.ez.no/browse/EZP-24998\r\n\r\n# Description\r\n\r\nThis patch makes sure the Content Tree and the Subitem views receives the Location lists sorted as indicated by the parent Location `sortOrder` and `sortField` property.\r\n\r\nScreencast:\r\n\r\n[![](https://img.youtube.com/vi/tDhFK7X5P5U/0.jpg)](http://www.youtube.com/watch?v=tDhFK7X5P5U \"Click to play on Youtube.com\")\r\n\r\n5 sort clauses seem to not be fully implemented server side (see also https://github.com/ezsystems/PlatformUIBundle/pull/622/files#diff-3d4c2abab2b4c380f20d2e09ec804e3cR367):\r\n\r\n* (Location)Priority https://jira.ez.no/browse/EZP-25907\r\n* (Location)Path https://jira.ez.no/browse/EZP-25911\r\n* (Location)Depth https://jira.ez.no/browse/EZP-25910 (ok this one is a bit stupid in that case, but can still be set the sort field for a Location)\r\n* Content Type identifier https://jira.ez.no/browse/EZP-25909\r\n* Content Type name https://jira.ez.no/browse/EZP-25908\r\n\r\nSo now the question is: how do we handle those before having the necessary server side code ?\r\n\r\n## Tasks\r\n\r\n* [x] Fix [EZP-25846](https://jira.ez.no/browse/EZP-25846)\r\n* [x] Expose the Location search as a public method in addition to the event so that it can be used from others plugins\r\n* [x] Allow to sort the search result based on a Location model\r\n* [x] Fix the Content Tree\r\n* [x] Fix the Subitem views\r\n* [x] Make sure the Subitem views and tree are updated when a Location sort order and/or sort field are updated\r\n\r\n# Tests\r\n\r\nmanual test + unit test","created_at":"2016-06-20T14:24:45Z","updated_at":"2016-06-22T07:43:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e8fab450ea714122a49b17f5655b81d6a03dffa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/622/commits","review_comments_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/622/comments","review_comment_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/622/comments","statuses_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/statuses/83664e493f1cfce18022ce930c298b5f0dd33308","head":{"label":"ezsystems:ezp-24998_order_random","ref":"ezp-24998_order_random","sha":"83664e493f1cfce18022ce930c298b5f0dd33308","user":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?v=3","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"repo":{"id":11221607,"name":"PlatformUIBundle","full_name":"ezsystems/PlatformUIBundle","owner":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?v=3","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ezsystems/PlatformUIBundle","description":"Main Bundle to provide editorial/admin UI for eZ Platform","fork":false,"url":"https://api.github.com/repos/ezsystems/PlatformUIBundle","forks_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/forks","keys_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/teams","hooks_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/events","assignees_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/tags","blobs_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/languages","stargazers_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/subscription","commits_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/merges","archive_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/downloads","issues_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/releases{/id}","deployments_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/deployments","created_at":"2013-07-06T17:21:40Z","updated_at":"2016-05-09T21:15:01Z","pushed_at":"2016-06-22T07:40:33Z","git_url":"git://github.com/ezsystems/PlatformUIBundle.git","ssh_url":"git@github.com:ezsystems/PlatformUIBundle.git","clone_url":"https://github.com/ezsystems/PlatformUIBundle.git","svn_url":"https://github.com/ezsystems/PlatformUIBundle","homepage":"http://ezplatform.com/","size":6994,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":22,"forks":31,"open_issues":22,"watchers":27,"default_branch":"master"}},"base":{"label":"ezsystems:master","ref":"master","sha":"046ae068ab7581802586daf1d08533199dc5bbf5","user":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?v=3","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"repo":{"id":11221607,"name":"PlatformUIBundle","full_name":"ezsystems/PlatformUIBundle","owner":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?v=3","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ezsystems/PlatformUIBundle","description":"Main Bundle to provide editorial/admin UI for eZ Platform","fork":false,"url":"https://api.github.com/repos/ezsystems/PlatformUIBundle","forks_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/forks","keys_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/teams","hooks_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/events","assignees_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/tags","blobs_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/languages","stargazers_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/subscription","commits_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/merges","archive_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/downloads","issues_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/releases{/id}","deployments_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/deployments","created_at":"2013-07-06T17:21:40Z","updated_at":"2016-05-09T21:15:01Z","pushed_at":"2016-06-22T07:40:33Z","git_url":"git://github.com/ezsystems/PlatformUIBundle.git","ssh_url":"git@github.com:ezsystems/PlatformUIBundle.git","clone_url":"https://github.com/ezsystems/PlatformUIBundle.git","svn_url":"https://github.com/ezsystems/PlatformUIBundle","homepage":"http://ezplatform.com/","size":6994,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":22,"forks":31,"open_issues":22,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/622"},"html":{"href":"https://github.com/ezsystems/PlatformUIBundle/pull/622"},"issue":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/622"},"comments":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/622/comments"},"review_comments":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/622/comments"},"review_comment":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/622/commits"},"statuses":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/statuses/83664e493f1cfce18022ce930c298b5f0dd33308"}}}}
{"actor":{"display_login":"andrerom"}}