mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-24 00:09:07 +01:00
Sort global config and repository config the same way
Adds a new option to configuration entry binding to improve sorting and sorts global and repository configuration likewise. Pushed-by: Viktor Egorov<viktor.egorov-extern@cloudogu.com> Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com> Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com> Co-authored-by: vegorov<viktor.egorov@triology.de>
This commit is contained in:
2
gradle/changelog/impove_sorting.yaml
Normal file
2
gradle/changelog/impove_sorting.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
- type: fixed
|
||||
description: Sort global config and repository config the same way
|
||||
@@ -54,4 +54,4 @@ binder.bind<extensionPoints.RepoConfigRoute>("repo-config.route", HgRepositoryCo
|
||||
|
||||
// bind global configuration
|
||||
|
||||
cfgBinder.bindGlobal("/hg", "scm-hg-plugin.config.link", "hgConfig", HgGlobalConfiguration);
|
||||
cfgBinder.bindGlobal("/hg", "scm-hg-plugin.config.link", "hgConfig", HgGlobalConfiguration, "mercurial");
|
||||
|
||||
@@ -64,7 +64,7 @@ class ConfigurationBinder {
|
||||
return <Route path={urls.escapeUrlForRoute(path)}>{Component}</Route>;
|
||||
}
|
||||
|
||||
bindGlobal(to: string, labelI18nKey: string, linkName: string, ConfigurationComponent: any) {
|
||||
bindGlobal(to: string, labelI18nKey: string, linkName: string, ConfigurationComponent: any, sortKey?: string) {
|
||||
// create predicate based on the link name of the index resource
|
||||
// if the linkname is not available, the navigation link and the route are not bound to the extension points
|
||||
const configPredicate = (props: any) => {
|
||||
@@ -77,7 +77,7 @@ class ConfigurationBinder {
|
||||
});
|
||||
|
||||
// bind navigation link to extension point
|
||||
binder.bind("admin.setting", ConfigNavLink, configPredicate, labelI18nKey);
|
||||
binder.bind("admin.setting", ConfigNavLink, configPredicate, sortKey ?? linkName);
|
||||
|
||||
// route for global configuration, passes the link from the index resource to component
|
||||
const ConfigRoute = ({ url, links, ...additionalProps }: GlobalRouteProps) => {
|
||||
@@ -145,7 +145,7 @@ class ConfigurationBinder {
|
||||
binder.bind("repository.route", RepoRoute, repoPredicate);
|
||||
}
|
||||
|
||||
bindRepositorySetting(to: string, labelI18nKey: string, linkName: string, RepositoryComponent: any) {
|
||||
bindRepositorySetting(to: string, labelI18nKey: string, linkName: string, RepositoryComponent: any, sortKey?: string) {
|
||||
// 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 repoPredicate = (props: any) => {
|
||||
@@ -158,7 +158,7 @@ class ConfigurationBinder {
|
||||
});
|
||||
|
||||
// bind navigation link to extension point
|
||||
binder.bind("repository.setting", RepoNavLink, repoPredicate);
|
||||
binder.bind("repository.setting", RepoNavLink, repoPredicate, sortKey ?? linkName);
|
||||
|
||||
// route for global configuration, passes the current repository to component
|
||||
const RepoRoute = ({ url, repository, ...additionalProps }: RepositoryRouteProps) => {
|
||||
|
||||
Reference in New Issue
Block a user