Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UITEN-306: Fix saving problem for routing service point(ECS only) #422

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* [UITEN-299](https://folio-org.atlassian.net/browse/UITEN-299) Rewrite class components to functional ones (ui-tenant-settings module).
* [UITEN-292](https://folio-org.atlassian.net/browse/UITEN-292) Change visibility rules for routing service points.
* [UITEN-304](https://folio-org.atlassian.net/browse/UITEN-304) Provide case insensitive sorted data to edit record, field components.
* [UITEN-306](https://folio-org.atlassian.net/browse/UITEN-306) Fix saving problem for routing service point(ECS only).

## [8.1.0](https://github.com/folio-org/ui-tenant-settings/tree/v8.1.0)(2024-03-19)
[Full Changelog](https://github.com/folio-org/ui-tenant-settings/compare/v8.0.0...v8.1.0)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
"@testing-library/dom": "^7.26.3",
"@testing-library/jest-dom": "^5.11.1",
"@testing-library/react": "^11.0.2",
"@testing-library/react-hooks": "^7.0.1",
"@testing-library/user-event": "^12.1.10",
"babel-eslint": "^9.0.0",
"babel-jest": "^26.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import {
QueryClient,
QueryClientProvider,
} from 'react-query';
import {
renderHook,
act,
} from '@testing-library/react-hooks';

import { useOkapiKy } from '@folio/stripes/core';

import useCirculationSettingsEcsTlrFeature from './useCirculationSettingsEcsTlrFeature';

const queryClient = new QueryClient();

// eslint-disable-next-line react/prop-types
const wrapper = ({ children }) => (
<QueryClientProvider client={queryClient}>
{children}
</QueryClientProvider>
);

const data = 'data';

describe('useCirculationSettingsEcsTlrFeature', () => {
it('should fetch data', async () => {
useOkapiKy.mockClear().mockReturnValue({
get: () => ({
json: () => ({
data,
}),
}),
});

const { result } = renderHook(() => useCirculationSettingsEcsTlrFeature(true), { wrapper });

await act(() => {
return !result.current.isLoading;
});

expect(result.current.titleLevelRequestsFeatureEnabled).toBeFalsy();
});
});
1 change: 1 addition & 0 deletions src/settings/ServicePoints/ServicePointFormContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

useEffect(() => {
setInitialValues(getServicePoint());
}, [servicePoint.id, parentResources.staffSlips.hasLoaded]);

Check warning on line 39 in src/settings/ServicePoints/ServicePointFormContainer.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

React Hook useEffect has a missing dependency: 'getServicePoint'. Either include it or remove the dependency array

Check warning on line 39 in src/settings/ServicePoints/ServicePointFormContainer.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

React Hook useEffect has a missing dependency: 'getServicePoint'. Either include it or remove the dependency array

const transformStaffSlipsData = useCallback((staffSlips) => {
const currentSlips = parentResources?.staffSlips?.records || [];
Expand All @@ -63,6 +63,7 @@
}

if (data.ecsRequestRouting) {
unset(data, 'shelvingLagTime');
unset(data, 'pickupLocation');
unset(data, 'holdShelfExpiryPeriod');
unset(data, 'holdShelfClosedLibraryDateManagement');
Expand Down
Loading