diff --git a/packages/my-joy-beta/src/components/instances/key-value.js b/packages/my-joy-beta/src/components/instances/key-value.js index 80e489bb..bb0166de 100644 --- a/packages/my-joy-beta/src/components/instances/key-value.js +++ b/packages/my-joy-beta/src/components/instances/key-value.js @@ -114,6 +114,7 @@ export const KeyValue = ({ input = 'input', type = 'metadata', method = 'add', + initialValues = {}, error = null, expanded = true, submitting = false, @@ -142,18 +143,14 @@ export const KeyValue = ({

{`${titleCase(method)} ${type}`}

) : ( - - !expanded ? `${input.value}: ` : {`${input.value}: `} - } - />, - {input.value}} - /> + + {!expanded ? ( + `${initialValues.name}: ` + ) : ( + {`${initialValues.name}: `} + )} + + {initialValues.value} )} @@ -233,6 +230,10 @@ KeyValue.propTypes = { input: PropTypes.oneOf(['input', 'textarea']).isRequired, type: PropTypes.string.isRequired, method: PropTypes.oneOf(['add', 'edit']).isRequired, + initialValues: PropTypes.shape({ + name: PropTypes.string, + value: PropTypes.string + }).isRequired, removing: PropTypes.bool.isRequired, expanded: PropTypes.bool.isRequired, onToggleExpanded: PropTypes.func, diff --git a/packages/my-joy-beta/src/containers/instances/tags.js b/packages/my-joy-beta/src/containers/instances/tags.js index dae06ddd..ee0a0334 100644 --- a/packages/my-joy-beta/src/containers/instances/tags.js +++ b/packages/my-joy-beta/src/containers/instances/tags.js @@ -92,12 +92,18 @@ export const Tags = ({ form={editing.form} initialValues={{ name: editing.name, value: editing.value }} onSubmit={handleEdit} - onCancel={() => handleToggleEditing(false)} - onToggleExpanded={() => handleToggleEditing(false)} - onRemove={() => handleRemove(editing.form, editing)} - removing={editing.removing} > - {TagsEditForm} + {props => ( + handleToggleEditing(false)} + onToggleExpanded={() => handleToggleEditing(false)} + onRemove={() => handleRemove(editing.form, editing)} + removing={editing.removing} + /> + )} ) : null;