diff --git a/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/ChartBoundaryLevelsConfiguration.tsx b/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/ChartBoundaryLevelsConfiguration.tsx index bf74c6a2e3..0d6ee3f9b5 100644 --- a/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/ChartBoundaryLevelsConfiguration.tsx +++ b/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/ChartBoundaryLevelsConfiguration.tsx @@ -10,8 +10,6 @@ import React, { ReactNode, useCallback, useMemo } from 'react'; interface Props { buttons?: ReactNode; - // TODO: EES-5402 - Remove when all boundary level changes are done - hasDataSetBoundaryLevels?: boolean; map: MapConfig; meta: FullTableMeta; options: ChartOptions; @@ -21,8 +19,6 @@ interface Props { export default function ChartBoundaryLevelsConfiguration({ buttons, - // TODO: EES-5402 - Remove when all boundary level changes are done - hasDataSetBoundaryLevels = true, map, meta, options, @@ -77,7 +73,6 @@ export default function ChartBoundaryLevelsConfiguration({ ) => void; onSubmit: (values: ChartBoundaryLevelsFormValues) => void; @@ -37,8 +35,6 @@ interface Props { export default function ChartBoundaryLevelsForm({ buttons, dataSetConfigs, - // TODO: EES-5402 - Remove when all boundary level changes are done - hasDataSetBoundaryLevels, initialValues, meta, onChange, @@ -120,16 +116,8 @@ export default function ChartBoundaryLevelsForm({ onMount={updateForm} /> - label={ - hasDataSetBoundaryLevels - ? 'Default boundary level' - : 'Boundary level' - } - hint={`Select a version of geographical data to use${ - hasDataSetBoundaryLevels - ? " across any data sets that don't have a specific one set" - : '' - }`} + label="Default boundary level" + hint="Select a version of geographical data to use across any data sets that don't have a specific one set" name="boundaryLevel" order={[]} options={[ @@ -140,7 +128,7 @@ export default function ChartBoundaryLevelsForm({ ...boundaryLevelOptions, ]} /> - {hasDataSetBoundaryLevels && dataSetRows.length > 1 && ( + {dataSetRows.length > 1 && ( <>

Set boundary levels per data set

diff --git a/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBoundaryLevelsConfiguration.test.tsx b/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBoundaryLevelsConfiguration.test.tsx index 9387194638..9469f7f66c 100644 --- a/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBoundaryLevelsConfiguration.test.tsx +++ b/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBoundaryLevelsConfiguration.test.tsx @@ -98,7 +98,6 @@ describe('ChartBoundaryLevelsConfiguration', () => { options={testDefaultChartOptions} onChange={noop} onSubmit={noop} - hasDataSetBoundaryLevels />, ); expect(screen.getByLabelText('Default boundary level')).toBeInTheDocument(); @@ -116,7 +115,6 @@ describe('ChartBoundaryLevelsConfiguration', () => { options={testDefaultChartOptions} onChange={noop} onSubmit={noop} - hasDataSetBoundaryLevels />, ); @@ -201,7 +199,6 @@ describe('ChartBoundaryLevelsConfiguration', () => { }} onChange={noop} onSubmit={noop} - hasDataSetBoundaryLevels />, ); @@ -229,7 +226,6 @@ describe('ChartBoundaryLevelsConfiguration', () => { options={testDefaultChartOptions} onChange={handleChange} onSubmit={noop} - hasDataSetBoundaryLevels />, ); @@ -264,7 +260,6 @@ describe('ChartBoundaryLevelsConfiguration', () => { options={testDefaultChartOptions} onChange={noop} onSubmit={noop} - hasDataSetBoundaryLevels />, ); @@ -294,7 +289,6 @@ describe('ChartBoundaryLevelsConfiguration', () => { options={testDefaultChartOptions} onChange={noop} onSubmit={handleSubmit} - hasDataSetBoundaryLevels />, ); @@ -329,7 +323,6 @@ describe('ChartBoundaryLevelsConfiguration', () => { }} onChange={noop} onSubmit={handleSubmit} - hasDataSetBoundaryLevels />, ); diff --git a/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBuilder.test.tsx b/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBuilder.test.tsx index b41146892e..7f3f64d867 100644 --- a/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBuilder.test.tsx +++ b/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBuilder.test.tsx @@ -361,7 +361,7 @@ describe('ChartBuilder', () => { test('calls `onTableQueryUpdate` when change boundary level', async () => { const testInitialChart: Chart = { - onBoundaryLevelChange: () => {}, + onBoundaryLevelChange: jest.fn(), type: 'map', boundaryLevel: 2, map: { @@ -444,7 +444,9 @@ describe('ChartBuilder', () => { await user.click(screen.getByRole('tab', { name: 'Boundary levels' })); - await user.selectOptions(screen.getByLabelText('Boundary level'), ['1']); + await user.selectOptions(screen.getByLabelText('Default boundary level'), [ + '1', + ]); expect(handleUpdate).toHaveBeenCalledWith({ boundaryLevel: 1 }); }); diff --git a/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBuilderTabSection.test.tsx b/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBuilderTabSection.test.tsx index 7112e71e92..6004fabca0 100644 --- a/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBuilderTabSection.test.tsx +++ b/src/explore-education-statistics-admin/src/pages/release/datablocks/components/chart/__tests__/ChartBuilderTabSection.test.tsx @@ -187,7 +187,9 @@ describe('ChartBuilderTabSection', () => { await user.click(screen.getByRole('tab', { name: 'Boundary levels' })); - await user.selectOptions(screen.getByLabelText('Boundary level'), ['1']); + await user.selectOptions(screen.getByLabelText('Default boundary level'), [ + '1', + ]); expect(tableBuilderService.getTableData).toHaveBeenCalledWith( { ...testQuery, boundaryLevel: 1 }, diff --git a/src/explore-education-statistics-common/src/modules/charts/components/MapBlock.tsx b/src/explore-education-statistics-common/src/modules/charts/components/MapBlock.tsx index 9652913702..c7bb73c1aa 100644 --- a/src/explore-education-statistics-common/src/modules/charts/components/MapBlock.tsx +++ b/src/explore-education-statistics-common/src/modules/charts/components/MapBlock.tsx @@ -225,7 +225,7 @@ export default function MapBlock({ ); const handleDataSetChange = useCallback( - async (value: string) => { + (value: string) => { setSelectedDataSetKey(value); const previouslyRenderredBoundaryLevel = selectedDataSetConfig?.boundaryLevel ?? boundaryLevel; @@ -234,7 +234,7 @@ export default function MapBlock({ if (newBoundaryLevelToRender !== previouslyRenderredBoundaryLevel) { setIsBoundaryLevelChanging.on(); - await onBoundaryLevelChange( + onBoundaryLevelChange( dataSetCategoryConfigs[value].boundaryLevel ?? boundaryLevel, ); }