{"action":"created","issue":{"url":"https://api.github.com/repos/mitodl/micromasters/issues/1628","repository_url":"https://api.github.com/repos/mitodl/micromasters","labels_url":"https://api.github.com/repos/mitodl/micromasters/issues/1628/labels{/name}","comments_url":"https://api.github.com/repos/mitodl/micromasters/issues/1628/comments","events_url":"https://api.github.com/repos/mitodl/micromasters/issues/1628/events","html_url":"https://github.com/mitodl/micromasters/pull/1628","id":186909079,"number":1628,"title":"Zendesk prepopulate program on program page","user":{"login":"singingwolfboy","id":132355,"avatar_url":"https://avatars.githubusercontent.com/u/132355?v=3","gravatar_id":"","url":"https://api.github.com/users/singingwolfboy","html_url":"https://github.com/singingwolfboy","followers_url":"https://api.github.com/users/singingwolfboy/followers","following_url":"https://api.github.com/users/singingwolfboy/following{/other_user}","gists_url":"https://api.github.com/users/singingwolfboy/gists{/gist_id}","starred_url":"https://api.github.com/users/singingwolfboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singingwolfboy/subscriptions","organizations_url":"https://api.github.com/users/singingwolfboy/orgs","repos_url":"https://api.github.com/users/singingwolfboy/repos","events_url":"https://api.github.com/users/singingwolfboy/events{/privacy}","received_events_url":"https://api.github.com/users/singingwolfboy/received_events","type":"User","site_admin":false},"labels":[{"id":335628406,"url":"https://api.github.com/repos/mitodl/micromasters/labels/Waiting%20on%20Author","name":"Waiting on Author","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"noisecapella","id":863262,"avatar_url":"https://avatars.githubusercontent.com/u/863262?v=3","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false},"assignees":[{"login":"noisecapella","id":863262,"avatar_url":"https://avatars.githubusercontent.com/u/863262?v=3","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2016-11-02T20:19:18Z","updated_at":"2016-11-07T15:43:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mitodl/micromasters/pulls/1628","html_url":"https://github.com/mitodl/micromasters/pull/1628","diff_url":"https://github.com/mitodl/micromasters/pull/1628.diff","patch_url":"https://github.com/mitodl/micromasters/pull/1628.patch"},"body":"Partial fix for #1262. This pull request builds on #1482 to also prepopulate the program field in the Zendesk ticket submission form. This pull request does several things:\r\n\r\n* Adds a `slug` field to the Program model, which is used to note which Zendesk field value this program is associated with\r\n* Adds a `ProgramPageSerializer` class, which is used to serialize information about the program into the `SETTINGS` object in the template\r\n* Refactors the callbacks in `zendesk_widget.js` to reflect the fact that Zendesk inserts _four_ iframes into the page, not just one\r\n* Adds a `ticketSubmissionFormLoaded` callback so that, if we are on a program page, the program field dropdown will be set to whatever value matches the program on the page\r\n\r\nNote that this pull request _only_ pre-populates the program field on a program page. No other page will cause the program field in the Zendesk form to pre-populate. A future pull-request can do that.\r\n\r\nAlso note that by including the faculty list and course list in the `ProgramPageSerializer`, we get some duplicated information in the `SETTINGS` object. I will clean up this duplication in a future pull request, as I did with  #1482 and #1615.\r\n\r\n**How should this be manually tested?**\r\n\r\nGo to the Programs model in the Django Admin (`/admin/courses/program/`). Create or edit a program so that the `slug` value is \"scm\". Next, make sure there is a ProgramPage for this program in Wagtail (`/cms`). If there isn't, go to the \"Explorer\" section in Wagtail, add a child page, and set the \"Program\" dropdown to the program you just edited in the Django admin. Visit the live page in your browser -- you'll need to publish the page in Wagtail before you can visit it. Once the page is loaded, click on the \"Help\" button at the bottom right of the page. Verify that the \"MicroMasters Program\" field in the ticket submission form is already set to \"Supply Chain Management\".\r\n\r\nNext, go back to the Django Admin, and change the `slug` value to \"dedp\". Go back to the program page for this program, refresh the page, and click the \"Help\" button again. This time, the \"MicroMasters Program\" field in the ticket submission form should already be set to \"Data, Economics, and Development Policy\".\r\n\r\nFinally, go back to the Django Admin, and change the `slug` value to any other string. Go back to the program page for this program, refresh the page, and click the \"Help\" button again. The \"MicroMasters Program\" field in the form should be set to the default value of \"-\"."},"comment":{"url":"https://api.github.com/repos/mitodl/micromasters/issues/comments/258870699","html_url":"https://github.com/mitodl/micromasters/pull/1628#issuecomment-258870699","issue_url":"https://api.github.com/repos/mitodl/micromasters/issues/1628","id":258870699,"user":{"login":"singingwolfboy","id":132355,"avatar_url":"https://avatars.githubusercontent.com/u/132355?v=3","gravatar_id":"","url":"https://api.github.com/users/singingwolfboy","html_url":"https://github.com/singingwolfboy","followers_url":"https://api.github.com/users/singingwolfboy/followers","following_url":"https://api.github.com/users/singingwolfboy/following{/other_user}","gists_url":"https://api.github.com/users/singingwolfboy/gists{/gist_id}","starred_url":"https://api.github.com/users/singingwolfboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singingwolfboy/subscriptions","organizations_url":"https://api.github.com/users/singingwolfboy/orgs","repos_url":"https://api.github.com/users/singingwolfboy/repos","events_url":"https://api.github.com/users/singingwolfboy/events{/privacy}","received_events_url":"https://api.github.com/users/singingwolfboy/received_events","type":"User","site_admin":false},"created_at":"2016-11-07T15:43:07Z","updated_at":"2016-11-07T15:43:07Z","body":"@noisecapella @pdpinch: just to be clear, you would like me to _remove_ the `slug` field entirely, and use the program's database ID instead? This will require whoever is setting up the Zendesk side to be aware of the program's database ID when creating/editing these custom tags. Is that correct?"}}
{"actor":{"display_login":"singingwolfboy"}}