mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
Minor fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import type {Branch} from "packages/ui-types/src/index";
|
import type {Branch} from "@scm-manager/ui-types";
|
||||||
import injectSheet from "react-jss";
|
import injectSheet from "react-jss";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import DropDown from "./forms/DropDown";
|
import DropDown from "./forms/DropDown";
|
||||||
@@ -35,7 +35,7 @@ class BranchSelector extends React.Component<Props, State> {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const selectedBranch = this.props.branches.find(branch => branch.name === this.props.selectedBranch);
|
const selectedBranch = this.props.branches.find(branch => branch.name === this.props.selectedBranch);
|
||||||
this.setState({ selectedBranch })
|
this.setState({ selectedBranch });
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import type {Branch, Repository} from "@scm-manager/ui-types";
|
import type { Branch, Repository } from "@scm-manager/ui-types";
|
||||||
import {translate} from "react-i18next";
|
import { translate } from "react-i18next";
|
||||||
import {Route, withRouter} from "react-router-dom";
|
import { Route, withRouter } from "react-router-dom";
|
||||||
import Changesets from "./Changesets";
|
import Changesets from "./Changesets";
|
||||||
import {connect} from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import {BranchSelector, ErrorNotification, Loading} from "@scm-manager/ui-components";
|
import {
|
||||||
import {fetchBranches, getBranches, getFetchBranchesFailure, isFetchBranchesPending} from "../modules/branches";
|
BranchSelector,
|
||||||
import {compose} from "redux";
|
ErrorNotification,
|
||||||
|
Loading
|
||||||
|
} from "@scm-manager/ui-components";
|
||||||
|
import {
|
||||||
|
fetchBranches,
|
||||||
|
getBranches,
|
||||||
|
getFetchBranchesFailure,
|
||||||
|
isFetchBranchesPending
|
||||||
|
} from "../modules/branches";
|
||||||
|
import { compose } from "redux";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
repository: Repository,
|
repository: Repository,
|
||||||
@@ -27,7 +36,8 @@ type Props = {
|
|||||||
|
|
||||||
// Context props
|
// Context props
|
||||||
history: any, // TODO flow type
|
history: any, // TODO flow type
|
||||||
match: any
|
match: any,
|
||||||
|
t: string => string
|
||||||
};
|
};
|
||||||
|
|
||||||
class BranchRoot extends React.Component<Props> {
|
class BranchRoot extends React.Component<Props> {
|
||||||
|
|||||||
@@ -1,15 +1,21 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {connect} from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import {withRouter} from "react-router-dom";
|
import { withRouter } from "react-router-dom";
|
||||||
import type {Branch, Repository} from "@scm-manager/ui-types";
|
import type { Branch, Repository } from "@scm-manager/ui-types";
|
||||||
import FileTree from "../components/FileTree";
|
import FileTree from "../components/FileTree";
|
||||||
import {ErrorNotification, Loading} from "@scm-manager/ui-components";
|
import { ErrorNotification, Loading } from "@scm-manager/ui-components";
|
||||||
import BranchSelector from "../../../../../scm-ui-components/packages/ui-components/src/BranchSelector";
|
import BranchSelector from "../../../../../scm-ui-components/packages/ui-components/src/BranchSelector";
|
||||||
import {fetchBranches, getBranches, getFetchBranchesFailure, isFetchBranchesPending} from "../../modules/branches";
|
import { translate } from "react-i18next";
|
||||||
import {compose} from "redux";
|
import {
|
||||||
|
fetchBranches,
|
||||||
|
getBranches,
|
||||||
|
getFetchBranchesFailure,
|
||||||
|
isFetchBranchesPending
|
||||||
|
} from "../../modules/branches";
|
||||||
|
import { compose } from "redux";
|
||||||
import Content from "./Content";
|
import Content from "./Content";
|
||||||
import {fetchSources, isDirectory} from "../modules/sources";
|
import { fetchSources, isDirectory } from "../modules/sources";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
repository: Repository,
|
repository: Repository,
|
||||||
@@ -27,7 +33,8 @@ type Props = {
|
|||||||
|
|
||||||
// Context props
|
// Context props
|
||||||
history: any,
|
history: any,
|
||||||
match: any
|
match: any,
|
||||||
|
t: string => string
|
||||||
};
|
};
|
||||||
|
|
||||||
class Sources extends React.Component<Props> {
|
class Sources extends React.Component<Props> {
|
||||||
@@ -104,13 +111,14 @@ class Sources extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderBranchSelector = () => {
|
renderBranchSelector = () => {
|
||||||
const { branches, revision } = this.props;
|
const { branches, revision, t } = this.props;
|
||||||
|
|
||||||
if (branches) {
|
if (branches) {
|
||||||
return (
|
return (
|
||||||
<BranchSelector
|
<BranchSelector
|
||||||
branches={branches}
|
branches={branches}
|
||||||
selectedBranch={revision}
|
selectedBranch={revision}
|
||||||
|
label={t("branch-selector.label")}
|
||||||
selected={(b: Branch) => {
|
selected={(b: Branch) => {
|
||||||
this.branchSelected(b);
|
this.branchSelected(b);
|
||||||
}}
|
}}
|
||||||
@@ -155,6 +163,7 @@ const mapDispatchToProps = dispatch => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
|
translate("repos"),
|
||||||
withRouter,
|
withRouter,
|
||||||
connect(
|
connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
|
|||||||
Reference in New Issue
Block a user