diff --git a/scm-ui-components/packages/ui-components/src/config/RepositoryConfigurationBinder.js b/scm-ui-components/packages/ui-components/src/config/RepositoryConfigurationBinder.js index be23c13eae..6438870860 100644 --- a/scm-ui-components/packages/ui-components/src/config/RepositoryConfigurationBinder.js +++ b/scm-ui-components/packages/ui-components/src/config/RepositoryConfigurationBinder.js @@ -1,7 +1,7 @@ // @flow import * as React from "react"; import { binder } from "@scm-manager/ui-extensions"; -import { NavLink } from "../navigation"; +import { RepositoryNavLink } from "../navigation"; import { Route } from "react-router-dom"; import { translate } from "react-i18next"; @@ -10,34 +10,35 @@ class RepositoryConfigurationBinder { i18nNamespace: string = "plugins"; - bindGlobal(to: string, labelI18nKey: string, linkName: string, ConfigurationComponent: any) { + bindRepository(to: string, labelI18nKey: string, linkName: string, RepositoryComponent: any) { - // create predicate based on the link name of the index resource + // create predicate based on the link name of the current repository route // if the linkname is not available, the navigation link and the route are not bound to the extension points - const configPredicate = (props: Object) => { + const repoPredicate = (props: Object) => { return props.repository && props.repository._links && props.repository._links[linkName]; }; // create NavigationLink with translated label - const ConfigNavLink = translate(this.i18nNamespace)(({t, url}) => { - return ; + const RepoNavLink = translate(this.i18nNamespace)(({t, url}) => { + return ; }); // bind navigation link to extension point - binder.bind("repository.navigation", ConfigNavLink, configPredicate); + binder.bind("repository.navigation", RepoNavLink, repoPredicate); // route for global configuration, passes the current repository to component - const ConfigRoute = ({ url, repository }) => { + const RepoRoute = ({ url, repository }) => { return } + render={() => } exact/>; }; // bind config route to extension point - binder.bind("repository.route", ConfigRoute, configPredicate); + binder.bind("repository.route", RepoRoute, repoPredicate); } + } export default new RepositoryConfigurationBinder();