@scm-manager/ui-api 2.31.2-20220208-073644 → 2.32.0

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-api",
3
- "version": "2.31.2-20220208-073644",
3
+ "version": "2.32.0",
4
4
  "description": "React hook api for the SCM-Manager backend",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -25,7 +25,7 @@
25
25
  "react-test-renderer": "^17.0.1"
26
26
  },
27
27
  "dependencies": {
28
- "@scm-manager/ui-types": "^2.31.2-20220208-073644",
28
+ "@scm-manager/ui-types": "^2.32.0",
29
29
  "fetch-mock-jest": "^1.5.1",
30
30
  "gitdiff-parser": "^0.1.2",
31
31
  "query-string": "6.14.1",
@@ -52,7 +52,7 @@ describe("ApiProvider tests", () => {
52
52
  });
53
53
 
54
54
  if (result.current?.onIndexFetched) {
55
- result.current.onIndexFetched({ version: "a.b.c", _links: {} });
55
+ result.current.onIndexFetched({ version: "a.b.c", _links: {}, instanceId: "123" });
56
56
  }
57
57
 
58
58
  expect(msg!).toEqual("hello");
@@ -33,7 +33,6 @@ export type BaseContext = {
33
33
 
34
34
  export type LegacyContext = BaseContext & {
35
35
  initialize: () => void;
36
- queryClient?: QueryClient;
37
36
  };
38
37
 
39
38
  const Context = createContext<LegacyContext | undefined>(undefined);
@@ -58,13 +58,14 @@ describe("Test config hooks", () => {
58
58
  proxyUser: null,
59
59
  realmDescription: "",
60
60
  alertsUrl: "",
61
+ feedbackUrl: "",
61
62
  releaseFeedUrl: "",
62
63
  skipFailedAuthenticators: false,
63
64
  _links: {
64
65
  update: {
65
- href: "/config",
66
- },
67
- },
66
+ href: "/config"
67
+ }
68
+ }
68
69
  };
69
70
 
70
71
  afterEach(() => {
@@ -77,7 +78,7 @@ describe("Test config hooks", () => {
77
78
  setIndexLink(queryClient, "config", "/config");
78
79
  fetchMock.get("/api/v2/config", config);
79
80
  const { result, waitFor } = renderHook(() => useConfig(), {
80
- wrapper: createWrapper(undefined, queryClient),
81
+ wrapper: createWrapper(undefined, queryClient)
81
82
  });
82
83
  await waitFor(() => !!result.current.data);
83
84
  expect(result.current.data).toEqual(config);
@@ -91,15 +92,15 @@ describe("Test config hooks", () => {
91
92
 
92
93
  const newConfig = {
93
94
  ...config,
94
- baseUrl: "/hog",
95
+ baseUrl: "/hog"
95
96
  };
96
97
 
97
98
  fetchMock.putOnce("/api/v2/config", {
98
- status: 200,
99
+ status: 200
99
100
  });
100
101
 
101
102
  const { result, waitForNextUpdate } = renderHook(() => useUpdateConfig(), {
102
- wrapper: createWrapper(undefined, queryClient),
103
+ wrapper: createWrapper(undefined, queryClient)
103
104
  });
104
105
 
105
106
  await act(() => {
package/src/config.ts CHANGED
@@ -30,20 +30,23 @@ import { requiredLink } from "./links";
30
30
 
31
31
  export const useConfig = (): ApiResult<Config> => {
32
32
  const indexLink = useIndexLink("config");
33
- return useQuery<Config, Error>("config", () => apiClient.get(indexLink!).then((response) => response.json()), {
34
- enabled: !!indexLink,
33
+ return useQuery<Config, Error>("config", () => apiClient.get(indexLink!).then(response => response.json()), {
34
+ enabled: !!indexLink
35
35
  });
36
36
  };
37
37
 
38
38
  export const useUpdateConfig = () => {
39
39
  const queryClient = useQueryClient();
40
40
  const { mutate, isLoading, error, data, reset } = useMutation<unknown, Error, Config>(
41
- (config) => {
41
+ config => {
42
42
  const updateUrl = requiredLink(config, "update");
43
43
  return apiClient.put(updateUrl, config, "application/vnd.scmm-config+json;v=2");
44
44
  },
45
45
  {
46
- onSuccess: () => queryClient.invalidateQueries("config"),
46
+ onSuccess: async () => {
47
+ await queryClient.invalidateQueries("config");
48
+ await queryClient.invalidateQueries("index");
49
+ }
47
50
  }
48
51
  );
49
52
  return {
@@ -51,6 +54,6 @@ export const useUpdateConfig = () => {
51
54
  isLoading,
52
55
  error,
53
56
  isUpdated: !!data,
54
- reset,
57
+ reset
55
58
  };
56
59
  };
@@ -137,11 +137,11 @@ Die Suche unterstützt die Verwendung von Klammern zur Gruppierung von Begriffen
137
137
 
138
138
  Die Suche unterstützt Sonderzeichen, die Teil der Abfragesyntax sind. Die aktuellen Sonderzeichen der Liste sind
139
139
 
140
- + - && || ! ( ) { } [ ] ^ " ~ * ? : \\ /
140
+ &plus; &minus; && || ! ( ) { } [ ] ^ " ~ * ? : &bsol; /
141
141
 
142
- Um diese Zeichen zu nutzen, verwenden Sie das „\\" vor dem jeweiligen Zeichen. Um zum Beispiel nach (1+1):2 zu suchen, verwenden Sie diese Abfrage:
142
+ Um diese Zeichen zu nutzen, verwenden Sie „&bsol;" vor dem jeweiligen Zeichen. Um zum Beispiel nach (1+1):2 zu suchen, verwenden Sie diese Abfrage:
143
143
 
144
- \\(1\\+1\\)\\:2
144
+ &bsol;(1&bsol;+1&bsol;)&bsol;:2
145
145
 
146
146
  Partiell übersetzt mit www.DeepL.com/Translator (kostenlose Version)
147
147
 
@@ -136,10 +136,10 @@ Search supports using parentheses to group clauses to form sub queries. This can
136
136
 
137
137
  The search supports escaping special characters that are part of the query syntax. The current list special characters are
138
138
 
139
- + - && || ! ( ) { } [ ] ^ " ~ * ? : \\ /
139
+ &plus; &minus; && || ! ( ) { } [ ] ^ " ~ * ? : &bsol; /
140
140
 
141
- To escape these characters use the "\\" before the character. For example to search for (1+1):2 use the query:
141
+ To escape these characters use the "&bsol;" before the character. For example to search for (1+1):2 use the query:
142
142
 
143
- \\(1\\+1\\)\\:2
143
+ &bsol;(1&bsol;+1&bsol;)&bsol;:2
144
144
 
145
145
  Source: [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)`;
package/src/index.ts CHANGED
@@ -63,6 +63,7 @@ export * from "./search";
63
63
  export * from "./loginInfo";
64
64
  export * from "./usePluginCenterAuthInfo";
65
65
  export * from "./compare";
66
+ export * from "./utils";
66
67
 
67
68
  export { default as ApiProvider } from "./ApiProvider";
68
69
  export * from "./ApiProvider";