@scm-manager/ui-components 4.0.0-REACT19-20250915-143710 → 4.0.0-REACT19-20250917-125211

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-manager/ui-components",
3
- "version": "4.0.0-REACT19-20250915-143710",
3
+ "version": "4.0.0-REACT19-20250917-125211",
4
4
  "description": "UI Components for SCM-Manager and its plugins",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -37,10 +37,10 @@
37
37
  "@scm-manager/jest-preset": "^2.15.0-alpha1",
38
38
  "@scm-manager/prettier-config": "^2.12.0",
39
39
  "@scm-manager/tsconfig": "^2.13.0",
40
- "@scm-manager/ui-shortcuts": "4.0.0-REACT19-20250915-143710",
41
- "@scm-manager/ui-syntaxhighlighting": "4.0.0-REACT19-20250915-143710",
42
- "@scm-manager/ui-text": "4.0.0-REACT19-20250915-143710",
43
- "@scm-manager/ui-types": "4.0.0-REACT19-20250915-143710",
40
+ "@scm-manager/ui-shortcuts": "4.0.0-REACT19-20250917-125211",
41
+ "@scm-manager/ui-syntaxhighlighting": "4.0.0-REACT19-20250917-125211",
42
+ "@scm-manager/ui-text": "4.0.0-REACT19-20250917-125211",
43
+ "@scm-manager/ui-types": "4.0.0-REACT19-20250917-125211",
44
44
  "@storybook/addon-actions": "^9.0.8",
45
45
  "@storybook/addon-docs": "^9.1.5",
46
46
  "@storybook/addon-essentials": "^9.0.0-alpha.12",
@@ -67,12 +67,12 @@
67
67
  "storybook-addon-themes": "^6.1.0"
68
68
  },
69
69
  "dependencies": {
70
- "@scm-manager/ui-api": "4.0.0-REACT19-20250915-143710",
71
- "@scm-manager/ui-buttons": "4.0.0-REACT19-20250915-143710",
72
- "@scm-manager/ui-core": "4.0.0-REACT19-20250915-143710",
73
- "@scm-manager/ui-extensions": "4.0.0-REACT19-20250915-143710",
74
- "@scm-manager/ui-layout": "4.0.0-REACT19-20250915-143710",
75
- "@scm-manager/ui-overlays": "4.0.0-REACT19-20250915-143710",
70
+ "@scm-manager/ui-api": "4.0.0-REACT19-20250917-125211",
71
+ "@scm-manager/ui-buttons": "4.0.0-REACT19-20250917-125211",
72
+ "@scm-manager/ui-core": "4.0.0-REACT19-20250917-125211",
73
+ "@scm-manager/ui-extensions": "4.0.0-REACT19-20250917-125211",
74
+ "@scm-manager/ui-layout": "4.0.0-REACT19-20250917-125211",
75
+ "@scm-manager/ui-overlays": "4.0.0-REACT19-20250917-125211",
76
76
  "deepmerge": "^4.2.2",
77
77
  "hast-util-sanitize": "^3.0.2",
78
78
  "react-diff-view": "2.6.0",
@@ -18,7 +18,7 @@ import React, { ComponentProps, ComponentType, FC } from "react";
18
18
  import { binder, extensionPoints } from "@scm-manager/ui-extensions";
19
19
  import { NavLink } from "../navigation";
20
20
  import { Route } from "react-router-dom";
21
- import { useTranslation, WithTranslation, withTranslation } from "react-i18next";
21
+ import { WithTranslation, withTranslation } from "react-i18next";
22
22
  import { Link, Links, Repository } from "@scm-manager/ui-types";
23
23
  import {
24
24
  TitledGlobalSettingComponent,
@@ -39,7 +39,7 @@ type RepositoryRouteProps = {
39
39
 
40
40
  type RepositoryNavProps = WithTranslation & { absoluteRepoUrl: string };
41
41
 
42
- type NamespaceNavProps = WithTranslation & { url: string };
42
+ type NamespaceNavProps = WithTranslation & { absoluteNamespaceUrl: string };
43
43
 
44
44
  class ConfigurationBinder {
45
45
  i18nNamespace = "plugins";
@@ -149,7 +149,7 @@ class ConfigurationBinder {
149
149
  ) {
150
150
  // create predicate based on the link name of the current repository route
151
151
  // if the linkname is not available, the navigation link and the route are not bound to the extension points
152
- const repoPredicate = (props: any) => {
152
+ const repoPredicate = (props: extensionPoints.RepositorySetting["props"]) => {
153
153
  return props.repository && props.repository._links && props.repository._links[linkName];
154
154
  };
155
155
 
@@ -188,12 +188,15 @@ class ConfigurationBinder {
188
188
  const namespacePredicate = (props: extensionPoints.NamespaceSetting["props"]) =>
189
189
  props.namespace && props.namespace._links && props.namespace._links[linkName];
190
190
 
191
- const NamespaceNavLink: FC<extensionPoints.NamespaceSetting["props"]> = () => {
192
- const [t] = useTranslation(this.i18nNamespace);
193
- return this.navLink("/" + NAMESPACE_SUB_ROUTES.SETTINGS + to, labelI18nKey, t, { activeOnlyWhenExact: false });
194
- };
191
+ const sanitizedTo = to.startsWith("/") ? to.substring(1) : to;
192
+
193
+ const NamespaceNavLink = withTranslation(this.i18nNamespace)(({ t, absoluteNamespaceUrl }: NamespaceNavProps) => {
194
+ return this.navLink(`${absoluteNamespaceUrl}/${NAMESPACE_SUB_ROUTES.SETTINGS}/${sanitizedTo}`, labelI18nKey, t, {
195
+ activeOnlyWhenExact: false,
196
+ });
197
+ });
195
198
 
196
- binder.bind<extensionPoints.NamespaceSetting>("namespace.setting", NamespaceNavLink, namespacePredicate);
199
+ binder.bind("namespace.setting", NamespaceNavLink, namespacePredicate);
197
200
 
198
201
  const NamespaceRoute = ({ ...additionalProps }: NamespaceNavProps) => {
199
202
  return this.route(