fix(my-joy-beta): don't update header when editing keyValue
This commit is contained in:
parent
4678addd7a
commit
0bccbc1988
@ -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 = ({
|
||||
<H4>{`${titleCase(method)} ${type}`}</H4>
|
||||
) : (
|
||||
<CollapsedKeyValue>
|
||||
<Field
|
||||
name="name"
|
||||
type="text"
|
||||
component={({ input = {} }) =>
|
||||
!expanded ? `${input.value}: ` : <b>{`${input.value}: `}</b>
|
||||
}
|
||||
/>,
|
||||
<Field
|
||||
name="value"
|
||||
type="text"
|
||||
component={({ input = {} }) => <span>{input.value}</span>}
|
||||
/>
|
||||
<span>
|
||||
{!expanded ? (
|
||||
`${initialValues.name}: `
|
||||
) : (
|
||||
<b>{`${initialValues.name}: `}</b>
|
||||
)}
|
||||
</span>
|
||||
<span>{initialValues.value}</span>
|
||||
</CollapsedKeyValue>
|
||||
)}
|
||||
</CardHeaderMeta>
|
||||
@ -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,
|
||||
|
@ -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 => (
|
||||
<TagsEditForm
|
||||
{...props}
|
||||
/* yeah, we need this here too */
|
||||
initialValues={{ name: editing.name, value: editing.value }}
|
||||
onCancel={() => handleToggleEditing(false)}
|
||||
onToggleExpanded={() => handleToggleEditing(false)}
|
||||
onRemove={() => handleRemove(editing.form, editing)}
|
||||
removing={editing.removing}
|
||||
/>
|
||||
)}
|
||||
</ReduxForm>
|
||||
) : null;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user