Merge branch 'release/1.0.0' into bugfix/profile-form-validation
This commit is contained in:
commit
47993da131
@ -101,13 +101,38 @@ class UpdateUserForm extends React.Component {
|
|||||||
this.onSelectGroups = this.onSelectGroups.bind(this);
|
this.onSelectGroups = this.onSelectGroups.bind(this);
|
||||||
this.onRemoveGroup = this.onRemoveGroup.bind(this);
|
this.onRemoveGroup = this.onRemoveGroup.bind(this);
|
||||||
|
|
||||||
|
this.handleWindowBeforeUnload = this.handleWindowBeforeUnload.bind(this);
|
||||||
|
|
||||||
this.mainFieldsContainerRef = React.createRef();
|
this.mainFieldsContainerRef = React.createRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.setIsEditTargetUser(true);
|
this.props.setIsEditTargetUser(true);
|
||||||
|
|
||||||
|
this.unblock = this.props.history.block((targetLocation) => {
|
||||||
|
if (this.props.isEdit) {
|
||||||
|
this.props.setIsVisibleDataLossDialog(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener("beforeunload", this.handleWindowBeforeUnload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
this.unblock();
|
||||||
|
window.removeEventListener("beforeunload", this.handleWindowBeforeUnload);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleWindowBeforeUnload = (e) => {
|
||||||
|
if (this.props.isEdit) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.returnValue = "";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState) {
|
componentDidUpdate(prevProps, prevState) {
|
||||||
if (this.props.match.params.userId !== prevProps.match.params.userId) {
|
if (this.props.match.params.userId !== prevProps.match.params.userId) {
|
||||||
this.setState(this.mapPropsToState(this.props));
|
this.setState(this.mapPropsToState(this.props));
|
||||||
@ -341,6 +366,8 @@ class UpdateUserForm extends React.Component {
|
|||||||
personal,
|
personal,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
|
this.unblock();
|
||||||
|
|
||||||
if (personal) {
|
if (personal) {
|
||||||
history.push(combineUrl(AppServerConfig.proxyURL, "/my"));
|
history.push(combineUrl(AppServerConfig.proxyURL, "/my"));
|
||||||
} else if (isEditTargetUser || document.referrer) {
|
} else if (isEditTargetUser || document.referrer) {
|
||||||
|
@ -21,6 +21,10 @@ const config = {
|
|||||||
entry: "./src/index",
|
entry: "./src/index",
|
||||||
mode: "development",
|
mode: "development",
|
||||||
|
|
||||||
|
stats: {
|
||||||
|
errorDetails: true,
|
||||||
|
},
|
||||||
|
|
||||||
devServer: {
|
devServer: {
|
||||||
devMiddleware: {
|
devMiddleware: {
|
||||||
publicPath: homepage,
|
publicPath: homepage,
|
||||||
@ -38,7 +42,9 @@ const config = {
|
|||||||
// errors: true,
|
// errors: true,
|
||||||
// warnings: true,
|
// warnings: true,
|
||||||
// }
|
// }
|
||||||
overlay: true,
|
overlay: {
|
||||||
|
warnings: false,
|
||||||
|
},
|
||||||
progress: true,
|
progress: true,
|
||||||
},
|
},
|
||||||
port: 5001,
|
port: 5001,
|
||||||
|
Loading…
Reference in New Issue
Block a user