mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 01:15:44 +01:00
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:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user