@scm-manager/ui-core 4.0.0-REACT19-20250915-150855 → 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.
@@ -1,12 +1,12 @@
1
1
  yarn run v1.22.22
2
2
  $ jest
3
- PASS src/base/helpers/useDocumentTitle.test.ts (12.478 s)
4
- PASS src/base/shortcuts/iterator/keyboardIterator.test.tsx (12.723 s)
5
- PASS src/base/text/textSplitAndReplace.test.ts (12.518 s)
3
+ PASS src/base/helpers/useDocumentTitle.test.ts (11.461 s)
4
+ PASS src/base/shortcuts/iterator/keyboardIterator.test.tsx (11.454 s)
5
+ PASS src/base/text/textSplitAndReplace.test.ts (13.412 s)
6
6
  ----------------------------------------|---------|----------|---------|---------|-------------------
7
7
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
8
8
  ----------------------------------------|---------|----------|---------|---------|-------------------
9
- All files | 2.3 | 2.15 | 1.33 | 2.27 |
9
+ All files | 2.29 | 2.15 | 1.32 | 2.26 |
10
10
  src | 0 | 0 | 0 | 0 |
11
11
  index.ts | 0 | 0 | 0 | 0 |
12
12
  src/base | 0 | 0 | 0 | 0 |
@@ -161,7 +161,7 @@ All files | 2.3 | 2.15 | 1.33 | 2.27
161
161
  import.ts | 0 | 100 | 100 | 0 | 17
162
162
  index.ts | 0 | 0 | 0 | 0 |
163
163
  me.ts | 0 | 100 | 100 | 0 | 17-19
164
- namespace.ts | 0 | 0 | 0 | 0 | 20-38
164
+ namespace.ts | 0 | 0 | 0 | 0 | 21-51
165
165
  repository.ts | 0 | 0 | 0 | 0 | 21-89
166
166
  user.ts | 0 | 100 | 100 | 0 | 17-20
167
167
  ----------------------------------------|---------|----------|---------|---------|-------------------
@@ -169,6 +169,6 @@ All files | 2.3 | 2.15 | 1.33 | 2.27
169
169
  Test Suites: 3 passed, 3 total
170
170
  Tests: 9 passed, 9 total
171
171
  Snapshots: 0 total
172
- Time: 39.143 s
172
+ Time: 39.418 s
173
173
  Ran all test suites.
174
- Done in 41.88s.
174
+ Done in 41.46s.
@@ -1,3 +1,3 @@
1
1
  yarn run v1.22.22
2
2
  $ tsc
3
- Done in 32.33s.
3
+ Done in 32.49s.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-manager/ui-core",
3
- "version": "4.0.0-REACT19-20250915-150855",
3
+ "version": "4.0.0-REACT19-20250917-125211",
4
4
  "main": "./src/index.ts",
5
5
  "license": "AGPL-3.0-only",
6
6
  "scripts": {
@@ -30,7 +30,7 @@
30
30
  "@radix-ui/react-tabs": "^1.0.4",
31
31
  "@radix-ui/react-tooltip": "1.0.2",
32
32
  "@radix-ui/react-visually-hidden": "^1.0.3",
33
- "@scm-manager/ui-api": "4.0.0-REACT19-20250915-150855",
33
+ "@scm-manager/ui-api": "4.0.0-REACT19-20250917-125211",
34
34
  "mousetrap": "1.6.5"
35
35
  },
36
36
  "devDependencies": {
@@ -39,7 +39,7 @@
39
39
  "@scm-manager/eslint-config": "^2.18.2",
40
40
  "@scm-manager/prettier-config": "^2.12.0",
41
41
  "@scm-manager/tsconfig": "^2.12.0",
42
- "@scm-manager/ui-types": "4.0.0-REACT19-20250915-150855",
42
+ "@scm-manager/ui-types": "4.0.0-REACT19-20250917-125211",
43
43
  "@storybook/addon-actions": "^9.0.8",
44
44
  "@storybook/addon-docs": "^9.1.5",
45
45
  "@storybook/addon-essentials": "^9.0.0-alpha.12",
@@ -16,6 +16,7 @@
16
16
 
17
17
  import { useParams } from "react-router-dom";
18
18
  import { useNamespace } from "@scm-manager/ui-api";
19
+ import { Namespace } from "@scm-manager/ui-types";
19
20
 
20
21
  export const SINGLE_NAMESPACE_BASE_ROUTE = "namespace";
21
22
  export const NAMESPACE_SUB_ROUTES = {
@@ -37,3 +38,16 @@ export const useNamespaceFromParams = () => {
37
38
  }
38
39
  return namespace;
39
40
  };
41
+
42
+ export const useCurrentNamespaceBaseUrl = () => {
43
+ const namespace = useNamespaceFromParams();
44
+ return getNamespaceBaseUrl(namespace.namespace);
45
+ };
46
+
47
+ export function getNamespaceBaseUrl(namespace: string | Namespace): string {
48
+ if (typeof namespace === "string") {
49
+ return `/${SINGLE_NAMESPACE_BASE_ROUTE}/${namespace}`;
50
+ } else {
51
+ return `/${SINGLE_NAMESPACE_BASE_ROUTE}/${namespace.namespace}`;
52
+ }
53
+ }
@@ -83,9 +83,9 @@ export function getRepositoryBaseUrl(namespace: string, name: string): string;
83
83
  export function getRepositoryBaseUrl(repository: Repository): string;
84
84
  export function getRepositoryBaseUrl(arg1: string | Repository, arg2?: string): string {
85
85
  if (typeof arg1 === "string" && arg2) {
86
- return `/repo/${arg1}/${arg2}`;
86
+ return `/${SINGLE_REPOSITORY_BASE_ROUTE}/${arg1}/${arg2}`;
87
87
  } else {
88
88
  const repository = arg1 as Repository;
89
- return `/repo/${repository.namespace}/${repository.name}`;
89
+ return `/${SINGLE_REPOSITORY_BASE_ROUTE}/${repository.namespace}/${repository.name}`;
90
90
  }
91
91
  }