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 ...@@ -21,7 +21,7 @@ const Detail = ({ name, description, placeholder, subtitleClass, url, icon, isEd
<textarea <textarea
className={S.detailTextarea} className={S.detailTextarea}
placeholder={placeholder} placeholder={placeholder}
{...field} onChange={field.onChange}
//FIXME: use initialValues from redux forms instead of default value //FIXME: use initialValues from redux forms instead of default value
// to allow for reinitializing on cancel (see GettingStartedGuide.jsx) // to allow for reinitializing on cancel (see GettingStartedGuide.jsx)
defaultValue={description} defaultValue={description}
......
...@@ -10,6 +10,7 @@ import E from "metabase/reference/components/EditButton.css"; ...@@ -10,6 +10,7 @@ import E from "metabase/reference/components/EditButton.css";
import IconBorder from "metabase/components/IconBorder.jsx"; import IconBorder from "metabase/components/IconBorder.jsx";
import Icon from "metabase/components/Icon.jsx"; import Icon from "metabase/components/Icon.jsx";
import Input from "metabase/components/Input.jsx";
import Ellipsified from "metabase/components/Ellipsified.jsx"; import Ellipsified from "metabase/components/Ellipsified.jsx";
import EditButton from "metabase/reference/components/EditButton.jsx"; import EditButton from "metabase/reference/components/EditButton.jsx";
...@@ -54,21 +55,19 @@ const EditableReferenceHeader = ({ ...@@ -54,21 +55,19 @@ const EditableReferenceHeader = ({
style={isEditing && name === 'Details' ? {alignItems: "flex-start"} : {}} style={isEditing && name === 'Details' ? {alignItems: "flex-start"} : {}}
> >
{ isEditing && name === 'Details' ? { isEditing && name === 'Details' ?
hasDisplayName ? <Input
<input
className={S.headerTextInput} className={S.headerTextInput}
type="text" type="text"
placeholder={entity.name} placeholder={entity.name}
{...displayNameFormField} onChange={
defaultValue={entity.display_name} hasDisplayName ? displayNameFormField.onChange : nameFormField.onChange
/> : }
<input defaultValue={
className={S.headerTextInput} hasDisplayName ? entity.display_name : entity.name
type="text" }
placeholder={entity.name}
{...nameFormField} />
defaultValue={entity.name} :
/> :
[ [
<Ellipsified <Ellipsified
key="1" 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