From a33b586e42331f25cc901ef52537fbe2cb32529c Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Mon, 22 Jan 2018 16:39:52 +0100 Subject: [PATCH] fix(my-joy-beta): don't expand metadada kv when in other section fixes #1052 --- .../src/containers/create-instance/metadata.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/my-joy-beta/src/containers/create-instance/metadata.js b/packages/my-joy-beta/src/containers/create-instance/metadata.js index 1fd3b58a..e81a7c18 100644 --- a/packages/my-joy-beta/src/containers/create-instance/metadata.js +++ b/packages/my-joy-beta/src/containers/create-instance/metadata.js @@ -57,7 +57,7 @@ export const Metadata = ({ ) : null} - {metadata.map(({ name, value, expanded }, index) => ( + {metadata.map(({ name, value, open }, index) => ( handleToggleExpanded(index)} + onToggleExpanded={() => + expanded ? handleToggleExpanded(index) : null} onCancel={() => handleCancelEdit(index)} onRemove={() => handleRemoveMetadata(index)} /> @@ -137,7 +138,7 @@ export default compose( set({ name: 'create-instance-metadata-proceeded', value: true }) ); - return history.push(`/instances/~create/user-scripts`); + return history.push(`/instances/~create/user-script`); }, handleEdit: () => { return history.push(`/instances/~create/metadata`); @@ -150,7 +151,7 @@ export default compose( const appendMetadata = set({ name: `create-instance-metadata`, - value: metadata.concat([{ ...value, expanded: false }]) + value: metadata.concat([{ ...value, open: false }]) }); return dispatch([ @@ -162,7 +163,7 @@ export default compose( handleUpdateMetadata: (index, newMetadata) => { metadata[index] = { ...newMetadata, - expanded: false + open: false }; return dispatch([ @@ -179,7 +180,7 @@ export default compose( handleToggleExpanded: index => { metadata[index] = { ...metadata[index], - expanded: !metadata[index].expanded + open: !metadata[index].open }; return dispatch( @@ -192,7 +193,7 @@ export default compose( handleCancelEdit: index => { metadata[index] = { ...metadata[index], - expanded: false + open: false }; return dispatch([