Skip to content

Commit e98d9d8

Browse files
fixes
1 parent 62f6ef7 commit e98d9d8

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

datahub-web-react/src/app/entityV2/shared/entity/EntityActions.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function EntityActions(props: Props) {
335335
onContinue={batchAddGlossaryTerms}
336336
onCancel={() => setIsBatchAddGlossaryTermModalVisible(false)}
337337
fixedEntityTypes={Array.from(
338-
entityRegistry.getTypesWithSupportedCapabilities(EntityCapabilityType.GLOSSARY_TERMS as any),
338+
entityRegistry.getTypesWithSupportedCapabilities(EntityCapabilityType.GLOSSARY_TERMS),
339339
)}
340340
/>
341341
)}
@@ -346,7 +346,7 @@ function EntityActions(props: Props) {
346346
onContinue={batchSetDomain}
347347
onCancel={() => setIsBatchSetDomainModalVisible(false)}
348348
fixedEntityTypes={Array.from(
349-
entityRegistry.getTypesWithSupportedCapabilities(EntityCapabilityType.DOMAINS as any),
349+
entityRegistry.getTypesWithSupportedCapabilities(EntityCapabilityType.DOMAINS),
350350
)}
351351
/>
352352
)}
@@ -357,7 +357,7 @@ function EntityActions(props: Props) {
357357
onContinue={batchSetApplication}
358358
onCancel={() => setIsBatchSetApplicationModalVisible(false)}
359359
fixedEntityTypes={Array.from(
360-
entityRegistry.getTypesWithSupportedCapabilities(EntityCapabilityType.APPLICATIONS as any),
360+
entityRegistry.getTypesWithSupportedCapabilities(EntityCapabilityType.APPLICATIONS),
361361
)}
362362
/>
363363
)}
@@ -368,7 +368,7 @@ function EntityActions(props: Props) {
368368
onContinue={batchSetDataProduct}
369369
onCancel={() => setIsBatchSetDataProductModalVisible(false)}
370370
fixedEntityTypes={Array.from(
371-
entityRegistry.getTypesWithSupportedCapabilities(EntityCapabilityType.DATA_PRODUCTS as any),
371+
entityRegistry.getTypesWithSupportedCapabilities(EntityCapabilityType.DATA_PRODUCTS),
372372
)}
373373
/>
374374
)}

