![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /opt/mattermost/client/ |
Upload File : |
"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[4414],{44414:(e,t,r)=>{r.r(t),r.d(t,{default:()=>N});var s=r(23453),a=r(52602),i=r(17085),n=r(26614),o=r(77440),c=r(69410),l=r(62688),m=r.n(l),d=(r(43813),r(17046),r(36169),r(3188),r(30973),r(6552),r(4290),r(97023)),u=r.n(d),g=r(34529),f=r(14778),v=r(78546),h=r(91767),p=r(96423),E=r(1396),T=r(3708),b=r(87064),S=r(53654),_=r(83007),A=r(78451),y=r(72965),M=r(62975);function O(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class w extends u().PureComponent{constructor(e){super(e),O(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.BN("/login?extra=".concat(A.YM.GET_TERMS_ERROR))})),O(this,"handleLogoutClick",(e=>{e.preventDefault(),h.BN("/login")})),O(this,"handleAcceptTerms",(()=>{this.setState({loadingAgree:!0,serverError:null}),this.registerUserAction(!0,(()=>{var e;const t=new URLSearchParams(null===(e=this.props.location)||void 0===e?void 0:e.search).get("redirect_to");t&&t.match(/^\/([^/]|$)/)?(0,_.J)().push(t):this.props.onboardingFlowEnabled?(0,_.J)().push("/"):h.tc()}))})),O(this,"handleRejectTerms",(()=>{this.setState({loadingDisagree:!0,serverError:null}),this.registerUserAction(!1,(()=>{h.BN("/login?extra=".concat(A.YM.TERMS_REJECTED))}))})),O(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:u().createElement(f.FormattedMessage,{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=(0,v.el)((t=>(0,M.vX)(t,{},e.emojiMap)))}componentDidMount(){this.props.termsEnabled?this.getTermsOfService():h.tc()}render(){if(this.state.loading)return u().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",u().createElement("div",{className:"signup-page-container"},u().createElement(p.default,null),u().createElement("div",{className:"signup-header"},u().createElement("a",{href:"#",onClick:this.handleLogoutClick},u().createElement(T.A,null),u().createElement(f.FormattedMessage,{id:"web.header.logout",defaultMessage:"Logout"}))),u().createElement("div",{className:"signup-team__container terms-of-service__container"},u().createElement("div",{className:e},u().createElement("div",{className:"medium-center","data-testid":"termsOfService"},(0,y.A)(this.formattedText(this.state.customTermsOfServiceText),{mentions:!1}))),u().createElement("div",{className:"terms-of-service__footer medium-center"},u().createElement("div",{className:"terms-of-service__button-group"},u().createElement(g.Button,{bsStyle:"primary",disabled:this.state.loadingAgree||this.state.loadingDisagree,id:"acceptTerms",onClick:this.handleAcceptTerms,type:"submit"},this.state.loadingAgree&&u().createElement(S.A,null),u().createElement(f.FormattedMessage,{id:"terms_of_service.agreeButton",defaultMessage:"I Agree"})),u().createElement(g.Button,{bsStyle:"default",className:"btn-quaternary",disabled:this.state.loadingAgree||this.state.loadingDisagree,id:"rejectTerms",onClick:this.handleRejectTerms,type:"reset"},this.state.loadingDisagree&&u().createElement(S.A,null),u().createElement(f.FormattedMessage,{id:"terms_of_service.disagreeButton",defaultMessage:"I Disagree"}))),Boolean(this.state.serverError)&&u().createElement("div",{className:"terms-of-service__server-error alert alert-warning"},u().createElement(b.A,null)," ",this.state.serverError))))}}O(w,"propTypes",{termsEnabled:m().bool.isRequired,actions:m().shape({getTermsOfService:m().func.isRequired,updateMyTermsOfServiceStatus:m().func.isRequired}).isRequired,onboardingFlowEnabled:m().bool.isRequired});const N=(0,s.connect)((function(e){const t=(0,n.zj)(e);return{onboardingFlowEnabled:(0,o.Pu)(e),termsEnabled:"true"===t.EnableCustomTermsOfService,emojiMap:(0,c.v6)(e)}}),(function(e){return{actions:(0,a.bindActionCreators)({getTermsOfService:i.AW,updateMyTermsOfServiceStatus:i.Zg},e)}}))(w)},3708:(e,t,r)=>{r.d(t,{A:()=>n});var s=r(97023),a=r.n(s),i=r(14778);function n(){const{formatMessage:e}=(0,i.useIntl)();return a().createElement("i",{className:"fa fa-1x fa-angle-left",title:e({id:"generic_icons.logout",defaultMessage:"Logout Icon"})})}},87064:(e,t,r)=>{r.d(t,{A:()=>d});var s=r(62688),a=r.n(s),i=r(71633),n=r.n(i),o=r(97023),c=r.n(o),l=r(14778);const m=e=>{let{additionalClassName:t}=e;const{formatMessage:r}=(0,l.useIntl)();return c().createElement("i",{className:n()("fa fa-warning",t),title:r({id:"generic_icons.warning",defaultMessage:"Warning Icon"})})};m.propTypes={additionalClassName:a().string};const d=c().memo(m)}}]); //# sourceMappingURL=4414.3d1b77f4eb703daa58ba.js.map