email?: string;
login: string;
name?: string;
- scmAccount?: string;
+ scmAccount: string[];
}): Promise<User> {
- return postJSON('/api/users/update', data);
+ return postJSON('/api/users/update', {
+ ...data,
+ scmAccount: data.scmAccount.length > 0 ? data.scmAccount : ''
+ });
}
export function deactivateUser(data: { login: string }): Promise<User> {
email: this.state.email,
login: this.state.login,
name: this.state.name,
- scmAccount: uniq(this.state.scmAccounts).join(',')
+ scmAccount: uniq(this.state.scmAccounts)
}).then(() => {
this.props.onUpdateUsers();
this.props.onClose();
/>
))}
<div className="spacer-bottom">
- <Button onClick={this.handleAddScmAccount} type="reset">
+ <Button className="js-scm-account-add" onClick={this.handleAddScmAccount}>
{translate('add_verb')}
</Button>
</div>
render() {
return (
- <div>
+ <div className="js-scm-account">
<input
maxLength={255}
onChange={this.handleChange}
const { scmAccounts } = this.props;
const limit = scmAccounts.length > SCM_LIMIT ? SCM_LIMIT - 1 : SCM_LIMIT;
return (
- <ul>
+ <ul className="js-scm-accounts">
{scmAccounts.slice(0, limit).map((scmAccount, idx) => (
<li className="little-spacer-bottom" key={idx}>
{scmAccount}