From 524c1a5b0d9b60abdea6ee803b2f082c68f2a67c Mon Sep 17 00:00:00 2001 From: IanLondon Date: Wed, 24 Oct 2018 16:34:32 -0400 Subject: [PATCH] feat(protocol-designer): collapse all step items on newly loaded file Closes #2541 --- protocol-designer/src/steplist/reducers.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/protocol-designer/src/steplist/reducers.js b/protocol-designer/src/steplist/reducers.js index 296e9efc2f5..2c9ac612c96 100644 --- a/protocol-designer/src/steplist/reducers.js +++ b/protocol-designer/src/steplist/reducers.js @@ -159,6 +159,12 @@ const collapsedSteps: Reducer = handleActions({ ...state, [payload]: !state[payload], }), + LOAD_FILE: (state: CollapsedStepsState, action: LoadFileAction) => + // default all steps to collapsed + getPDMetadata(action.payload).orderedSteps.reduce( + (acc: CollapsedStepsState, stepId) => ({...acc, [stepId]: true}), + {} + ), }, {}) export type OrderedStepsState = Array