{"action":"opened","number":727,"pull_request":{"url":"https://api.github.com/repos/ucla/ohmageX/pulls/727","id":41963063,"html_url":"https://github.com/ucla/ohmageX/pull/727","diff_url":"https://github.com/ucla/ohmageX/pull/727.diff","patch_url":"https://github.com/ucla/ohmageX/pull/727.patch","issue_url":"https://api.github.com/repos/ucla/ohmageX/issues/727","number":727,"state":"open","locked":false,"title":"Wifi only upload","user":{"login":"stevenolen","id":808870,"avatar_url":"https://avatars.githubusercontent.com/u/808870?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenolen","html_url":"https://github.com/stevenolen","followers_url":"https://api.github.com/users/stevenolen/followers","following_url":"https://api.github.com/users/stevenolen/following{/other_user}","gists_url":"https://api.github.com/users/stevenolen/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenolen/subscriptions","organizations_url":"https://api.github.com/users/stevenolen/orgs","repos_url":"https://api.github.com/users/stevenolen/repos","events_url":"https://api.github.com/users/stevenolen/events{/privacy}","received_events_url":"https://api.github.com/users/stevenolen/received_events","type":"User","site_admin":false},"body":"a basic implementation for #655.\r\n\r\nDetails of implementation:\r\n  * New base entity (UserPreferences)\r\n    * generically implemented as this could be useful for other things down the road.\r\n    * offers a getter and setter method for an arbitrary preference\r\n    * Defaults of these preferences can/should be specific in config files\r\n    * Persists user changes to localstorage so they survive app death.\r\n  * Added row to profile page for wifi-upload-only preference\r\n    * rough css, Profile page still has some rudimentary styling so I didn't go overboard on this..\r\n    * copied switch css from reminder page (noted that this could be abstracted, but I'm terrible at CSS and know nothing about blocks...so it's probably best if I don't do this).\r\n    * toggling switch sets the preference (OFF = normal state, ON = app will *not* upload when on cell network.\r\n  * Set `if` block for `native && wifi-upload-only && on cell network` in uploader:new method.\r\n    * Continue to allow user to \"retry\" even with this failure (existing code appears to assume this)\r\n    * added upload failure state for `wifionly` to all upload contexts.\r\n    * this preference is not available in the browser (profile page is disabled currently), so \"preference\" is ignored if in browser.\r\n\r\n@ctrance -- this has yet to be tested on iOS as I don't have iOS device with a cell connection (and it's required for testing the feature, ha!). Could you test this with the builds labeled `ohmageX-steve` on https://apps.ohmage.org ? -- note that I haven't pulled in @wrenr's recent dashboard changes (and pull from his branch mid-implementation) so it's best to report issues only relating to:\r\n  * profile page (displaying wifi switch, toggling switch)\r\n  * survey uploads (both from survey context and upload queue context)\r\n    * should always upload if on wifi as well as if on cell and preference is set to \"off\" (which is default)\r\n    * should never upload if on cell network and preference is set to \"on\" (survey upload attempts and upload queue single survey attempts should provide info about the preference being on, \"upload all attempts\" currently do not specify errors.\r\n  * Killing app should keep preference. \r\n  * Logging out should set back to default ","created_at":"2015-08-09T00:26:16Z","updated_at":"2015-08-09T00:26:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ucla/ohmageX/pulls/727/commits","review_comments_url":"https://api.github.com/repos/ucla/ohmageX/pulls/727/comments","review_comment_url":"https://api.github.com/repos/ucla/ohmageX/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ucla/ohmageX/issues/727/comments","statuses_url":"https://api.github.com/repos/ucla/ohmageX/statuses/34b85e0bec84f42487f99e8d6273be4eb77e0066","head":{"label":"stevenolen:wifi_only_upload","ref":"wifi_only_upload","sha":"34b85e0bec84f42487f99e8d6273be4eb77e0066","user":{"login":"stevenolen","id":808870,"avatar_url":"https://avatars.githubusercontent.com/u/808870?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenolen","html_url":"https://github.com/stevenolen","followers_url":"https://api.github.com/users/stevenolen/followers","following_url":"https://api.github.com/users/stevenolen/following{/other_user}","gists_url":"https://api.github.com/users/stevenolen/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenolen/subscriptions","organizations_url":"https://api.github.com/users/stevenolen/orgs","repos_url":"https://api.github.com/users/stevenolen/repos","events_url":"https://api.github.com/users/stevenolen/events{/privacy}","received_events_url":"https://api.github.com/users/stevenolen/received_events","type":"User","site_admin":false},"repo":{"id":40370433,"name":"ohmageX","full_name":"stevenolen/ohmageX","owner":{"login":"stevenolen","id":808870,"avatar_url":"https://avatars.githubusercontent.com/u/808870?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenolen","html_url":"https://github.com/stevenolen","followers_url":"https://api.github.com/users/stevenolen/followers","following_url":"https://api.github.com/users/stevenolen/following{/other_user}","gists_url":"https://api.github.com/users/stevenolen/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenolen/subscriptions","organizations_url":"https://api.github.com/users/stevenolen/orgs","repos_url":"https://api.github.com/users/stevenolen/repos","events_url":"https://api.github.com/users/stevenolen/events{/privacy}","received_events_url":"https://api.github.com/users/stevenolen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevenolen/ohmageX","description":"Updated version of ohmage MWF","fork":true,"url":"https://api.github.com/repos/stevenolen/ohmageX","forks_url":"https://api.github.com/repos/stevenolen/ohmageX/forks","keys_url":"https://api.github.com/repos/stevenolen/ohmageX/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevenolen/ohmageX/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevenolen/ohmageX/teams","hooks_url":"https://api.github.com/repos/stevenolen/ohmageX/hooks","issue_events_url":"https://api.github.com/repos/stevenolen/ohmageX/issues/events{/number}","events_url":"https://api.github.com/repos/stevenolen/ohmageX/events","assignees_url":"https://api.github.com/repos/stevenolen/ohmageX/assignees{/user}","branches_url":"https://api.github.com/repos/stevenolen/ohmageX/branches{/branch}","tags_url":"https://api.github.com/repos/stevenolen/ohmageX/tags","blobs_url":"https://api.github.com/repos/stevenolen/ohmageX/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevenolen/ohmageX/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevenolen/ohmageX/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevenolen/ohmageX/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevenolen/ohmageX/statuses/{sha}","languages_url":"https://api.github.com/repos/stevenolen/ohmageX/languages","stargazers_url":"https://api.github.com/repos/stevenolen/ohmageX/stargazers","contributors_url":"https://api.github.com/repos/stevenolen/ohmageX/contributors","subscribers_url":"https://api.github.com/repos/stevenolen/ohmageX/subscribers","subscription_url":"https://api.github.com/repos/stevenolen/ohmageX/subscription","commits_url":"https://api.github.com/repos/stevenolen/ohmageX/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevenolen/ohmageX/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevenolen/ohmageX/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevenolen/ohmageX/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevenolen/ohmageX/contents/{+path}","compare_url":"https://api.github.com/repos/stevenolen/ohmageX/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevenolen/ohmageX/merges","archive_url":"https://api.github.com/repos/stevenolen/ohmageX/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevenolen/ohmageX/downloads","issues_url":"https://api.github.com/repos/stevenolen/ohmageX/issues{/number}","pulls_url":"https://api.github.com/repos/stevenolen/ohmageX/pulls{/number}","milestones_url":"https://api.github.com/repos/stevenolen/ohmageX/milestones{/number}","notifications_url":"https://api.github.com/repos/stevenolen/ohmageX/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevenolen/ohmageX/labels{/name}","releases_url":"https://api.github.com/repos/stevenolen/ohmageX/releases{/id}","created_at":"2015-08-07T16:38:00Z","updated_at":"2015-08-07T16:38:01Z","pushed_at":"2015-08-09T00:20:22Z","git_url":"git://github.com/stevenolen/ohmageX.git","ssh_url":"git@github.com:stevenolen/ohmageX.git","clone_url":"https://github.com/stevenolen/ohmageX.git","svn_url":"https://github.com/stevenolen/ohmageX","homepage":null,"size":10639,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"ucla:develop","ref":"develop","sha":"00f24f1800b53d5499eeceb82b7b3a79e0e34971","user":{"login":"ucla","id":39207,"avatar_url":"https://avatars.githubusercontent.com/u/39207?v=3","gravatar_id":"","url":"https://api.github.com/users/ucla","html_url":"https://github.com/ucla","followers_url":"https://api.github.com/users/ucla/followers","following_url":"https://api.github.com/users/ucla/following{/other_user}","gists_url":"https://api.github.com/users/ucla/gists{/gist_id}","starred_url":"https://api.github.com/users/ucla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ucla/subscriptions","organizations_url":"https://api.github.com/users/ucla/orgs","repos_url":"https://api.github.com/users/ucla/repos","events_url":"https://api.github.com/users/ucla/events{/privacy}","received_events_url":"https://api.github.com/users/ucla/received_events","type":"Organization","site_admin":false},"repo":{"id":22932816,"name":"ohmageX","full_name":"ucla/ohmageX","owner":{"login":"ucla","id":39207,"avatar_url":"https://avatars.githubusercontent.com/u/39207?v=3","gravatar_id":"","url":"https://api.github.com/users/ucla","html_url":"https://github.com/ucla","followers_url":"https://api.github.com/users/ucla/followers","following_url":"https://api.github.com/users/ucla/following{/other_user}","gists_url":"https://api.github.com/users/ucla/gists{/gist_id}","starred_url":"https://api.github.com/users/ucla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ucla/subscriptions","organizations_url":"https://api.github.com/users/ucla/orgs","repos_url":"https://api.github.com/users/ucla/repos","events_url":"https://api.github.com/users/ucla/events{/privacy}","received_events_url":"https://api.github.com/users/ucla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ucla/ohmageX","description":"Updated version of ohmage MWF","fork":false,"url":"https://api.github.com/repos/ucla/ohmageX","forks_url":"https://api.github.com/repos/ucla/ohmageX/forks","keys_url":"https://api.github.com/repos/ucla/ohmageX/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ucla/ohmageX/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ucla/ohmageX/teams","hooks_url":"https://api.github.com/repos/ucla/ohmageX/hooks","issue_events_url":"https://api.github.com/repos/ucla/ohmageX/issues/events{/number}","events_url":"https://api.github.com/repos/ucla/ohmageX/events","assignees_url":"https://api.github.com/repos/ucla/ohmageX/assignees{/user}","branches_url":"https://api.github.com/repos/ucla/ohmageX/branches{/branch}","tags_url":"https://api.github.com/repos/ucla/ohmageX/tags","blobs_url":"https://api.github.com/repos/ucla/ohmageX/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ucla/ohmageX/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ucla/ohmageX/git/refs{/sha}","trees_url":"https://api.github.com/repos/ucla/ohmageX/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ucla/ohmageX/statuses/{sha}","languages_url":"https://api.github.com/repos/ucla/ohmageX/languages","stargazers_url":"https://api.github.com/repos/ucla/ohmageX/stargazers","contributors_url":"https://api.github.com/repos/ucla/ohmageX/contributors","subscribers_url":"https://api.github.com/repos/ucla/ohmageX/subscribers","subscription_url":"https://api.github.com/repos/ucla/ohmageX/subscription","commits_url":"https://api.github.com/repos/ucla/ohmageX/commits{/sha}","git_commits_url":"https://api.github.com/repos/ucla/ohmageX/git/commits{/sha}","comments_url":"https://api.github.com/repos/ucla/ohmageX/comments{/number}","issue_comment_url":"https://api.github.com/repos/ucla/ohmageX/issues/comments{/number}","contents_url":"https://api.github.com/repos/ucla/ohmageX/contents/{+path}","compare_url":"https://api.github.com/repos/ucla/ohmageX/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ucla/ohmageX/merges","archive_url":"https://api.github.com/repos/ucla/ohmageX/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ucla/ohmageX/downloads","issues_url":"https://api.github.com/repos/ucla/ohmageX/issues{/number}","pulls_url":"https://api.github.com/repos/ucla/ohmageX/pulls{/number}","milestones_url":"https://api.github.com/repos/ucla/ohmageX/milestones{/number}","notifications_url":"https://api.github.com/repos/ucla/ohmageX/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ucla/ohmageX/labels{/name}","releases_url":"https://api.github.com/repos/ucla/ohmageX/releases{/id}","created_at":"2014-08-13T22:05:59Z","updated_at":"2015-07-20T19:09:53Z","pushed_at":"2015-08-08T00:34:17Z","git_url":"git://github.com/ucla/ohmageX.git","ssh_url":"git@github.com:ucla/ohmageX.git","clone_url":"https://github.com/ucla/ohmageX.git","svn_url":"https://github.com/ucla/ohmageX","homepage":null,"size":10639,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":94,"forks":1,"open_issues":94,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ucla/ohmageX/pulls/727"},"html":{"href":"https://github.com/ucla/ohmageX/pull/727"},"issue":{"href":"https://api.github.com/repos/ucla/ohmageX/issues/727"},"comments":{"href":"https://api.github.com/repos/ucla/ohmageX/issues/727/comments"},"review_comments":{"href":"https://api.github.com/repos/ucla/ohmageX/pulls/727/comments"},"review_comment":{"href":"https://api.github.com/repos/ucla/ohmageX/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ucla/ohmageX/pulls/727/commits"},"statuses":{"href":"https://api.github.com/repos/ucla/ohmageX/statuses/34b85e0bec84f42487f99e8d6273be4eb77e0066"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":4,"additions":198,"deletions":10,"changed_files":11}}