{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/29598020","id":29598020,"diff_hunk":"@@ -587,6 +786,53 @@ var CaseConfig = (function () {\n                     condition: cleanCondition(close_condition)\n                 }\n             };\n+        },\n+        to_usercase_transaction: function (o, caseConfig) {\n+            var self = HQFormActions.normalize(o);\n+            var required_properties = caseConfig.requires() === 'none' && !o.update_case.update.name ? [{\n+                key: 'name',\n+                path: self.open_case.name_path,\n+                required: true\n+            }] : [];\n+            var case_properties = CC_UTILS.propertyDictToArray(\n+                required_properties,\n+                self.update_case.update,\n+                caseConfig\n+            );\n+            var case_preload = CC_UTILS.propertyDictToArray(\n+                [],\n+                self.case_preload.preload,\n+                caseConfig,\n+                true\n+            );\n+            return UserCaseTransaction.wrap({\n+                case_properties: case_properties,\n+                case_preload: case_preload,\n+\n+                suggestedProperties: function () {\n+                    // TODO: Do we need suggestedProperties?\n+                    // TODO: Pass user case type from the view.\n+                    if (_(caseConfig.usercasePropertiesMap).has('commcare-user')) {\n+                        return caseConfig.usercasePropertiesMap['commcare-user']();\n+                    } else {\n+                        return [];\n+                    }\n+                }\n+            }, caseConfig);\n+        },\n+        from_usercase_transaction: function (usercase_transaction) {\n+            var o = UserCaseTransaction.unwrap(usercase_transaction);\n+            var x = CC_UTILS.propertyArrayToDict(['name'], o.case_properties);\n+            var case_properties = x[0]  ;\n+            var case_preload = CC_UTILS.propertyArrayToDict([], o.case_preload, true)[0];\n+            return {\n+                update_usercase: {\n+                    update: case_properties\n+                },\n+                case_preload: {","path":"corehq/apps/app_manager/static/app_manager/js/case-config-ui-2.js","position":289,"original_position":289,"commit_id":"da2514eb83119bf75c1f23cd743c9abdd889cfe0","original_commit_id":"da2514eb83119bf75c1f23cd743c9abdd889cfe0","user":{"login":"kaapstorm","id":708421,"avatar_url":"https://avatars.githubusercontent.com/u/708421?v=3","gravatar_id":"","url":"https://api.github.com/users/kaapstorm","html_url":"https://github.com/kaapstorm","followers_url":"https://api.github.com/users/kaapstorm/followers","following_url":"https://api.github.com/users/kaapstorm/following{/other_user}","gists_url":"https://api.github.com/users/kaapstorm/gists{/gist_id}","starred_url":"https://api.github.com/users/kaapstorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaapstorm/subscriptions","organizations_url":"https://api.github.com/users/kaapstorm/orgs","repos_url":"https://api.github.com/users/kaapstorm/repos","events_url":"https://api.github.com/users/kaapstorm/events{/privacy}","received_events_url":"https://api.github.com/users/kaapstorm/received_events","type":"User","site_admin":false},"body":"Well spotted!","created_at":"2015-05-04T16:17:38Z","updated_at":"2015-05-04T16:17:38Z","html_url":"https://github.com/dimagi/commcare-hq/pull/6340#discussion_r29598020","pull_request_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/6340","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/29598020"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/6340#discussion_r29598020"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/6340"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/6340","id":33455804,"html_url":"https://github.com/dimagi/commcare-hq/pull/6340","diff_url":"https://github.com/dimagi/commcare-hq/pull/6340.diff","patch_url":"https://github.com/dimagi/commcare-hq/pull/6340.patch","issue_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/6340","number":6340,"state":"open","locked":false,"title":"Changed usercase prefix to \"user/\"","user":{"login":"kaapstorm","id":708421,"avatar_url":"https://avatars.githubusercontent.com/u/708421?v=3","gravatar_id":"","url":"https://api.github.com/users/kaapstorm","html_url":"https://github.com/kaapstorm","followers_url":"https://api.github.com/users/kaapstorm/followers","following_url":"https://api.github.com/users/kaapstorm/following{/other_user}","gists_url":"https://api.github.com/users/kaapstorm/gists{/gist_id}","starred_url":"https://api.github.com/users/kaapstorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaapstorm/subscriptions","organizations_url":"https://api.github.com/users/kaapstorm/orgs","repos_url":"https://api.github.com/users/kaapstorm/repos","events_url":"https://api.github.com/users/kaapstorm/events{/privacy}","received_events_url":"https://api.github.com/users/kaapstorm/received_events","type":"User","site_admin":false},"body":"Don't accept colons in case property names. Added doctest for validate_property. \r\n\r\n(Disallowing colons reverts 7a03a32f)\r\n\r\n@czue, @snopoke for context \r\n","created_at":"2015-04-16T14:24:49Z","updated_at":"2015-05-04T16:17:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1b554bd20e4fddace660e89b5d05f6b18ebaf47","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/6340/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/6340/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/6340/comments","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/da2514eb83119bf75c1f23cd743c9abdd889cfe0","head":{"label":"dimagi:usercase","ref":"usercase","sha":"da2514eb83119bf75c1f23cd743c9abdd889cfe0","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","created_at":"2009-07-09T17:00:07Z","updated_at":"2015-05-04T15:42:40Z","pushed_at":"2015-05-04T16:15:20Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"http://www.commcarehq.org","size":381158,"stargazers_count":44,"watchers_count":44,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":56,"mirror_url":null,"open_issues_count":41,"forks":56,"open_issues":41,"watchers":44,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"1aaff56f66ffd725db6292614d6668360466c163","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","created_at":"2009-07-09T17:00:07Z","updated_at":"2015-05-04T15:42:40Z","pushed_at":"2015-05-04T16:15:20Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"http://www.commcarehq.org","size":381158,"stargazers_count":44,"watchers_count":44,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":56,"mirror_url":null,"open_issues_count":41,"forks":56,"open_issues":41,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/6340"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/6340"},"issue":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/6340"},"comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/6340/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/6340/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/6340/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcare-hq/statuses/da2514eb83119bf75c1f23cd743c9abdd889cfe0"}}}}