{"action":"created","comment":{"url":"https://api.github.com/repos/keystonejs/keystone/pulls/comments/211870746","pull_request_review_id":148380543,"id":211870746,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTg3MDc0Ng==","diff_hunk":"@@ -214,10 +260,85 @@ module.exports = Field.create({\n \t\t\t\ttarget=\"__blank\"\n \t\t\t\tstyle={{ float: 'left', marginRight: '1em' }}\n \t\t\t>\n-\t\t\t\t<img src={this.getImageSource()} style={{ height: 90 }} />\n+\t\t\t\t<img src={this.getImageSource()} style={{ height: 90, minWidth: 90 }} />\n+\t\t\t\t{renderIcons()}\n \t\t\t</ImageThumbnail>\n \t\t);\n \t},\n+\trenderOption (option, isValue) {\n+\t\tconst className = `octicon octicon-${this.getSelectIcon(option.resource_type)}`;\n+\t\tconst styles = {\n+\t\t\timage: {\n+\t\t\t\theight: isValue ? 24 : 50,\n+\t\t\t\twidth: isValue ? 48 : 100,\n+\t\t\t\tmarginRight: '1em',\n+\t\t\t},\n+\t\t\tglyph: {\n+\t\t\t\tpaddingRight: '0.5em',\n+\t\t\t},\n+\t\t};\n+\t\tlet label = option.label;\n+\t\tif (option.filename) {\n+\t\t\tlabel = option.filename;\n+\t\t}\n+\t\treturn (\n+\t\t\t<div>\n+\t\t\t\t<img alt={label} src={option.thumbnail} style={styles.image} />\n+\t\t\t\t<span><i style={styles.glyph} className={className} />{label}</span>\n+\t\t\t</div>\n+\t\t);\n+\t},\n+\thandleSelectOnChange (option) {\n+\t\tthis.setState({ selectValue: option ? option.value : null });\n+\t},\n+\thandleLoadOptions (input, callback) {\n+\t\tconst { listPath, path, selectPrefix } = this.props;\n+\n+\t\tlet prefix = '';\n+\t\tif (selectPrefix) {\n+\t\t\tprefix = selectPrefix;\n+\t\t} else if (Keystone.options.cloudinaryFolders) {\n+\t\t\tprefix = Keystone.options.cloudinaryPrefix ? `${Keystone.options.cloudinaryPrefix}/` : '';\n+\t\t\tprefix += `${listPath}/${path}`;\n+\t\t}\n+\n+\t\t$.get('/keystone/api/cloudinary/autocomplete', {","path":"fields/types/cloudinaryimage/CloudinaryImageField.js","position":213,"original_position":213,"commit_id":"ba257407da9163966f83d5881f4f25837038bffb","original_commit_id":"ba257407da9163966f83d5881f4f25837038bffb","user":{"login":"udox-cameron","id":35331214,"node_id":"MDQ6VXNlcjM1MzMxMjE0","avatar_url":"https://avatars2.githubusercontent.com/u/35331214?v=4","gravatar_id":"","url":"https://api.github.com/users/udox-cameron","html_url":"https://github.com/udox-cameron","followers_url":"https://api.github.com/users/udox-cameron/followers","following_url":"https://api.github.com/users/udox-cameron/following{/other_user}","gists_url":"https://api.github.com/users/udox-cameron/gists{/gist_id}","starred_url":"https://api.github.com/users/udox-cameron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/udox-cameron/subscriptions","organizations_url":"https://api.github.com/users/udox-cameron/orgs","repos_url":"https://api.github.com/users/udox-cameron/repos","events_url":"https://api.github.com/users/udox-cameron/events{/privacy}","received_events_url":"https://api.github.com/users/udox-cameron/received_events","type":"User","site_admin":false},"body":"Works pretty well, I did see that this line needs updating to this.\r\n`${Keystone.options.cloudinaryPrefix}/api/cloudinary/autocomplete`","created_at":"2018-08-22T08:32:18Z","updated_at":"2018-08-22T08:32:18Z","html_url":"https://github.com/keystonejs/keystone/pull/4774#discussion_r211870746","pull_request_url":"https://api.github.com/repos/keystonejs/keystone/pulls/4774","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/keystonejs/keystone/pulls/comments/211870746"},"html":{"href":"https://github.com/keystonejs/keystone/pull/4774#discussion_r211870746"},"pull_request":{"href":"https://api.github.com/repos/keystonejs/keystone/pulls/4774"}}},"pull_request":{"url":"https://api.github.com/repos/keystonejs/keystone/pulls/4774","id":209901237,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5OTAxMjM3","html_url":"https://github.com/keystonejs/keystone/pull/4774","diff_url":"https://github.com/keystonejs/keystone/pull/4774.diff","patch_url":"https://github.com/keystonejs/keystone/pull/4774.patch","issue_url":"https://api.github.com/repos/keystonejs/keystone/issues/4774","number":4774,"state":"open","locked":false,"title":"Repair Cloudinary Select and extend upload functionality v2","user":{"login":"chasms","id":24377102,"node_id":"MDQ6VXNlcjI0Mzc3MTAy","avatar_url":"https://avatars2.githubusercontent.com/u/24377102?v=4","gravatar_id":"","url":"https://api.github.com/users/chasms","html_url":"https://github.com/chasms","followers_url":"https://api.github.com/users/chasms/followers","following_url":"https://api.github.com/users/chasms/following{/other_user}","gists_url":"https://api.github.com/users/chasms/gists{/gist_id}","starred_url":"https://api.github.com/users/chasms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chasms/subscriptions","organizations_url":"https://api.github.com/users/chasms/orgs","repos_url":"https://api.github.com/users/chasms/repos","events_url":"https://api.github.com/users/chasms/events{/privacy}","received_events_url":"https://api.github.com/users/chasms/received_events","type":"User","site_admin":false},"body":"#### Rebase of #4633 \r\n\r\n<!--\r\n\r\n Please make sure the following is filled in before submitting your Pull Request - thanks!\r\n\r\n -->\r\n\r\n## Description of changes\r\n\r\n* Restored select functionality of CloudinaryImageType input field https://github.com/keystonejs/keystone/issues/4099\r\n\r\n* Restored `selectPrefix` option functionality of CloudinaryImageType schema type so that select options are scoped to the correct path in Cloudinary\r\n\r\n* Added support for additional filetypes in Cloudinary, including video\r\n\r\n* Updated behavior of CloudinaryImageType with `filenameAsPublicID` option to use the filename and to throw a semantic error when filename already exists as related to discussion here: https://github.com/keystonejs/keystone/pull/925\r\n\r\n* Set default behavior of CloudinaryImageType to use the Cloudinary `use_filename: true` convention - by which the publicID is set to the filename + a short uniqueID on upload to prevent collision - and use retry for `whenExists`\r\n\r\n* Fixed issue where CloudinaryImageType's getExists was checking filename without first sanitizing and removing extension, causing false negatives\r\n\r\n* Added new `uploadOptions` for Cloudinary so that upload presets, eager transformations, and other cloudinary upload options can be set per field on the schema all in an object that is passed to the upload request (so that all options are accommodated):\r\nhttps://github.com/keystonejs/keystone/issues/832,\r\nhttps://github.com/keystonejs/keystone/issues/4459, https://github.com/keystonejs/keystone/issues/2360, https://github.com/keystonejs/keystone/issues/2260,\r\nhttps://cloudinary.com/blog/centralized_control_for_image_upload_image_size_format_thumbnail_generation_tagging_and_more\r\n\r\n* Added detail error messages for \"Field Error\" errors in `EditForm` `AlertMessages`, e.g. from Cloudinary upload responses when `whenExists: 'error'`:\r\nhttps://github.com/keystonejs/keystone-storage-adapter-s3/issues/9\r\n\r\n* Added detail error messages for custom `pre('save'` and `pre('validate'` hooks by adding `error.detail` into the `res.apiError` call of the `Update` route:\r\nhttps://github.com/keystonejs/keystone/issues/3348\r\nInside of the hooks, errors should be compiled like this to activate this functionality:\r\n```\r\nPost.schema.pre('validate', async function (next) {\r\n    const error = []\r\n\r\n    // on validations, push into the errors array\r\n    // with an object with 'fieldLabel' and 'message' fields\r\n    if (!this.title) {\r\n        errors.push({ fieldLabel: 'title', message: 'No title set' });\r\n    }\r\n\r\n    // at end of validation, call next\r\n    // with the compiled errors as the detail\r\n    if (errors.length) {\r\n        const error = new Error('field errors');\r\n        error.detail = errors;\r\n        next(error);\r\n    } else {\r\n        next();\r\n    }\r\n});\r\n```\r\n\r\n* Added defensive code to prevent breaking UI when cloudinaryImageSummary attempts to render empty image in table cell\r\n\r\n* Added textArea character counts on UI per spec in #126\r\n\r\n## Related issues (if any)\r\n\r\n* Clean up old `getRequestHandler` methods https://github.com/keystonejs/keystone/issues/3433\r\n* Add option to display character count under Text fields #140\r\n\r\n## Testing\r\n\r\n- [ ] Please confirm `npm run test-all` ran successfully.\r\n\r\n<!--\r\n\r\n Notes:\r\n\r\n * To successfully have all e2e tests pass you need to have the following setup:\r\n    - a recent version of the chrome browser\r\n    - java 1.8+\r\n * If you are developing in Windows you may run into linebreak linting issues.\r\n   One possible workaround is to remove the \"linebreak-style\" rule in `node_modules/eslint-config-keystone/eslintrc.json`.\r\n\r\n -->\r\n","created_at":"2018-08-21T17:32:20Z","updated_at":"2018-08-22T08:32:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e2316cbece4fcc40fab9fac0577c4f7a76d4141","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/keystonejs/keystone/pulls/4774/commits","review_comments_url":"https://api.github.com/repos/keystonejs/keystone/pulls/4774/comments","review_comment_url":"https://api.github.com/repos/keystonejs/keystone/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keystonejs/keystone/issues/4774/comments","statuses_url":"https://api.github.com/repos/keystonejs/keystone/statuses/ba257407da9163966f83d5881f4f25837038bffb","head":{"label":"giantmachines:cloudinary-v2","ref":"cloudinary-v2","sha":"ba257407da9163966f83d5881f4f25837038bffb","user":{"login":"giantmachines","id":3694980,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2OTQ5ODA=","avatar_url":"https://avatars2.githubusercontent.com/u/3694980?v=4","gravatar_id":"","url":"https://api.github.com/users/giantmachines","html_url":"https://github.com/giantmachines","followers_url":"https://api.github.com/users/giantmachines/followers","following_url":"https://api.github.com/users/giantmachines/following{/other_user}","gists_url":"https://api.github.com/users/giantmachines/gists{/gist_id}","starred_url":"https://api.github.com/users/giantmachines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantmachines/subscriptions","organizations_url":"https://api.github.com/users/giantmachines/orgs","repos_url":"https://api.github.com/users/giantmachines/repos","events_url":"https://api.github.com/users/giantmachines/events{/privacy}","received_events_url":"https://api.github.com/users/giantmachines/received_events","type":"Organization","site_admin":false},"repo":{"id":127192436,"node_id":"MDEwOlJlcG9zaXRvcnkxMjcxOTI0MzY=","name":"keystone","full_name":"giantmachines/keystone","owner":{"login":"giantmachines","id":3694980,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2OTQ5ODA=","avatar_url":"https://avatars2.githubusercontent.com/u/3694980?v=4","gravatar_id":"","url":"https://api.github.com/users/giantmachines","html_url":"https://github.com/giantmachines","followers_url":"https://api.github.com/users/giantmachines/followers","following_url":"https://api.github.com/users/giantmachines/following{/other_user}","gists_url":"https://api.github.com/users/giantmachines/gists{/gist_id}","starred_url":"https://api.github.com/users/giantmachines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantmachines/subscriptions","organizations_url":"https://api.github.com/users/giantmachines/orgs","repos_url":"https://api.github.com/users/giantmachines/repos","events_url":"https://api.github.com/users/giantmachines/events{/privacy}","received_events_url":"https://api.github.com/users/giantmachines/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/giantmachines/keystone","description":"node.js cms and web app framework","fork":true,"url":"https://api.github.com/repos/giantmachines/keystone","forks_url":"https://api.github.com/repos/giantmachines/keystone/forks","keys_url":"https://api.github.com/repos/giantmachines/keystone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giantmachines/keystone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giantmachines/keystone/teams","hooks_url":"https://api.github.com/repos/giantmachines/keystone/hooks","issue_events_url":"https://api.github.com/repos/giantmachines/keystone/issues/events{/number}","events_url":"https://api.github.com/repos/giantmachines/keystone/events","assignees_url":"https://api.github.com/repos/giantmachines/keystone/assignees{/user}","branches_url":"https://api.github.com/repos/giantmachines/keystone/branches{/branch}","tags_url":"https://api.github.com/repos/giantmachines/keystone/tags","blobs_url":"https://api.github.com/repos/giantmachines/keystone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giantmachines/keystone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giantmachines/keystone/git/refs{/sha}","trees_url":"https://api.github.com/repos/giantmachines/keystone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giantmachines/keystone/statuses/{sha}","languages_url":"https://api.github.com/repos/giantmachines/keystone/languages","stargazers_url":"https://api.github.com/repos/giantmachines/keystone/stargazers","contributors_url":"https://api.github.com/repos/giantmachines/keystone/contributors","subscribers_url":"https://api.github.com/repos/giantmachines/keystone/subscribers","subscription_url":"https://api.github.com/repos/giantmachines/keystone/subscription","commits_url":"https://api.github.com/repos/giantmachines/keystone/commits{/sha}","git_commits_url":"https://api.github.com/repos/giantmachines/keystone/git/commits{/sha}","comments_url":"https://api.github.com/repos/giantmachines/keystone/comments{/number}","issue_comment_url":"https://api.github.com/repos/giantmachines/keystone/issues/comments{/number}","contents_url":"https://api.github.com/repos/giantmachines/keystone/contents/{+path}","compare_url":"https://api.github.com/repos/giantmachines/keystone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giantmachines/keystone/merges","archive_url":"https://api.github.com/repos/giantmachines/keystone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giantmachines/keystone/downloads","issues_url":"https://api.github.com/repos/giantmachines/keystone/issues{/number}","pulls_url":"https://api.github.com/repos/giantmachines/keystone/pulls{/number}","milestones_url":"https://api.github.com/repos/giantmachines/keystone/milestones{/number}","notifications_url":"https://api.github.com/repos/giantmachines/keystone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giantmachines/keystone/labels{/name}","releases_url":"https://api.github.com/repos/giantmachines/keystone/releases{/id}","deployments_url":"https://api.github.com/repos/giantmachines/keystone/deployments","created_at":"2018-03-28T20:06:27Z","updated_at":"2018-08-21T14:24:14Z","pushed_at":"2018-08-21T14:25:12Z","git_url":"git://github.com/giantmachines/keystone.git","ssh_url":"git@github.com:giantmachines/keystone.git","clone_url":"https://github.com/giantmachines/keystone.git","svn_url":"https://github.com/giantmachines/keystone","homepage":"http://www.keystonejs.com","size":149463,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"keystonejs:master","ref":"master","sha":"20a7723b6a3682f1c4e87750e832de564d83a590","user":{"login":"keystonejs","id":6118534,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxMTg1MzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6118534?v=4","gravatar_id":"","url":"https://api.github.com/users/keystonejs","html_url":"https://github.com/keystonejs","followers_url":"https://api.github.com/users/keystonejs/followers","following_url":"https://api.github.com/users/keystonejs/following{/other_user}","gists_url":"https://api.github.com/users/keystonejs/gists{/gist_id}","starred_url":"https://api.github.com/users/keystonejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keystonejs/subscriptions","organizations_url":"https://api.github.com/users/keystonejs/orgs","repos_url":"https://api.github.com/users/keystonejs/repos","events_url":"https://api.github.com/users/keystonejs/events{/privacy}","received_events_url":"https://api.github.com/users/keystonejs/received_events","type":"Organization","site_admin":false},"repo":{"id":11116372,"node_id":"MDEwOlJlcG9zaXRvcnkxMTExNjM3Mg==","name":"keystone","full_name":"keystonejs/keystone","owner":{"login":"keystonejs","id":6118534,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxMTg1MzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6118534?v=4","gravatar_id":"","url":"https://api.github.com/users/keystonejs","html_url":"https://github.com/keystonejs","followers_url":"https://api.github.com/users/keystonejs/followers","following_url":"https://api.github.com/users/keystonejs/following{/other_user}","gists_url":"https://api.github.com/users/keystonejs/gists{/gist_id}","starred_url":"https://api.github.com/users/keystonejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keystonejs/subscriptions","organizations_url":"https://api.github.com/users/keystonejs/orgs","repos_url":"https://api.github.com/users/keystonejs/repos","events_url":"https://api.github.com/users/keystonejs/events{/privacy}","received_events_url":"https://api.github.com/users/keystonejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keystonejs/keystone","description":"Node.js CMS and web app framework","fork":false,"url":"https://api.github.com/repos/keystonejs/keystone","forks_url":"https://api.github.com/repos/keystonejs/keystone/forks","keys_url":"https://api.github.com/repos/keystonejs/keystone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keystonejs/keystone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keystonejs/keystone/teams","hooks_url":"https://api.github.com/repos/keystonejs/keystone/hooks","issue_events_url":"https://api.github.com/repos/keystonejs/keystone/issues/events{/number}","events_url":"https://api.github.com/repos/keystonejs/keystone/events","assignees_url":"https://api.github.com/repos/keystonejs/keystone/assignees{/user}","branches_url":"https://api.github.com/repos/keystonejs/keystone/branches{/branch}","tags_url":"https://api.github.com/repos/keystonejs/keystone/tags","blobs_url":"https://api.github.com/repos/keystonejs/keystone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keystonejs/keystone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keystonejs/keystone/git/refs{/sha}","trees_url":"https://api.github.com/repos/keystonejs/keystone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keystonejs/keystone/statuses/{sha}","languages_url":"https://api.github.com/repos/keystonejs/keystone/languages","stargazers_url":"https://api.github.com/repos/keystonejs/keystone/stargazers","contributors_url":"https://api.github.com/repos/keystonejs/keystone/contributors","subscribers_url":"https://api.github.com/repos/keystonejs/keystone/subscribers","subscription_url":"https://api.github.com/repos/keystonejs/keystone/subscription","commits_url":"https://api.github.com/repos/keystonejs/keystone/commits{/sha}","git_commits_url":"https://api.github.com/repos/keystonejs/keystone/git/commits{/sha}","comments_url":"https://api.github.com/repos/keystonejs/keystone/comments{/number}","issue_comment_url":"https://api.github.com/repos/keystonejs/keystone/issues/comments{/number}","contents_url":"https://api.github.com/repos/keystonejs/keystone/contents/{+path}","compare_url":"https://api.github.com/repos/keystonejs/keystone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keystonejs/keystone/merges","archive_url":"https://api.github.com/repos/keystonejs/keystone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keystonejs/keystone/downloads","issues_url":"https://api.github.com/repos/keystonejs/keystone/issues{/number}","pulls_url":"https://api.github.com/repos/keystonejs/keystone/pulls{/number}","milestones_url":"https://api.github.com/repos/keystonejs/keystone/milestones{/number}","notifications_url":"https://api.github.com/repos/keystonejs/keystone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keystonejs/keystone/labels{/name}","releases_url":"https://api.github.com/repos/keystonejs/keystone/releases{/id}","deployments_url":"https://api.github.com/repos/keystonejs/keystone/deployments","created_at":"2013-07-02T05:01:55Z","updated_at":"2018-08-22T08:27:10Z","pushed_at":"2018-08-21T18:29:38Z","git_url":"git://github.com/keystonejs/keystone.git","ssh_url":"git@github.com:keystonejs/keystone.git","clone_url":"https://github.com/keystonejs/keystone.git","svn_url":"https://github.com/keystonejs/keystone","homepage":"http://www.keystonejs.com","size":149140,"stargazers_count":13165,"watchers_count":13165,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2117,"mirror_url":null,"archived":false,"open_issues_count":323,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2117,"open_issues":323,"watchers":13165,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keystonejs/keystone/pulls/4774"},"html":{"href":"https://github.com/keystonejs/keystone/pull/4774"},"issue":{"href":"https://api.github.com/repos/keystonejs/keystone/issues/4774"},"comments":{"href":"https://api.github.com/repos/keystonejs/keystone/issues/4774/comments"},"review_comments":{"href":"https://api.github.com/repos/keystonejs/keystone/pulls/4774/comments"},"review_comment":{"href":"https://api.github.com/repos/keystonejs/keystone/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keystonejs/keystone/pulls/4774/commits"},"statuses":{"href":"https://api.github.com/repos/keystonejs/keystone/statuses/ba257407da9163966f83d5881f4f25837038bffb"}},"author_association":"NONE"}}
{"actor":{"display_login":"udox-cameron"}}