{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/Vellum/pulls/comments/206663403","pull_request_review_id":142120154,"id":206663403,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjY2MzQwMw==","diff_hunk":"@@ -676,21 +676,25 @@ define([\n             return;\n         }\n \n+        var required = el.popAttr('required');\n+\n         var attrs = {\n             relevantAttr: parseVellumAttrs(form, el, 'relevant'),\n             calculateAttr: parseVellumAttrs(form, el, 'calculate'),\n             constraintAttr: parseVellumAttrs(form, el, 'constraint'),\n             constraintMsgAttr: lookForNamespaced(el, \"constraintMsg\"),\n-            requiredAttr: parseBoolAttributeValue(el.popAttr('required')),\n+            requiredAttr: parseBoolAttributeValue(required),\n+            requiredCondition: (el.popAttr('requiredCondition') ||\n+                                ['true()', 'false()'].indexOf(required) === -1 ? required : undefined),","path":"src/parser.js","position":80,"original_position":80,"commit_id":"89d5c10593afd06262c514fc665e0b0860ead07e","original_commit_id":"89d5c10593afd06262c514fc665e0b0860ead07e","user":{"login":"jmtroth0","id":13040327,"node_id":"MDQ6VXNlcjEzMDQwMzI3","avatar_url":"https://avatars0.githubusercontent.com/u/13040327?v=4","gravatar_id":"","url":"https://api.github.com/users/jmtroth0","html_url":"https://github.com/jmtroth0","followers_url":"https://api.github.com/users/jmtroth0/followers","following_url":"https://api.github.com/users/jmtroth0/following{/other_user}","gists_url":"https://api.github.com/users/jmtroth0/gists{/gist_id}","starred_url":"https://api.github.com/users/jmtroth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmtroth0/subscriptions","organizations_url":"https://api.github.com/users/jmtroth0/orgs","repos_url":"https://api.github.com/users/jmtroth0/repos","events_url":"https://api.github.com/users/jmtroth0/events{/privacy}","received_events_url":"https://api.github.com/users/jmtroth0/received_events","type":"User","site_admin":false},"body":"See the comment above. I can clean this up and not use a ternary nested in an if statement if this route is acceptable","created_at":"2018-07-31T19:57:53Z","updated_at":"2018-07-31T19:57:53Z","html_url":"https://github.com/dimagi/Vellum/pull/947#discussion_r206663403","pull_request_url":"https://api.github.com/repos/dimagi/Vellum/pulls/947","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/comments/206663403"},"html":{"href":"https://github.com/dimagi/Vellum/pull/947#discussion_r206663403"},"pull_request":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/947"}},"in_reply_to_id":206661647},"pull_request":{"url":"https://api.github.com/repos/dimagi/Vellum/pulls/947","id":202886894,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyODg2ODk0","html_url":"https://github.com/dimagi/Vellum/pull/947","diff_url":"https://github.com/dimagi/Vellum/pull/947.diff","patch_url":"https://github.com/dimagi/Vellum/pull/947.patch","issue_url":"https://api.github.com/repos/dimagi/Vellum/issues/947","number":947,"state":"open","locked":false,"title":"required condition","user":{"login":"jmtroth0","id":13040327,"node_id":"MDQ6VXNlcjEzMDQwMzI3","avatar_url":"https://avatars0.githubusercontent.com/u/13040327?v=4","gravatar_id":"","url":"https://api.github.com/users/jmtroth0","html_url":"https://github.com/jmtroth0","followers_url":"https://api.github.com/users/jmtroth0/followers","following_url":"https://api.github.com/users/jmtroth0/following{/other_user}","gists_url":"https://api.github.com/users/jmtroth0/gists{/gist_id}","starred_url":"https://api.github.com/users/jmtroth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmtroth0/subscriptions","organizations_url":"https://api.github.com/users/jmtroth0/orgs","repos_url":"https://api.github.com/users/jmtroth0/repos","events_url":"https://api.github.com/users/jmtroth0/events{/privacy}","received_events_url":"https://api.github.com/users/jmtroth0/received_events","type":"User","site_admin":false},"body":"I'm mainly interested in this point on feedback on both UX and whether or not I found all the things I needed to change.\r\n\r\nRight now it adds an input box in the logic section for the required condition. If you enter anything while it isn't marked \"required\" then it will warn you off. I was thinking of making it so the box only appeared if required was checked, but I wasn't sure about how to do that or if it was that much better.\r\n\r\nhttps://trello.com/c/pb9LDmk8/6-make-it-possible-to-define-a-function-for-required-on-a-question-jen\r\n\r\nNot sure who usually reviews vellum stuff --> @millerdev @orangejenny buddy: @snopoke \r\n\r\nI definitely recommend `w=1`, but probably can 🏛 . Only commits 2fac576, 685e7ea, and 05a8363 do anything\r\n\r\n<img width=\"795\" alt=\"screen shot 2018-07-20 at 11 41 08 am\" src=\"https://user-images.githubusercontent.com/13040327/43011558-df4c155a-8c11-11e8-81fd-4602493dad25.png\">","created_at":"2018-07-20T15:42:48Z","updated_at":"2018-07-31T19:57:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f740e4751a617a2e891f5288f044d2ff25af99dd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":731763008,"node_id":"MDU6TGFiZWw3MzE3NjMwMDg=","url":"https://api.github.com/repos/dimagi/Vellum/labels/product/all-users-all-environments","name":"product/all-users-all-environments","color":"0e8a16","default":false},{"id":181321498,"node_id":"MDU6TGFiZWwxODEzMjE0OTg=","url":"https://api.github.com/repos/dimagi/Vellum/labels/review.%20don't%20merge","name":"review. don't merge","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/Vellum/pulls/947/commits","review_comments_url":"https://api.github.com/repos/dimagi/Vellum/pulls/947/comments","review_comment_url":"https://api.github.com/repos/dimagi/Vellum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/Vellum/issues/947/comments","statuses_url":"https://api.github.com/repos/dimagi/Vellum/statuses/89d5c10593afd06262c514fc665e0b0860ead07e","head":{"label":"dimagi:jr/required-condition","ref":"jr/required-condition","sha":"89d5c10593afd06262c514fc665e0b0860ead07e","user":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","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":1859793,"node_id":"MDEwOlJlcG9zaXRvcnkxODU5Nzkz","name":"Vellum","full_name":"dimagi/Vellum","owner":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","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/Vellum","description":"An XForms form designer written purely in Javascript","fork":false,"url":"https://api.github.com/repos/dimagi/Vellum","forks_url":"https://api.github.com/repos/dimagi/Vellum/forks","keys_url":"https://api.github.com/repos/dimagi/Vellum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/Vellum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/Vellum/teams","hooks_url":"https://api.github.com/repos/dimagi/Vellum/hooks","issue_events_url":"https://api.github.com/repos/dimagi/Vellum/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/Vellum/events","assignees_url":"https://api.github.com/repos/dimagi/Vellum/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/Vellum/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/Vellum/tags","blobs_url":"https://api.github.com/repos/dimagi/Vellum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/Vellum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/Vellum/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/Vellum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/Vellum/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/Vellum/languages","stargazers_url":"https://api.github.com/repos/dimagi/Vellum/stargazers","contributors_url":"https://api.github.com/repos/dimagi/Vellum/contributors","subscribers_url":"https://api.github.com/repos/dimagi/Vellum/subscribers","subscription_url":"https://api.github.com/repos/dimagi/Vellum/subscription","commits_url":"https://api.github.com/repos/dimagi/Vellum/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/Vellum/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/Vellum/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/Vellum/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/Vellum/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/Vellum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/Vellum/merges","archive_url":"https://api.github.com/repos/dimagi/Vellum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/Vellum/downloads","issues_url":"https://api.github.com/repos/dimagi/Vellum/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/Vellum/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/Vellum/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/Vellum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/Vellum/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/Vellum/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/Vellum/deployments","created_at":"2011-06-07T13:03:34Z","updated_at":"2018-07-24T22:10:09Z","pushed_at":"2018-07-27T19:40:22Z","git_url":"git://github.com/dimagi/Vellum.git","ssh_url":"git@github.com:dimagi/Vellum.git","clone_url":"https://github.com/dimagi/Vellum.git","svn_url":"https://github.com/dimagi/Vellum","homepage":"","size":13324,"stargazers_count":64,"watchers_count":64,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":24,"open_issues":2,"watchers":64,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"6017088a455b7d77e74951f9f63d652d50aea12a","user":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","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":1859793,"node_id":"MDEwOlJlcG9zaXRvcnkxODU5Nzkz","name":"Vellum","full_name":"dimagi/Vellum","owner":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","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/Vellum","description":"An XForms form designer written purely in Javascript","fork":false,"url":"https://api.github.com/repos/dimagi/Vellum","forks_url":"https://api.github.com/repos/dimagi/Vellum/forks","keys_url":"https://api.github.com/repos/dimagi/Vellum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/Vellum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/Vellum/teams","hooks_url":"https://api.github.com/repos/dimagi/Vellum/hooks","issue_events_url":"https://api.github.com/repos/dimagi/Vellum/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/Vellum/events","assignees_url":"https://api.github.com/repos/dimagi/Vellum/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/Vellum/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/Vellum/tags","blobs_url":"https://api.github.com/repos/dimagi/Vellum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/Vellum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/Vellum/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/Vellum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/Vellum/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/Vellum/languages","stargazers_url":"https://api.github.com/repos/dimagi/Vellum/stargazers","contributors_url":"https://api.github.com/repos/dimagi/Vellum/contributors","subscribers_url":"https://api.github.com/repos/dimagi/Vellum/subscribers","subscription_url":"https://api.github.com/repos/dimagi/Vellum/subscription","commits_url":"https://api.github.com/repos/dimagi/Vellum/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/Vellum/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/Vellum/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/Vellum/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/Vellum/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/Vellum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/Vellum/merges","archive_url":"https://api.github.com/repos/dimagi/Vellum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/Vellum/downloads","issues_url":"https://api.github.com/repos/dimagi/Vellum/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/Vellum/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/Vellum/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/Vellum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/Vellum/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/Vellum/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/Vellum/deployments","created_at":"2011-06-07T13:03:34Z","updated_at":"2018-07-24T22:10:09Z","pushed_at":"2018-07-27T19:40:22Z","git_url":"git://github.com/dimagi/Vellum.git","ssh_url":"git@github.com:dimagi/Vellum.git","clone_url":"https://github.com/dimagi/Vellum.git","svn_url":"https://github.com/dimagi/Vellum","homepage":"","size":13324,"stargazers_count":64,"watchers_count":64,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":24,"open_issues":2,"watchers":64,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/947"},"html":{"href":"https://github.com/dimagi/Vellum/pull/947"},"issue":{"href":"https://api.github.com/repos/dimagi/Vellum/issues/947"},"comments":{"href":"https://api.github.com/repos/dimagi/Vellum/issues/947/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/947/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/947/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/Vellum/statuses/89d5c10593afd06262c514fc665e0b0860ead07e"}},"author_association":"NONE"}}
{"actor":{"display_login":"jmtroth0"}}