From 976f50cd7fced1f7a2b67b6d7161bbdad501d429 Mon Sep 17 00:00:00 2001 From: studioswong Date: Wed, 28 Jul 2021 15:08:43 +0100 Subject: [PATCH 1/3] v3.14.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e1b5584b5e..34c6640150 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@quantumblack/kedro-viz", - "version": "3.13.1", + "version": "3.14.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -31188,4 +31188,4 @@ "dev": true } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index f873f36e81..27e9dda832 100644 --- a/package.json +++ b/package.json @@ -129,4 +129,4 @@ "not op_mini all" ], "snyk": true -} +} \ No newline at end of file From 6a9b4c065da79149ff3ce17c6d4e0d3d281830fa Mon Sep 17 00:00:00 2001 From: studioswong Date: Fri, 3 Sep 2021 11:31:37 +0100 Subject: [PATCH 2/3] added dispatch action and relevant test --- src/components/pipeline-list/index.js | 2 ++ src/components/pipeline-list/pipeline-list.test.js | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/pipeline-list/index.js b/src/components/pipeline-list/index.js index 1d9cf5e102..955f89f9de 100644 --- a/src/components/pipeline-list/index.js +++ b/src/components/pipeline-list/index.js @@ -4,6 +4,7 @@ import { connect } from 'react-redux'; import Dropdown from '@quantumblack/kedro-ui/lib/components/dropdown'; import MenuOption from '@quantumblack/kedro-ui/lib/components/menu-option'; import { loadPipelineData } from '../../actions/pipelines'; +import { toggleFocusMode } from '../../actions'; import './pipeline-list.css'; /** @@ -57,6 +58,7 @@ export const mapStateToProps = (state) => ({ export const mapDispatchToProps = (dispatch) => ({ onUpdateActivePipeline: (event) => { dispatch(loadPipelineData(event.value)); + dispatch(toggleFocusMode(null)); }, }); diff --git a/src/components/pipeline-list/pipeline-list.test.js b/src/components/pipeline-list/pipeline-list.test.js index f604be1d78..8da1589f57 100644 --- a/src/components/pipeline-list/pipeline-list.test.js +++ b/src/components/pipeline-list/pipeline-list.test.js @@ -70,6 +70,12 @@ describe('PipelineList', () => { it('maps dispatch to props', async () => { const dispatch = jest.fn(); mapDispatchToProps(dispatch).onUpdateActivePipeline({ value: '123' }); - expect(dispatch.mock.calls.length).toEqual(1); + // The calls would also include the action to dispatch an action to reset focus mode + expect(dispatch.mock.calls.length).toEqual(2); + // ensure that the action to reset focus mode is being called + expect(dispatch.mock.calls[1][0]).toEqual({ + type: 'TOGGLE_MODULAR_PIPELINE_FOCUS_MODE', + modularPipeline: null, + }); }); }); From 816ba83e1d9976d63e62f3b4021cacdcf363ffeb Mon Sep 17 00:00:00 2001 From: studioswong Date: Fri, 3 Sep 2021 11:38:14 +0100 Subject: [PATCH 3/3] refine comment wording --- src/components/pipeline-list/pipeline-list.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/pipeline-list/pipeline-list.test.js b/src/components/pipeline-list/pipeline-list.test.js index 8da1589f57..30b6aaf16e 100644 --- a/src/components/pipeline-list/pipeline-list.test.js +++ b/src/components/pipeline-list/pipeline-list.test.js @@ -70,7 +70,7 @@ describe('PipelineList', () => { it('maps dispatch to props', async () => { const dispatch = jest.fn(); mapDispatchToProps(dispatch).onUpdateActivePipeline({ value: '123' }); - // The calls would also include the action to dispatch an action to reset focus mode + // The calls would also include the action to reset focus mode expect(dispatch.mock.calls.length).toEqual(2); // ensure that the action to reset focus mode is being called expect(dispatch.mock.calls[1][0]).toEqual({