import React from 'react'; import { Row, Col, FormGroup, FormControl, HelpBlock, Alert } from 'react-bootstrap'; import Logo from './logo'; import AsyncButton from '../components/async-button'; import Fa from '../components/fa'; import Card from '../components/card'; import { server } from '../commons/server'; /** * Wellcome page - First page displayed under e-TB Manager first time execution */ export default class ForgotPwd extends React.Component { constructor(props) { super(props); this.submit = this.submit.bind(this); this.inputChange = this.inputChange.bind(this); this.state = { }; } submit() { const self = this; server.post('/api/pub/forgotpwd?id=' + this.state.value) .then(res => { self.setState({ fetching: null, requested: true, success: res.success }); }) .catch(() => self.setState({ fetching: null, requested: false })); this.setState({ fetching: true }); } inputChange(evt) { this.setState({ value: evt.target.value }); } /** * Render the component */ render() { const err = this.state.err; const val = this.state.value ? this.state.value : ''; const title = __('forgotpwd'); return ( { !this.state.success ?

{title}

{__('forgotpwd.msg')}

{err && {err}} { this.state.requested && {__('forgotpwd.invalid')} }
{__('action.submit')}
:

{__('global.success')}

{__('forgotpwd.success.1')}

}
); } }