-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Mappings editor] Remove boost parameter from field types #113142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
faadfb5
9949994
a8d4b3c
37757e7
cbb918c
832f37e
ee756c4
957ea8c
50f6077
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -504,18 +504,21 @@ export const useField = <T, FormType = FormData, I = T>( | |
| const { resetValue = true, defaultValue: updatedDefaultValue } = resetOptions; | ||
|
|
||
| setPristine(true); | ||
| setIsModified(false); | ||
| setValidating(false); | ||
| setIsChangingValue(false); | ||
| setIsValidated(false); | ||
| setStateErrors([]); | ||
|
|
||
| if (resetValue) { | ||
| hasBeenReset.current = true; | ||
| const newValue = deserializeValue(updatedDefaultValue ?? defaultValue); | ||
| // updateStateIfMounted('value', newValue); | ||
| setValue(newValue); | ||
| return newValue; | ||
|
|
||
| if (isMounted.current) { | ||
| setIsModified(false); | ||
| setValidating(false); | ||
| setIsChangingValue(false); | ||
| setIsValidated(false); | ||
| setStateErrors([]); | ||
|
|
||
| if (resetValue) { | ||
| hasBeenReset.current = true; | ||
| const newValue = deserializeValue(updatedDefaultValue ?? defaultValue); | ||
| // updateStateIfMounted('value', newValue); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we remove this comment? |
||
| setValue(newValue); | ||
| return newValue; | ||
| } | ||
| } | ||
| }, | ||
| [deserializeValue, defaultValue, setValue, setStateErrors] | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,3 +17,9 @@ export const PLUGIN = { | |
| defaultMessage: 'Index Management', | ||
| }), | ||
| }; | ||
|
|
||
| // Ideally we want to access the Kibana major version from core | ||
| // "PluginInitializerContext.env.packageInfo.version". In some cases it is not possible | ||
| // to dynamically inject that version without a huge refactor on the code base. | ||
| // We will then keep this single constant to declare on which major branch we are. | ||
| export const MAJOR_VERSION = '8.0.0'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will be changed to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we create a ticket so we don't forget to do so?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will immediately do it after merging 😊
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done on the PR itself: d45518a |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to add this
ifstatement as there was a strange race condition in one of the tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add any tests for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is test coverage for
form.reset()in theuse_form.test.tsxwhich test this part of the code. Aside this is a very low risk change as we are simply protecting ourselves from updating the state on an unmounted component.