@scm-manager/ui-api 2.36.1 → 2.36.2-20220522-120507
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/build/index.d.ts +735 -0
- package/build/index.js +3200 -0
- package/build/index.mjs +3031 -0
- package/package.json +15 -10
- package/LICENSE.txt +0 -21
- package/src/ApiProvider.test.tsx +0 -60
- package/src/ApiProvider.tsx +0 -80
- package/src/LegacyContext.test.tsx +0 -52
- package/src/LegacyContext.tsx +0 -75
- package/src/admin.test.ts +0 -55
- package/src/admin.ts +0 -42
- package/src/alerts.ts +0 -107
- package/src/annotations.ts +0 -45
- package/src/apiKeys.ts +0 -82
- package/src/apiclient.test.ts +0 -126
- package/src/apiclient.ts +0 -336
- package/src/base.test.ts +0 -238
- package/src/base.ts +0 -120
- package/src/branches.test.ts +0 -234
- package/src/branches.ts +0 -201
- package/src/changesets.test.ts +0 -178
- package/src/changesets.ts +0 -82
- package/src/compare.ts +0 -90
- package/src/config.test.ts +0 -118
- package/src/config.ts +0 -60
- package/src/configLink.test.ts +0 -169
- package/src/configLink.ts +0 -89
- package/src/contentType.ts +0 -58
- package/src/diff.test.ts +0 -234
- package/src/diff.ts +0 -93
- package/src/errors.test.ts +0 -59
- package/src/errors.ts +0 -133
- package/src/fileContent.ts +0 -33
- package/src/groupSuggestions.ts +0 -32
- package/src/groups.test.ts +0 -241
- package/src/groups.ts +0 -141
- package/src/help/search/modal.de.ts +0 -33
- package/src/help/search/modal.en.ts +0 -33
- package/src/help/search/syntax.de.ts +0 -148
- package/src/help/search/syntax.en.ts +0 -145
- package/src/history.ts +0 -62
- package/src/import.ts +0 -114
- package/src/index.ts +0 -72
- package/src/keys.ts +0 -48
- package/src/links.test.ts +0 -99
- package/src/links.ts +0 -54
- package/src/login.test.ts +0 -240
- package/src/login.ts +0 -128
- package/src/loginInfo.ts +0 -43
- package/src/namespaceSuggestions.ts +0 -32
- package/src/namespaces.test.ts +0 -95
- package/src/namespaces.ts +0 -43
- package/src/notifications.ts +0 -183
- package/src/permissions.test.ts +0 -345
- package/src/permissions.ts +0 -202
- package/src/plugins.test.ts +0 -336
- package/src/plugins.ts +0 -259
- package/src/publicKeys.ts +0 -83
- package/src/repositories.test.ts +0 -508
- package/src/repositories.ts +0 -375
- package/src/repository-roles.test.ts +0 -229
- package/src/repository-roles.ts +0 -142
- package/src/reset.ts +0 -36
- package/src/search.ts +0 -153
- package/src/sources.test.ts +0 -233
- package/src/sources.ts +0 -136
- package/src/suggestions.ts +0 -47
- package/src/tags.test.ts +0 -272
- package/src/tags.ts +0 -118
- package/src/tests/createInfiniteCachingClient.ts +0 -37
- package/src/tests/createWrapper.tsx +0 -37
- package/src/tests/indexLinks.ts +0 -43
- package/src/urls.test.ts +0 -104
- package/src/urls.ts +0 -118
- package/src/usePluginCenterAuthInfo.ts +0 -91
- package/src/userSuggestions.ts +0 -32
- package/src/users.test.ts +0 -310
- package/src/users.ts +0 -240
- package/src/utils.ts +0 -29
package/src/groupSuggestions.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
import { Link } from "@scm-manager/ui-types";
|
|
25
|
-
import { useIndexLinks } from "./base";
|
|
26
|
-
import { useSuggestions } from "./suggestions";
|
|
27
|
-
|
|
28
|
-
export const useGroupSuggestions = () => {
|
|
29
|
-
const indexLinks = useIndexLinks();
|
|
30
|
-
const autocompleteLink = (indexLinks.autocomplete as Link[]).find((i) => i.name === "groups");
|
|
31
|
-
return useSuggestions(autocompleteLink?.href);
|
|
32
|
-
};
|
package/src/groups.test.ts
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import { Group } from "@scm-manager/ui-types";
|
|
26
|
-
import fetchMock from "fetch-mock-jest";
|
|
27
|
-
import createInfiniteCachingClient from "./tests/createInfiniteCachingClient";
|
|
28
|
-
import { setIndexLink } from "./tests/indexLinks";
|
|
29
|
-
import { renderHook } from "@testing-library/react-hooks";
|
|
30
|
-
import { useCreateGroup, useDeleteGroup, useGroup, useGroups, useUpdateGroup } from "./groups";
|
|
31
|
-
import createWrapper from "./tests/createWrapper";
|
|
32
|
-
import { act } from "react-test-renderer";
|
|
33
|
-
|
|
34
|
-
describe("Test group hooks", () => {
|
|
35
|
-
const jedis: Group = {
|
|
36
|
-
name: "jedis",
|
|
37
|
-
description: "May the force be with you",
|
|
38
|
-
external: false,
|
|
39
|
-
members: [],
|
|
40
|
-
type: "xml",
|
|
41
|
-
_links: {
|
|
42
|
-
delete: {
|
|
43
|
-
href: "/groups/jedis",
|
|
44
|
-
},
|
|
45
|
-
update: {
|
|
46
|
-
href: "/groups/jedis",
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
_embedded: {
|
|
50
|
-
members: [],
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const jedisCollection = {
|
|
55
|
-
_embedded: {
|
|
56
|
-
groups: [jedis],
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
afterEach(() => {
|
|
61
|
-
fetchMock.reset();
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
describe("useGroups tests", () => {
|
|
65
|
-
it("should return groups", async () => {
|
|
66
|
-
const queryClient = createInfiniteCachingClient();
|
|
67
|
-
setIndexLink(queryClient, "groups", "/groups");
|
|
68
|
-
fetchMock.get("/api/v2/groups", jedisCollection);
|
|
69
|
-
const { result, waitFor } = renderHook(() => useGroups(), {
|
|
70
|
-
wrapper: createWrapper(undefined, queryClient),
|
|
71
|
-
});
|
|
72
|
-
await waitFor(() => !!result.current.data);
|
|
73
|
-
expect(result.current.data).toEqual(jedisCollection);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it("should return paged groups", async () => {
|
|
77
|
-
const queryClient = createInfiniteCachingClient();
|
|
78
|
-
setIndexLink(queryClient, "groups", "/groups");
|
|
79
|
-
fetchMock.get("/api/v2/groups", jedisCollection, {
|
|
80
|
-
query: {
|
|
81
|
-
page: "42",
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
const { result, waitFor } = renderHook(() => useGroups({ page: 42 }), {
|
|
85
|
-
wrapper: createWrapper(undefined, queryClient),
|
|
86
|
-
});
|
|
87
|
-
await waitFor(() => !!result.current.data);
|
|
88
|
-
expect(result.current.data).toEqual(jedisCollection);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it("should return searched groups", async () => {
|
|
92
|
-
const queryClient = createInfiniteCachingClient();
|
|
93
|
-
setIndexLink(queryClient, "groups", "/groups");
|
|
94
|
-
fetchMock.get("/api/v2/groups", jedisCollection, {
|
|
95
|
-
query: {
|
|
96
|
-
q: "jedis",
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
const { result, waitFor } = renderHook(() => useGroups({ search: "jedis" }), {
|
|
100
|
-
wrapper: createWrapper(undefined, queryClient),
|
|
101
|
-
});
|
|
102
|
-
await waitFor(() => !!result.current.data);
|
|
103
|
-
expect(result.current.data).toEqual(jedisCollection);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it("should update group cache", async () => {
|
|
107
|
-
const queryClient = createInfiniteCachingClient();
|
|
108
|
-
setIndexLink(queryClient, "groups", "/groups");
|
|
109
|
-
fetchMock.get("/api/v2/groups", jedisCollection);
|
|
110
|
-
const { result, waitFor } = renderHook(() => useGroups(), {
|
|
111
|
-
wrapper: createWrapper(undefined, queryClient),
|
|
112
|
-
});
|
|
113
|
-
await waitFor(() => !!result.current.data);
|
|
114
|
-
expect(queryClient.getQueryData(["group", "jedis"])).toEqual(jedis);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
describe("useGroup tests", () => {
|
|
119
|
-
it("should return group", async () => {
|
|
120
|
-
const queryClient = createInfiniteCachingClient();
|
|
121
|
-
setIndexLink(queryClient, "groups", "/groups");
|
|
122
|
-
fetchMock.get("/api/v2/groups/jedis", jedis);
|
|
123
|
-
const { result, waitFor } = renderHook(() => useGroup("jedis"), {
|
|
124
|
-
wrapper: createWrapper(undefined, queryClient),
|
|
125
|
-
});
|
|
126
|
-
await waitFor(() => !!result.current.data);
|
|
127
|
-
expect(result.current.data).toEqual(jedis);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
describe("useCreateGroup tests", () => {
|
|
132
|
-
it("should create group", async () => {
|
|
133
|
-
const queryClient = createInfiniteCachingClient();
|
|
134
|
-
setIndexLink(queryClient, "groups", "/groups");
|
|
135
|
-
|
|
136
|
-
fetchMock.postOnce("/api/v2/groups", {
|
|
137
|
-
status: 201,
|
|
138
|
-
headers: {
|
|
139
|
-
Location: "/groups/jedis",
|
|
140
|
-
},
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
fetchMock.getOnce("/api/v2/groups/jedis", jedis);
|
|
144
|
-
|
|
145
|
-
const { result, waitForNextUpdate } = renderHook(() => useCreateGroup(), {
|
|
146
|
-
wrapper: createWrapper(undefined, queryClient),
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
await act(() => {
|
|
150
|
-
const { create } = result.current;
|
|
151
|
-
create(jedis);
|
|
152
|
-
return waitForNextUpdate();
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
expect(result.current.group).toEqual(jedis);
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
it("should fail without location header", async () => {
|
|
159
|
-
const queryClient = createInfiniteCachingClient();
|
|
160
|
-
setIndexLink(queryClient, "groups", "/groups");
|
|
161
|
-
|
|
162
|
-
fetchMock.postOnce("/api/v2/groups", {
|
|
163
|
-
status: 201,
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
fetchMock.getOnce("/api/v2/groups/jedis", jedis);
|
|
167
|
-
|
|
168
|
-
const { result, waitForNextUpdate } = renderHook(() => useCreateGroup(), {
|
|
169
|
-
wrapper: createWrapper(undefined, queryClient),
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
await act(() => {
|
|
173
|
-
const { create } = result.current;
|
|
174
|
-
create(jedis);
|
|
175
|
-
return waitForNextUpdate();
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
expect(result.current.error).toBeDefined();
|
|
179
|
-
});
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
describe("useDeleteGroup tests", () => {
|
|
183
|
-
it("should delete group", async () => {
|
|
184
|
-
const queryClient = createInfiniteCachingClient();
|
|
185
|
-
setIndexLink(queryClient, "groups", "/groups");
|
|
186
|
-
|
|
187
|
-
fetchMock.deleteOnce("/api/v2/groups/jedis", {
|
|
188
|
-
status: 200,
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
const { result, waitForNextUpdate } = renderHook(() => useDeleteGroup(), {
|
|
192
|
-
wrapper: createWrapper(undefined, queryClient),
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
await act(() => {
|
|
196
|
-
const { remove } = result.current;
|
|
197
|
-
remove(jedis);
|
|
198
|
-
return waitForNextUpdate();
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
expect(result.current.error).toBeFalsy();
|
|
202
|
-
expect(result.current.isDeleted).toBe(true);
|
|
203
|
-
expect(result.current.isLoading).toBe(false);
|
|
204
|
-
expect(queryClient.getQueryData(["group", "jedis"])).toBeUndefined();
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
describe("useUpdateGroup tests", () => {
|
|
209
|
-
it("should update group", async () => {
|
|
210
|
-
const queryClient = createInfiniteCachingClient();
|
|
211
|
-
setIndexLink(queryClient, "groups", "/groups");
|
|
212
|
-
|
|
213
|
-
const newJedis = {
|
|
214
|
-
...jedis,
|
|
215
|
-
description: "may the 4th be with you",
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
fetchMock.putOnce("/api/v2/groups/jedis", {
|
|
219
|
-
status: 200,
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
fetchMock.getOnce("/api/v2/groups/jedis", newJedis);
|
|
223
|
-
|
|
224
|
-
const { result, waitForNextUpdate } = renderHook(() => useUpdateGroup(), {
|
|
225
|
-
wrapper: createWrapper(undefined, queryClient),
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
await act(() => {
|
|
229
|
-
const { update } = result.current;
|
|
230
|
-
update(newJedis);
|
|
231
|
-
return waitForNextUpdate();
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
expect(result.current.error).toBeFalsy();
|
|
235
|
-
expect(result.current.isUpdated).toBe(true);
|
|
236
|
-
expect(result.current.isLoading).toBe(false);
|
|
237
|
-
expect(queryClient.getQueryData(["group", "jedis"])).toBeUndefined();
|
|
238
|
-
expect(queryClient.getQueryData(["groups"])).toBeUndefined();
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
});
|
package/src/groups.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import { ApiResult, useRequiredIndexLink } from "./base";
|
|
26
|
-
import { useMutation, useQuery, useQueryClient } from "react-query";
|
|
27
|
-
import { Group, GroupCollection, GroupCreation, Link } from "@scm-manager/ui-types";
|
|
28
|
-
import { apiClient } from "./apiclient";
|
|
29
|
-
import { createQueryString } from "./utils";
|
|
30
|
-
import { concat } from "./urls";
|
|
31
|
-
|
|
32
|
-
export type UseGroupsRequest = {
|
|
33
|
-
page?: number | string;
|
|
34
|
-
search?: string;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const useGroups = (request?: UseGroupsRequest): ApiResult<GroupCollection> => {
|
|
38
|
-
const queryClient = useQueryClient();
|
|
39
|
-
const indexLink = useRequiredIndexLink("groups");
|
|
40
|
-
|
|
41
|
-
const queryParams: Record<string, string> = {};
|
|
42
|
-
if (request?.search) {
|
|
43
|
-
queryParams.q = request.search;
|
|
44
|
-
}
|
|
45
|
-
if (request?.page) {
|
|
46
|
-
queryParams.page = request.page.toString();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return useQuery<GroupCollection, Error>(
|
|
50
|
-
["groups", request?.search || "", request?.page || 0],
|
|
51
|
-
() => apiClient.get(`${indexLink}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
|
52
|
-
{
|
|
53
|
-
onSuccess: (groups: GroupCollection) => {
|
|
54
|
-
groups._embedded.groups.forEach((group: Group) => queryClient.setQueryData(["group", group.name], group));
|
|
55
|
-
},
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const useGroup = (name: string): ApiResult<Group> => {
|
|
61
|
-
const indexLink = useRequiredIndexLink("groups");
|
|
62
|
-
return useQuery<Group, Error>(["group", name], () =>
|
|
63
|
-
apiClient.get(concat(indexLink, name)).then((response) => response.json())
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const createGroup = (link: string) => {
|
|
68
|
-
return (group: GroupCreation) => {
|
|
69
|
-
return apiClient
|
|
70
|
-
.post(link, group, "application/vnd.scmm-group+json;v=2")
|
|
71
|
-
.then((response) => {
|
|
72
|
-
const location = response.headers.get("Location");
|
|
73
|
-
if (!location) {
|
|
74
|
-
throw new Error("Server does not return required Location header");
|
|
75
|
-
}
|
|
76
|
-
return apiClient.get(location);
|
|
77
|
-
})
|
|
78
|
-
.then((response) => response.json());
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const useCreateGroup = () => {
|
|
83
|
-
const queryClient = useQueryClient();
|
|
84
|
-
const link = useRequiredIndexLink("groups");
|
|
85
|
-
const { mutate, data, isLoading, error } = useMutation<Group, Error, GroupCreation>(createGroup(link), {
|
|
86
|
-
onSuccess: (group) => {
|
|
87
|
-
queryClient.setQueryData(["group", group.name], group);
|
|
88
|
-
return queryClient.invalidateQueries(["groups"]);
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
return {
|
|
92
|
-
create: (group: GroupCreation) => mutate(group),
|
|
93
|
-
isLoading,
|
|
94
|
-
error,
|
|
95
|
-
group: data,
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export const useUpdateGroup = () => {
|
|
100
|
-
const queryClient = useQueryClient();
|
|
101
|
-
const { mutate, isLoading, error, data } = useMutation<unknown, Error, Group>(
|
|
102
|
-
(group) => {
|
|
103
|
-
const updateUrl = (group._links.update as Link).href;
|
|
104
|
-
return apiClient.put(updateUrl, group, "application/vnd.scmm-group+json;v=2");
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
onSuccess: async (_, group) => {
|
|
108
|
-
await queryClient.invalidateQueries(["group", group.name]);
|
|
109
|
-
await queryClient.invalidateQueries(["groups"]);
|
|
110
|
-
},
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
return {
|
|
114
|
-
update: (group: Group) => mutate(group),
|
|
115
|
-
isLoading,
|
|
116
|
-
error,
|
|
117
|
-
isUpdated: !!data,
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export const useDeleteGroup = () => {
|
|
122
|
-
const queryClient = useQueryClient();
|
|
123
|
-
const { mutate, isLoading, error, data } = useMutation<unknown, Error, Group>(
|
|
124
|
-
(group) => {
|
|
125
|
-
const deleteUrl = (group._links.delete as Link).href;
|
|
126
|
-
return apiClient.delete(deleteUrl);
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
onSuccess: async (_, name) => {
|
|
130
|
-
await queryClient.removeQueries(["group", name]);
|
|
131
|
-
await queryClient.invalidateQueries(["groups"]);
|
|
132
|
-
},
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
return {
|
|
136
|
-
remove: (group: Group) => mutate(group),
|
|
137
|
-
isLoading,
|
|
138
|
-
error,
|
|
139
|
-
isDeleted: !!data,
|
|
140
|
-
};
|
|
141
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
export default `Unsere Suche basiert auf Lucene. Sie können die [vollständige Syntax](http://lucene.apache.org/core/8_9_0/index.html) nutzen.
|
|
25
|
-
|
|
26
|
-
Um mehr über die fortgeschrittene Suche zu erfahren, lesen sie unsere [Expertenseite](/help/search-syntax).
|
|
27
|
-
|
|
28
|
-
### Einfache Suche
|
|
29
|
-
|
|
30
|
-
- Die relevantesten Repositories werden in den Quick Results angezeigt.
|
|
31
|
-
- Über die Eingabe-Taste oder den Button "Alle Ergebnisse anzeigen" bekommen Sie Ergebnisse aller durchsuchten Entitäten wie Nutzern oder Gruppen.
|
|
32
|
-
- Eine Wildcard für eine beliebige Anzahl an beliebigen Zeichen wird Ihrer Suche standardmäßig angehängt.
|
|
33
|
-
- Geben Sie keine Wildcards vor dem Suchbegriff ein!`;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
export default `Our search uses Lucene and you may use the [full syntax](http://lucene.apache.org/core/8_9_0/index.html).
|
|
25
|
-
|
|
26
|
-
To learn about advanced search read our [Expert Search Site](/help/search-syntax).
|
|
27
|
-
|
|
28
|
-
### Basic Search
|
|
29
|
-
|
|
30
|
-
- The most relevant repositories are shown in the quick results.
|
|
31
|
-
- Press "enter" or click the "Show all results" button to find more results for all entities like users or groups.
|
|
32
|
-
- A multi-character wildcard (*) is added to your search by default.
|
|
33
|
-
- Do not enter Wildcards in front of the search!`;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
export default `## Modifikatoren
|
|
25
|
-
|
|
26
|
-
Hinweis: Sie können keine Wildcards als erstes Zeichen einer Suche verwenden.
|
|
27
|
-
|
|
28
|
-
<table>
|
|
29
|
-
<tr>
|
|
30
|
-
<th>Definition</th>
|
|
31
|
-
<th>Beispiel</th>
|
|
32
|
-
</tr>
|
|
33
|
-
<tr>
|
|
34
|
-
<td>? - Einzelzeichen-Wildcard</td>
|
|
35
|
-
<td>Ultimate?Repo - findet z.B. Ultimate-Repo, Ultimate Repo, Ultimate+Repo</td>
|
|
36
|
-
</tr>
|
|
37
|
-
<tr>
|
|
38
|
-
<td>* - mehrstelliger Platzhalter</td>
|
|
39
|
-
<td>Ultimat*y - findet z.B. Ultimate Repository, Ultimates-Spezial-Repository, Ultimate</td>
|
|
40
|
-
</tr>
|
|
41
|
-
</table>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
### Bereiche
|
|
45
|
-
|
|
46
|
-
Bereichsabfragen ermöglichen den Abgleich von Dokumenten, deren Feldwerte zwischen der unteren und der oberen Grenze liegen, die in der Bereichsabfrage angegeben sind. Bereichsabfragen können die obere und untere Grenze einschließen oder ausschließen. Die Sortierung erfolgt lexikografisch.
|
|
47
|
-
|
|
48
|
-
Bereiche sind nicht auf numerische Felder beschränkt.
|
|
49
|
-
|
|
50
|
-
<table>
|
|
51
|
-
<tr>
|
|
52
|
-
<th>Definition</th>
|
|
53
|
-
<th>Beispiel</th>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr>
|
|
56
|
-
<td>[ … TO … ] - inklusiver Bereich</td>
|
|
57
|
-
<td>creationDate:[1609459200000 TO 1612137600000] – findet z.B. Repositories, die zwischen dem 01.01.2021 und dem 01.02.2021 angelegt wurden.</td>
|
|
58
|
-
</tr>
|
|
59
|
-
<tr>
|
|
60
|
-
<td>{… TO …} - ausschließender Bereich</td>
|
|
61
|
-
<td>name:{Aida TO Carmen} – findet Namen zwischen Aida und Carmen, jedoch ohne die beiden Namen einzuschließen.</td>
|
|
62
|
-
</tr>
|
|
63
|
-
</table>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
## Boosten
|
|
67
|
-
|
|
68
|
-
Mit dem Boosting können Sie die Relevanz eines Dokuments steuern, indem Sie seinen Term verstärken.
|
|
69
|
-
|
|
70
|
-
<table>
|
|
71
|
-
<tr>
|
|
72
|
-
<th>Definition</th>
|
|
73
|
-
<th>Beispiel</th>
|
|
74
|
-
</tr>
|
|
75
|
-
<tr>
|
|
76
|
-
<td>term^Zahl</td>
|
|
77
|
-
<td>ultimate^2 repository – erhöht die Relevanz von „ultimate"</td>
|
|
78
|
-
</tr>
|
|
79
|
-
</table>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
Standardmäßig ist der Boost-Faktor 1. Obwohl der Boost-Faktor positiv sein muss, kann er kleiner als 1 sein (z. B. 0,2)
|
|
83
|
-
|
|
84
|
-
Standardmäßig werden Repository-Namen um 1,5 und Namespace-Namen um 1,25 geboostet.
|
|
85
|
-
|
|
86
|
-
## Boolesche Operatoren
|
|
87
|
-
|
|
88
|
-
Hinweis: Logische Operatoren müssen in Großbuchstaben eingegeben werden (z. B. „AND").
|
|
89
|
-
|
|
90
|
-
<table>
|
|
91
|
-
<tr>
|
|
92
|
-
<th>Definition</th>
|
|
93
|
-
<th>Beispiel</th>
|
|
94
|
-
</tr>
|
|
95
|
-
<tr>
|
|
96
|
-
<td>AND – beide Terme müssen enthalten sein</td>
|
|
97
|
-
<td>Ultimate AND Repository – findet z.B. Ultimate Repository, Ultimate Special Repository
|
|
98
|
-
</td>
|
|
99
|
-
</tr>
|
|
100
|
-
<tr>
|
|
101
|
-
<td>OR – mindestens einer der Terme muss enthalten sein</td>
|
|
102
|
-
<td>Ultimate OR Repository – findet z.B.. Ultimate Repository, Ultimate User, Special Repository</td>
|
|
103
|
-
</tr>
|
|
104
|
-
<tr>
|
|
105
|
-
<td>NOT – der nachfolgende Term darf nicht enthalten sein. „!" kann alternativ verwendet werden.</td>
|
|
106
|
-
<td>Ultimate NOT Repository – findet z.B.. Ultimate user, nicht jedoch z.B. Ultimate Repository</td>
|
|
107
|
-
</tr>
|
|
108
|
-
<tr>
|
|
109
|
-
<td>– schließt den folgenden Term von der Suche aus</td>
|
|
110
|
-
<td>Ultimate Repository -Special – findet z.B. Ultimate Repository, schließt z.B. Ultimate Special Repository aus</td>
|
|
111
|
-
</tr>
|
|
112
|
-
<tr>
|
|
113
|
-
<td>– der folgende Term muss enthalten sein</td>
|
|
114
|
-
<td>Ultimate +Repository – findet z.B. my Repository, Ultimate Repository</td>
|
|
115
|
-
</tr>
|
|
116
|
-
</table>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
## Gruppieren
|
|
120
|
-
|
|
121
|
-
Die Suche unterstützt die Verwendung von Klammern zur Gruppierung von Begriffen, um Teilabfragen zu bilden. Dies kann sehr nützlich sein, wenn Sie die boolesche Logik für eine Abfrage steuern möchten.
|
|
122
|
-
|
|
123
|
-
<table>
|
|
124
|
-
<tr>
|
|
125
|
-
<th>Definition</th>
|
|
126
|
-
<th>Beispiel</th>
|
|
127
|
-
</tr>
|
|
128
|
-
<tr>
|
|
129
|
-
<td>() – Terme zwischen den Klammern werden gruppiert</td>
|
|
130
|
-
<td>(Ultimate OR my) AND Repository – findet z.B.. Ultimate Repository, my Repository, schließt z.B. Super Repository. Entweder "Ultimate" oder “My” müssen im Ergebnis existieren, “Repository” muss immer enthalten sein.
|
|
131
|
-
</td>
|
|
132
|
-
</tr>
|
|
133
|
-
</table>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
## Umgang mit Sonderzeichen
|
|
137
|
-
|
|
138
|
-
Die Suche unterstützt Sonderzeichen, die Teil der Abfragesyntax sind. Die aktuellen Sonderzeichen der Liste sind
|
|
139
|
-
|
|
140
|
-
+ − && || ! ( ) { } [ ] ^ " ~ * ? : \ /
|
|
141
|
-
|
|
142
|
-
Um diese Zeichen zu nutzen, verwenden Sie „\" vor dem jeweiligen Zeichen. Um zum Beispiel nach (1+1):2 zu suchen, verwenden Sie diese Abfrage:
|
|
143
|
-
|
|
144
|
-
\(1\+1\)\:2
|
|
145
|
-
|
|
146
|
-
Partiell übersetzt mit www.DeepL.com/Translator (kostenlose Version)
|
|
147
|
-
|
|
148
|
-
Quelle [https://javadoc.io/static/org.apache.lucene/lucene-queryparser/8.9.0/org/apache/lucene/queryparser/classic/package-summary.html#package.description](https://javadoc.io/static/org.apache.lucene/lucene-queryparser/8.9.0/org/apache/lucene/queryparser/classic/package-summary.html#package.description)`;
|