upstream sync
This commit is contained in:
@@ -2340,19 +2340,19 @@ html.static.boxed {
|
||||
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
src: url(/assets/./fonts/646474e48f4c1ea783f43ac5e41fd111.woff2) format("woff2"), url(/assets/./fonts/374df2a818582454b6e6832804e52f86.woff) format("woff");
|
||||
src: url(/fonts/lato/lato-regular-webfont.woff2) format("woff2"), url(/fonts/lato/lato-regular-webfont.woff) format("woff");
|
||||
font-weight: bold;
|
||||
font-style: normal; }
|
||||
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
src: url(/assets/./fonts/5fa6d7ddc0a0d53311752343d7176d70.woff2) format("woff2"), url(/assets/./fonts/c53136193516ed2d4fac337d1dc6965a.woff) format("woff");
|
||||
src: url(/assets/./fonts/lato/lato-bolditalic-webfont.woff2) format("woff2"), url(/assets/./fonts/lato/lato-bolditalic-webfont.woff) format("woff");
|
||||
font-weight: bold;
|
||||
font-style: italic; }
|
||||
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
src: url(/assets/./fonts/9bcf055a732c0b22d2279ba79e20c577.woff2) format("woff2"), url(/assets/./fonts/c8eef482ac448a91ecca9d008634c044.woff) format("woff");
|
||||
src: url(/assets/./fonts/lato/lato-italic-webfont.woff2) format("woff2"), url(/assets/./fonts/lato/lato-italic-webfont.woff) format("woff");
|
||||
font-weight: normal;
|
||||
font-style: italic; }
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ import Instance from '../../../../../../../components/Connection';
|
||||
import Checkbox from 'material-ui/Checkbox';
|
||||
import Popover from 'material-ui/Popover';
|
||||
|
||||
const ADDRESS_TYPE_HOME = "home";
|
||||
|
||||
let DateTimeFormat;
|
||||
|
||||
|
||||
@@ -469,6 +471,16 @@ class VerticalNonLinear extends React.Component {
|
||||
if (user.useruuid !== loggedUser.useruuid) {
|
||||
Instance.getRawConn().get(`/v1/nemt/users/member/${user.useruuid}`)
|
||||
.then(function (res) {
|
||||
let userHomeAddress = null;
|
||||
res.data.addresses.forEach(address => {
|
||||
if (address.address_type === ADDRESS_TYPE_HOME) {
|
||||
userHomeAddress = address;
|
||||
}
|
||||
});
|
||||
if (userHomeAddress != null) {
|
||||
userHomeAddress.name = "Home";
|
||||
state.handlePickupChanged(userHomeAddress, state);
|
||||
}
|
||||
state.setState(Object.assign(state.state, { user: res.data, showUserSelection: true, userSelectionText: `${res.data.member} - ${res.data.name}` }));
|
||||
})
|
||||
.catch(err => {
|
||||
@@ -894,7 +906,17 @@ class VerticalNonLinear extends React.Component {
|
||||
|
||||
if (this.state.showUserSelection && this.state.users.length > 0) {
|
||||
const handleAutocomplete = (u) => {
|
||||
state.setState(Object.assign(state.state, { user: u, userSelectionText: u.userdata }));
|
||||
let userHomeAddress = null;
|
||||
u.addresses.forEach(address => {
|
||||
if (address.address_type === ADDRESS_TYPE_HOME) {
|
||||
userHomeAddress = address;
|
||||
}
|
||||
});
|
||||
if (userHomeAddress != null) {
|
||||
userHomeAddress.name = "Home";
|
||||
state.handlePickupChanged(userHomeAddress,state);
|
||||
}
|
||||
state.setState(Object.assign(state.state, { user: u, userSelectionText: u.userdata }));
|
||||
}
|
||||
const datasourceConfig = { text: 'userdata', value: 'useruuid' }
|
||||
userSelection = (
|
||||
|
||||
@@ -47,7 +47,9 @@ class SignUp extends React.Component {
|
||||
"role": { name: "", key: "SP", desc: "" },
|
||||
"profiles": [],
|
||||
"types": [],
|
||||
"organizations": []
|
||||
"organizations": [],
|
||||
showValidationErrors : false,
|
||||
validationErrors: []
|
||||
}
|
||||
|
||||
this.buttonValidated = this.buttonValidated.bind(this);
|
||||
@@ -226,12 +228,42 @@ class SignUp extends React.Component {
|
||||
localStorage.removeItem('loggedUser');
|
||||
location.href = '/#/login';
|
||||
}).catch(function (err) {
|
||||
alert('Error to log in: ' + err.message);
|
||||
if (err.response.status === 422){
|
||||
//Unprocessable Entity (validation failed)
|
||||
state.setState(Object.assign(state.state, {
|
||||
showValidationErrors:true,
|
||||
validationErrors:err.response.data.data
|
||||
}));
|
||||
}else{
|
||||
alert('Error to log in: ' + err.message);
|
||||
}
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
handleDismiss(){
|
||||
this.setState(Object.assign(this.state, { showErrorMessage: false }));
|
||||
}
|
||||
|
||||
render() {
|
||||
let validationErrors = null;
|
||||
if (this.state.showValidationErrors){
|
||||
validationErrors = (
|
||||
<ul>
|
||||
{this.state.validationErrors.map(errorMessage=>{
|
||||
const oneValidationMessage = (<li>{errorMessage.message}</li>);
|
||||
const oneValidationMessageWithTab = (<span><li style={{marginLeft:2 + "em"}}>{errorMessage.message}</li></span>);
|
||||
|
||||
if (errorMessage.field_name === "password-tab"){
|
||||
return oneValidationMessageWithTab;
|
||||
} else{
|
||||
return oneValidationMessage;
|
||||
}
|
||||
})}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="body-inner">
|
||||
|
||||
@@ -334,6 +366,10 @@ class SignUp extends React.Component {
|
||||
<div className="form-group">
|
||||
<p className="text-small">By clicking on sign up, you agree to <a href="javascript:;"><i>terms</i></a> and <a href="javascript:;"><i>privacy policy</i></a></p>
|
||||
</div>
|
||||
<div className="divider" />
|
||||
<div className="form-group">
|
||||
{validationErrors}
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user