From 8356e6f8093c06a575f8576dc96a010b1b94bc41 Mon Sep 17 00:00:00 2001 From: stefanbabukov Date: Mon, 27 Nov 2023 17:46:28 +0000 Subject: [PATCH 1/4] disabled bin step for the knee plot Signed-off-by: stefanbabukov --- .../CellSizeDistribution/CalculationConfig.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx b/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx index 5114b8317d..50826b0c8c 100644 --- a/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx +++ b/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx @@ -16,7 +16,7 @@ const MIN_CELL_SIZE_PLACEHOLDER = 10800; const CellSizeDistributionConfig = (props) => { const { - config, disabled, updateSettings, highestUmi, + config, disabled, updateSettings, highestUmi, plotType, } = props; const withinRange = (cellSize) => Math.max(Math.min(cellSize, highestUmi), 0); @@ -54,7 +54,7 @@ const CellSizeDistributionConfig = (props) => { onUpdate={(value) => { updateSettings({ binStep: value }); }} - disabled={disabled} + disabled={disabled || plotType === 'kneePlot'} /> @@ -65,12 +65,14 @@ CellSizeDistributionConfig.defaultProps = { config: {}, disabled: false, highestUmi: null, + plotType: null, }; CellSizeDistributionConfig.propTypes = { updateSettings: PropTypes.func, config: PropTypes.object, disabled: PropTypes.bool, highestUmi: PropTypes.number, + plotType: PropTypes.string, }; export default CellSizeDistributionConfig; From f8f46365bcfecb26f1c5adf01bee463f5000fbd3 Mon Sep 17 00:00:00 2001 From: stefanbabukov Date: Mon, 27 Nov 2023 17:44:17 +0000 Subject: [PATCH 2/4] Revert "disable bin step for the knee plot" This reverts commit e445326d09763423ab482f53712cfcbe963d582b. Signed-off-by: stefanbabukov --- .../CellSizeDistribution/CalculationConfig.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx b/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx index 50826b0c8c..5114b8317d 100644 --- a/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx +++ b/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx @@ -16,7 +16,7 @@ const MIN_CELL_SIZE_PLACEHOLDER = 10800; const CellSizeDistributionConfig = (props) => { const { - config, disabled, updateSettings, highestUmi, plotType, + config, disabled, updateSettings, highestUmi, } = props; const withinRange = (cellSize) => Math.max(Math.min(cellSize, highestUmi), 0); @@ -54,7 +54,7 @@ const CellSizeDistributionConfig = (props) => { onUpdate={(value) => { updateSettings({ binStep: value }); }} - disabled={disabled || plotType === 'kneePlot'} + disabled={disabled} /> @@ -65,14 +65,12 @@ CellSizeDistributionConfig.defaultProps = { config: {}, disabled: false, highestUmi: null, - plotType: null, }; CellSizeDistributionConfig.propTypes = { updateSettings: PropTypes.func, config: PropTypes.object, disabled: PropTypes.bool, highestUmi: PropTypes.number, - plotType: PropTypes.string, }; export default CellSizeDistributionConfig; From 1234a41b3ba43269786a91aeff4b21e04d57c7a0 Mon Sep 17 00:00:00 2001 From: stefanbabukov Date: Mon, 27 Nov 2023 17:46:28 +0000 Subject: [PATCH 3/4] disabled bin step for the knee plot Signed-off-by: stefanbabukov --- .../CellSizeDistribution/CalculationConfig.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx b/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx index 5114b8317d..50826b0c8c 100644 --- a/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx +++ b/src/components/data-processing/CellSizeDistribution/CalculationConfig.jsx @@ -16,7 +16,7 @@ const MIN_CELL_SIZE_PLACEHOLDER = 10800; const CellSizeDistributionConfig = (props) => { const { - config, disabled, updateSettings, highestUmi, + config, disabled, updateSettings, highestUmi, plotType, } = props; const withinRange = (cellSize) => Math.max(Math.min(cellSize, highestUmi), 0); @@ -54,7 +54,7 @@ const CellSizeDistributionConfig = (props) => { onUpdate={(value) => { updateSettings({ binStep: value }); }} - disabled={disabled} + disabled={disabled || plotType === 'kneePlot'} /> @@ -65,12 +65,14 @@ CellSizeDistributionConfig.defaultProps = { config: {}, disabled: false, highestUmi: null, + plotType: null, }; CellSizeDistributionConfig.propTypes = { updateSettings: PropTypes.func, config: PropTypes.object, disabled: PropTypes.bool, highestUmi: PropTypes.number, + plotType: PropTypes.string, }; export default CellSizeDistributionConfig; From 7c814c4a20bad3941a2b74c2df3597265bc7494a Mon Sep 17 00:00:00 2001 From: stefanbabukov Date: Tue, 28 Nov 2023 16:20:25 +0000 Subject: [PATCH 4/4] test added Signed-off-by: stefanbabukov --- .../CellSizeDistribution.test.jsx | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/__test__/components/data-processing/cellsize-distribution/CellSizeDistribution.test.jsx b/src/__test__/components/data-processing/cellsize-distribution/CellSizeDistribution.test.jsx index 8cb414c9a6..b826032485 100644 --- a/src/__test__/components/data-processing/cellsize-distribution/CellSizeDistribution.test.jsx +++ b/src/__test__/components/data-processing/cellsize-distribution/CellSizeDistribution.test.jsx @@ -10,6 +10,7 @@ import { initialPlotConfigStates } from 'redux/reducers/componentConfig/initialS import { generateDataProcessingPlotUuid } from 'utils/generateCustomPlotUuid'; import CellSizeDistribution from 'components/data-processing/CellSizeDistribution/CellSizeDistribution'; import CalculationConfig from 'components/data-processing/CellSizeDistribution/CalculationConfig'; +import SliderWithInput from 'components/SliderWithInput'; import generateExperimentSettingsMock from '../../../test-utils/experimentSettings.mock'; import filterStatisticsMock from '../../../test-utils/plotData.mock'; @@ -147,4 +148,31 @@ describe('CellSizeDistribution', () => { expect(plots.length).toEqual(3); expect(tables.length).toEqual(1); }); + it('Disables bin step slider when plot type is knee plot', () => { + const modifiedWithData = { + ...withData, + componentConfig: { + ...withData.componentConfig, + plotType: 'kneePlot', + }, + }; + + const store = mockStore(modifiedWithData); + + const component = mount( + + { }} + /> + , + ); + + const page = component.find(CellSizeDistribution).at(0); + const calculationConfig = page.find(CalculationConfig); + const sliderWithInput = calculationConfig.find(SliderWithInput); + expect(sliderWithInput.props().disabled).toBe(true); + }); });