{"action":"created","issue":{"url":"https://api.github.com/repos/mattermost/platform/issues/4589","repository_url":"https://api.github.com/repos/mattermost/platform","labels_url":"https://api.github.com/repos/mattermost/platform/issues/4589/labels{/name}","comments_url":"https://api.github.com/repos/mattermost/platform/issues/4589/comments","events_url":"https://api.github.com/repos/mattermost/platform/issues/4589/events","html_url":"https://github.com/mattermost/platform/issues/4589","id":190502298,"number":4589,"title":"[Help Wanted] Move instances of Client.createPost() in components to an action","user":{"login":"jwilander","id":2672098,"avatar_url":"https://avatars.githubusercontent.com/u/2672098?v=3","gravatar_id":"","url":"https://api.github.com/users/jwilander","html_url":"https://github.com/jwilander","followers_url":"https://api.github.com/users/jwilander/followers","following_url":"https://api.github.com/users/jwilander/following{/other_user}","gists_url":"https://api.github.com/users/jwilander/gists{/gist_id}","starred_url":"https://api.github.com/users/jwilander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwilander/subscriptions","organizations_url":"https://api.github.com/users/jwilander/orgs","repos_url":"https://api.github.com/users/jwilander/repos","events_url":"https://api.github.com/users/jwilander/events{/privacy}","received_events_url":"https://api.github.com/users/jwilander/received_events","type":"User","site_admin":false},"labels":[{"id":472666592,"url":"https://api.github.com/repos/mattermost/platform/labels/Difficulty:%20Introductory","name":"Difficulty: Introductory","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-19T15:29:18Z","updated_at":"2016-11-21T08:48:58Z","closed_at":null,"body":"If you're interested please comment here and come [join our \"Contributors\" community channel](https://pre-release.mattermost.com/core/channels/tickets) on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please  [join our \"Developers\" community channel](https://pre-release.mattermost.com/core/channels/developers).\r\n\r\nNew contributors please see our [Developer's Guide](https://docs.mattermost.com/guides/developer.html), specifically for [machine setup](https://docs.mattermost.com/developer/developer-setup.html) and for [developer workflow](https://docs.mattermost.com/developer/developer-flow.html).\r\n\r\n---\r\n\r\n**Difficulty**: Introductory (new to codebase)\r\n\r\n**Details**:\r\nTo be [Flux](https://facebook.github.io/flux/docs/actions-and-the-dispatcher.html)-compliant our web utilities should be separate from our views and UI components. Views should use re-usable actions instead of directly interacting with the web utilities (specifically Client/client.jsx in our case).\r\n\r\nMove any instances of `Client.createPost()` inside of the [components directory](https://github.com/mattermost/platform/tree/master/webapp/components) into an action inside of [webapp/actions/post_actions.jsx](https://github.com/mattermost/platform/blob/master/webapp/actions/post_actions.jsx) and use the new action in place of where the `Client.createPost()` invocations were.\r\n\r\nAny common functionality should be performed in the action where possible, for example event dispatches through `AppDispatcher`.\r\n\r\nPlease see other actions inside of [webapp/actions/post_actions.jsx](https://github.com/mattermost/platform/blob/master/webapp/actions/post_actions.jsx) for examples.\r\n\r\nA quick grep at the time of creation of this ticket shows `Client.createPost()` being used in:\r\n- https://github.com/mattermost/platform/tree/master/webapp/components/create_comment.jsx\r\n- https://github.com/mattermost/platform/tree/master/webapp/components/create_post.jsx\r\n- https://github.com/mattermost/platform/tree/master/webapp/components/post_view/components/pending_post_options.jsx"},"comment":{"url":"https://api.github.com/repos/mattermost/platform/issues/comments/261878085","html_url":"https://github.com/mattermost/platform/issues/4589#issuecomment-261878085","issue_url":"https://api.github.com/repos/mattermost/platform/issues/4589","id":261878085,"user":{"login":"cpanato","id":4115580,"avatar_url":"https://avatars.githubusercontent.com/u/4115580?v=3","gravatar_id":"","url":"https://api.github.com/users/cpanato","html_url":"https://github.com/cpanato","followers_url":"https://api.github.com/users/cpanato/followers","following_url":"https://api.github.com/users/cpanato/following{/other_user}","gists_url":"https://api.github.com/users/cpanato/gists{/gist_id}","starred_url":"https://api.github.com/users/cpanato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpanato/subscriptions","organizations_url":"https://api.github.com/users/cpanato/orgs","repos_url":"https://api.github.com/users/cpanato/repos","events_url":"https://api.github.com/users/cpanato/events{/privacy}","received_events_url":"https://api.github.com/users/cpanato/received_events","type":"User","site_admin":false},"created_at":"2016-11-21T08:48:58Z","updated_at":"2016-11-21T08:48:58Z","body":"I can take this one"}}
{"actor":{"display_login":"cpanato"}}