{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/61749621","id":61749621,"diff_hunk":"@@ -0,0 +1,79 @@\n+;(function (define) {\n+    'use strict';\n+    define(['jquery', 'underscore', 'backbone', 'gettext', 'edx-ui-toolkit/js/utils/string-utils',\n+            'js/models/notification', 'js/views/notification'],\n+        function ($, _, Backbone, gettext, StringUtils) {\n+            /*global NotificationModel, NotificationView */\n+\n+            var VerifiedTrackSettingsNotificationView = Backbone.View.extend({\n+\n+                render: function () {\n+                    // All rendering is done in validateSettings, which must be called with some additional information.\n+                    return this;\n+                },\n+\n+                validateSettings: function (isCohorted, cohortCollection, enableCohortsCheckbox) {\n+                    if (this.model.get('enabled')) {\n+                        var verifiedCohortName = this.model.get('verified_cohort_name');\n+                        if (isCohorted) {\n+                            var verifiedCohortExists = false;\n+                            $.each(cohortCollection, function (_, cohort) {\n+                                if (cohort.get('assignment_type') === 'manual' &&\n+                                    cohort.get('name') === verifiedCohortName) {\n+                                    verifiedCohortExists = true;\n+                                    cohort.disableEditingName = true;\n+                                }","path":"lms/static/js/groups/views/verified_track_settings_notification.js","position":25,"original_position":25,"commit_id":"987f589d5601e5f1bc133f398caee88edac0e38e","original_commit_id":"987f589d5601e5f1bc133f398caee88edac0e38e","user":{"login":"efischer19","id":7373924,"avatar_url":"https://avatars.githubusercontent.com/u/7373924?v=3","gravatar_id":"","url":"https://api.github.com/users/efischer19","html_url":"https://github.com/efischer19","followers_url":"https://api.github.com/users/efischer19/followers","following_url":"https://api.github.com/users/efischer19/following{/other_user}","gists_url":"https://api.github.com/users/efischer19/gists{/gist_id}","starred_url":"https://api.github.com/users/efischer19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efischer19/subscriptions","organizations_url":"https://api.github.com/users/efischer19/orgs","repos_url":"https://api.github.com/users/efischer19/repos","events_url":"https://api.github.com/users/efischer19/events{/privacy}","received_events_url":"https://api.github.com/users/efischer19/received_events","type":"User","site_admin":false},"body":"Nit: The indentation of this if-block's contents lining up with the last part of the condition threw me for a second on first read, could the body of the block get bumped inwards one more tab?","created_at":"2016-05-02T14:57:11Z","updated_at":"2016-05-02T14:57:11Z","html_url":"https://github.com/edx/edx-platform/pull/12278#discussion_r61749621","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/12278","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/61749621"},"html":{"href":"https://github.com/edx/edx-platform/pull/12278#discussion_r61749621"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/12278"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/12278","id":68077406,"html_url":"https://github.com/edx/edx-platform/pull/12278","diff_url":"https://github.com/edx/edx-platform/pull/12278.diff","patch_url":"https://github.com/edx/edx-platform/pull/12278.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/12278","number":12278,"state":"open","locked":false,"title":"Add messaging when verified track content MVP is enabled.","user":{"login":"cahrens","id":484484,"avatar_url":"https://avatars.githubusercontent.com/u/484484?v=3","gravatar_id":"","url":"https://api.github.com/users/cahrens","html_url":"https://github.com/cahrens","followers_url":"https://api.github.com/users/cahrens/followers","following_url":"https://api.github.com/users/cahrens/following{/other_user}","gists_url":"https://api.github.com/users/cahrens/gists{/gist_id}","starred_url":"https://api.github.com/users/cahrens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahrens/subscriptions","organizations_url":"https://api.github.com/users/cahrens/orgs","repos_url":"https://api.github.com/users/cahrens/repos","events_url":"https://api.github.com/users/cahrens/events{/privacy}","received_events_url":"https://api.github.com/users/cahrens/received_events","type":"User","site_admin":false},"body":"## [TNL-4393](https://openedx.atlassian.net/browse/TNL-4393)\r\n\r\nThis PR adds messaging in the cohorting admin section of the instructor dashboard if the automatic verified track cohorting feature is enabled. See below for screenshots and details.\r\n\r\n### Sandbox\r\n- [x] https://cahrens.sandbox.edx.org/courses/course-v1:edx+100+1/instructor#view-cohort_management, can modify verified track settings at https://cahrens.sandbox.edx.org/admin/verified_track_content/verifiedtrackcohortedcourse/ (log in as \"admin@example.com\" with password \"edx\")\r\n\r\n### Testing\r\n- [x] i18n\r\n- [x] Data is properly encoded in HTML templates to avoid XSS\r\n- [x] Unit, integration, acceptance tests as appropriate\r\n\r\n### Reviewers\r\nIf you've been tagged for review, please check your corresponding box once you've given the :+1:.\r\n- [ ] Code review: @dianakhuang\r\n- [ ] Code review: @efischer19\r\n- [ ] UI strings/error msgs review: @catong \r\n- [ ] UX review: @chris-mike \r\n- [ ] Product review: @scottrish \r\n\r\n### Post-review\r\n- [ ] Squash commits\r\n\r\nScreenshots (all with course that has verified track cohorting enabled, course-v1:edx+100+1):\r\nA) Cohorting not enabled in cohort admin section of instructor dashboard\r\n![image](https://cloud.githubusercontent.com/assets/484484/14942786/0b3b12d4-0f95-11e6-8a0a-e44f5716c3d1.png)\r\n\r\nB) Cohorting enabled, no \"Verified Learners\" cohort exists (note that the ability to disable cohorts is now disabled).\r\n\r\n![image](https://cloud.githubusercontent.com/assets/484484/14942789/280bc868-0f95-11e6-9acb-d5f156cdebd8.png)\r\n\r\nC) Cohorting enabled, \"Verified Learners\" cohort exists. In this case, course staff should not be able to rename the Verified Learners cohort name (and also can't disable cohorts).\r\n\r\n![image](https://cloud.githubusercontent.com/assets/484484/14942798/6e7c033a-0f95-11e6-9446-471baf2ae4a8.png)\r\n\r\nNote that there is an edge case when first creating a cohort with the \"verified\" name, if it wasn't created before verified track cohorting was enabled (this is NOT the recommended workflow)-- in this edge case, the ability to rename the cohort is not disabled until the cohorting editing template is re-rendered. Given that we do not expect this use case, the cohorting status message DOES update after the rename to state that there is no correctly named cohort, and that the template will re-render on pretty much any other operation afterwards (correcting the issue), I think this is acceptable. I can demonstrate this case if anyone cares. :)","created_at":"2016-04-27T15:49:39Z","updated_at":"2016-05-02T14:57:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23bf4e5df5622bed0ddaf7c8388c9453838f4400","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/12278/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/12278/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/12278/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/987f589d5601e5f1bc133f398caee88edac0e38e","head":{"label":"edx:christina/cohort-messages","ref":"christina/cohort-messages","sha":"987f589d5601e5f1bc133f398caee88edac0e38e","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-platform/deployments","created_at":"2013-05-30T20:20:38Z","updated_at":"2016-05-02T11:46:19Z","pushed_at":"2016-05-02T14:54:42Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":741069,"stargazers_count":2540,"watchers_count":2540,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1546,"mirror_url":null,"open_issues_count":178,"forks":1546,"open_issues":178,"watchers":2540,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"7a6278e69bfdeea4a40c7408e382f2bcd03e203d","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-platform/deployments","created_at":"2013-05-30T20:20:38Z","updated_at":"2016-05-02T11:46:19Z","pushed_at":"2016-05-02T14:54:42Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":741069,"stargazers_count":2540,"watchers_count":2540,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1546,"mirror_url":null,"open_issues_count":178,"forks":1546,"open_issues":178,"watchers":2540,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/12278"},"html":{"href":"https://github.com/edx/edx-platform/pull/12278"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/12278"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/12278/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/12278/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/12278/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/987f589d5601e5f1bc133f398caee88edac0e38e"}}}}