From 1ba21b4fbc66cc7f9c577ed3f003958037c6b7b6 Mon Sep 17 00:00:00 2001 From: aidynoJ Date: Thu, 14 Nov 2024 17:27:17 +0500 Subject: [PATCH] rename to useUserTenantPermissions --- CHANGELOG.md | 2 +- index.js | 2 +- src/hooks/index.js | 2 +- ...SelfTenantPermissions.js => useUserTenantPermissions.js} | 4 ++-- ...Permissions.test.js => useUserTenantPermissions.test.js} | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) rename src/hooks/{useUserSelfTenantPermissions.js => useUserTenantPermissions.js} (92%) rename src/hooks/{useUserSelfTenantPermissions.test.js => useUserTenantPermissions.test.js} (87%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8adbbf654..1c3b82899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ * Conditionally use `/users-keycloak/_self` endpoint when `users-keycloak` interface is present. Refs STCOR-835. * Wait longer before declaring a rotation request to be stale. Refs STCOR-895. * Send the stored central tenant name in the header on logout. Refs STCOR-900. -* Use the `users-keycloak/_self` endpoint conditionally when the `users-keycloak` interface is present; otherwise, use `bl-users/_self` within `useUserSelfTenantPermissions`. Refs STCOR-905. +* Use the `users-keycloak/_self` endpoint conditionally when the `users-keycloak` interface is present; otherwise, use `bl-users/_self` within `useUserTenantPermissions`. Refs STCOR-905. ## [10.2.0](https://github.com/folio-org/stripes-core/tree/v10.2.0) (2024-10-11) [Full Changelog](https://github.com/folio-org/stripes-core/compare/v10.1.1...v10.2.0) diff --git a/index.js b/index.js index cb7a94d2c..67fd4d1d0 100644 --- a/index.js +++ b/index.js @@ -40,7 +40,7 @@ export { useChunkedCQLFetch } from './src/queries'; export { getUserTenantsPermissions } from './src/queries'; /* Hooks */ -export { useUserSelfTenantPermissions } from './src/hooks'; +export { useUserTenantPermissions } from './src/hooks'; /* misc */ export { supportedLocales } from './src/loginServices'; diff --git a/src/hooks/index.js b/src/hooks/index.js index 70c0af475..8a889a1b9 100644 --- a/src/hooks/index.js +++ b/src/hooks/index.js @@ -1 +1 @@ -export { default as useUserSelfTenantPermissions } from './useUserSelfTenantPermissions'; +export { default as useUserTenantPermissions } from './useUserTenantPermissions'; // eslint-disable-line import/prefer-default-export diff --git a/src/hooks/useUserSelfTenantPermissions.js b/src/hooks/useUserTenantPermissions.js similarity index 92% rename from src/hooks/useUserSelfTenantPermissions.js rename to src/hooks/useUserTenantPermissions.js index 4deadfcad..91b5a503e 100644 --- a/src/hooks/useUserSelfTenantPermissions.js +++ b/src/hooks/useUserTenantPermissions.js @@ -6,7 +6,7 @@ import useOkapiKy from '../useOkapiKy'; const INITIAL_DATA = []; -const useUserSelfTenantPermissions = ( +const useUserTenantPermissions = ( { tenantId }, options = {}, ) => { @@ -49,4 +49,4 @@ const useUserSelfTenantPermissions = ( }); }; -export default useUserSelfTenantPermissions; +export default useUserTenantPermissions; diff --git a/src/hooks/useUserSelfTenantPermissions.test.js b/src/hooks/useUserTenantPermissions.test.js similarity index 87% rename from src/hooks/useUserSelfTenantPermissions.test.js rename to src/hooks/useUserTenantPermissions.test.js index c2876a5dc..18be2f44f 100644 --- a/src/hooks/useUserSelfTenantPermissions.test.js +++ b/src/hooks/useUserTenantPermissions.test.js @@ -5,7 +5,7 @@ import { } from 'react-query'; import permissions from 'fixtures/permissions'; -import useUserSelfTenantPermissions from './useUserSelfTenantPermissions'; +import useUserTenantPermissions from './useUserTenantPermissions'; import useOkapiKy from '../useOkapiKy'; jest.mock('../useOkapiKy'); @@ -31,7 +31,7 @@ const response = { permissions: { permissions }, }; -describe('useUserSelfTenantPermissions', () => { +describe('useUserTenantPermissions', () => { const getMock = jest.fn(() => ({ json: () => Promise.resolve(response), })); @@ -55,7 +55,7 @@ describe('useUserSelfTenantPermissions', () => { const options = { tenantId: 'tenantId', }; - const { result } = renderHook(() => useUserSelfTenantPermissions(options), { wrapper }); + const { result } = renderHook(() => useUserTenantPermissions(options), { wrapper }); await waitFor(() => !result.current.isLoading);