mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-10-31 10:35:56 +01:00 
			
		
		
		
	codify extension points docs (#1947)
This pull request converts the current incomplete textual documentation of the available frontend extension points to in-code definitions that act both as documentation and as type helpers for improving overall code quality. All extension points available in the SCM-Manager core are now available, but no plugin was updated and only those parts of the core codebase had the new types added that did not require runtime changes. The only exception to this is the breadcrumbs, which was a simple change that is fully backwards-compatible.
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							5006e9b821
						
					
				
				
					commit
					4d203ff36f
				
			| @@ -25,7 +25,7 @@ import React, { useState } from "react"; | ||||
| import { match as Match } from "react-router"; | ||||
| import { Link as RouteLink, Redirect, Route, RouteProps, Switch, useRouteMatch } from "react-router-dom"; | ||||
| import { useTranslation } from "react-i18next"; | ||||
| import { binder, ExtensionPoint } from "@scm-manager/ui-extensions"; | ||||
| import { binder, ExtensionPoint, extensionPoints } from "@scm-manager/ui-extensions"; | ||||
| import { Changeset, Link } from "@scm-manager/ui-types"; | ||||
| import { | ||||
|   CustomQueryFlexWrappedColumns, | ||||
| @@ -122,7 +122,7 @@ const RepositoryRoot = () => { | ||||
|     match | ||||
|   }; | ||||
|  | ||||
|   const redirectUrlFactory = binder.getExtension("repository.redirect", props); | ||||
|   const redirectUrlFactory = binder.getExtension<extensionPoints.RepositoryRedirect>("repository.redirect", props); | ||||
|   let redirectedUrl; | ||||
|   if (redirectUrlFactory) { | ||||
|     redirectedUrl = url + redirectUrlFactory(props); | ||||
| @@ -295,12 +295,20 @@ const RepositoryRoot = () => { | ||||
|               <Route path={`${url}/compare/:sourceType/:sourceName`}> | ||||
|                 <CompareRoot repository={repository} baseUrl={`${url}/compare`} /> | ||||
|               </Route> | ||||
|               <ExtensionPoint name="repository.route" props={extensionProps} renderAll={true} /> | ||||
|               <ExtensionPoint<extensionPoints.RepositoryRoute> | ||||
|                 name="repository.route" | ||||
|                 props={extensionProps} | ||||
|                 renderAll={true} | ||||
|               /> | ||||
|             </Switch> | ||||
|           </PrimaryContentColumn> | ||||
|           <SecondaryNavigationColumn> | ||||
|             <SecondaryNavigation label={t("repositoryRoot.menu.navigationLabel")}> | ||||
|               <ExtensionPoint name="repository.navigation.topLevel" props={extensionProps} renderAll={true} /> | ||||
|               <ExtensionPoint<extensionPoints.RepositoryNavigationTopLevel> | ||||
|                 name="repository.navigation.topLevel" | ||||
|                 props={extensionProps} | ||||
|                 renderAll={true} | ||||
|               /> | ||||
|               <NavLink | ||||
|                 to={`${url}/info`} | ||||
|                 icon="fas fa-info-circle" | ||||
| @@ -337,7 +345,11 @@ const RepositoryRoot = () => { | ||||
|                 activeOnlyWhenExact={false} | ||||
|                 title={t("repositoryRoot.menu.sourcesNavLink")} | ||||
|               /> | ||||
|               <ExtensionPoint name="repository.navigation" props={extensionProps} renderAll={true} /> | ||||
|               <ExtensionPoint<extensionPoints.RepositoryNavigation> | ||||
|                 name="repository.navigation" | ||||
|                 props={extensionProps} | ||||
|                 renderAll={true} | ||||
|               /> | ||||
|               <SubNavigation | ||||
|                 to={`${url}/settings/general`} | ||||
|                 label={t("repositoryRoot.menu.settingsNavLink")} | ||||
| @@ -345,7 +357,11 @@ const RepositoryRoot = () => { | ||||
|               > | ||||
|                 <EditRepoNavLink repository={repository} editUrl={`${url}/settings/general`} /> | ||||
|                 <PermissionsNavLink permissionUrl={`${url}/settings/permissions`} repository={repository} /> | ||||
|                 <ExtensionPoint name="repository.setting" props={extensionProps} renderAll={true} /> | ||||
|                 <ExtensionPoint<extensionPoints.RepositorySetting> | ||||
|                   name="repository.setting" | ||||
|                   props={extensionProps} | ||||
|                   renderAll={true} | ||||
|                 /> | ||||
|               </SubNavigation> | ||||
|             </SecondaryNavigation> | ||||
|           </SecondaryNavigationColumn> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user