@scm-manager/ui-components 4.0.0-REACT19-20251103-141810 → 4.0.0-REACT19-20251104-145242
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-20251104-145242",
|
|
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-20251104-145242",
|
|
38
|
+
"@scm-manager/ui-types": "4.0.0-REACT19-20251104-145242",
|
|
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-20251104-145242",
|
|
70
|
+
"@scm-manager/ui-core": "4.0.0-REACT19-20251104-145242",
|
|
71
|
+
"@scm-manager/ui-extensions": "4.0.0-REACT19-20251104-145242",
|
|
72
72
|
"deepmerge": "^4.2.2",
|
|
73
73
|
"hast-util-sanitize": "^3.0.2",
|
|
74
74
|
"react-diff-view": "2.6.0",
|
package/src/ErrorBoundary.tsx
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
import React, { FC, ReactNode, useEffect } from "react";
|
|
18
18
|
import { useLocation } from "react-router-dom";
|
|
19
|
-
import { ErrorBoundary as ReactErrorBoundary, FallbackProps } from "react-error-boundary";
|
|
20
19
|
import { useTranslation } from "react-i18next";
|
|
21
20
|
import classNames from "classnames";
|
|
22
21
|
import styled from "styled-components";
|
|
23
22
|
import { MissingLinkError, urls, useIndexLink } from "@scm-manager/ui-api";
|
|
23
|
+
import { ErrorBoundary as ReactErrorBoundary, FallbackProps } from "react-error-boundary";
|
|
24
24
|
import { useDocumentTitle } from "@scm-manager/ui-core";
|
|
25
25
|
import ErrorNotification from "./ErrorNotification";
|
|
26
26
|
import ErrorPage from "./ErrorPage";
|
|
@@ -57,7 +57,7 @@ class ConfigurationBinder {
|
|
|
57
57
|
return { path, element: Component };
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
bindAdminSetting(to: string, labelI18nKey: string, linkName: string, ConfigurationComponent: any, sortKey?: string) {
|
|
61
61
|
// create predicate based on the link name of the index resource
|
|
62
62
|
// if the linkname is not available, the navigation link and the route are not bound to the extension points
|
|
63
63
|
const configPredicate = (props: any) => {
|
|
@@ -74,7 +74,7 @@ class ConfigurationBinder {
|
|
|
74
74
|
binder.bind("admin.setting", ConfigNavLink, configPredicate, sortKey ?? linkName);
|
|
75
75
|
|
|
76
76
|
// route for global configuration, passes the link from the index resource to component
|
|
77
|
-
const ConfigRoute = ({ ...additionalProps }: GlobalRouteProps) => {
|
|
77
|
+
const ConfigRoute = ({ ...additionalProps }: GlobalRouteProps = {} as GlobalRouteProps) => {
|
|
78
78
|
return this.route(
|
|
79
79
|
sanitizedTo,
|
|
80
80
|
<TitledGlobalSettingComponent i18nNamespace={this.i18nNamespace} label={labelI18nKey}>
|
|
@@ -84,28 +84,19 @@ class ConfigurationBinder {
|
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
// bind config route to extension point
|
|
87
|
-
binder.bind("admin.route", ConfigRoute);
|
|
87
|
+
binder.bind("admin.settings.route", ConfigRoute);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
bindAdmin(
|
|
91
|
-
to: string,
|
|
92
|
-
labelI18nKey: string,
|
|
93
|
-
icon: string,
|
|
94
|
-
linkName: string,
|
|
95
|
-
Component: React.ComponentType<{ link: string }>,
|
|
96
|
-
) {
|
|
97
|
-
const predicate = ({ links }: extensionPoints.AdminRoute["props"]) => links![linkName];
|
|
98
|
-
|
|
90
|
+
bindAdmin(to: string, labelI18nKey: string, icon: string, Component: React.ComponentType) {
|
|
99
91
|
const AdminNavLink = withTranslation(this.i18nNamespace)(
|
|
100
92
|
({ t }: WithTranslation & extensionPoints.AdminNavigation["props"]) =>
|
|
101
93
|
this.navLink("/admin/" + to, labelI18nKey, t, { icon }),
|
|
102
94
|
);
|
|
103
|
-
binder.bind("admin.navigation", AdminNavLink
|
|
95
|
+
binder.bind("admin.navigation", AdminNavLink);
|
|
104
96
|
|
|
105
|
-
const AdminRoute: extensionPoints.AdminRoute["type"] = (
|
|
106
|
-
this.route(to, <Component link={(links![linkName] as Link).href} />);
|
|
97
|
+
const AdminRoute: extensionPoints.AdminRoute["type"] = () => this.route(to, <Component />);
|
|
107
98
|
|
|
108
|
-
binder.bind<extensionPoints.AdminRoute>("admin.route", AdminRoute
|
|
99
|
+
binder.bind<extensionPoints.AdminRoute>("admin.route", AdminRoute);
|
|
109
100
|
}
|
|
110
101
|
|
|
111
102
|
bindRepository(to: string, labelI18nKey: string, linkName: string, RepositoryComponent: any) {
|