@scm-manager/ui-components 4.0.0-REACT19-20260005-080205 → 4.0.0-REACT19-20260006-120602
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-
|
|
3
|
+
"version": "4.0.0-REACT19-20260006-120602",
|
|
4
4
|
"description": "UI Components for SCM-Manager and its plugins",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@scm-manager/eslint-config": "^2.18.2",
|
|
35
35
|
"@scm-manager/prettier-config": "^2.12.0",
|
|
36
36
|
"@scm-manager/tsconfig": "^2.13.0",
|
|
37
|
-
"@scm-manager/ui-syntaxhighlighting": "4.0.0-REACT19-
|
|
38
|
-
"@scm-manager/ui-types": "4.0.0-REACT19-
|
|
37
|
+
"@scm-manager/ui-syntaxhighlighting": "4.0.0-REACT19-20260006-120602",
|
|
38
|
+
"@scm-manager/ui-types": "4.0.0-REACT19-20260006-120602",
|
|
39
39
|
"@storybook/addon-actions": "^9.0.8",
|
|
40
40
|
"@storybook/addon-docs": "^9.1.5",
|
|
41
41
|
"@storybook/addon-essentials": "^9.0.0-alpha.12",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"vitest": "^3.2.4"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@scm-manager/ui-api": "4.0.0-REACT19-
|
|
70
|
-
"@scm-manager/ui-core": "4.0.0-REACT19-
|
|
71
|
-
"@scm-manager/ui-extensions": "4.0.0-REACT19-
|
|
69
|
+
"@scm-manager/ui-api": "4.0.0-REACT19-20260006-120602",
|
|
70
|
+
"@scm-manager/ui-core": "4.0.0-REACT19-20260006-120602",
|
|
71
|
+
"@scm-manager/ui-extensions": "4.0.0-REACT19-20260006-120602",
|
|
72
72
|
"deepmerge": "^4.2.2",
|
|
73
73
|
"hast-util-sanitize": "^3.0.2",
|
|
74
74
|
"react-diff-view": "2.6.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { ComponentProps, ComponentType } from "react";
|
|
17
|
+
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 { type RouteObject } from "react-router-dom";
|
|
@@ -42,6 +42,31 @@ type RepositoryNavProps = WithTranslation & { absoluteRepoUrl: string };
|
|
|
42
42
|
|
|
43
43
|
type NamespaceNavProps = WithTranslation & { absoluteNamespaceUrl: string };
|
|
44
44
|
|
|
45
|
+
type GlobalSettingsWrapperProps = {
|
|
46
|
+
ConfigurationComponent: any;
|
|
47
|
+
linkName: string;
|
|
48
|
+
i18nNamespace: string;
|
|
49
|
+
labelI18nKey: string;
|
|
50
|
+
additionalProps?: GlobalRouteProps;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const GlobalSettingsWrapper: FC<GlobalSettingsWrapperProps> = ({
|
|
54
|
+
ConfigurationComponent,
|
|
55
|
+
linkName,
|
|
56
|
+
i18nNamespace,
|
|
57
|
+
labelI18nKey,
|
|
58
|
+
additionalProps,
|
|
59
|
+
}) => {
|
|
60
|
+
const links = useIndexLinks();
|
|
61
|
+
const link = links[linkName];
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<TitledGlobalSettingComponent i18nNamespace={i18nNamespace} label={labelI18nKey}>
|
|
65
|
+
<ConfigurationComponent link={(link as Link)?.href} {...additionalProps} />
|
|
66
|
+
</TitledGlobalSettingComponent>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
45
70
|
class ConfigurationBinder {
|
|
46
71
|
i18nNamespace = "plugins";
|
|
47
72
|
|
|
@@ -76,14 +101,15 @@ class ConfigurationBinder {
|
|
|
76
101
|
|
|
77
102
|
// route for global configuration, passes the link from the index resource to component
|
|
78
103
|
const ConfigRoute = ({ ...additionalProps }: GlobalRouteProps = {} as GlobalRouteProps) => {
|
|
79
|
-
const links = useIndexLinks();
|
|
80
|
-
const link = links[linkName];
|
|
81
|
-
|
|
82
104
|
return this.route(
|
|
83
105
|
sanitizedTo,
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
106
|
+
<GlobalSettingsWrapper
|
|
107
|
+
ConfigurationComponent={ConfigurationComponent}
|
|
108
|
+
linkName={linkName}
|
|
109
|
+
i18nNamespace={this.i18nNamespace}
|
|
110
|
+
labelI18nKey={labelI18nKey}
|
|
111
|
+
{...additionalProps}
|
|
112
|
+
/>,
|
|
87
113
|
);
|
|
88
114
|
};
|
|
89
115
|
|