webpackJsonp([19],{1854:function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var o=t.location.query.id;return(0,a.default)({},t,{hookId:o,hook:e.entities.integrations.incomingHooks[o],updateIncomingHookRequest:e.requests.integrations.createIncomingHook})}function i(e){return{actions:(0,d.bindActionCreators)({updateIncomingHook:c.updateIncomingHook,getIncomingHook:c.getIncomingHook},e)}}Object.defineProperty(t,"__esModule",{value:!0});var u=o(19),a=n(u),s=o(41),d=o(20),c=o(672),p=o(2159),f=n(p);t.default=(0,s.connect)(r,i)(f.default)},2159:function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(113),i=n(r),u=o(114),a=n(u),s=o(6),d=n(s),c=o(4),p=n(c),f=o(5),l=n(f),k=o(7),m=n(k),g=o(8),h=n(g),H=o(44),I=o(222),v=n(I),b=o(1829),_=n(b),w=o(1),q=n(w),R=o(2),E=n(R),y={id:"integrations.edit",defaultMessage:"Edit"},M={id:"update_incoming_webhook.update",defaultMessage:"Update"},j=function(e){function t(e){var o=this;(0,p.default)(this,t);var n=(0,m.default)(this,(t.__proto__||(0,d.default)(t)).call(this,e));return n.editIncomingHook=function(){var e=(0,a.default)(i.default.mark(function e(t){return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.newHook=t,n.props.hook.id&&(t.id=n.props.hook.id),n.props.hook.token&&(t.token=n.props.hook.token),e.next=5,n.submitHook();case 5:case"end":return e.stop()}},e,o)}));return function(t){return e.apply(this,arguments)}}(),n.submitHook=(0,a.default)(i.default.mark(function e(){var t;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.setState({serverError:""}),e.next=3,n.props.actions.updateIncomingHook(n.newHook);case 3:if(!(t=e.sent)){e.next=7;break}return H.browserHistory.push("/"+n.props.team.name+"/integrations/incoming_webhooks"),e.abrupt("return");case 7:n.props.updateIncomingHookRequest.error&&n.setState({serverError:n.props.updateIncomingHookRequest.error.message});case 8:case"end":return e.stop()}},e,o)})),n.state={showConfirmModal:!1,serverError:""},n}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){"true"===window.mm_config.EnableIncomingWebhooks&&this.props.actions.getIncomingHook(this.props.hookId)}},{key:"render",value:function(){return this.props.hook?q.default.createElement(_.default,{team:this.props.team,header:y,footer:M,action:this.editIncomingHook,serverError:this.state.serverError,initialHook:this.props.hook}):q.default.createElement(v.default,null)}}]),t}(q.default.PureComponent);j.propTypes={team:E.default.object.isRequired,hook:E.default.object,hookId:E.default.string.isRequired,updateIncomingHookRequest:E.default.object.isRequired,actions:E.default.shape({updateIncomingHook:E.default.func.isRequired,getIncomingHook:E.default.func.isRequired}).isRequired},t.default=j}});
//# sourceMappingURL=19.78ccb57c8a982a931e99.js.map