From 746d7454d2185b20bbe780f6210930fc736c37cf Mon Sep 17 00:00:00 2001 From: Roberto Jimenez Sanchez Date: Wed, 10 Dec 2025 17:04:28 +0100 Subject: [PATCH] Update useResourceStats hook in BootstrapStep component to accept selected target - Modified the BootstrapStep component to pass the selected target to the useResourceStats hook. - Updated related tests to reflect the change in expected arguments for the useResourceStats hook. --- .../app/features/provisioning/Wizard/BootstrapStep.test.tsx | 4 ++-- public/app/features/provisioning/Wizard/BootstrapStep.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/features/provisioning/Wizard/BootstrapStep.test.tsx b/public/app/features/provisioning/Wizard/BootstrapStep.test.tsx index e4681247e94..3b2eb7d7157 100644 --- a/public/app/features/provisioning/Wizard/BootstrapStep.test.tsx +++ b/public/app/features/provisioning/Wizard/BootstrapStep.test.tsx @@ -207,7 +207,7 @@ describe('BootstrapStep', () => { setup(); const mockUseResourceStats = require('./hooks/useResourceStats').useResourceStats; - expect(mockUseResourceStats).toHaveBeenCalledWith('test-repo', undefined); + expect(mockUseResourceStats).toHaveBeenCalledWith('test-repo', 'instance'); }); it('should use useResourceStats hook with legacy storage flag', async () => { @@ -220,7 +220,7 @@ describe('BootstrapStep', () => { }); const mockUseResourceStats = require('./hooks/useResourceStats').useResourceStats; - expect(mockUseResourceStats).toHaveBeenCalledWith('test-repo', true); + expect(mockUseResourceStats).toHaveBeenCalledWith('test-repo', 'instance'); }); }); diff --git a/public/app/features/provisioning/Wizard/BootstrapStep.tsx b/public/app/features/provisioning/Wizard/BootstrapStep.tsx index 3c792b81189..4931581751e 100644 --- a/public/app/features/provisioning/Wizard/BootstrapStep.tsx +++ b/public/app/features/provisioning/Wizard/BootstrapStep.tsx @@ -37,7 +37,7 @@ export const BootstrapStep = memo(function BootstrapStep({ settingsData, repoNam const repositoryType = watch('repository.type'); const { enabledOptions, disabledOptions } = useModeOptions(repoName, settingsData); const { target } = enabledOptions?.[0]; - const { resourceCountString, fileCountString, isLoading } = useResourceStats(repoName); + const { resourceCountString, fileCountString, isLoading } = useResourceStats(repoName, selectedTarget); const styles = useStyles2(getStyles); useEffect(() => {