fix routes for sources and changesets // fix typing errors

This commit is contained in:
Eduard Heimbuch
2020-01-08 10:31:43 +01:00
parent 20c00e7222
commit c73e85e3d6
13 changed files with 130 additions and 257 deletions

View File

@@ -73,7 +73,7 @@ class BranchRoot extends React.Component<Props> {
}
}
const mapStateToProps = (state, ownProps) => {
const mapStateToProps = (state: any, ownProps: Props) => {
const { repository } = ownProps;
const branchName = decodeURIComponent(ownProps.match.params.branch);
const branch = getBranch(state, repository, branchName);
@@ -88,7 +88,7 @@ const mapStateToProps = (state, ownProps) => {
};
};
const mapDispatchToProps = dispatch => {
const mapDispatchToProps = (dispatch: any) => {
return {
fetchBranch: (repository: Repository, branchName: string) => {
dispatch(fetchBranch(repository, branchName));

View File

@@ -18,6 +18,7 @@ import {
isFetchBranchesPending,
getFetchBranchesFailure
} from "../modules/branches";
import { compose } from "redux";
type Props = WithTranslation & {
loading?: boolean;
@@ -92,7 +93,7 @@ class CreateBranch extends React.Component<Props> {
}
}
const mapDispatchToProps = dispatch => {
const mapDispatchToProps = (dispatch: any) => {
return {
fetchBranches: (repository: Repository) => {
dispatch(fetchBranches(repository));
@@ -111,7 +112,7 @@ const mapDispatchToProps = dispatch => {
};
};
const mapStateToProps = (state, ownProps) => {
const mapStateToProps = (state: any, ownProps: Props) => {
const { repository } = ownProps;
const loading = isFetchBranchesPending(state, repository) || isCreateBranchPending(state, repository);
const error = getFetchBranchesFailure(state, repository) || getCreateBranchFailure(state, repository);
@@ -126,9 +127,8 @@ const mapStateToProps = (state, ownProps) => {
};
};
export default withRouter(
connect(
mapStateToProps,
mapDispatchToProps
)(withTranslation("repos")(CreateBranch))
);
export default compose(
withTranslation("repos"),
connect(mapStateToProps, mapDispatchToProps),
withRouter
)(CreateBranch);