Skip to content

Commit

Permalink
[ML] Data Frame Analytics creation: ensure job config validity persis…
Browse files Browse the repository at this point in the history
…ts when switching from/to form/editor (#94654)

* persisted validation form state  when switching from editor to form

* persist complete form state when switching from json editor
  • Loading branch information
alvarezmelissa87 authored Mar 17, 2021
1 parent 881b9a5 commit e962751
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,9 @@ export function reducer(state: State, action: Action): State {
case ACTION.SWITCH_TO_FORM:
const { jobConfig: config } = state;
const { jobId } = state.form;
// Persist form state when switching back from advanced editor
// @ts-ignore
const formState = getFormStateFromJobConfig(config, false);
const formState = { ...state.form, ...getFormStateFromJobConfig(config, false) };

if (typeof jobId === 'string' && jobId.trim() !== '') {
formState.jobId = jobId;
Expand Down

0 comments on commit e962751

Please sign in to comment.