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 #!groovy
// Keep the version in sync with the one used in pom.xml in order to get correct syntax completion. // 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.* import com.cloudogu.ces.cesbuildlib.*
node() { // No specific label node() { // No specific label

View File

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