mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
don't unmount create form on error
This commit is contained in:
@@ -8,6 +8,7 @@ type Props = {
|
|||||||
subtitle?: string,
|
subtitle?: string,
|
||||||
loading?: boolean,
|
loading?: boolean,
|
||||||
error?: Error,
|
error?: Error,
|
||||||
|
showContentOnError?: boolean,
|
||||||
children: React.Node
|
children: React.Node
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -35,8 +36,8 @@ class Page extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderContent() {
|
renderContent() {
|
||||||
const { loading, children, error } = this.props;
|
const { loading, children, showContentOnError, error } = this.props;
|
||||||
if (error) {
|
if (error && !showContentOnError) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (loading) {
|
if (loading) {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class AddUser extends React.Component<Props> {
|
|||||||
title={t("add-user.title")}
|
title={t("add-user.title")}
|
||||||
subtitle={t("add-user.subtitle")}
|
subtitle={t("add-user.subtitle")}
|
||||||
error={error}
|
error={error}
|
||||||
|
showContentOnError={true}
|
||||||
>
|
>
|
||||||
<UserForm
|
<UserForm
|
||||||
submitForm={user => this.createUser(user)}
|
submitForm={user => this.createUser(user)}
|
||||||
|
|||||||
Reference in New Issue
Block a user