mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 01:15:44 +01:00
Added tests, fixed edit/add users
This commit is contained in:
@@ -5,10 +5,10 @@ import UserForm from "./UserForm";
|
||||
import type { User } from "../types/User";
|
||||
|
||||
import { addUser } from "../modules/users";
|
||||
import { Route, Link } from "react-router-dom";
|
||||
|
||||
type Props = {
|
||||
addUser: User => void
|
||||
addUser: User => void,
|
||||
loading?: boolean
|
||||
};
|
||||
|
||||
class AddUser extends React.Component<Props> {
|
||||
@@ -17,7 +17,10 @@ class AddUser extends React.Component<Props> {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<UserForm submitForm={user => addUser(user)} />
|
||||
<UserForm
|
||||
submitForm={user => addUser(user)}
|
||||
loading={this.props.loading}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -32,6 +35,11 @@ const mapDispatchToProps = dispatch => {
|
||||
};
|
||||
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
if (state.users && state.users.users) {
|
||||
return {
|
||||
loading: state.users.users.loading
|
||||
};
|
||||
}
|
||||
return {};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user