{"action":"created","comment":{"url":"https://api.github.com/repos/interglobalvision/applaya/pulls/comments/70968707","id":70968707,"diff_hunk":"@@ -1,23 +1,40 @@\n-export const FormSchema = new SimpleSchema({\n+/* globals _ */\n+import { Upload } from '/imports/schemas/Upload.js';\n+\n+const Schema = new SimpleSchema({\n   name: {\n     type: String,\n   },\n \n-  category: {\n-    type: String,\n-    allowedValues: [\n-      'news',\n-      'image',\n-      'video',\n-    ],\n+  idCard: {\n+    type: Upload,\n+    // This makes the field 'required'\n+    autoValue() {\n+      if (_.isEmpty(this.value.file)) {\n+        this.unset();\n+      }\n+    },\n   },\n \n-  publishedDate: {\n-    type: Date,\n+  cv: {\n+    type: Upload,\n   },\n \n-  published: {\n-    type: Boolean,\n-    optional: true,\n+  photos: {\n+    type: [ Upload ],\n+    maxCount: 2,\n   },\n+  \n+  docs: {\n+    type: [ Upload ],\n+    // This makes minCount work\n+    autoValue() {\n+      return _.filter(this.value, (val) => !_.isEmpty(val.file));\n+    },\n+    minCount: 1,\n+    maxCount: 2,","path":"app/imports/schemas/TestForm.js","position":48,"original_position":48,"commit_id":"046f10bc4faaff07f6a34a8f4ba85d719ac9bf9b","original_commit_id":"046f10bc4faaff07f6a34a8f4ba85d719ac9bf9b","user":{"login":"varffs","id":845186,"avatar_url":"https://avatars.githubusercontent.com/u/845186?v=3","gravatar_id":"","url":"https://api.github.com/users/varffs","html_url":"https://github.com/varffs","followers_url":"https://api.github.com/users/varffs/followers","following_url":"https://api.github.com/users/varffs/following{/other_user}","gists_url":"https://api.github.com/users/varffs/gists{/gist_id}","starred_url":"https://api.github.com/users/varffs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varffs/subscriptions","organizations_url":"https://api.github.com/users/varffs/orgs","repos_url":"https://api.github.com/users/varffs/repos","events_url":"https://api.github.com/users/varffs/events{/privacy}","received_events_url":"https://api.github.com/users/varffs/received_events","type":"User","site_admin":false},"body":"why is max 2? Is this for the entire schema?","created_at":"2016-07-15T13:01:50Z","updated_at":"2016-07-15T13:01:51Z","html_url":"https://github.com/interglobalvision/applaya/pull/20#discussion_r70968707","pull_request_url":"https://api.github.com/repos/interglobalvision/applaya/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/interglobalvision/applaya/pulls/comments/70968707"},"html":{"href":"https://github.com/interglobalvision/applaya/pull/20#discussion_r70968707"},"pull_request":{"href":"https://api.github.com/repos/interglobalvision/applaya/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/interglobalvision/applaya/pulls/20","id":77503357,"html_url":"https://github.com/interglobalvision/applaya/pull/20","diff_url":"https://github.com/interglobalvision/applaya/pull/20.diff","patch_url":"https://github.com/interglobalvision/applaya/pull/20.patch","issue_url":"https://api.github.com/repos/interglobalvision/applaya/issues/20","number":20,"state":"open","locked":false,"title":"Feat upload field","user":{"login":"mixcas","id":1994425,"avatar_url":"https://avatars.githubusercontent.com/u/1994425?v=3","gravatar_id":"","url":"https://api.github.com/users/mixcas","html_url":"https://github.com/mixcas","followers_url":"https://api.github.com/users/mixcas/followers","following_url":"https://api.github.com/users/mixcas/following{/other_user}","gists_url":"https://api.github.com/users/mixcas/gists{/gist_id}","starred_url":"https://api.github.com/users/mixcas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixcas/subscriptions","organizations_url":"https://api.github.com/users/mixcas/orgs","repos_url":"https://api.github.com/users/mixcas/repos","events_url":"https://api.github.com/users/mixcas/events{/privacy}","received_events_url":"https://api.github.com/users/mixcas/received_events","type":"User","site_admin":false},"body":"This is the upload form. It works fine and has some file preview. Needs better styling and better UI.\r\n\r\nDeclaring uploads in the schema requires a lot of code but I couldn't find a way to make it more reusable. Other solution required other parts to be overwritten. \r\n\r\nThe branch started a while a go, so if the merge is impossible, I can do it.","created_at":"2016-07-14T18:33:31Z","updated_at":"2016-07-15T13:01:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"varffs","id":845186,"avatar_url":"https://avatars.githubusercontent.com/u/845186?v=3","gravatar_id":"","url":"https://api.github.com/users/varffs","html_url":"https://github.com/varffs","followers_url":"https://api.github.com/users/varffs/followers","following_url":"https://api.github.com/users/varffs/following{/other_user}","gists_url":"https://api.github.com/users/varffs/gists{/gist_id}","starred_url":"https://api.github.com/users/varffs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varffs/subscriptions","organizations_url":"https://api.github.com/users/varffs/orgs","repos_url":"https://api.github.com/users/varffs/repos","events_url":"https://api.github.com/users/varffs/events{/privacy}","received_events_url":"https://api.github.com/users/varffs/received_events","type":"User","site_admin":false},"assignees":[{"login":"varffs","id":845186,"avatar_url":"https://avatars.githubusercontent.com/u/845186?v=3","gravatar_id":"","url":"https://api.github.com/users/varffs","html_url":"https://github.com/varffs","followers_url":"https://api.github.com/users/varffs/followers","following_url":"https://api.github.com/users/varffs/following{/other_user}","gists_url":"https://api.github.com/users/varffs/gists{/gist_id}","starred_url":"https://api.github.com/users/varffs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varffs/subscriptions","organizations_url":"https://api.github.com/users/varffs/orgs","repos_url":"https://api.github.com/users/varffs/repos","events_url":"https://api.github.com/users/varffs/events{/privacy}","received_events_url":"https://api.github.com/users/varffs/received_events","type":"User","site_admin":false},{"login":"mikeyrayvon","id":7727722,"avatar_url":"https://avatars.githubusercontent.com/u/7727722?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeyrayvon","html_url":"https://github.com/mikeyrayvon","followers_url":"https://api.github.com/users/mikeyrayvon/followers","following_url":"https://api.github.com/users/mikeyrayvon/following{/other_user}","gists_url":"https://api.github.com/users/mikeyrayvon/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeyrayvon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeyrayvon/subscriptions","organizations_url":"https://api.github.com/users/mikeyrayvon/orgs","repos_url":"https://api.github.com/users/mikeyrayvon/repos","events_url":"https://api.github.com/users/mikeyrayvon/events{/privacy}","received_events_url":"https://api.github.com/users/mikeyrayvon/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/interglobalvision/applaya/pulls/20/commits","review_comments_url":"https://api.github.com/repos/interglobalvision/applaya/pulls/20/comments","review_comment_url":"https://api.github.com/repos/interglobalvision/applaya/pulls/comments{/number}","comments_url":"https://api.github.com/repos/interglobalvision/applaya/issues/20/comments","statuses_url":"https://api.github.com/repos/interglobalvision/applaya/statuses/046f10bc4faaff07f6a34a8f4ba85d719ac9bf9b","head":{"label":"interglobalvision:feat-upload-field","ref":"feat-upload-field","sha":"046f10bc4faaff07f6a34a8f4ba85d719ac9bf9b","user":{"login":"interglobalvision","id":6844994,"avatar_url":"https://avatars.githubusercontent.com/u/6844994?v=3","gravatar_id":"","url":"https://api.github.com/users/interglobalvision","html_url":"https://github.com/interglobalvision","followers_url":"https://api.github.com/users/interglobalvision/followers","following_url":"https://api.github.com/users/interglobalvision/following{/other_user}","gists_url":"https://api.github.com/users/interglobalvision/gists{/gist_id}","starred_url":"https://api.github.com/users/interglobalvision/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interglobalvision/subscriptions","organizations_url":"https://api.github.com/users/interglobalvision/orgs","repos_url":"https://api.github.com/users/interglobalvision/repos","events_url":"https://api.github.com/users/interglobalvision/events{/privacy}","received_events_url":"https://api.github.com/users/interglobalvision/received_events","type":"Organization","site_admin":false},"repo":{"id":59867441,"name":"applaya","full_name":"interglobalvision/applaya","owner":{"login":"interglobalvision","id":6844994,"avatar_url":"https://avatars.githubusercontent.com/u/6844994?v=3","gravatar_id":"","url":"https://api.github.com/users/interglobalvision","html_url":"https://github.com/interglobalvision","followers_url":"https://api.github.com/users/interglobalvision/followers","following_url":"https://api.github.com/users/interglobalvision/following{/other_user}","gists_url":"https://api.github.com/users/interglobalvision/gists{/gist_id}","starred_url":"https://api.github.com/users/interglobalvision/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interglobalvision/subscriptions","organizations_url":"https://api.github.com/users/interglobalvision/orgs","repos_url":"https://api.github.com/users/interglobalvision/repos","events_url":"https://api.github.com/users/interglobalvision/events{/privacy}","received_events_url":"https://api.github.com/users/interglobalvision/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/interglobalvision/applaya","description":"Life's a beach, then you apply.","fork":false,"url":"https://api.github.com/repos/interglobalvision/applaya","forks_url":"https://api.github.com/repos/interglobalvision/applaya/forks","keys_url":"https://api.github.com/repos/interglobalvision/applaya/keys{/key_id}","collaborators_url":"https://api.github.com/repos/interglobalvision/applaya/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/interglobalvision/applaya/teams","hooks_url":"https://api.github.com/repos/interglobalvision/applaya/hooks","issue_events_url":"https://api.github.com/repos/interglobalvision/applaya/issues/events{/number}","events_url":"https://api.github.com/repos/interglobalvision/applaya/events","assignees_url":"https://api.github.com/repos/interglobalvision/applaya/assignees{/user}","branches_url":"https://api.github.com/repos/interglobalvision/applaya/branches{/branch}","tags_url":"https://api.github.com/repos/interglobalvision/applaya/tags","blobs_url":"https://api.github.com/repos/interglobalvision/applaya/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/interglobalvision/applaya/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/interglobalvision/applaya/git/refs{/sha}","trees_url":"https://api.github.com/repos/interglobalvision/applaya/git/trees{/sha}","statuses_url":"https://api.github.com/repos/interglobalvision/applaya/statuses/{sha}","languages_url":"https://api.github.com/repos/interglobalvision/applaya/languages","stargazers_url":"https://api.github.com/repos/interglobalvision/applaya/stargazers","contributors_url":"https://api.github.com/repos/interglobalvision/applaya/contributors","subscribers_url":"https://api.github.com/repos/interglobalvision/applaya/subscribers","subscription_url":"https://api.github.com/repos/interglobalvision/applaya/subscription","commits_url":"https://api.github.com/repos/interglobalvision/applaya/commits{/sha}","git_commits_url":"https://api.github.com/repos/interglobalvision/applaya/git/commits{/sha}","comments_url":"https://api.github.com/repos/interglobalvision/applaya/comments{/number}","issue_comment_url":"https://api.github.com/repos/interglobalvision/applaya/issues/comments{/number}","contents_url":"https://api.github.com/repos/interglobalvision/applaya/contents/{+path}","compare_url":"https://api.github.com/repos/interglobalvision/applaya/compare/{base}...{head}","merges_url":"https://api.github.com/repos/interglobalvision/applaya/merges","archive_url":"https://api.github.com/repos/interglobalvision/applaya/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/interglobalvision/applaya/downloads","issues_url":"https://api.github.com/repos/interglobalvision/applaya/issues{/number}","pulls_url":"https://api.github.com/repos/interglobalvision/applaya/pulls{/number}","milestones_url":"https://api.github.com/repos/interglobalvision/applaya/milestones{/number}","notifications_url":"https://api.github.com/repos/interglobalvision/applaya/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/interglobalvision/applaya/labels{/name}","releases_url":"https://api.github.com/repos/interglobalvision/applaya/releases{/id}","deployments_url":"https://api.github.com/repos/interglobalvision/applaya/deployments","created_at":"2016-05-27T23:00:31Z","updated_at":"2016-06-28T21:58:40Z","pushed_at":"2016-07-15T12:56:24Z","git_url":"git://github.com/interglobalvision/applaya.git","ssh_url":"git@github.com:interglobalvision/applaya.git","clone_url":"https://github.com/interglobalvision/applaya.git","svn_url":"https://github.com/interglobalvision/applaya","homepage":"","size":117,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"interglobalvision:master","ref":"master","sha":"ec1caeb0795775fbebbe2488a0975a16419d7942","user":{"login":"interglobalvision","id":6844994,"avatar_url":"https://avatars.githubusercontent.com/u/6844994?v=3","gravatar_id":"","url":"https://api.github.com/users/interglobalvision","html_url":"https://github.com/interglobalvision","followers_url":"https://api.github.com/users/interglobalvision/followers","following_url":"https://api.github.com/users/interglobalvision/following{/other_user}","gists_url":"https://api.github.com/users/interglobalvision/gists{/gist_id}","starred_url":"https://api.github.com/users/interglobalvision/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interglobalvision/subscriptions","organizations_url":"https://api.github.com/users/interglobalvision/orgs","repos_url":"https://api.github.com/users/interglobalvision/repos","events_url":"https://api.github.com/users/interglobalvision/events{/privacy}","received_events_url":"https://api.github.com/users/interglobalvision/received_events","type":"Organization","site_admin":false},"repo":{"id":59867441,"name":"applaya","full_name":"interglobalvision/applaya","owner":{"login":"interglobalvision","id":6844994,"avatar_url":"https://avatars.githubusercontent.com/u/6844994?v=3","gravatar_id":"","url":"https://api.github.com/users/interglobalvision","html_url":"https://github.com/interglobalvision","followers_url":"https://api.github.com/users/interglobalvision/followers","following_url":"https://api.github.com/users/interglobalvision/following{/other_user}","gists_url":"https://api.github.com/users/interglobalvision/gists{/gist_id}","starred_url":"https://api.github.com/users/interglobalvision/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interglobalvision/subscriptions","organizations_url":"https://api.github.com/users/interglobalvision/orgs","repos_url":"https://api.github.com/users/interglobalvision/repos","events_url":"https://api.github.com/users/interglobalvision/events{/privacy}","received_events_url":"https://api.github.com/users/interglobalvision/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/interglobalvision/applaya","description":"Life's a beach, then you apply.","fork":false,"url":"https://api.github.com/repos/interglobalvision/applaya","forks_url":"https://api.github.com/repos/interglobalvision/applaya/forks","keys_url":"https://api.github.com/repos/interglobalvision/applaya/keys{/key_id}","collaborators_url":"https://api.github.com/repos/interglobalvision/applaya/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/interglobalvision/applaya/teams","hooks_url":"https://api.github.com/repos/interglobalvision/applaya/hooks","issue_events_url":"https://api.github.com/repos/interglobalvision/applaya/issues/events{/number}","events_url":"https://api.github.com/repos/interglobalvision/applaya/events","assignees_url":"https://api.github.com/repos/interglobalvision/applaya/assignees{/user}","branches_url":"https://api.github.com/repos/interglobalvision/applaya/branches{/branch}","tags_url":"https://api.github.com/repos/interglobalvision/applaya/tags","blobs_url":"https://api.github.com/repos/interglobalvision/applaya/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/interglobalvision/applaya/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/interglobalvision/applaya/git/refs{/sha}","trees_url":"https://api.github.com/repos/interglobalvision/applaya/git/trees{/sha}","statuses_url":"https://api.github.com/repos/interglobalvision/applaya/statuses/{sha}","languages_url":"https://api.github.com/repos/interglobalvision/applaya/languages","stargazers_url":"https://api.github.com/repos/interglobalvision/applaya/stargazers","contributors_url":"https://api.github.com/repos/interglobalvision/applaya/contributors","subscribers_url":"https://api.github.com/repos/interglobalvision/applaya/subscribers","subscription_url":"https://api.github.com/repos/interglobalvision/applaya/subscription","commits_url":"https://api.github.com/repos/interglobalvision/applaya/commits{/sha}","git_commits_url":"https://api.github.com/repos/interglobalvision/applaya/git/commits{/sha}","comments_url":"https://api.github.com/repos/interglobalvision/applaya/comments{/number}","issue_comment_url":"https://api.github.com/repos/interglobalvision/applaya/issues/comments{/number}","contents_url":"https://api.github.com/repos/interglobalvision/applaya/contents/{+path}","compare_url":"https://api.github.com/repos/interglobalvision/applaya/compare/{base}...{head}","merges_url":"https://api.github.com/repos/interglobalvision/applaya/merges","archive_url":"https://api.github.com/repos/interglobalvision/applaya/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/interglobalvision/applaya/downloads","issues_url":"https://api.github.com/repos/interglobalvision/applaya/issues{/number}","pulls_url":"https://api.github.com/repos/interglobalvision/applaya/pulls{/number}","milestones_url":"https://api.github.com/repos/interglobalvision/applaya/milestones{/number}","notifications_url":"https://api.github.com/repos/interglobalvision/applaya/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/interglobalvision/applaya/labels{/name}","releases_url":"https://api.github.com/repos/interglobalvision/applaya/releases{/id}","deployments_url":"https://api.github.com/repos/interglobalvision/applaya/deployments","created_at":"2016-05-27T23:00:31Z","updated_at":"2016-06-28T21:58:40Z","pushed_at":"2016-07-15T12:56:24Z","git_url":"git://github.com/interglobalvision/applaya.git","ssh_url":"git@github.com:interglobalvision/applaya.git","clone_url":"https://github.com/interglobalvision/applaya.git","svn_url":"https://github.com/interglobalvision/applaya","homepage":"","size":117,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/interglobalvision/applaya/pulls/20"},"html":{"href":"https://github.com/interglobalvision/applaya/pull/20"},"issue":{"href":"https://api.github.com/repos/interglobalvision/applaya/issues/20"},"comments":{"href":"https://api.github.com/repos/interglobalvision/applaya/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/interglobalvision/applaya/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/interglobalvision/applaya/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/interglobalvision/applaya/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/interglobalvision/applaya/statuses/046f10bc4faaff07f6a34a8f4ba85d719ac9bf9b"}}}}
{"actor":{"display_login":"varffs"}}