renamed navlink to simple delete

This commit is contained in:
Florian Scholdei
2019-01-23 10:08:15 +01:00
parent 904f5851a7
commit cb5e74e791
6 changed files with 38 additions and 53 deletions

View File

@@ -1,20 +1,8 @@
// @flow
import React from "react";
import { translate } from "react-i18next";
import { Subtitle, DeleteButton, confirmAlert } from "@scm-manager/ui-components";
import type { User } from "@scm-manager/ui-types";
import {
Subtitle,
DeleteButton,
confirmAlert
} from "@scm-manager/ui-components";
import { connect } from "react-redux";
import {
deleteUser,
fetchUserByName,
getDeleteUserFailure,
getUserByName,
isDeleteUserPending
} from "../modules/users";
import type { History } from "history";
type Props = {
@@ -31,6 +19,10 @@ type Props = {
};
class DeleteUser extends React.Component<Props> {
static defaultProps = {
confirmDialog: true
};
userDeleted = () => {
this.props.history.push("/users");
};
@@ -39,10 +31,6 @@ class DeleteUser extends React.Component<Props> {
this.props.deleteUser(user, this.userDeleted);
};
static defaultProps = {
confirmDialog: true
};
deleteUser = () => {
this.props.deleteUser(this.props.user);
};