use global configuration abstraction to implement global configuration for git

This commit is contained in:
Sebastian Sdorra
2018-11-06 16:38:49 +01:00
parent c14e8d654b
commit f5f96042b3
7 changed files with 116 additions and 238 deletions

View File

@@ -2,8 +2,9 @@
import { binder } from "@scm-manager/ui-extensions";
import ProtocolInformation from "./ProtocolInformation";
import GitAvatar from "./GitAvatar";
import GitConfigurationNavLink from "./GitConfigurationNavLink";
import GitConfigurationRoute from "./GitConfigurationRoute";
import { ConfigurationBinder as cfgBinder } from "@scm-manager/ui-components";
import GitGlobalConfiguration from "./GitGlobalConfiguration";
// repository
@@ -16,9 +17,4 @@ binder.bind("repos.repository-avatar", GitAvatar, gitPredicate);
// global config
const gitConfigPredicate = (props: Object) => {
return props.links && props.links["gitConfig"];
};
binder.bind("config.navigation", GitConfigurationNavLink, gitConfigPredicate);
binder.bind("config.route", GitConfigurationRoute, gitConfigPredicate);
cfgBinder.bindGlobal("/git", "scm-git-plugin.config.link", "gitConfig", GitGlobalConfiguration);