diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-12-01 12:17:27 +0100 |
---|---|---|
committer | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-12-01 13:47:16 +0100 |
commit | da198c7706fbc244e644665a4e9b5026e929d9de (patch) | |
tree | 873fc7e1ab44e94fd2a75c434e398f3b7e968064 | |
parent | eb91fef70101f1059685c3547b4d0f74315a395e (diff) | |
download | sonarqube-da198c7706fbc244e644665a4e9b5026e929d9de.tar.gz sonarqube-da198c7706fbc244e644665a4e9b5026e929d9de.zip |
Fix issue in users admin when editing user without scm accounts
-rw-r--r-- | server/sonar-web/src/main/js/api/users.ts | 4 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/users/components/UserForm.tsx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/api/users.ts b/server/sonar-web/src/main/js/api/users.ts index f78343b5969..d04b71bcd55 100644 --- a/server/sonar-web/src/main/js/api/users.ts +++ b/server/sonar-web/src/main/js/api/users.ts @@ -33,7 +33,7 @@ export interface User { name: string; active: boolean; email?: string; - scmAccounts: string[]; + scmAccounts?: string[]; groups?: string[]; tokensCount?: number; local: boolean; @@ -90,7 +90,7 @@ export function updateUser(data: { email?: string; login: string; name?: string; - scmAccount: string[]; + scmAccount?: string; }): Promise<User> { return postJSON('/api/users/update', data); } diff --git a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx index 292d13f85c8..500594e7413 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx @@ -54,7 +54,7 @@ export default class UserForm extends React.PureComponent<Props, State> { login: user.login, name: user.name, password: '', - scmAccounts: user.scmAccounts, + scmAccounts: user.scmAccounts || [], submitting: false }; } else { @@ -124,7 +124,7 @@ export default class UserForm extends React.PureComponent<Props, State> { email: this.state.email || undefined, login: this.state.login, name: this.state.name, - scmAccount: uniq(this.state.scmAccounts) + scmAccount: uniq(this.state.scmAccounts).join(',') }).then(() => { this.props.onUpdateUsers(); this.props.onClose(); |