{"action":"created","comment":{"url":"https://api.github.com/repos/motech/motech/pulls/comments/51850016","id":51850016,"diff_hunk":"@@ -2409,6 +2409,59 @@\n         };\n     });\n \n+    directives.directive('floatValidity', function() {\n+        var FLOAT_REGEXP = new RegExp('^[-]?\\\\d+(\\\\.\\\\d+)?$'),\n+        TWOZERO_REGEXP = new RegExp('^[-]?0+\\\\d+(\\\\.\\\\d+)?$');\n+        return {\n+            require: 'ngModel',\n+            link: function(scope, element, attrs, ctrl) {\n+                var elm = angular.element(element), originalValue;\n+                ctrl.$parsers.unshift(function(viewValue) {\n+                    if (viewValue === '' || FLOAT_REGEXP.test(viewValue)) {\n+                        // it is valid\n+                        ctrl.$setValidity('float', true);\n+                        originalValue = viewValue;\n+                        viewValue = parseFloat(viewValue);\n+                        if (isNaN(viewValue)) {\n+                            viewValue = '';\n+                        }\n+                        if (TWOZERO_REGEXP.test(originalValue)) {\n+                            setTimeout(function () {\n+                                elm.val(viewValue);\n+                            }, 1000);","path":"platform/mds/mds-web/src/main/resources/webapp/js/directives.js","position":23,"original_position":23,"commit_id":"964c97332a2ce2b408e28fb796582efd4a34136e","original_commit_id":"8ffa6eed93cc836e70a53dc76333529b7d32fe02","user":{"login":"tstalka","id":7116048,"avatar_url":"https://avatars.githubusercontent.com/u/7116048?v=3","gravatar_id":"","url":"https://api.github.com/users/tstalka","html_url":"https://github.com/tstalka","followers_url":"https://api.github.com/users/tstalka/followers","following_url":"https://api.github.com/users/tstalka/following{/other_user}","gists_url":"https://api.github.com/users/tstalka/gists{/gist_id}","starred_url":"https://api.github.com/users/tstalka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tstalka/subscriptions","organizations_url":"https://api.github.com/users/tstalka/orgs","repos_url":"https://api.github.com/users/tstalka/repos","events_url":"https://api.github.com/users/tstalka/events{/privacy}","received_events_url":"https://api.github.com/users/tstalka/received_events","type":"User","site_admin":false},"body":"Please avoid copy paste and add separate method for these validators","created_at":"2016-02-04T09:52:40Z","updated_at":"2016-02-04T09:52:40Z","html_url":"https://github.com/motech/motech/pull/273#discussion_r51850016","pull_request_url":"https://api.github.com/repos/motech/motech/pulls/273","_links":{"self":{"href":"https://api.github.com/repos/motech/motech/pulls/comments/51850016"},"html":{"href":"https://github.com/motech/motech/pull/273#discussion_r51850016"},"pull_request":{"href":"https://api.github.com/repos/motech/motech/pulls/273"}}},"pull_request":{"url":"https://api.github.com/repos/motech/motech/pulls/273","id":55594218,"html_url":"https://github.com/motech/motech/pull/273","diff_url":"https://github.com/motech/motech/pull/273.diff","patch_url":"https://github.com/motech/motech/pull/273.patch","issue_url":"https://api.github.com/repos/motech/motech/issues/273","number":273,"state":"open","locked":false,"title":"MOTECH-1659: Add support for float, short and char in MDS","user":{"login":"atish160384","id":8927693,"avatar_url":"https://avatars.githubusercontent.com/u/8927693?v=3","gravatar_id":"","url":"https://api.github.com/users/atish160384","html_url":"https://github.com/atish160384","followers_url":"https://api.github.com/users/atish160384/followers","following_url":"https://api.github.com/users/atish160384/following{/other_user}","gists_url":"https://api.github.com/users/atish160384/gists{/gist_id}","starred_url":"https://api.github.com/users/atish160384/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atish160384/subscriptions","organizations_url":"https://api.github.com/users/atish160384/orgs","repos_url":"https://api.github.com/users/atish160384/repos","events_url":"https://api.github.com/users/atish160384/events{/privacy}","received_events_url":"https://api.github.com/users/atish160384/received_events","type":"User","site_admin":false},"body":"* Database is migrated to V4\r\n* Added Type validations for the new types\r\n* Added form validations for the new types","created_at":"2016-01-11T07:54:28Z","updated_at":"2016-02-04T09:52:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c108926b5585b28622e32f3a8ff37f95ff5fab9","assignee":{"login":"tstalka","id":7116048,"avatar_url":"https://avatars.githubusercontent.com/u/7116048?v=3","gravatar_id":"","url":"https://api.github.com/users/tstalka","html_url":"https://github.com/tstalka","followers_url":"https://api.github.com/users/tstalka/followers","following_url":"https://api.github.com/users/tstalka/following{/other_user}","gists_url":"https://api.github.com/users/tstalka/gists{/gist_id}","starred_url":"https://api.github.com/users/tstalka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tstalka/subscriptions","organizations_url":"https://api.github.com/users/tstalka/orgs","repos_url":"https://api.github.com/users/tstalka/repos","events_url":"https://api.github.com/users/tstalka/events{/privacy}","received_events_url":"https://api.github.com/users/tstalka/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/motech/motech/pulls/273/commits","review_comments_url":"https://api.github.com/repos/motech/motech/pulls/273/comments","review_comment_url":"https://api.github.com/repos/motech/motech/pulls/comments{/number}","comments_url":"https://api.github.com/repos/motech/motech/issues/273/comments","statuses_url":"https://api.github.com/repos/motech/motech/statuses/964c97332a2ce2b408e28fb796582efd4a34136e","head":{"label":"atish160384:motech-1659","ref":"motech-1659","sha":"964c97332a2ce2b408e28fb796582efd4a34136e","user":{"login":"atish160384","id":8927693,"avatar_url":"https://avatars.githubusercontent.com/u/8927693?v=3","gravatar_id":"","url":"https://api.github.com/users/atish160384","html_url":"https://github.com/atish160384","followers_url":"https://api.github.com/users/atish160384/followers","following_url":"https://api.github.com/users/atish160384/following{/other_user}","gists_url":"https://api.github.com/users/atish160384/gists{/gist_id}","starred_url":"https://api.github.com/users/atish160384/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atish160384/subscriptions","organizations_url":"https://api.github.com/users/atish160384/orgs","repos_url":"https://api.github.com/users/atish160384/repos","events_url":"https://api.github.com/users/atish160384/events{/privacy}","received_events_url":"https://api.github.com/users/atish160384/received_events","type":"User","site_admin":false},"repo":{"id":45253160,"name":"motech","full_name":"atish160384/motech","owner":{"login":"atish160384","id":8927693,"avatar_url":"https://avatars.githubusercontent.com/u/8927693?v=3","gravatar_id":"","url":"https://api.github.com/users/atish160384","html_url":"https://github.com/atish160384","followers_url":"https://api.github.com/users/atish160384/followers","following_url":"https://api.github.com/users/atish160384/following{/other_user}","gists_url":"https://api.github.com/users/atish160384/gists{/gist_id}","starred_url":"https://api.github.com/users/atish160384/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atish160384/subscriptions","organizations_url":"https://api.github.com/users/atish160384/orgs","repos_url":"https://api.github.com/users/atish160384/repos","events_url":"https://api.github.com/users/atish160384/events{/privacy}","received_events_url":"https://api.github.com/users/atish160384/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/atish160384/motech","description":"Mobile Technology for Community Health","fork":true,"url":"https://api.github.com/repos/atish160384/motech","forks_url":"https://api.github.com/repos/atish160384/motech/forks","keys_url":"https://api.github.com/repos/atish160384/motech/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atish160384/motech/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atish160384/motech/teams","hooks_url":"https://api.github.com/repos/atish160384/motech/hooks","issue_events_url":"https://api.github.com/repos/atish160384/motech/issues/events{/number}","events_url":"https://api.github.com/repos/atish160384/motech/events","assignees_url":"https://api.github.com/repos/atish160384/motech/assignees{/user}","branches_url":"https://api.github.com/repos/atish160384/motech/branches{/branch}","tags_url":"https://api.github.com/repos/atish160384/motech/tags","blobs_url":"https://api.github.com/repos/atish160384/motech/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atish160384/motech/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atish160384/motech/git/refs{/sha}","trees_url":"https://api.github.com/repos/atish160384/motech/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atish160384/motech/statuses/{sha}","languages_url":"https://api.github.com/repos/atish160384/motech/languages","stargazers_url":"https://api.github.com/repos/atish160384/motech/stargazers","contributors_url":"https://api.github.com/repos/atish160384/motech/contributors","subscribers_url":"https://api.github.com/repos/atish160384/motech/subscribers","subscription_url":"https://api.github.com/repos/atish160384/motech/subscription","commits_url":"https://api.github.com/repos/atish160384/motech/commits{/sha}","git_commits_url":"https://api.github.com/repos/atish160384/motech/git/commits{/sha}","comments_url":"https://api.github.com/repos/atish160384/motech/comments{/number}","issue_comment_url":"https://api.github.com/repos/atish160384/motech/issues/comments{/number}","contents_url":"https://api.github.com/repos/atish160384/motech/contents/{+path}","compare_url":"https://api.github.com/repos/atish160384/motech/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atish160384/motech/merges","archive_url":"https://api.github.com/repos/atish160384/motech/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atish160384/motech/downloads","issues_url":"https://api.github.com/repos/atish160384/motech/issues{/number}","pulls_url":"https://api.github.com/repos/atish160384/motech/pulls{/number}","milestones_url":"https://api.github.com/repos/atish160384/motech/milestones{/number}","notifications_url":"https://api.github.com/repos/atish160384/motech/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atish160384/motech/labels{/name}","releases_url":"https://api.github.com/repos/atish160384/motech/releases{/id}","deployments_url":"https://api.github.com/repos/atish160384/motech/deployments","created_at":"2015-10-30T13:40:54Z","updated_at":"2016-01-21T07:20:15Z","pushed_at":"2016-02-04T06:47:05Z","git_url":"git://github.com/atish160384/motech.git","ssh_url":"git@github.com:atish160384/motech.git","clone_url":"https://github.com/atish160384/motech.git","svn_url":"https://github.com/atish160384/motech","homepage":"http://docs.motechproject.org","size":42609,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"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":"motech:master","ref":"master","sha":"cf2ddbdf00c77c87ed8d41055c04b11181e52bf6","user":{"login":"motech","id":477919,"avatar_url":"https://avatars.githubusercontent.com/u/477919?v=3","gravatar_id":"","url":"https://api.github.com/users/motech","html_url":"https://github.com/motech","followers_url":"https://api.github.com/users/motech/followers","following_url":"https://api.github.com/users/motech/following{/other_user}","gists_url":"https://api.github.com/users/motech/gists{/gist_id}","starred_url":"https://api.github.com/users/motech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motech/subscriptions","organizations_url":"https://api.github.com/users/motech/orgs","repos_url":"https://api.github.com/users/motech/repos","events_url":"https://api.github.com/users/motech/events{/privacy}","received_events_url":"https://api.github.com/users/motech/received_events","type":"Organization","site_admin":false},"repo":{"id":40527870,"name":"motech","full_name":"motech/motech","owner":{"login":"motech","id":477919,"avatar_url":"https://avatars.githubusercontent.com/u/477919?v=3","gravatar_id":"","url":"https://api.github.com/users/motech","html_url":"https://github.com/motech","followers_url":"https://api.github.com/users/motech/followers","following_url":"https://api.github.com/users/motech/following{/other_user}","gists_url":"https://api.github.com/users/motech/gists{/gist_id}","starred_url":"https://api.github.com/users/motech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motech/subscriptions","organizations_url":"https://api.github.com/users/motech/orgs","repos_url":"https://api.github.com/users/motech/repos","events_url":"https://api.github.com/users/motech/events{/privacy}","received_events_url":"https://api.github.com/users/motech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/motech/motech","description":"Mobile Technology for Community Health","fork":false,"url":"https://api.github.com/repos/motech/motech","forks_url":"https://api.github.com/repos/motech/motech/forks","keys_url":"https://api.github.com/repos/motech/motech/keys{/key_id}","collaborators_url":"https://api.github.com/repos/motech/motech/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/motech/motech/teams","hooks_url":"https://api.github.com/repos/motech/motech/hooks","issue_events_url":"https://api.github.com/repos/motech/motech/issues/events{/number}","events_url":"https://api.github.com/repos/motech/motech/events","assignees_url":"https://api.github.com/repos/motech/motech/assignees{/user}","branches_url":"https://api.github.com/repos/motech/motech/branches{/branch}","tags_url":"https://api.github.com/repos/motech/motech/tags","blobs_url":"https://api.github.com/repos/motech/motech/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/motech/motech/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/motech/motech/git/refs{/sha}","trees_url":"https://api.github.com/repos/motech/motech/git/trees{/sha}","statuses_url":"https://api.github.com/repos/motech/motech/statuses/{sha}","languages_url":"https://api.github.com/repos/motech/motech/languages","stargazers_url":"https://api.github.com/repos/motech/motech/stargazers","contributors_url":"https://api.github.com/repos/motech/motech/contributors","subscribers_url":"https://api.github.com/repos/motech/motech/subscribers","subscription_url":"https://api.github.com/repos/motech/motech/subscription","commits_url":"https://api.github.com/repos/motech/motech/commits{/sha}","git_commits_url":"https://api.github.com/repos/motech/motech/git/commits{/sha}","comments_url":"https://api.github.com/repos/motech/motech/comments{/number}","issue_comment_url":"https://api.github.com/repos/motech/motech/issues/comments{/number}","contents_url":"https://api.github.com/repos/motech/motech/contents/{+path}","compare_url":"https://api.github.com/repos/motech/motech/compare/{base}...{head}","merges_url":"https://api.github.com/repos/motech/motech/merges","archive_url":"https://api.github.com/repos/motech/motech/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/motech/motech/downloads","issues_url":"https://api.github.com/repos/motech/motech/issues{/number}","pulls_url":"https://api.github.com/repos/motech/motech/pulls{/number}","milestones_url":"https://api.github.com/repos/motech/motech/milestones{/number}","notifications_url":"https://api.github.com/repos/motech/motech/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/motech/motech/labels{/name}","releases_url":"https://api.github.com/repos/motech/motech/releases{/id}","deployments_url":"https://api.github.com/repos/motech/motech/deployments","created_at":"2015-08-11T07:26:54Z","updated_at":"2016-01-12T16:30:12Z","pushed_at":"2016-02-04T09:42:59Z","git_url":"git://github.com/motech/motech.git","ssh_url":"git@github.com:motech/motech.git","clone_url":"https://github.com/motech/motech.git","svn_url":"https://github.com/motech/motech","homepage":"http://docs.motechproject.org","size":43771,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":17,"forks":28,"open_issues":17,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/motech/motech/pulls/273"},"html":{"href":"https://github.com/motech/motech/pull/273"},"issue":{"href":"https://api.github.com/repos/motech/motech/issues/273"},"comments":{"href":"https://api.github.com/repos/motech/motech/issues/273/comments"},"review_comments":{"href":"https://api.github.com/repos/motech/motech/pulls/273/comments"},"review_comment":{"href":"https://api.github.com/repos/motech/motech/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/motech/motech/pulls/273/commits"},"statuses":{"href":"https://api.github.com/repos/motech/motech/statuses/964c97332a2ce2b408e28fb796582efd4a34136e"}}}}