Skip to content

Commit

Permalink
default destIndex to transform id in transform wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Jan 13, 2020
1 parent 47d075e commit 3eac458
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const StepDetailsForm: FC<Props> = React.memo(({ overrides = {}, onChange
defaults.transformDescription
);
const [destinationIndex, setDestinationIndex] = useState<EsIndexName>(defaults.destinationIndex);
const [destinationIndexDefaultSet, setDestinationIndexDefaultSet] = useState<boolean>(false);
const [transformIds, setTransformIds] = useState<TransformId[]>([]);
const [indexNames, setIndexNames] = useState<EsIndexName[]>([]);
const [indexPatternTitles, setIndexPatternTitles] = useState<IndexPatternTitle[]>([]);
Expand Down Expand Up @@ -206,7 +207,14 @@ export const StepDetailsForm: FC<Props> = React.memo(({ overrides = {}, onChange
<EuiFieldText
placeholder="transform ID"
value={transformId}
onChange={e => setTransformId(e.target.value)}
onChange={e => {
if (destinationIndexDefaultSet === false) {
setTransformId(e.target.value);
setDestinationIndex(e.target.value);
} else {
setTransformId(e.target.value);
}
}}
aria-label={i18n.translate(
'xpack.transform.stepDetailsForm.transformIdInputAriaLabel',
{
Expand Down Expand Up @@ -276,7 +284,10 @@ export const StepDetailsForm: FC<Props> = React.memo(({ overrides = {}, onChange
<EuiFieldText
placeholder="destination index"
value={destinationIndex}
onChange={e => setDestinationIndex(e.target.value)}
onChange={e => {
setDestinationIndex(e.target.value);
setDestinationIndexDefaultSet(true);
}}
aria-label={i18n.translate(
'xpack.transform.stepDetailsForm.destinationIndexInputAriaLabel',
{
Expand Down

0 comments on commit 3eac458

Please sign in to comment.