GitHub PullRequestReviewCommentEvent at 2014-12-15 15:13:09
Repository: PlatformUIBundle
Actor: dpobel
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/comments/21830527","id":21830527,"diff_hunk":"@@ -0,0 +1,549 @@\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('ez-image-editview', function (Y) {\n+    \"use strict\";\n+    /**\n+     * Provides the field edit view for the Image (ezimage) fields\n+     *\n+     * @module ez-image-editview\n+     */\n+\n+    Y.namespace('eZ');\n+\n+    var FIELDTYPE_IDENTIFIER = 'ezimage',\n+        HAS_WARNING = 'has-warning',\n+        IS_EMPTY = 'is-image-empty',\n+        IS_LOADING = 'is-image-loading',\n+        IS_BEING_UPDATED = 'is-image-being-updated',\n+        HAS_LOADING_ERROR = 'has-loading-error',\n+        L = Y.Lang,\n+        win = Y.config.win,\n+        events = {\n+            '.ez-image-input-file': {\n+                'change': '_updateImage'\n+            },\n+            '.ez-button-upload': {\n+                'tap': '_chooseImage',\n+            },\n+            '.ez-button-delete': {\n+                'tap': '_removeImage',\n+            },\n+            '.ez-image-alt-text-input': {\n+                'valuechange': '_altTextChange',\n+                'blur': 'validate',\n+            },\n+            '.ez-image-warning-hide': {\n+                'tap': '_hideWarning',\n+            },\n+        };\n+\n+    /**\n+     * The Image edit view\n+     *\n+     * @namespace eZ\n+     * @class ImageEditView\n+     * @constructor\n+     * @extends eZ.FieldEditView\n+     */\n+    Y.eZ.ImageEditView = Y.Base.create('imageEditView', Y.eZ.FieldEditView, [Y.eZ.AsynchronousView], {\n+        initializer: function () {\n+            this.events = Y.merge(this.events, events);\n+            this._fireMethod = this._fireLoadImageVariation;\n+            this._watchAttribute = false;\n+\n+            this._initAttributesData();\n+            this._initAttributesEvents();\n+        },\n+\n+        /**\n+         * Initializes the attributes initial data depending on the field passed\n+         * during the building of the object\n+         *\n+         * @method _initAttributesData\n+         * @protected\n+         */\n+        _initAttributesData: function () {\n+            var fieldValue = this.get('field').fieldValue;\n+\n+            this._set('image', this.get('field'));\n+            if ( fieldValue ) {\n+                this._set('alternativeText', fieldValue.alternativeText);\n+            }\n+        },\n+\n+        /**\n+         * Initializes the attributes events handling\n+         *\n+         * @method _initAttributesEvents\n+         * @protected\n+         */\n+        _initAttributesEvents: function () {\n+            this.after('warningChange', this._uiHandleWarningMessage);\n+\n+            this.after('imageVariationChange', function (e) {\n+                this.get('image').displayUri = e.newVal.uri;\n+                this._uiImageChange();\n+            });\n+\n+            this.after('imageChange', function () {\n+                this._set('updated', true);","path":"Resources/public/js/views/fields/ez-image-editview.js","position":91,"original_position":91,"commit_id":"3ee81da29fa0b3c0bc13fe6ccec142a25e5df49f","original_commit_id":"3ee81da29fa0b3c0bc13fe6ccec142a25e5df49f","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":"http://yuilibrary.com/yui/docs/attribute/#configuration\r\n\r\n> Configures the attribute to be read-only. Users will not be able to set the value of the attribute using Attribute's public API.","created_at":"2014-12-15T15:13:09Z","updated_at":"2014-12-15T15:13:09Z","html_url":"https://github.com/ezsystems/PlatformUIBundle/pull/138#discussion_r21830527","pull_request_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/138","_links":{"self":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/comments/21830527"},"html":{"href":"https://github.com/ezsystems/PlatformUIBundle/pull/138#discussion_r21830527"},"pull_request":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/138"}}},"pull_request":{"url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/138","id":25967343,"html_url":"https://github.com/ezsystems/PlatformUIBundle/pull/138","diff_url":"https://github.com/ezsystems/PlatformUIBundle/pull/138.diff","patch_url":"https://github.com/ezsystems/PlatformUIBundle/pull/138.patch","issue_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/138","number":138,"state":"open","locked":false,"title":"EZP-23748: As an editor, I want to be able to fill the image field","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-23748\r\n\r\n# Description\r\n\r\nThis PR adds a field edit view for the Image fields, as a result it's not possible to handle the Image fields content.\r\n\r\nScreencast: https://www.youtube.com/watch?v=GuGH5TrmAQU\r\n\r\n## Bug / Known limitations\r\n\r\n* [No drag and drop yet](https://jira.ez.no/browse/EZP-23789) (to limit the size of this already too big PR)\r\n* Because of [EZP-23788](https://jira.ez.no/browse/EZP-23788), you can not update the alternative text without updating the image\r\n* The image type is not displayed if the image field is already filled because [the REST API does not provide the mime type of the image](https://jira.ez.no/browse/EZP-23758).\r\n* In an ideal world, [the chosen file should uploaded as soon as possible](https://jira.ez.no/browse/EZP-23802) (for instance while the user is filling the rest of the form) but [the REST API is missing a resource for that](https://jira.ez.no/browse/EZP-23801).\r\n\r\n## Tasks\r\n\r\n* [x] Implement a basic Image field edit view\r\n* [x] Avoid sending the image content even if it was not changed\r\n* [x] Improve the CSS to better handle small images (width < 300px)\r\n* [x] Improve the transitions to make it feel smoother\r\n* [x] Fix the form validation so that the form is updated when the user clicks on publish\r\n* [ ] ~~Drag an drop~~ (will be done later in https://jira.ez.no/browse/EZP-23789)\r\n\r\n# Tests\r\n\r\nunit tests + manual test","created_at":"2014-12-12T11:28:03Z","updated_at":"2014-12-15T15:13:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1f97925a12638e6486a83e44eaef2a6b45f8b04c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/138/commits","review_comments_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/138/comments","review_comment_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/138/comments","statuses_url":"https://api.github.com/repos/ezsystems/PlatformUIBundle/statuses/3ee81da29fa0b3c0bc13fe6ccec142a25e5df49f","head":{"label":"ezsystems:ezp-23748_image_edit_view","ref":"ezp-23748_image_edit_view","sha":"3ee81da29fa0b3c0bc13fe6ccec142a25e5df49f","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":"","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}","created_at":"2013-07-06T17:21:40Z","updated_at":"2014-12-15T09:49:03Z","pushed_at":"2014-12-15T15:09:15Z","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":null,"size":4646,"stargazers_count":15,"watchers_count":15,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":13,"forks":9,"open_issues":13,"watchers":15,"default_branch":"master"}},"base":{"label":"ezsystems:master","ref":"master","sha":"5b5b283950577d7c4607b8cf3afb8dc82a5680dd","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":"","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}","created_at":"2013-07-06T17:21:40Z","updated_at":"2014-12-15T09:49:03Z","pushed_at":"2014-12-15T15:09:15Z","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":null,"size":4646,"stargazers_count":15,"watchers_count":15,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":13,"forks":9,"open_issues":13,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/138"},"html":{"href":"https://github.com/ezsystems/PlatformUIBundle/pull/138"},"issue":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/138"},"comments":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/issues/138/comments"},"review_comments":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/138/comments"},"review_comment":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/pulls/138/commits"},"statuses":{"href":"https://api.github.com/repos/ezsystems/PlatformUIBundle/statuses/3ee81da29fa0b3c0bc13fe6ccec142a25e5df49f"}}}}