{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments/64240839","id":64240839,"diff_hunk":"@@ -162,10 +117,112 @@ angular.module(\"openshiftConsole\")\n         readonlyKeys: \"@\",\n         keyValidationTooltip: \"@\",\n         valueValidationTooltip: \"@\",\n-        preventEmpty: \"=?\",\n+        preventEmpty: \"=?\"\n       },\n       controller: function($scope){\n+        var focusElem;\n+        var added = {};\n+        var isUncommitted = function() {\n+          return (!!$scope.key) || (!!$scope.value);\n+        };\n+        var checkCommitted = function() {\n+          if(isUncommitted()) {\n+            $scope.showCommmitWarning = true;\n+          } else {\n+            $scope.showCommmitWarning = false;\n+          }\n+        };\n+        // checks if the key,value inputs have any text value.\n+        // if so, sets the form name=\"clean\" to an 'invalid' state, which will\n+        // invalidate any parent form up the chain.  This should result in an\n+        // inability to submit that form until the user commits the new key-value pair.\n+        var isClean = _.debounce(function() {\n+          $scope.$applyAsync(function() {\n+            if(!!$scope.key) {\n+              $scope.clean.isClean.$setValidity('isClean', false);\n+            } else if(!!$scope.value) {\n+              $scope.clean.isClean.$setValidity('isClean', false);\n+            } else {\n+              $scope.clean.isClean.$setValidity('isClean', true);\n+            }\n+          });\n+        }, 100);\n+\n+        var onBlur = function(nodes) {","path":"app/scripts/directives/oscKeyValues.js","position":88,"original_position":88,"commit_id":"312041237ddbe3cea6e16a58c40ff58a504fcf35","original_commit_id":"312041237ddbe3cea6e16a58c40ff58a504fcf35","user":{"login":"jwforres","id":1467629,"avatar_url":"https://avatars.githubusercontent.com/u/1467629?v=3","gravatar_id":"","url":"https://api.github.com/users/jwforres","html_url":"https://github.com/jwforres","followers_url":"https://api.github.com/users/jwforres/followers","following_url":"https://api.github.com/users/jwforres/following{/other_user}","gists_url":"https://api.github.com/users/jwforres/gists{/gist_id}","starred_url":"https://api.github.com/users/jwforres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwforres/subscriptions","organizations_url":"https://api.github.com/users/jwforres/orgs","repos_url":"https://api.github.com/users/jwforres/repos","events_url":"https://api.github.com/users/jwforres/events{/privacy}","received_events_url":"https://api.github.com/users/jwforres/received_events","type":"User","site_admin":false},"body":"add a comment explaining what this does / why its there","created_at":"2016-05-23T15:28:28Z","updated_at":"2016-05-23T15:28:28Z","html_url":"https://github.com/openshift/origin-web-console/pull/18#discussion_r64240839","pull_request_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments/64240839"},"html":{"href":"https://github.com/openshift/origin-web-console/pull/18#discussion_r64240839"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin-web-console/pulls/18","id":70411382,"html_url":"https://github.com/openshift/origin-web-console/pull/18","diff_url":"https://github.com/openshift/origin-web-console/pull/18.diff","patch_url":"https://github.com/openshift/origin-web-console/pull/18.patch","issue_url":"https://api.github.com/repos/openshift/origin-web-console/issues/18","number":18,"state":"open","locked":false,"title":"Fix bug 1333118, ensure key,value committed before allowing parent forms to submit.","user":{"login":"benjaminapetersen","id":280512,"avatar_url":"https://avatars.githubusercontent.com/u/280512?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminapetersen","html_url":"https://github.com/benjaminapetersen","followers_url":"https://api.github.com/users/benjaminapetersen/followers","following_url":"https://api.github.com/users/benjaminapetersen/following{/other_user}","gists_url":"https://api.github.com/users/benjaminapetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminapetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminapetersen/subscriptions","organizations_url":"https://api.github.com/users/benjaminapetersen/orgs","repos_url":"https://api.github.com/users/benjaminapetersen/repos","events_url":"https://api.github.com/users/benjaminapetersen/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminapetersen/received_events","type":"User","site_admin":false},"body":"Nixed the prev solution, presenting new:\r\n\r\n- link function passes DOM elements to controller once rendered\r\n- blur events used to check against `document.activeElement` to see if an `osc-key-values` child is active\r\n- show message when user leaves `osc-key-values` with uncommitted changes\r\n- eliminates secondary controller & assimilates it into the main directive controller to simplify access to `$scope` vars\r\n- when uncommitted key-value pairs exist, osc-key-values remains valid, HOWEVER it will invalidate the parent form, ensuring it is not submitted until the user decides to keep or discard all key-value pairs.\r\n\r\n\r\n@jwforres @spadgett thoughts?","created_at":"2016-05-17T19:00:32Z","updated_at":"2016-05-23T15:28:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d300da76df25b0f0801061d133cdbab2e7ede0f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/18/commits","review_comments_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/18/comments","review_comment_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin-web-console/issues/18/comments","statuses_url":"https://api.github.com/repos/openshift/origin-web-console/statuses/312041237ddbe3cea6e16a58c40ff58a504fcf35","head":{"label":"benjaminapetersen:bpeterse/bug-1333118-osc-key-values-quick-fix","ref":"bpeterse/bug-1333118-osc-key-values-quick-fix","sha":"312041237ddbe3cea6e16a58c40ff58a504fcf35","user":{"login":"benjaminapetersen","id":280512,"avatar_url":"https://avatars.githubusercontent.com/u/280512?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminapetersen","html_url":"https://github.com/benjaminapetersen","followers_url":"https://api.github.com/users/benjaminapetersen/followers","following_url":"https://api.github.com/users/benjaminapetersen/following{/other_user}","gists_url":"https://api.github.com/users/benjaminapetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminapetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminapetersen/subscriptions","organizations_url":"https://api.github.com/users/benjaminapetersen/orgs","repos_url":"https://api.github.com/users/benjaminapetersen/repos","events_url":"https://api.github.com/users/benjaminapetersen/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminapetersen/received_events","type":"User","site_admin":false},"repo":{"id":58689425,"name":"origin-web-console","full_name":"benjaminapetersen/origin-web-console","owner":{"login":"benjaminapetersen","id":280512,"avatar_url":"https://avatars.githubusercontent.com/u/280512?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminapetersen","html_url":"https://github.com/benjaminapetersen","followers_url":"https://api.github.com/users/benjaminapetersen/followers","following_url":"https://api.github.com/users/benjaminapetersen/following{/other_user}","gists_url":"https://api.github.com/users/benjaminapetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminapetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminapetersen/subscriptions","organizations_url":"https://api.github.com/users/benjaminapetersen/orgs","repos_url":"https://api.github.com/users/benjaminapetersen/repos","events_url":"https://api.github.com/users/benjaminapetersen/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminapetersen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benjaminapetersen/origin-web-console","description":"","fork":true,"url":"https://api.github.com/repos/benjaminapetersen/origin-web-console","forks_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/forks","keys_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/teams","hooks_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/hooks","issue_events_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/issues/events{/number}","events_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/events","assignees_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/assignees{/user}","branches_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/branches{/branch}","tags_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/tags","blobs_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/git/refs{/sha}","trees_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/statuses/{sha}","languages_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/languages","stargazers_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/stargazers","contributors_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/contributors","subscribers_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/subscribers","subscription_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/subscription","commits_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/commits{/sha}","git_commits_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/git/commits{/sha}","comments_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/comments{/number}","issue_comment_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/issues/comments{/number}","contents_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/contents/{+path}","compare_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/merges","archive_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/downloads","issues_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/issues{/number}","pulls_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/pulls{/number}","milestones_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/milestones{/number}","notifications_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/labels{/name}","releases_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/releases{/id}","deployments_url":"https://api.github.com/repos/benjaminapetersen/origin-web-console/deployments","created_at":"2016-05-13T01:31:58Z","updated_at":"2016-05-13T01:31:59Z","pushed_at":"2016-05-20T21:04:59Z","git_url":"git://github.com/benjaminapetersen/origin-web-console.git","ssh_url":"git@github.com:benjaminapetersen/origin-web-console.git","clone_url":"https://github.com/benjaminapetersen/origin-web-console.git","svn_url":"https://github.com/benjaminapetersen/origin-web-console","homepage":null,"size":6355,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"fcb4d14a38b4fb3b7d210d8e375d0e53eff5396a","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":58488264,"name":"origin-web-console","full_name":"openshift/origin-web-console","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin-web-console","description":"","fork":false,"url":"https://api.github.com/repos/openshift/origin-web-console","forks_url":"https://api.github.com/repos/openshift/origin-web-console/forks","keys_url":"https://api.github.com/repos/openshift/origin-web-console/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin-web-console/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin-web-console/teams","hooks_url":"https://api.github.com/repos/openshift/origin-web-console/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin-web-console/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin-web-console/events","assignees_url":"https://api.github.com/repos/openshift/origin-web-console/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin-web-console/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin-web-console/tags","blobs_url":"https://api.github.com/repos/openshift/origin-web-console/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin-web-console/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin-web-console/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin-web-console/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin-web-console/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin-web-console/languages","stargazers_url":"https://api.github.com/repos/openshift/origin-web-console/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin-web-console/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin-web-console/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin-web-console/subscription","commits_url":"https://api.github.com/repos/openshift/origin-web-console/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin-web-console/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin-web-console/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin-web-console/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin-web-console/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin-web-console/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin-web-console/merges","archive_url":"https://api.github.com/repos/openshift/origin-web-console/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin-web-console/downloads","issues_url":"https://api.github.com/repos/openshift/origin-web-console/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin-web-console/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin-web-console/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin-web-console/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin-web-console/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin-web-console/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin-web-console/deployments","created_at":"2016-05-10T19:31:50Z","updated_at":"2016-05-12T13:49:28Z","pushed_at":"2016-05-23T13:39:59Z","git_url":"git://github.com/openshift/origin-web-console.git","ssh_url":"git@github.com:openshift/origin-web-console.git","clone_url":"https://github.com/openshift/origin-web-console.git","svn_url":"https://github.com/openshift/origin-web-console","homepage":null,"size":6687,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":9,"forks":10,"open_issues":9,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/18"},"html":{"href":"https://github.com/openshift/origin-web-console/pull/18"},"issue":{"href":"https://api.github.com/repos/openshift/origin-web-console/issues/18"},"comments":{"href":"https://api.github.com/repos/openshift/origin-web-console/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin-web-console/statuses/312041237ddbe3cea6e16a58c40ff58a504fcf35"}}}}
{"actor":{"display_login":"jwforres"}}