| 
									
										
										
										
											2020-03-23 15:35:58 +01:00
										 |  |  | /* | 
					
						
							|  |  |  |  * MIT License | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Copyright (c) 2020-present Cloudogu GmbH and Contributors | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Permission is hereby granted, free of charge, to any person obtaining a copy | 
					
						
							|  |  |  |  * of this software and associated documentation files (the "Software"), to deal | 
					
						
							|  |  |  |  * in the Software without restriction, including without limitation the rights | 
					
						
							|  |  |  |  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 
					
						
							|  |  |  |  * copies of the Software, and to permit persons to whom the Software is | 
					
						
							|  |  |  |  * furnished to do so, subject to the following conditions: | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The above copyright notice and this permission notice shall be included in all | 
					
						
							|  |  |  |  * copies or substantial portions of the Software. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 
					
						
							|  |  |  |  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 
					
						
							|  |  |  |  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 
					
						
							|  |  |  |  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 
					
						
							|  |  |  |  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | 
					
						
							|  |  |  |  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 
					
						
							|  |  |  |  * SOFTWARE. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  | import React, { useEffect, useState } from "react"; | 
					
						
							| 
									
										
										
										
											2021-12-09 09:12:02 +01:00
										 |  |  | import { match as Match } from "react-router"; | 
					
						
							|  |  |  | import { Link as RouteLink, Redirect, Route, RouteProps, Switch, useRouteMatch } from "react-router-dom"; | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  | import { useTranslation } from "react-i18next"; | 
					
						
							| 
									
										
										
										
											2022-03-29 15:04:14 +02:00
										 |  |  | import { binder, ExtensionPoint, extensionPoints } from "@scm-manager/ui-extensions"; | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  | import { Changeset, Link } from "@scm-manager/ui-types"; | 
					
						
							| 
									
										
										
										
											2020-02-25 09:49:23 +01:00
										 |  |  | import { | 
					
						
							| 
									
										
										
										
											2020-08-10 20:48:08 +02:00
										 |  |  |   CustomQueryFlexWrappedColumns, | 
					
						
							| 
									
										
										
										
											2022-02-18 14:48:21 +01:00
										 |  |  |   devices, | 
					
						
							| 
									
										
										
										
											2020-02-26 15:45:24 +01:00
										 |  |  |   ErrorPage, | 
					
						
							| 
									
										
										
										
											2020-12-16 10:58:29 +01:00
										 |  |  |   FileControlFactory, | 
					
						
							| 
									
										
										
										
											2021-04-21 10:09:23 +02:00
										 |  |  |   HealthCheckFailureDetail, | 
					
						
							| 
									
										
										
										
											2020-12-16 10:58:29 +01:00
										 |  |  |   JumpToFileButton, | 
					
						
							| 
									
										
										
										
											2020-02-26 15:45:24 +01:00
										 |  |  |   Loading, | 
					
						
							|  |  |  |   NavLink, | 
					
						
							|  |  |  |   Page, | 
					
						
							| 
									
										
										
										
											2020-03-25 15:35:46 +01:00
										 |  |  |   PrimaryContentColumn, | 
					
						
							| 
									
										
										
										
											2021-07-28 15:04:00 +02:00
										 |  |  |   RepositoryFlags, | 
					
						
							| 
									
										
										
										
											2020-03-11 15:47:40 +01:00
										 |  |  |   SecondaryNavigation, | 
					
						
							| 
									
										
										
										
											2020-08-10 20:48:08 +02:00
										 |  |  |   SecondaryNavigationColumn, | 
					
						
							|  |  |  |   StateMenuContextProvider, | 
					
						
							| 
									
										
										
										
											2020-12-16 10:58:29 +01:00
										 |  |  |   SubNavigation, | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  |   urls, | 
					
						
							| 
									
										
										
										
											2020-02-26 15:45:24 +01:00
										 |  |  | } from "@scm-manager/ui-components"; | 
					
						
							| 
									
										
										
										
											2019-10-20 18:02:52 +02:00
										 |  |  | import RepositoryDetails from "../components/RepositoryDetails"; | 
					
						
							|  |  |  | import EditRepo from "./EditRepo"; | 
					
						
							|  |  |  | import BranchesOverview from "../branches/containers/BranchesOverview"; | 
					
						
							|  |  |  | import CreateBranch from "../branches/containers/CreateBranch"; | 
					
						
							|  |  |  | import Permissions from "../permissions/containers/Permissions"; | 
					
						
							|  |  |  | import EditRepoNavLink from "../components/EditRepoNavLink"; | 
					
						
							|  |  |  | import BranchRoot from "../branches/containers/BranchRoot"; | 
					
						
							|  |  |  | import PermissionsNavLink from "../components/PermissionsNavLink"; | 
					
						
							|  |  |  | import RepositoryNavLink from "../components/RepositoryNavLink"; | 
					
						
							| 
									
										
										
										
											2020-01-08 10:31:43 +01:00
										 |  |  | import CodeOverview from "../codeSection/containers/CodeOverview"; | 
					
						
							|  |  |  | import ChangesetView from "./ChangesetView"; | 
					
						
							|  |  |  | import SourceExtensions from "../sources/containers/SourceExtensions"; | 
					
						
							| 
									
										
										
										
											2020-09-16 12:45:22 +02:00
										 |  |  | import TagsOverview from "../tags/container/TagsOverview"; | 
					
						
							| 
									
										
										
										
											2022-01-20 11:00:49 +01:00
										 |  |  | import CompareRoot from "../compare/CompareRoot"; | 
					
						
							| 
									
										
										
										
											2020-09-16 12:45:22 +02:00
										 |  |  | import TagRoot from "../tags/container/TagRoot"; | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  | import { useIndexLinks, useNamespaceAndNameContext, useRepository } from "@scm-manager/ui-api"; | 
					
						
							| 
									
										
										
										
											2021-06-04 14:05:47 +02:00
										 |  |  | import styled from "styled-components"; | 
					
						
							| 
									
										
										
										
											2020-02-25 09:49:23 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-09 09:05:13 +02:00
										 |  |  | const TagGroup = styled.span`
 | 
					
						
							| 
									
										
										
										
											2021-06-04 14:05:47 +02:00
										 |  |  |   & > * { | 
					
						
							|  |  |  |     margin-right: 0.25rem; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2021-04-21 10:09:23 +02:00
										 |  |  | `;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-18 14:48:21 +01:00
										 |  |  | const MobileWrapped = styled.div`
 | 
					
						
							|  |  |  |   @media screen and (max-width: ${devices.mobile.width}px) { | 
					
						
							|  |  |  |     margin-left: auto; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | `;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  | type UrlParams = { | 
					
						
							|  |  |  |   namespace: string; | 
					
						
							|  |  |  |   name: string; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-09 09:12:02 +01:00
										 |  |  | const useRepositoryFromUrl = (match: Match<UrlParams>) => { | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |   const { namespace, name } = match.params; | 
					
						
							|  |  |  |   const { data: repository, ...rest } = useRepository(namespace, name); | 
					
						
							|  |  |  |   return { | 
					
						
							|  |  |  |     repository, | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  |     ...rest, | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |   }; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const RepositoryRoot = () => { | 
					
						
							|  |  |  |   const match = useRouteMatch<UrlParams>(); | 
					
						
							|  |  |  |   const { isLoading, error, repository } = useRepositoryFromUrl(match); | 
					
						
							|  |  |  |   const indexLinks = useIndexLinks(); | 
					
						
							| 
									
										
										
										
											2021-04-21 10:09:23 +02:00
										 |  |  |   const [showHealthCheck, setShowHealthCheck] = useState(false); | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |   const [t] = useTranslation("repos"); | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  |   const context = useNamespaceAndNameContext(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   useEffect(() => { | 
					
						
							|  |  |  |     if (repository) { | 
					
						
							|  |  |  |       context.setNamespace(repository.namespace); | 
					
						
							|  |  |  |       context.setName(repository.name); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return () => { | 
					
						
							|  |  |  |       context.setNamespace(""); | 
					
						
							|  |  |  |       context.setName(""); | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }, [repository, context]); | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   if (error) { | 
					
						
							|  |  |  |     return ( | 
					
						
							|  |  |  |       <ErrorPage title={t("repositoryRoot.errorTitle")} subtitle={t("repositoryRoot.errorSubtitle")} error={error} /> | 
					
						
							|  |  |  |     ); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if (!repository || isLoading) { | 
					
						
							|  |  |  |     return <Loading />; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const url = urls.matchedUrlFromMatch(match); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // props used for extensions
 | 
					
						
							|  |  |  |   // most of the props required for compatibility
 | 
					
						
							|  |  |  |   const props = { | 
					
						
							|  |  |  |     namespace: repository.namespace, | 
					
						
							|  |  |  |     name: repository.name, | 
					
						
							|  |  |  |     repository: repository, | 
					
						
							|  |  |  |     loading: isLoading, | 
					
						
							|  |  |  |     error, | 
					
						
							|  |  |  |     repoLink: (indexLinks.repositories as Link)?.href, | 
					
						
							|  |  |  |     indexLinks, | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  |     match, | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-29 15:04:14 +02:00
										 |  |  |   const redirectUrlFactory = binder.getExtension<extensionPoints.RepositoryRedirect>("repository.redirect", props); | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |   let redirectedUrl; | 
					
						
							|  |  |  |   if (redirectUrlFactory) { | 
					
						
							|  |  |  |     redirectedUrl = url + redirectUrlFactory(props); | 
					
						
							|  |  |  |   } else { | 
					
						
							| 
									
										
										
										
											2021-07-28 15:04:00 +02:00
										 |  |  |     redirectedUrl = url + "/code/sources/"; | 
					
						
							| 
									
										
										
										
											2018-08-01 18:23:16 +02:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  |   const fileControlFactoryFactory: (changeset: Changeset) => FileControlFactory = (changeset) => (file) => { | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |     const baseUrl = `${url}/code/sources`; | 
					
						
							|  |  |  |     const sourceLink = file.newPath && { | 
					
						
							|  |  |  |       url: `${baseUrl}/${changeset.id}/${file.newPath}/`, | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  |       label: t("diff.jumpToSource"), | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |     }; | 
					
						
							|  |  |  |     const targetLink = file.oldPath && | 
					
						
							|  |  |  |       changeset._embedded?.parents?.length === 1 && { | 
					
						
							|  |  |  |         url: `${baseUrl}/${changeset._embedded.parents[0].id}/${file.oldPath}`, | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  |         label: t("diff.jumpToTarget"), | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |       }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const links = []; | 
					
						
							|  |  |  |     switch (file.type) { | 
					
						
							|  |  |  |       case "add": | 
					
						
							|  |  |  |         if (sourceLink) { | 
					
						
							|  |  |  |           links.push(sourceLink); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |       case "delete": | 
					
						
							|  |  |  |         if (targetLink) { | 
					
						
							|  |  |  |           links.push(targetLink); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |       default: | 
					
						
							|  |  |  |         if (targetLink && sourceLink) { | 
					
						
							|  |  |  |           links.push(targetLink, sourceLink); // Target link first because its the previous file
 | 
					
						
							|  |  |  |         } else if (sourceLink) { | 
					
						
							|  |  |  |           links.push(sourceLink); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2020-06-25 09:16:19 +02:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return links ? links.map(({ url, label }) => <JumpToFileButton tooltip={label} link={url} />) : null; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const titleComponent = ( | 
					
						
							|  |  |  |     <> | 
					
						
							| 
									
										
										
										
											2021-11-16 15:14:18 +01:00
										 |  |  |       <RouteLink to={`/repos/${repository.namespace}/`} className="has-text-inherit"> | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |         {repository.namespace} | 
					
						
							|  |  |  |       </RouteLink> | 
					
						
							|  |  |  |       /{repository.name} | 
					
						
							|  |  |  |     </> | 
					
						
							|  |  |  |   ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const extensionProps = { | 
					
						
							|  |  |  |     repository, | 
					
						
							|  |  |  |     url, | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  |     indexLinks, | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-09 09:12:02 +01:00
										 |  |  |   const matchesBranches = (route: RouteProps) => { | 
					
						
							| 
									
										
										
										
											2019-03-29 13:52:19 +01:00
										 |  |  |     const regex = new RegExp(`${url}/branch/.+/info`); | 
					
						
							| 
									
										
										
										
											2021-12-09 09:12:02 +01:00
										 |  |  |     if (!route.location) { | 
					
						
							|  |  |  |       return false; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return !!route.location.pathname.match(regex); | 
					
						
							| 
									
										
										
										
											2019-03-29 10:22:54 +01:00
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-09 09:12:02 +01:00
										 |  |  |   const matchesTags = (route: RouteProps) => { | 
					
						
							| 
									
										
										
										
											2020-09-16 12:45:22 +02:00
										 |  |  |     const regex = new RegExp(`${url}/tag/.+/info`); | 
					
						
							| 
									
										
										
										
											2021-12-09 09:12:02 +01:00
										 |  |  |     if (!route.location) { | 
					
						
							|  |  |  |       return false; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return !!route.location.pathname.match(regex); | 
					
						
							| 
									
										
										
										
											2020-09-16 12:45:22 +02:00
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-09 09:12:02 +01:00
										 |  |  |   const matchesCode = (route: RouteProps) => { | 
					
						
							| 
									
										
										
										
											2020-01-07 10:30:46 +01:00
										 |  |  |     const regex = new RegExp(`${url}(/code)/.*`); | 
					
						
							| 
									
										
										
										
											2021-12-09 09:12:02 +01:00
										 |  |  |     if (!route.location) { | 
					
						
							|  |  |  |       return false; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return !!route.location.pathname.match(regex); | 
					
						
							| 
									
										
										
										
											2018-10-09 11:53:06 +02:00
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |   const getCodeLinkname = () => { | 
					
						
							| 
									
										
										
										
											2020-01-07 10:30:46 +01:00
										 |  |  |     if (repository?._links?.sources) { | 
					
						
							|  |  |  |       return "sources"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (repository?._links?.changesets) { | 
					
						
							|  |  |  |       return "changesets"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |   const evaluateDestinationForCodeLink = () => { | 
					
						
							| 
									
										
										
										
											2020-01-07 10:30:46 +01:00
										 |  |  |     if (repository?._links?.sources) { | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |       return `${url}/code/sources/`; | 
					
						
							| 
									
										
										
										
											2020-01-07 10:30:46 +01:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |     return `${url}/code/changesets`; | 
					
						
							| 
									
										
										
										
											2019-11-01 09:29:57 +01:00
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-21 10:09:23 +02:00
										 |  |  |   const modal = ( | 
					
						
							|  |  |  |     <HealthCheckFailureDetail | 
					
						
							|  |  |  |       closeFunction={() => setShowHealthCheck(false)} | 
					
						
							|  |  |  |       active={showHealthCheck} | 
					
						
							|  |  |  |       failures={repository.healthCheckFailures} | 
					
						
							|  |  |  |     /> | 
					
						
							|  |  |  |   ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |   const escapedUrl = urls.escapeUrlForRoute(url); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |   return ( | 
					
						
							|  |  |  |     <StateMenuContextProvider> | 
					
						
							|  |  |  |       <Page | 
					
						
							|  |  |  |         title={titleComponent} | 
					
						
							|  |  |  |         documentTitle={`${repository.namespace}/${repository.name}`} | 
					
						
							|  |  |  |         afterTitle={ | 
					
						
							| 
									
										
										
										
											2022-02-18 14:48:21 +01:00
										 |  |  |           <MobileWrapped className="is-flex is-align-items-center"> | 
					
						
							|  |  |  |             <ExtensionPoint name="repository.afterTitle" props={{ repository }} /> | 
					
						
							| 
									
										
										
										
											2021-09-15 17:40:08 +02:00
										 |  |  |             <TagGroup className="has-text-weight-bold"> | 
					
						
							| 
									
										
										
										
											2021-07-28 15:04:00 +02:00
										 |  |  |               <RepositoryFlags repository={repository} tooltipLocation="bottom" /> | 
					
						
							| 
									
										
										
										
											2021-06-04 14:05:47 +02:00
										 |  |  |             </TagGroup> | 
					
						
							| 
									
										
										
										
											2022-02-18 14:48:21 +01:00
										 |  |  |           </MobileWrapped> | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |         } | 
					
						
							|  |  |  |       > | 
					
						
							| 
									
										
										
										
											2021-04-21 10:09:23 +02:00
										 |  |  |         {modal} | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |         <CustomQueryFlexWrappedColumns> | 
					
						
							|  |  |  |           <PrimaryContentColumn> | 
					
						
							|  |  |  |             <Switch> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Redirect exact from={urls.escapeUrlForRoute(match.url)} to={urls.escapeUrlForRoute(redirectedUrl)} /> | 
					
						
							| 
									
										
										
										
											2018-08-01 18:23:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |               {/* redirect pre 2.0.0-rc2 links */} | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Redirect from={`${escapedUrl}/changeset/:id`} to={`${url}/code/changeset/:id`} /> | 
					
						
							|  |  |  |               <Redirect exact from={`${escapedUrl}/sources`} to={`${url}/code/sources`} /> | 
					
						
							|  |  |  |               <Redirect from={`${escapedUrl}/sources/:revision/:path*`} to={`${url}/code/sources/:revision/:path*`} /> | 
					
						
							|  |  |  |               <Redirect exact from={`${escapedUrl}/changesets`} to={`${url}/code/changesets`} /> | 
					
						
							|  |  |  |               <Redirect | 
					
						
							|  |  |  |                 from={`${escapedUrl}/branch/:branch/changesets`} | 
					
						
							|  |  |  |                 to={`${url}/code/branch/:branch/changesets/`} | 
					
						
							|  |  |  |               /> | 
					
						
							| 
									
										
										
										
											2018-08-01 18:23:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/info`} exact> | 
					
						
							| 
									
										
										
										
											2021-02-25 08:30:23 +01:00
										 |  |  |                 <RepositoryDetails repository={repository} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/settings/general`}> | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |                 <EditRepo repository={repository} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/settings/permissions`}> | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |                 <Permissions namespaceOrRepository={repository} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route exact path={`${escapedUrl}/code/changeset/:id`}> | 
					
						
							| 
									
										
										
										
											2022-01-20 11:00:49 +01:00
										 |  |  |                 <ChangesetView repository={repository} fileControlFactoryFactory={fileControlFactoryFactory} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/code/sourceext/:extension`} exact={true}> | 
					
						
							| 
									
										
										
										
											2022-01-20 11:00:49 +01:00
										 |  |  |                 <SourceExtensions repository={repository} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/code/sourceext/:extension/:revision/:path*`}> | 
					
						
							| 
									
										
										
										
											2022-01-20 11:00:49 +01:00
										 |  |  |                 <SourceExtensions repository={repository} baseUrl={`${url}/code/sources`} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/code`}> | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |                 <CodeOverview baseUrl={`${url}/code`} repository={repository} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/branch/:branch`}> | 
					
						
							| 
									
										
										
										
											2022-01-20 11:00:49 +01:00
										 |  |  |                 <BranchRoot repository={repository} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/branches`} exact={true}> | 
					
						
							| 
									
										
										
										
											2022-01-20 11:00:49 +01:00
										 |  |  |                 <BranchesOverview repository={repository} baseUrl={`${url}/branch`} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/branches/create`}> | 
					
						
							| 
									
										
										
										
											2022-01-20 11:00:49 +01:00
										 |  |  |                 <CreateBranch repository={repository} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/tag/:tag`}> | 
					
						
							| 
									
										
										
										
											2022-01-20 11:00:49 +01:00
										 |  |  |                 <TagRoot repository={repository} baseUrl={`${url}/tag`} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/tags`} exact={true}> | 
					
						
							| 
									
										
										
										
											2022-01-20 11:00:49 +01:00
										 |  |  |                 <TagsOverview repository={repository} baseUrl={`${url}/tag`} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |               <Route path={`${escapedUrl}/compare/:sourceType/:sourceName`}> | 
					
						
							| 
									
										
										
										
											2022-01-20 11:00:49 +01:00
										 |  |  |                 <CompareRoot repository={repository} baseUrl={`${url}/compare`} /> | 
					
						
							|  |  |  |               </Route> | 
					
						
							| 
									
										
										
										
											2022-03-29 15:04:14 +02:00
										 |  |  |               <ExtensionPoint<extensionPoints.RepositoryRoute> | 
					
						
							|  |  |  |                 name="repository.route" | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |                 props={{ | 
					
						
							|  |  |  |                   repository, | 
					
						
							|  |  |  |                   url: urls.escapeUrlForRoute(url), | 
					
						
							| 
									
										
										
										
											2022-08-04 11:29:05 +02:00
										 |  |  |                   indexLinks, | 
					
						
							| 
									
										
										
										
											2022-04-13 13:06:02 +02:00
										 |  |  |                 }} | 
					
						
							| 
									
										
										
										
											2022-03-29 15:04:14 +02:00
										 |  |  |                 renderAll={true} | 
					
						
							|  |  |  |               /> | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |             </Switch> | 
					
						
							|  |  |  |           </PrimaryContentColumn> | 
					
						
							|  |  |  |           <SecondaryNavigationColumn> | 
					
						
							|  |  |  |             <SecondaryNavigation label={t("repositoryRoot.menu.navigationLabel")}> | 
					
						
							| 
									
										
										
										
											2022-03-29 15:04:14 +02:00
										 |  |  |               <ExtensionPoint<extensionPoints.RepositoryNavigationTopLevel> | 
					
						
							|  |  |  |                 name="repository.navigation.topLevel" | 
					
						
							|  |  |  |                 props={extensionProps} | 
					
						
							|  |  |  |                 renderAll={true} | 
					
						
							|  |  |  |               /> | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |               <NavLink | 
					
						
							|  |  |  |                 to={`${url}/info`} | 
					
						
							|  |  |  |                 icon="fas fa-info-circle" | 
					
						
							|  |  |  |                 label={t("repositoryRoot.menu.informationNavLink")} | 
					
						
							|  |  |  |                 title={t("repositoryRoot.menu.informationNavLink")} | 
					
						
							|  |  |  |               /> | 
					
						
							|  |  |  |               <RepositoryNavLink | 
					
						
							|  |  |  |                 repository={repository} | 
					
						
							|  |  |  |                 linkName="branches" | 
					
						
							|  |  |  |                 to={`${url}/branches/`} | 
					
						
							|  |  |  |                 icon="fas fa-code-branch" | 
					
						
							|  |  |  |                 label={t("repositoryRoot.menu.branchesNavLink")} | 
					
						
							|  |  |  |                 activeWhenMatch={matchesBranches} | 
					
						
							|  |  |  |                 activeOnlyWhenExact={false} | 
					
						
							|  |  |  |                 title={t("repositoryRoot.menu.branchesNavLink")} | 
					
						
							|  |  |  |               /> | 
					
						
							|  |  |  |               <RepositoryNavLink | 
					
						
							|  |  |  |                 repository={repository} | 
					
						
							|  |  |  |                 linkName="tags" | 
					
						
							|  |  |  |                 to={`${url}/tags/`} | 
					
						
							|  |  |  |                 icon="fas fa-tags" | 
					
						
							|  |  |  |                 label={t("repositoryRoot.menu.tagsNavLink")} | 
					
						
							|  |  |  |                 activeWhenMatch={matchesTags} | 
					
						
							|  |  |  |                 activeOnlyWhenExact={false} | 
					
						
							|  |  |  |                 title={t("repositoryRoot.menu.tagsNavLink")} | 
					
						
							|  |  |  |               /> | 
					
						
							|  |  |  |               <RepositoryNavLink | 
					
						
							|  |  |  |                 repository={repository} | 
					
						
							|  |  |  |                 linkName={getCodeLinkname()} | 
					
						
							|  |  |  |                 to={evaluateDestinationForCodeLink()} | 
					
						
							|  |  |  |                 icon="fas fa-code" | 
					
						
							|  |  |  |                 label={t("repositoryRoot.menu.sourcesNavLink")} | 
					
						
							|  |  |  |                 activeWhenMatch={matchesCode} | 
					
						
							|  |  |  |                 activeOnlyWhenExact={false} | 
					
						
							|  |  |  |                 title={t("repositoryRoot.menu.sourcesNavLink")} | 
					
						
							|  |  |  |               /> | 
					
						
							| 
									
										
										
										
											2022-03-29 15:04:14 +02:00
										 |  |  |               <ExtensionPoint<extensionPoints.RepositoryNavigation> | 
					
						
							|  |  |  |                 name="repository.navigation" | 
					
						
							|  |  |  |                 props={extensionProps} | 
					
						
							|  |  |  |                 renderAll={true} | 
					
						
							|  |  |  |               /> | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |               <SubNavigation | 
					
						
							|  |  |  |                 to={`${url}/settings/general`} | 
					
						
							|  |  |  |                 label={t("repositoryRoot.menu.settingsNavLink")} | 
					
						
							|  |  |  |                 title={t("repositoryRoot.menu.settingsNavLink")} | 
					
						
							|  |  |  |               > | 
					
						
							|  |  |  |                 <EditRepoNavLink repository={repository} editUrl={`${url}/settings/general`} /> | 
					
						
							|  |  |  |                 <PermissionsNavLink permissionUrl={`${url}/settings/permissions`} repository={repository} /> | 
					
						
							| 
									
										
										
										
											2022-03-29 15:04:14 +02:00
										 |  |  |                 <ExtensionPoint<extensionPoints.RepositorySetting> | 
					
						
							|  |  |  |                   name="repository.setting" | 
					
						
							|  |  |  |                   props={extensionProps} | 
					
						
							|  |  |  |                   renderAll={true} | 
					
						
							|  |  |  |                 /> | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  |               </SubNavigation> | 
					
						
							|  |  |  |             </SecondaryNavigation> | 
					
						
							|  |  |  |           </SecondaryNavigationColumn> | 
					
						
							|  |  |  |         </CustomQueryFlexWrappedColumns> | 
					
						
							|  |  |  |       </Page> | 
					
						
							|  |  |  |     </StateMenuContextProvider> | 
					
						
							|  |  |  |   ); | 
					
						
							| 
									
										
										
										
											2018-08-01 18:23:16 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-24 08:17:40 +01:00
										 |  |  | export default RepositoryRoot; |