corrected subtitle in create/edit

This commit is contained in:
Florian Scholdei
2019-01-23 14:48:29 +01:00
parent 0b4c7148e9
commit 4b24c8db06
3 changed files with 50 additions and 41 deletions

View File

@@ -72,12 +72,13 @@ class GroupForm extends React.Component<Props, State> {
};
render() {
const { t, loading } = this.props;
const { loading, t } = this.props;
const { group } = this.state;
let firstField = null;
let nameField = null;
let subtitle = null;
if (!this.props.group) {
// create new group
firstField = (
nameField = (
<InputField
label={t("group.name")}
errorMessage={t("groupForm.nameError")}
@@ -89,12 +90,14 @@ class GroupForm extends React.Component<Props, State> {
);
} else {
// edit existing group
firstField = <Subtitle subtitle={t("groupForm.subtitle")} />;
subtitle = <Subtitle subtitle={t("groupForm.subtitle")} />;
}
return (
<>
{subtitle}
<form onSubmit={this.submit}>
{firstField}
{nameField}
<Textarea
label={t("group.description")}
errorMessage={t("groupForm.descriptionError")}
@@ -129,6 +132,7 @@ class GroupForm extends React.Component<Props, State> {
loading={loading}
/>
</form>
</>
);
}

View File

@@ -88,7 +88,9 @@ class UserForm extends React.Component<Props, State> {
let nameField = null;
let passwordChangeField = null;
let subtitle = null;
if (!this.props.user) {
// create new user
nameField = (
<InputField
label={t("user.name")}
@@ -103,10 +105,13 @@ class UserForm extends React.Component<Props, State> {
passwordChangeField = (
<PasswordConfirmation passwordChanged={this.handlePasswordChange} />
);
} else {
// edit existing user
subtitle = <Subtitle subtitle={t("userForm.subtitle")} />;
}
return (
<>
<Subtitle subtitle={t("userForm.subtitle")} />
{subtitle}
<form onSubmit={this.submit}>
<div className="columns">
<div className="column is-half">

View File

@@ -92,7 +92,7 @@ class SingleUser extends React.Component<Props> {
component={() => <SetUserPassword user={user} />}
/>
<Route
path={`${url}/permissions`}
path={`${url}/settings/permissions`}
component={() => (
<SetPermissions
selectedPermissionsLink={user._links.permissions}