Add un-escaped url prop in repository nav extension point

The url needs to be escaped for the route component, so that
react-router can perform his matching logic.
But additionally, the components rendered within the
extension point also need the unescaped url to create further
links based on this url.
This commit is contained in:
Thomas Zerr
2025-05-26 17:10:36 +02:00
committed by René Pfeuffer
parent 4fede25d41
commit 9bcb9f2512
2 changed files with 3 additions and 2 deletions

View File

@@ -602,7 +602,7 @@ export type RepositorySourcesContentDownloadButton = RenderableExtensionPointDef
export type RepositoryRoute = RenderableExtensionPointDefinition<
"repository.route",
{ repository: Repository; url: string; indexLinks: Links }
{ repository: Repository; url: string; indexLinks: Links; urlForLinks: string }
>;
type RepositoryRedirectProps = {
@@ -686,7 +686,7 @@ export type RepositoryInformationTableBottom = RenderableExtensionPointDefinitio
export type RepositoryBanner = RenderableExtensionPointDefinition<
"repository.banner",
{ repository: Repository, url: string }
{ repository: Repository; url: string }
>;
export type UserInformationTableBottom = RenderableExtensionPointDefinition<

View File

@@ -343,6 +343,7 @@ const RepositoryRoot = () => {
repository,
url: urls.escapeUrlForRoute(url),
indexLinks,
urlForLinks: url,
}}
renderAll={true}
/>