Skip to content
Snippets Groups Projects
Commit fa251e76 authored by Kyle Doherty's avatar Kyle Doherty Committed by GitHub
Browse files

clean up EditReferenceHeader and Detail inputs (#5719)

parent 5a02c313
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ const Detail = ({ name, description, placeholder, subtitleClass, url, icon, isEd
<textarea
className={S.detailTextarea}
placeholder={placeholder}
{...field}
onChange={field.onChange}
//FIXME: use initialValues from redux forms instead of default value
// to allow for reinitializing on cancel (see GettingStartedGuide.jsx)
defaultValue={description}
......
......@@ -10,6 +10,7 @@ import E from "metabase/reference/components/EditButton.css";
import IconBorder from "metabase/components/IconBorder.jsx";
import Icon from "metabase/components/Icon.jsx";
import Input from "metabase/components/Input.jsx";
import Ellipsified from "metabase/components/Ellipsified.jsx";
import EditButton from "metabase/reference/components/EditButton.jsx";
......@@ -54,21 +55,19 @@ const EditableReferenceHeader = ({
style={isEditing && name === 'Details' ? {alignItems: "flex-start"} : {}}
>
{ isEditing && name === 'Details' ?
hasDisplayName ?
<input
<Input
className={S.headerTextInput}
type="text"
placeholder={entity.name}
{...displayNameFormField}
defaultValue={entity.display_name}
/> :
<input
className={S.headerTextInput}
type="text"
placeholder={entity.name}
{...nameFormField}
defaultValue={entity.name}
/> :
onChange={
hasDisplayName ? displayNameFormField.onChange : nameFormField.onChange
}
defaultValue={
hasDisplayName ? entity.display_name : entity.name
}
/>
:
[
<Ellipsified
key="1"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment