{"action":"created","comment":{"url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/comments/66070459","id":66070459,"diff_hunk":"@@ -0,0 +1,80 @@\n+/*\n+ * Copyright (C) eZ Systems AS. All rights reserved.\n+ * For full copyright and license information view LICENSE file distributed with this source code.\n+ */\n+YUI.add('ezsearch-searchlistview', function (Y) {\n+    \"use strict\";\n+  \n+    Y.namespace('eZSearch');\n+\n+    Y.eZSearch.SearchListView = Y.Base.create('ezsearchSearchListView', Y.eZ.TemplateBasedView, [], {\n+        \n+        initializer: function () {\n+        },\n+        \n+        render: function () {\n+            this._setResultItems();\n+            this.get('container').setHTML(this.template({\n+                searchResultItems: this.get('searchResultItems'),\n+                columns: this._getColumns(),\n+            }));\n+            return this;\n+        },\n+\n+        /**\n+         * Returns an array of objects describing the columns to add to the\n+         * list. Each object contains an `identifier` and a `name`.\n+         *\n+         * @method _getColumns\n+         * @protected\n+         * @return Array\n+         */\n+        _getColumns: function () {\n+            return this.get('displayedProperties').map(function (identifier) {\n+                return {\n+                    name: this.get('propertyNames')[identifier],\n+                    identifier: identifier,\n+                };\n+            }, this);\n+        },\n+        \n+        _setResultItems: function () {\n+            var searchResultItems = [];\n+\n+            if ( !this.get('searchResultList') ) {\n+                return this.get('searchResultList');\n+            }\n+\n+            this.get('searchResultList').forEach(function (struct) {\n+                searchResultItems.push({\n+                    name: struct.content.get('name'),\n+                    lastModificationDate: struct.content.get('lastModificationDate').toLocaleDateString(\n+                        'en', {year: \"numeric\", month: \"short\", day: \"numeric\"}\n+                    ) + ' ' + struct.content.get('lastModificationDate').toLocaleTimeString(\n+                        'en', {hour: '2-digit', minute: '2-digit', hour12: true}\n+                    ),\n+                    contentType: struct.contentType.get('names')['eng-GB'],\n+                    translations: struct.content.get('currentVersion').getTranslationsList().join(', '),\n+                });\n+            }, this);\n+            this._set('searchResultItems', searchResultItems);\n+        },\n+\n+    }, {\n+        ATTRS: {\n+            searchResultList: {},\n+            searchResultItems: {},\n+            propertyNames: {\n+                value: {\n+                    'name': 'Name',\n+                    'lastModificationDate': 'Modified',\n+                    'contentType': 'Content type',\n+                    'translations': 'Translations',\n+                }\n+            },\n+            displayedProperties: {\n+                value: ['name', 'lastModificationDate', 'contentType', 'translations'],","path":"Resources/public/js/views/ezsearch-searchlistview.js","position":76,"original_position":76,"commit_id":"f07b7d904c40287cd669c4fcd1c37a4a6f5f2e9e","original_commit_id":"f07b7d904c40287cd669c4fcd1c37a4a6f5f2e9e","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":"this gives the impression that you just have to add something here to get a new column in the page but that's not true, better (for now) hard code the columns in the template","created_at":"2016-06-07T13:32:54Z","updated_at":"2016-06-07T13:32:54Z","html_url":"https://github.com/ezsystems/platform-ui-search-prototype-bundle/pull/4#discussion_r66070459","pull_request_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/comments/66070459"},"html":{"href":"https://github.com/ezsystems/platform-ui-search-prototype-bundle/pull/4#discussion_r66070459"},"pull_request":{"href":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/4","id":72869339,"html_url":"https://github.com/ezsystems/platform-ui-search-prototype-bundle/pull/4","diff_url":"https://github.com/ezsystems/platform-ui-search-prototype-bundle/pull/4.diff","patch_url":"https://github.com/ezsystems/platform-ui-search-prototype-bundle/pull/4.patch","issue_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/issues/4","number":4,"state":"open","locked":false,"title":"EZP-25822 Do the search request","user":{"login":"StephaneDiot","id":5558766,"avatar_url":"https://avatars.githubusercontent.com/u/5558766?v=3","gravatar_id":"","url":"https://api.github.com/users/StephaneDiot","html_url":"https://github.com/StephaneDiot","followers_url":"https://api.github.com/users/StephaneDiot/followers","following_url":"https://api.github.com/users/StephaneDiot/following{/other_user}","gists_url":"https://api.github.com/users/StephaneDiot/gists{/gist_id}","starred_url":"https://api.github.com/users/StephaneDiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephaneDiot/subscriptions","organizations_url":"https://api.github.com/users/StephaneDiot/orgs","repos_url":"https://api.github.com/users/StephaneDiot/repos","events_url":"https://api.github.com/users/StephaneDiot/events{/privacy}","received_events_url":"https://api.github.com/users/StephaneDiot/received_events","type":"User","site_admin":false},"body":"jira: https://jira.ez.no/browse/EZP-25822\r\n\r\n## Description\r\n\r\nThe user can now do a search. Currentlly only the 10 first results are shown (pagination will come later).","created_at":"2016-06-07T12:53:49Z","updated_at":"2016-06-07T13:32:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ccfa4efd4ad7986a2eeb30cfa308ae41a211ead5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/4/commits","review_comments_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/4/comments","review_comment_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/issues/4/comments","statuses_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/statuses/f07b7d904c40287cd669c4fcd1c37a4a6f5f2e9e","head":{"label":"ezsystems:EZP-25822_Do_search_request","ref":"EZP-25822_Do_search_request","sha":"f07b7d904c40287cd669c4fcd1c37a4a6f5f2e9e","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":60016151,"name":"platform-ui-search-prototype-bundle","full_name":"ezsystems/platform-ui-search-prototype-bundle","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/platform-ui-search-prototype-bundle","description":"","fork":false,"url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle","forks_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/forks","keys_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/teams","hooks_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/events","assignees_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/tags","blobs_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/languages","stargazers_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/subscription","commits_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/merges","archive_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/downloads","issues_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/deployments","created_at":"2016-05-30T14:27:13Z","updated_at":"2016-06-02T14:58:33Z","pushed_at":"2016-06-07T12:53:49Z","git_url":"git://github.com/ezsystems/platform-ui-search-prototype-bundle.git","ssh_url":"git@github.com:ezsystems/platform-ui-search-prototype-bundle.git","clone_url":"https://github.com/ezsystems/platform-ui-search-prototype-bundle.git","svn_url":"https://github.com/ezsystems/platform-ui-search-prototype-bundle","homepage":null,"size":10,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ezsystems:master","ref":"master","sha":"68cfa0eadc726e996c761e7e4b16381708a6f707","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":60016151,"name":"platform-ui-search-prototype-bundle","full_name":"ezsystems/platform-ui-search-prototype-bundle","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/platform-ui-search-prototype-bundle","description":"","fork":false,"url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle","forks_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/forks","keys_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/teams","hooks_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/events","assignees_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/tags","blobs_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/languages","stargazers_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/subscription","commits_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/merges","archive_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/downloads","issues_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/deployments","created_at":"2016-05-30T14:27:13Z","updated_at":"2016-06-02T14:58:33Z","pushed_at":"2016-06-07T12:53:49Z","git_url":"git://github.com/ezsystems/platform-ui-search-prototype-bundle.git","ssh_url":"git@github.com:ezsystems/platform-ui-search-prototype-bundle.git","clone_url":"https://github.com/ezsystems/platform-ui-search-prototype-bundle.git","svn_url":"https://github.com/ezsystems/platform-ui-search-prototype-bundle","homepage":null,"size":10,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/4"},"html":{"href":"https://github.com/ezsystems/platform-ui-search-prototype-bundle/pull/4"},"issue":{"href":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/issues/4"},"comments":{"href":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/ezsystems/platform-ui-search-prototype-bundle/statuses/f07b7d904c40287cd669c4fcd1c37a4a6f5f2e9e"}}}}
{"actor":{"display_login":"dpobel"}}