Add "enable file search" flag on global config.

Make the repository file search deactivatable
via the global config. This feature could
overwhelm the server on repositories with
millions of file therefore it now can be turned off.

Committed-by: Rene Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This commit is contained in:
Eduard Heimbuch
2023-07-06 08:47:51 +02:00
parent 84fbe7ea35
commit c1d7230fbd
25 changed files with 246 additions and 82 deletions

View File

@@ -42,6 +42,7 @@ describe("Test config hooks", () => {
enabledUserConverter: false,
enabledXsrfProtection: false,
enabledApiKeys: false,
enabledFileSearch: true,
forceBaseUrl: false,
loginAttemptLimit: 0,
loginAttemptLimitTimeout: 0,
@@ -62,9 +63,9 @@ describe("Test config hooks", () => {
skipFailedAuthenticators: false,
_links: {
update: {
href: "/config"
}
}
href: "/config",
},
},
};
afterEach(() => {
@@ -77,7 +78,7 @@ describe("Test config hooks", () => {
setIndexLink(queryClient, "config", "/config");
fetchMock.get("/api/v2/config", config);
const { result, waitFor } = renderHook(() => useConfig(), {
wrapper: createWrapper(undefined, queryClient)
wrapper: createWrapper(undefined, queryClient),
});
await waitFor(() => !!result.current.data);
expect(result.current.data).toEqual(config);
@@ -91,15 +92,15 @@ describe("Test config hooks", () => {
const newConfig = {
...config,
baseUrl: "/hog"
baseUrl: "/hog",
};
fetchMock.putOnce("/api/v2/config", {
status: 200
status: 200,
});
const { result, waitForNextUpdate } = renderHook(() => useUpdateConfig(), {
wrapper: createWrapper(undefined, queryClient)
wrapper: createWrapper(undefined, queryClient),
});
await act(() => {