datahub-web-react/src/app/entityV2/shared/sidebarSection/SidebarStructuredProperties.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
SHOW_IN_ASSET_SUMMARY_PROPERTY_FILTER_NAME,
2626
SHOW_IN_COLUMNS_TABLE_PROPERTY_FILTER_NAME,
2727
} from '@src/app/searchV2/utils/constants';
28-
import { useEntityRegistry } from '@src/app/useEntityRegistry';
28+
import { useEntityRegistryV2 } from '@src/app/useEntityRegistry';
2929
import { useGetSearchResultsForMultipleQuery } from '@src/graphql/search.generated';
3030
import {
3131
EntityType,
@@ -50,7 +50,7 @@ const MAX_STRUCTURED_PROPERTIES_TO_FETCH = 100;
5050

5151
const SidebarStructuredProperties = ({ properties }: Props) => {
5252
const { entityData, entityType } = useEntityData();
53-
const entityRegistry = useEntityRegistry();
53+
const entityRegistry = useEntityRegistryV2();
5454
const canEditProps = entityData?.parent?.privileges?.canEditProperties || entityData?.privileges?.canEditProperties;
5555
const [isPropModalVisible, setIsPropModalVisible] = useState(false);
5656
const [selectedProperty, setSelectedProperty] = useState<SearchResult | undefined>();

datahub-web-react/src/app/sharedV2/reloadableContext/hooks/__tests__/useReloadableLazyQuery.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('useReloadableLazyQuery', () => {
1616
const mockLazyQueryHook = vi.fn().mockReturnValue([mockExecute, { loading: false, error: null }]);
1717
useReloadableContextSpy.mockReturnValue({
1818
shouldBeReloaded: () => true,
19-
reloaded: () => {},
19+
markAsReloaded: () => {},
2020
reloadByKeyType: () => {},
2121
});
2222

@@ -36,7 +36,7 @@ describe('useReloadableLazyQuery', () => {
3636
const mockLazyQueryHook = vi.fn().mockReturnValue([mockExecute, { loading: false, error: null }]);
3737
useReloadableContextSpy.mockReturnValue({
3838
shouldBeReloaded: () => false,
39-
reloaded: () => {},
39+
markAsReloaded: () => {},
4040
reloadByKeyType: () => {},
4141
});
4242

@@ -52,46 +52,46 @@ describe('useReloadableLazyQuery', () => {
5252
});
5353

5454
it('should call the reloaded function when the query is successful', () => {
55-
const reloadedMock = vi.fn();
55+
const markAsReloadedMock = vi.fn();
5656
const mockLazyQueryHook = vi.fn().mockReturnValue([vi.fn(), { loading: false, error: null }]);
5757
useReloadableContextSpy.mockReturnValue({
5858
shouldBeReloaded: () => true,
59-
reloaded: reloadedMock,
59+
markAsReloaded: markAsReloadedMock,
6060
reloadByKeyType: () => {},
6161
});
6262

6363
renderHook(() => useReloadableLazyQuery(mockLazyQueryHook, { type: 'test', id: '1' }, {}));
6464

65-
expect(reloadedMock).toHaveBeenCalledWith('test', '1');
65+
expect(markAsReloadedMock).toHaveBeenCalledWith('test', '1');
6666
});
6767

6868
it('should not call the reloaded function when the query is loading', () => {
69-
const reloadedMock = vi.fn();
69+
const markAsReloadedMock = vi.fn();
7070
const mockLazyQueryHook = vi.fn().mockReturnValue([vi.fn(), { loading: true, error: null }]);
7171
useReloadableContextSpy.mockReturnValue({
7272
shouldBeReloaded: () => true,
73-
reloaded: reloadedMock,
73+
markAsReloaded: markAsReloadedMock,
7474
reloadByKeyType: () => {},
7575
});
7676

7777
renderHook(() => useReloadableLazyQuery(mockLazyQueryHook, { type: 'test', id: '1' }, {}));
7878

79-
expect(reloadedMock).not.toHaveBeenCalled();
79+
expect(markAsReloadedMock).not.toHaveBeenCalled();
8080
});
8181

8282
it('should not call the reloaded function when the query has an error', () => {
83-
const reloadedMock = vi.fn();
83+
const markAsReloadedMock = vi.fn();
8484
const mockLazyQueryHook = vi
8585
.fn()
8686
.mockReturnValue([vi.fn(), { loading: false, error: new Error('test error') }]);
8787
useReloadableContextSpy.mockReturnValue({
8888
shouldBeReloaded: () => true,
89-
reloaded: reloadedMock,
89+
markAsReloaded: markAsReloadedMock,
9090
reloadByKeyType: () => {},
9191
});
9292

9393
renderHook(() => useReloadableLazyQuery(mockLazyQueryHook, { type: 'test', id: '1' }, {}));
9494

95-
expect(reloadedMock).not.toHaveBeenCalled();
95+
expect(markAsReloadedMock).not.toHaveBeenCalled();
9696
});
9797
});

datahub-web-react/src/app/sharedV2/reloadableContext/hooks/__tests__/useReloadableQuery.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('useReloadableQuery', () => {
1515
const mockQueryHook = vi.fn().mockReturnValue({ loading: false, error: null });
1616
useReloadableContextSpy.mockReturnValue({
1717
shouldBeReloaded: () => true,
18-
reloaded: () => {},
18+
markAsReloaded: () => {},
1919
reloadByKeyType: () => {},
2020
});
2121

@@ -28,7 +28,7 @@ describe('useReloadableQuery', () => {
2828
const mockQueryHook = vi.fn().mockReturnValue({ loading: false, error: null });
2929
useReloadableContextSpy.mockReturnValue({
3030
shouldBeReloaded: () => false,
31-
reloaded: () => {},
31+
markAsReloaded: () => {},
3232
reloadByKeyType: () => {},
3333
});
3434

@@ -38,44 +38,44 @@ describe('useReloadableQuery', () => {
3838
});
3939

4040
it('should call the reloaded function when the query is successful', () => {
41-
const reloadedMock = vi.fn();
41+
const markAsReloadedMock = vi.fn();
4242
const mockQueryHook = vi.fn().mockReturnValue({ loading: false, error: null });
4343
useReloadableContextSpy.mockReturnValue({
4444
shouldBeReloaded: () => true,
45-
reloaded: reloadedMock,
45+
markAsReloaded: markAsReloadedMock,
4646
reloadByKeyType: () => {},
4747
});
4848

4949
renderHook(() => useReloadableQuery(mockQueryHook, { type: 'test', id: '1' }, {}));
5050

51-
expect(reloadedMock).toHaveBeenCalledWith('test', '1');
51+
expect(markAsReloadedMock).toHaveBeenCalledWith('test', '1');
5252
});
5353

5454
it('should not call the reloaded function when the query is loading', () => {
55-
const reloadedMock = vi.fn();
55+
const markAsReloadedMock = vi.fn();
5656
const mockQueryHook = vi.fn().mockReturnValue({ loading: true, error: null });
5757
useReloadableContextSpy.mockReturnValue({
5858
shouldBeReloaded: () => true,
59-
reloaded: reloadedMock,
59+
markAsReloaded: markAsReloadedMock,
6060
reloadByKeyType: () => {},
6161
});
6262

6363
renderHook(() => useReloadableQuery(mockQueryHook, { type: 'test', id: '1' }, {}));
6464

65-
expect(reloadedMock).not.toHaveBeenCalled();
65+
expect(markAsReloadedMock).not.toHaveBeenCalled();
6666
});
6767

6868
it('should not call the reloaded function when the query has an error', () => {
69-
const reloadedMock = vi.fn();
69+
const markAsReloadedMock = vi.fn();
7070
const mockQueryHook = vi.fn().mockReturnValue({ loading: false, error: new Error('test error') });
7171
useReloadableContextSpy.mockReturnValue({
7272
shouldBeReloaded: () => true,
73-
reloaded: reloadedMock,
73+
markAsReloaded: markAsReloadedMock,
7474
reloadByKeyType: () => {},
7575
});
7676

7777
renderHook(() => useReloadableQuery(mockQueryHook, { type: 'test', id: '1' }, {}));
7878

79-
expect(reloadedMock).not.toHaveBeenCalled();
79+
expect(markAsReloadedMock).not.toHaveBeenCalled();
8080
});
8181
});

0 commit comments

Comments
 (0)