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

@@ -17,7 +17,9 @@ import BranchRoot from "../branches/containers/BranchRoot";
import PermissionsNavLink from "../components/PermissionsNavLink";
import RepositoryNavLink from "../components/RepositoryNavLink";
import { getLinks, getRepositoriesLink } from "../../modules/indexResource";
import CodeSectionOverview from "../codeSection/containers/CodeSectionOverview";
import CodeOverview from "../codeSection/containers/CodeOverview";
import ChangesetView from "./ChangesetView";
import SourceExtensions from "../sources/containers/SourceExtensions";
type Props = WithTranslation & {
namespace: string;
@@ -128,9 +130,23 @@ class RepositoryRoot extends React.Component<Props> {
<Permissions namespace={this.props.repository.namespace} repoName={this.props.repository.name} />
)}
/>
<Route
exact
path={`${url}/code/changeset/:id`}
render={() => <ChangesetView repository={repository} />}
/>
<Route
path={`${url}/code/sourceext/:extension`}
exact={true}
render={() => <SourceExtensions repository={repository} />}
/>
<Route
path={`${url}/code/sourceext/:extension/:revision/:path*`}
render={() => <SourceExtensions repository={repository} />}
/>
<Route
path={`${url}/code`}
render={() => <CodeSectionOverview baseUrl={`${url}/code`} repository={repository} />}
render={() => <CodeOverview baseUrl={`${url}/code`} repository={repository} />}
/>
<Route
path={`${url}/branch/:branch`}
@@ -187,7 +203,7 @@ class RepositoryRoot extends React.Component<Props> {
}
}
const mapStateToProps = (state, ownProps) => {
const mapStateToProps = (state: any, ownProps: Props) => {
const { namespace, name } = ownProps.match.params;
const repository = getRepository(state, namespace, name);
const loading = isFetchRepoPending(state, namespace, name);
@@ -205,7 +221,7 @@ const mapStateToProps = (state, ownProps) => {
};
};
const mapDispatchToProps = dispatch => {
const mapDispatchToProps = (dispatch: any) => {
return {
fetchRepoByName: (link: string, namespace: string, name: string) => {
dispatch(fetchRepoByName(link, namespace, name));