EVOLUTION-MANAGER
Edit File: 24.615918b146cac92577d0.js
(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{1236:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var a=r(7),s=r.n(a),i=r(1106);class n extends s.a.PureComponent{render(){return s.a.createElement(i.a,{id:"generic_icons.logout",defaultMessage:"Logout Icon"},e=>s.a.createElement("i",{className:"fa fa-1x fa-angle-left",title:e}))}}},1953:function(e,t,r){"use strict";r.r(t);var a=r(309),s=r(6),i=r(20),n=r(15),c=(r(52),r(138),r(170),r(34),r(592),r(33)),o=r.n(c),l=r(7),m=r.n(l),u=r(1250),d=r(1201),g=r(1106),f=r(53),h=r(1120),v=r(1181),E=r(1119),p=r(1154),T=r(1236),S=r(1163),_=r(95),b=r(1268),O=r(40),y=r(0);function A(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class R extends m.a.PureComponent{constructor(e){super(e),A(this,"getTermsOfService",async()=>{this.setState({customTermsOfServiceId:"",customTermsOfServiceText:"",loading:!0});const{data:e}=await this.props.actions.getTermsOfService();e?this.setState({customTermsOfServiceId:e.id,customTermsOfServiceText:e.text,loading:!1}):h.e("/login?extra=".concat(y.j.GET_TERMS_ERROR))}),A(this,"handleLogoutClick",e=>{e.preventDefault(),h.e("/login")}),A(this,"handleAcceptTerms",()=>{this.setState({loadingAgree:!0,serverError:null}),this.registerUserAction(!0,()=>{const e=new URLSearchParams(this.props.location.search).get("redirect_to");e&&e.match(/^\/([^/]|$)/)?_.a.push(e):h.f()})}),A(this,"handleRejectTerms",()=>{this.setState({loadingDisagree:!0,serverError:null}),this.registerUserAction(!1,()=>{h.e("/login?extra=".concat(y.j.TERMS_REJECTED))})}),A(this,"registerUserAction",async(e,t)=>{const{data:r}=await this.props.actions.updateMyTermsOfServiceStatus(this.state.customTermsOfServiceId,e);r?t(r):this.setState({loadingAgree:!1,loadingDisagree:!1,serverError:m.a.createElement(g.a,{id:"terms_of_service.api_error",defaultMessage:"Unable to complete the request. If this issue persists, contact your System Administrator."})})}),this.state={customTermsOfServiceId:"",customTermsOfServiceText:"",loading:!0,loadingAgree:!1,loadingDisagree:!1,serverError:null},this.formattedText=Object(f.memoizeResult)(e=>Object(O.e)(e))}componentDidMount(){this.props.termsEnabled?this.getTermsOfService():h.f()}render(){if(this.state.loading)return m.a.createElement(E.a,null);let e="terms-of-service__markdown";return this.state.serverError?e+=" terms-of-service-error__height--fill":e+=" terms-of-service__height--fill",m.a.createElement("div",null,m.a.createElement(v.a,null),m.a.createElement("div",{className:"signup-header"},m.a.createElement("a",{href:"#",onClick:this.handleLogoutClick},m.a.createElement(T.a,null),m.a.createElement(g.a,{id:"web.header.logout",defaultMessage:"Logout"}))),m.a.createElement("div",null,m.a.createElement("div",{className:"signup-team__container terms-of-service__container"},m.a.createElement("div",{className:e},m.a.createElement("div",{className:"medium-center"},Object(b.a)(this.formattedText(this.state.customTermsOfServiceText),!1,{mentions:!1}))),m.a.createElement("div",{className:"terms-of-service__footer medium-center"},m.a.createElement(u.a,{className:"terms-of-service__button-group"},m.a.createElement(d.a,{bsStyle:"primary",disabled:this.state.loadingAgree||this.state.loadingDisagree,id:"acceptTerms",onClick:this.handleAcceptTerms,type:"submit"},this.state.loadingAgree&&m.a.createElement(p.a,null),m.a.createElement(g.a,{id:"terms_of_service.agreeButton",defaultMessage:"I Agree"})),m.a.createElement(d.a,{bsStyle:"link",disabled:this.state.loadingAgree||this.state.loadingDisagree,id:"rejectTerms",onClick:this.handleRejectTerms,type:"reset"},this.state.loadingDisagree&&m.a.createElement(p.a,null),m.a.createElement(g.a,{id:"terms_of_service.disagreeButton",defaultMessage:"I Disagree"}))),Boolean(this.state.serverError)&&m.a.createElement("div",{className:"terms-of-service__server-error alert alert-warning"},m.a.createElement(S.a,null)," ",this.state.serverError)))))}}A(R,"propTypes",{location:o.a.object,termsEnabled:o.a.bool.isRequired,actions:o.a.shape({getTermsOfService:o.a.func.isRequired,updateMyTermsOfServiceStatus:o.a.func.isRequired}).isRequired});t.default=Object(a.connect)((function(e){return{termsEnabled:"true"===Object(n.getConfig)(e).EnableCustomTermsOfService}}),(function(e){return{actions:Object(s.bindActionCreators)({getTermsOfService:i.getTermsOfService,updateMyTermsOfServiceStatus:i.updateMyTermsOfServiceStatus},e)}}))(R)}}]); //# sourceMappingURL=24.615918b146cac92577d0.js.map