Merge heads

This commit is contained in:
Philipp Czora
2018-07-25 16:43:40 +02:00
2 changed files with 42 additions and 43 deletions

2
Jenkinsfile vendored
View File

@@ -1,7 +1,7 @@
#!groovy
// Keep the version in sync with the one used in pom.xml in order to get correct syntax completion.
@Library('github.com/cloudogu/ces-build-lib@9aadeeb')
@Library('github.com/cloudogu/ces-build-lib@59d3e94')
import com.cloudogu.ces.cesbuildlib.*
node() { // No specific label

View File

@@ -9,7 +9,6 @@ import Loading from "../../components/Loading";
type Props = {
submitForm: User => void,
user?: User,
loading?: boolean,
t: string => string
};
@@ -39,14 +38,20 @@ class UserForm extends React.Component<Props, User> {
render() {
const { t } = this.props;
const user = this.state;
if (user) {
return (
<form onSubmit={this.submit}>
let nameField = null;
if (!this.props.user) {
nameField = (
<InputField
label={t("user.name")}
onChange={this.handleUsernameChange}
value={user ? user.name : ""}
/>
);
}
return (
<form onSubmit={this.submit}>
{nameField}
<InputField
label={t("user.displayName")}
onChange={this.handleDisplayNameChange}
@@ -73,15 +78,9 @@ class UserForm extends React.Component<Props, User> {
onChange={this.handleActiveChange}
checked={user ? user.active : false}
/>
<SubmitButton
label={t("user-form.submit")}
loading={this.props.loading}
/>
<SubmitButton label={t("user-form.submit")} />
</form>
);
} else {
return <Loading />;
}
}
handleUsernameChange = (name: string) => {