mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
removed unnecessary stuff in reporoot
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
//@flow
|
//@flow
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {deleteRepo, fetchRepoByName, getFetchRepoFailure, getRepository, isFetchRepoPending} from "../modules/repos";
|
import {fetchRepoByName, getFetchRepoFailure, getRepository, isFetchRepoPending} from "../modules/repos";
|
||||||
|
|
||||||
import {connect} from "react-redux";
|
import {connect} from "react-redux";
|
||||||
import {Route, Switch} from "react-router-dom";
|
import {Route, Switch} from "react-router-dom";
|
||||||
@@ -32,7 +32,6 @@ type Props = {
|
|||||||
|
|
||||||
// dispatch functions
|
// dispatch functions
|
||||||
fetchRepoByName: (link: string, namespace: string, name: string) => void,
|
fetchRepoByName: (link: string, namespace: string, name: string) => void,
|
||||||
deleteRepo: (repository: Repository, () => void) => void,
|
|
||||||
|
|
||||||
// context props
|
// context props
|
||||||
t: string => string,
|
t: string => string,
|
||||||
@@ -58,14 +57,6 @@ class RepositoryRoot extends React.Component<Props> {
|
|||||||
return this.stripEndingSlash(this.props.match.url);
|
return this.stripEndingSlash(this.props.match.url);
|
||||||
};
|
};
|
||||||
|
|
||||||
deleted = () => {
|
|
||||||
this.props.history.push("/repos");
|
|
||||||
};
|
|
||||||
|
|
||||||
delete = (repository: Repository) => {
|
|
||||||
this.props.deleteRepo(repository, this.deleted);
|
|
||||||
};
|
|
||||||
|
|
||||||
matches = (route: any) => {
|
matches = (route: any) => {
|
||||||
const url = this.matchedUrl();
|
const url = this.matchedUrl();
|
||||||
const regex = new RegExp(`${url}(/branches)?/?[^/]*/changesets?.*`);
|
const regex = new RegExp(`${url}(/branches)?/?[^/]*/changesets?.*`);
|
||||||
@@ -227,9 +218,6 @@ const mapDispatchToProps = dispatch => {
|
|||||||
return {
|
return {
|
||||||
fetchRepoByName: (link: string, namespace: string, name: string) => {
|
fetchRepoByName: (link: string, namespace: string, name: string) => {
|
||||||
dispatch(fetchRepoByName(link, namespace, name));
|
dispatch(fetchRepoByName(link, namespace, name));
|
||||||
},
|
|
||||||
deleteRepo: (repository: Repository, callback: () => void) => {
|
|
||||||
dispatch(deleteRepo(repository, callback));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user