Skip to content

Commit d62f9a7

Browse files
committed
Fix failing test (2)
1 parent a95c282 commit d62f9a7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/plugins/es_ui_shared/public/forms/form_wizard/form_wizard_context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const FormWizardProvider = WithMultiContent<Props<any>>(function FormWiza
147147
return nextState;
148148
});
149149
},
150-
[getStepIndex, validate, onSave, getData]
150+
[getStepIndex, validate, onSave, getData, lastStep]
151151
);
152152

153153
const value: Context = {

x-pack/plugins/index_management/public/application/components/mappings_editor/use_state_listener.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@ export const useMappingsStateListener = ({ onChange, value }: Args) => {
2929
const dispatch = useDispatch();
3030

3131
const parsedFieldsDefaultValue = useMemo(() => normalize(value?.fields), [value?.fields]);
32-
3332
useEffect(() => {
3433
// If we are creating a new field, but haven't entered any name
3534
// it is valid and we can byPass its form validation (that requires a "name" to be defined)
3635
const isFieldFormVisible = state.fieldForm !== undefined;
3736
const emptyNameValue =
3837
isFieldFormVisible &&
39-
state.fieldForm!.data.raw.name !== undefined &&
40-
state.fieldForm!.data.raw.name.trim() === '';
38+
(state.fieldForm!.data.raw.name === undefined ||
39+
state.fieldForm!.data.raw.name.trim() === '');
4140

4241
const bypassFieldFormValidation =
4342
state.documentFields.status === 'creatingField' && emptyNameValue;

0 commit comments

Comments
 (0)