{"action":"created","comment":{"url":"https://api.github.com/repos/3scale/porta/pulls/comments/268936396","pull_request_review_id":218684406,"id":268936396,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2ODkzNjM5Ng==","diff_hunk":"@@ -19,10 +19,12 @@ def inline_errors\n       @options_inline_erros || super\n     end\n \n-    def text_field_with_errors( method, opts = {})\n-      errors =  @object.errors[method]\n+    def text_field_with_errors(method, opts = {})\n+      errors = @object.errors[method]\n       if errors.present?\n         opts = opts.merge(:class => 'error', 'data-errors' => errors, :title => errors)\n+      elsif method == :pattern && @object.pattern.in?(['', '/'])\n+        opts = opts.merge(:class => \"#{opts[:class]} catch-all-warning\")","path":"app/lib/three_scale/semantic_form_builder.rb","position":11,"original_position":11,"commit_id":"984e8213494d7561b96e346b78acec98caa079be","original_commit_id":"984e8213494d7561b96e346b78acec98caa079be","user":{"login":"hallelujah","id":64276,"node_id":"MDQ6VXNlcjY0Mjc2","avatar_url":"https://avatars3.githubusercontent.com/u/64276?v=4","gravatar_id":"","url":"https://api.github.com/users/hallelujah","html_url":"https://github.com/hallelujah","followers_url":"https://api.github.com/users/hallelujah/followers","following_url":"https://api.github.com/users/hallelujah/following{/other_user}","gists_url":"https://api.github.com/users/hallelujah/gists{/gist_id}","starred_url":"https://api.github.com/users/hallelujah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hallelujah/subscriptions","organizations_url":"https://api.github.com/users/hallelujah/orgs","repos_url":"https://api.github.com/users/hallelujah/repos","events_url":"https://api.github.com/users/hallelujah/events{/privacy}","received_events_url":"https://api.github.com/users/hallelujah/received_events","type":"User","site_admin":false},"body":"You can use arrays with `:class` so you can do\r\n\r\n`opts.merge(class: [*opts[:class], 'catch-all-warning'])`","created_at":"2019-03-26T04:01:32Z","updated_at":"2019-03-26T04:01:32Z","html_url":"https://github.com/3scale/porta/pull/720#discussion_r268936396","pull_request_url":"https://api.github.com/repos/3scale/porta/pulls/720","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/3scale/porta/pulls/comments/268936396"},"html":{"href":"https://github.com/3scale/porta/pull/720#discussion_r268936396"},"pull_request":{"href":"https://api.github.com/repos/3scale/porta/pulls/720"}}},"pull_request":{"url":"https://api.github.com/repos/3scale/porta/pulls/720","id":263586761,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYzNTg2NzYx","html_url":"https://github.com/3scale/porta/pull/720","diff_url":"https://github.com/3scale/porta/pull/720.diff","patch_url":"https://github.com/3scale/porta/pull/720.patch","issue_url":"https://api.github.com/repos/3scale/porta/issues/720","number":720,"state":"open","locked":false,"title":"Adds warning styling & info for catch-all mapping rules","user":{"login":"josemigallas","id":11672286,"node_id":"MDQ6VXNlcjExNjcyMjg2","avatar_url":"https://avatars0.githubusercontent.com/u/11672286?v=4","gravatar_id":"","url":"https://api.github.com/users/josemigallas","html_url":"https://github.com/josemigallas","followers_url":"https://api.github.com/users/josemigallas/followers","following_url":"https://api.github.com/users/josemigallas/following{/other_user}","gists_url":"https://api.github.com/users/josemigallas/gists{/gist_id}","starred_url":"https://api.github.com/users/josemigallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josemigallas/subscriptions","organizations_url":"https://api.github.com/users/josemigallas/orgs","repos_url":"https://api.github.com/users/josemigallas/repos","events_url":"https://api.github.com/users/josemigallas/events{/privacy}","received_events_url":"https://api.github.com/users/josemigallas/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\n\r\nCreates a new style for _catch-all_ mapping rules: `catch-all-warning` that gets added to each input when its value is empty or equals `/`. During the initial render this class is included by default depending on each rule's `:pattern` and afterwards jQuery toggles it when on `keyup`.\r\n\r\n![mapping-rules](https://user-images.githubusercontent.com/11672286/54940790-bcb9ec00-4f2b-11e9-877f-96b5ac15ed54.gif)\r\n\r\nTODO:\r\n\r\n- [x] Add warning: different color row and an exclamation mark icon\r\n- [x] Warning text on hover\r\n- [ ] Tests\r\n\r\n**Which issue(s) this PR fixes** \r\n[THREESCALE-1861 Distinguished styling & info for catch-all mapping rules](https://issues.jboss.org/browse/THREESCALE-1861)\r\n\r\n**Verification steps** \r\n\r\n1. Go to API > Integration > Configuration > Edit > Mapping Rules\r\n1. All patterns matching `/` or empty should have a distinguished orange-warning style\r\n1. Edit and try different values to see such warning appear and disappear\r\n1. With JS disabled, the warning will only appear at the start and it won't change\r\n","created_at":"2019-03-22T12:04:14Z","updated_at":"2019-03-26T04:01:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f372c1f70360145261c94473cc474a1d1a8dd2cd","assignee":{"login":"josemigallas","id":11672286,"node_id":"MDQ6VXNlcjExNjcyMjg2","avatar_url":"https://avatars0.githubusercontent.com/u/11672286?v=4","gravatar_id":"","url":"https://api.github.com/users/josemigallas","html_url":"https://github.com/josemigallas","followers_url":"https://api.github.com/users/josemigallas/followers","following_url":"https://api.github.com/users/josemigallas/following{/other_user}","gists_url":"https://api.github.com/users/josemigallas/gists{/gist_id}","starred_url":"https://api.github.com/users/josemigallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josemigallas/subscriptions","organizations_url":"https://api.github.com/users/josemigallas/orgs","repos_url":"https://api.github.com/users/josemigallas/repos","events_url":"https://api.github.com/users/josemigallas/events{/privacy}","received_events_url":"https://api.github.com/users/josemigallas/received_events","type":"User","site_admin":false},"assignees":[{"login":"josemigallas","id":11672286,"node_id":"MDQ6VXNlcjExNjcyMjg2","avatar_url":"https://avatars0.githubusercontent.com/u/11672286?v=4","gravatar_id":"","url":"https://api.github.com/users/josemigallas","html_url":"https://github.com/josemigallas","followers_url":"https://api.github.com/users/josemigallas/followers","following_url":"https://api.github.com/users/josemigallas/following{/other_user}","gists_url":"https://api.github.com/users/josemigallas/gists{/gist_id}","starred_url":"https://api.github.com/users/josemigallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josemigallas/subscriptions","organizations_url":"https://api.github.com/users/josemigallas/orgs","repos_url":"https://api.github.com/users/josemigallas/repos","events_url":"https://api.github.com/users/josemigallas/events{/privacy}","received_events_url":"https://api.github.com/users/josemigallas/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"didierofrivia","id":4183971,"node_id":"MDQ6VXNlcjQxODM5NzE=","avatar_url":"https://avatars3.githubusercontent.com/u/4183971?v=4","gravatar_id":"","url":"https://api.github.com/users/didierofrivia","html_url":"https://github.com/didierofrivia","followers_url":"https://api.github.com/users/didierofrivia/followers","following_url":"https://api.github.com/users/didierofrivia/following{/other_user}","gists_url":"https://api.github.com/users/didierofrivia/gists{/gist_id}","starred_url":"https://api.github.com/users/didierofrivia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/didierofrivia/subscriptions","organizations_url":"https://api.github.com/users/didierofrivia/orgs","repos_url":"https://api.github.com/users/didierofrivia/repos","events_url":"https://api.github.com/users/didierofrivia/events{/privacy}","received_events_url":"https://api.github.com/users/didierofrivia/received_events","type":"User","site_admin":false},{"login":"damianpm","id":13486237,"node_id":"MDQ6VXNlcjEzNDg2MjM3","avatar_url":"https://avatars0.githubusercontent.com/u/13486237?v=4","gravatar_id":"","url":"https://api.github.com/users/damianpm","html_url":"https://github.com/damianpm","followers_url":"https://api.github.com/users/damianpm/followers","following_url":"https://api.github.com/users/damianpm/following{/other_user}","gists_url":"https://api.github.com/users/damianpm/gists{/gist_id}","starred_url":"https://api.github.com/users/damianpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damianpm/subscriptions","organizations_url":"https://api.github.com/users/damianpm/orgs","repos_url":"https://api.github.com/users/damianpm/repos","events_url":"https://api.github.com/users/damianpm/events{/privacy}","received_events_url":"https://api.github.com/users/damianpm/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1161446154,"node_id":"MDU6TGFiZWwxMTYxNDQ2MTU0","url":"https://api.github.com/repos/3scale/porta/labels/javascript","name":"javascript","color":"168700","default":false},{"id":1161439904,"node_id":"MDU6TGFiZWwxMTYxNDM5OTA0","url":"https://api.github.com/repos/3scale/porta/labels/ruby","name":"ruby","color":"ce2d2d","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/3scale/porta/pulls/720/commits","review_comments_url":"https://api.github.com/repos/3scale/porta/pulls/720/comments","review_comment_url":"https://api.github.com/repos/3scale/porta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/3scale/porta/issues/720/comments","statuses_url":"https://api.github.com/repos/3scale/porta/statuses/984e8213494d7561b96e346b78acec98caa079be","head":{"label":"3scale:feature/THREESCALE-1861-catch-all-map-rules","ref":"feature/THREESCALE-1861-catch-all-map-rules","sha":"984e8213494d7561b96e346b78acec98caa079be","user":{"login":"3scale","id":21415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"repo":{"id":149315920,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkzMTU5MjA=","name":"porta","full_name":"3scale/porta","private":false,"owner":{"login":"3scale","id":21415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/3scale/porta","description":"Red Hat 3scale API Management, Porta","fork":false,"url":"https://api.github.com/repos/3scale/porta","forks_url":"https://api.github.com/repos/3scale/porta/forks","keys_url":"https://api.github.com/repos/3scale/porta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/3scale/porta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/3scale/porta/teams","hooks_url":"https://api.github.com/repos/3scale/porta/hooks","issue_events_url":"https://api.github.com/repos/3scale/porta/issues/events{/number}","events_url":"https://api.github.com/repos/3scale/porta/events","assignees_url":"https://api.github.com/repos/3scale/porta/assignees{/user}","branches_url":"https://api.github.com/repos/3scale/porta/branches{/branch}","tags_url":"https://api.github.com/repos/3scale/porta/tags","blobs_url":"https://api.github.com/repos/3scale/porta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/3scale/porta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/3scale/porta/git/refs{/sha}","trees_url":"https://api.github.com/repos/3scale/porta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/3scale/porta/statuses/{sha}","languages_url":"https://api.github.com/repos/3scale/porta/languages","stargazers_url":"https://api.github.com/repos/3scale/porta/stargazers","contributors_url":"https://api.github.com/repos/3scale/porta/contributors","subscribers_url":"https://api.github.com/repos/3scale/porta/subscribers","subscription_url":"https://api.github.com/repos/3scale/porta/subscription","commits_url":"https://api.github.com/repos/3scale/porta/commits{/sha}","git_commits_url":"https://api.github.com/repos/3scale/porta/git/commits{/sha}","comments_url":"https://api.github.com/repos/3scale/porta/comments{/number}","issue_comment_url":"https://api.github.com/repos/3scale/porta/issues/comments{/number}","contents_url":"https://api.github.com/repos/3scale/porta/contents/{+path}","compare_url":"https://api.github.com/repos/3scale/porta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/3scale/porta/merges","archive_url":"https://api.github.com/repos/3scale/porta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/3scale/porta/downloads","issues_url":"https://api.github.com/repos/3scale/porta/issues{/number}","pulls_url":"https://api.github.com/repos/3scale/porta/pulls{/number}","milestones_url":"https://api.github.com/repos/3scale/porta/milestones{/number}","notifications_url":"https://api.github.com/repos/3scale/porta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/3scale/porta/labels{/name}","releases_url":"https://api.github.com/repos/3scale/porta/releases{/id}","deployments_url":"https://api.github.com/repos/3scale/porta/deployments","created_at":"2018-09-18T16:03:13Z","updated_at":"2019-03-22T14:35:16Z","pushed_at":"2019-03-26T03:48:49Z","git_url":"git://github.com/3scale/porta.git","ssh_url":"git@github.com:3scale/porta.git","clone_url":"https://github.com/3scale/porta.git","svn_url":"https://github.com/3scale/porta","homepage":"","size":36211,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":11,"open_issues":45,"watchers":15,"default_branch":"master"}},"base":{"label":"3scale:master","ref":"master","sha":"4765f61766cfbb0e2f0110fa81bff72c7af5ef18","user":{"login":"3scale","id":21415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"repo":{"id":149315920,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkzMTU5MjA=","name":"porta","full_name":"3scale/porta","private":false,"owner":{"login":"3scale","id":21415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/3scale/porta","description":"Red Hat 3scale API Management, Porta","fork":false,"url":"https://api.github.com/repos/3scale/porta","forks_url":"https://api.github.com/repos/3scale/porta/forks","keys_url":"https://api.github.com/repos/3scale/porta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/3scale/porta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/3scale/porta/teams","hooks_url":"https://api.github.com/repos/3scale/porta/hooks","issue_events_url":"https://api.github.com/repos/3scale/porta/issues/events{/number}","events_url":"https://api.github.com/repos/3scale/porta/events","assignees_url":"https://api.github.com/repos/3scale/porta/assignees{/user}","branches_url":"https://api.github.com/repos/3scale/porta/branches{/branch}","tags_url":"https://api.github.com/repos/3scale/porta/tags","blobs_url":"https://api.github.com/repos/3scale/porta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/3scale/porta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/3scale/porta/git/refs{/sha}","trees_url":"https://api.github.com/repos/3scale/porta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/3scale/porta/statuses/{sha}","languages_url":"https://api.github.com/repos/3scale/porta/languages","stargazers_url":"https://api.github.com/repos/3scale/porta/stargazers","contributors_url":"https://api.github.com/repos/3scale/porta/contributors","subscribers_url":"https://api.github.com/repos/3scale/porta/subscribers","subscription_url":"https://api.github.com/repos/3scale/porta/subscription","commits_url":"https://api.github.com/repos/3scale/porta/commits{/sha}","git_commits_url":"https://api.github.com/repos/3scale/porta/git/commits{/sha}","comments_url":"https://api.github.com/repos/3scale/porta/comments{/number}","issue_comment_url":"https://api.github.com/repos/3scale/porta/issues/comments{/number}","contents_url":"https://api.github.com/repos/3scale/porta/contents/{+path}","compare_url":"https://api.github.com/repos/3scale/porta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/3scale/porta/merges","archive_url":"https://api.github.com/repos/3scale/porta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/3scale/porta/downloads","issues_url":"https://api.github.com/repos/3scale/porta/issues{/number}","pulls_url":"https://api.github.com/repos/3scale/porta/pulls{/number}","milestones_url":"https://api.github.com/repos/3scale/porta/milestones{/number}","notifications_url":"https://api.github.com/repos/3scale/porta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/3scale/porta/labels{/name}","releases_url":"https://api.github.com/repos/3scale/porta/releases{/id}","deployments_url":"https://api.github.com/repos/3scale/porta/deployments","created_at":"2018-09-18T16:03:13Z","updated_at":"2019-03-22T14:35:16Z","pushed_at":"2019-03-26T03:48:49Z","git_url":"git://github.com/3scale/porta.git","ssh_url":"git@github.com:3scale/porta.git","clone_url":"https://github.com/3scale/porta.git","svn_url":"https://github.com/3scale/porta","homepage":"","size":36211,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":11,"open_issues":45,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/3scale/porta/pulls/720"},"html":{"href":"https://github.com/3scale/porta/pull/720"},"issue":{"href":"https://api.github.com/repos/3scale/porta/issues/720"},"comments":{"href":"https://api.github.com/repos/3scale/porta/issues/720/comments"},"review_comments":{"href":"https://api.github.com/repos/3scale/porta/pulls/720/comments"},"review_comment":{"href":"https://api.github.com/repos/3scale/porta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/3scale/porta/pulls/720/commits"},"statuses":{"href":"https://api.github.com/repos/3scale/porta/statuses/984e8213494d7561b96e346b78acec98caa079be"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hallelujah"}}