mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-10-30 18:15:52 +01:00 
			
		
		
		
	merge with branch 2.0.0-m3
This commit is contained in:
		| @@ -7,9 +7,11 @@ import { | ||||
|   getRepository, | ||||
|   isFetchRepoPending | ||||
| } from "../modules/repos"; | ||||
|  | ||||
| import { connect } from "react-redux"; | ||||
| import { Route, Switch } from "react-router-dom"; | ||||
| import type { Repository } from "@scm-manager/ui-types"; | ||||
|  | ||||
| import { | ||||
|   ErrorPage, | ||||
|   Loading, | ||||
| @@ -26,8 +28,12 @@ import Permissions from "../permissions/containers/Permissions"; | ||||
|  | ||||
| import type { History } from "history"; | ||||
| import EditNavLink from "../components/EditNavLink"; | ||||
| import BranchRoot from "./BranchRoot"; | ||||
|  | ||||
| import BranchRoot from "./ChangesetsRoot"; | ||||
| import ChangesetView from "./ChangesetView"; | ||||
| import PermissionsNavLink from "../components/PermissionsNavLink"; | ||||
| import Sources from "../sources/containers/Sources"; | ||||
| import RepositoryNavLink from "../components/RepositoryNavLink"; | ||||
| import { getRepositoriesLink } from "../../modules/indexResource"; | ||||
|  | ||||
| type Props = { | ||||
| @@ -74,6 +80,11 @@ class RepositoryRoot extends React.Component<Props> { | ||||
|     this.props.deleteRepo(repository, this.deleted); | ||||
|   }; | ||||
|  | ||||
|   matchChangeset = (route: any) => { | ||||
|     const url = this.matchedUrl(); | ||||
|     return route.location.pathname.match(`${url}/changeset/`); | ||||
|   }; | ||||
|  | ||||
|   matches = (route: any) => { | ||||
|     const url = this.matchedUrl(); | ||||
|     const regex = new RegExp(`${url}(/branches)?/?[^/]*/changesets?.*`); | ||||
| @@ -121,6 +132,24 @@ class RepositoryRoot extends React.Component<Props> { | ||||
|                   /> | ||||
|                 )} | ||||
|               /> | ||||
|               <Route | ||||
|                 exact | ||||
|                 path={`${url}/changeset/:id`} | ||||
|                 render={() => <ChangesetView repository={repository} />} | ||||
|               /> | ||||
|               <Route | ||||
|                 path={`${url}/sources`} | ||||
|                 exact={true} | ||||
|                 render={() => ( | ||||
|                   <Sources repository={repository} baseUrl={`${url}/sources`} /> | ||||
|                 )} | ||||
|               /> | ||||
|               <Route | ||||
|                 path={`${url}/sources/:revision/:path*`} | ||||
|                 render={() => ( | ||||
|                   <Sources repository={repository} baseUrl={`${url}/sources`} /> | ||||
|                 )} | ||||
|               /> | ||||
|               <Route | ||||
|                 path={`${url}/changesets`} | ||||
|                 render={() => ( | ||||
| @@ -147,11 +176,20 @@ class RepositoryRoot extends React.Component<Props> { | ||||
|             <Navigation> | ||||
|               <Section label={t("repository-root.navigation-label")}> | ||||
|                 <NavLink to={url} label={t("repository-root.information")} /> | ||||
|                 <NavLink | ||||
|                   activeOnlyWhenExact={false} | ||||
|                 <RepositoryNavLink | ||||
|                   repository={repository} | ||||
|                   linkName="changesets" | ||||
|                   to={`${url}/changesets/`} | ||||
|                   label={t("repository-root.history")} | ||||
|                   activeWhenMatch={this.matches} | ||||
|                   activeOnlyWhenExact={false} | ||||
|                 /> | ||||
|                 <RepositoryNavLink | ||||
|                   repository={repository} | ||||
|                   linkName="sources" | ||||
|                   to={`${url}/sources`} | ||||
|                   label={t("repository-root.sources")} | ||||
|                   activeOnlyWhenExact={false} | ||||
|                 /> | ||||
|                 <EditNavLink repository={repository} editUrl={`${url}/edit`} /> | ||||
|                 <PermissionsNavLink | ||||
|   | ||||
		Reference in New Issue
	
	Block a user