Index pattern class cleanup - remove _.apply and any instance #76004
Merged
mattkime merged 9 commits intoelastic:masterfrom Aug 27, 2020
Merged
Index pattern class cleanup - remove _.apply and any instance #76004mattkime merged 9 commits intoelastic:masterfrom
any instance #76004mattkime merged 9 commits intoelastic:masterfrom
Conversation
any instance
Contributor
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
mattkime
commented
Aug 27, 2020
|
|
||
| const serverChangedKeys: string[] = []; | ||
| Object.entries(updatedBody).forEach(([key, value]) => { | ||
| // @ts-ignore |
Contributor
Author
There was a problem hiding this comment.
I think these two ts-ignore statements are an acceptable compromise for now. It would be nice to do a deeper refactoring on this code first.
streamich
approved these changes
Aug 27, 2020
Contributor
streamich
left a comment
There was a problem hiding this comment.
Code LGTM, but I see there is one functional test that needs fixing.
Comment on lines
+530
to
+531
| // @ts-ignore | ||
| if (value !== body[key] && value !== this.originalBody[key]) { |
Contributor
There was a problem hiding this comment.
Better use casting:
Suggested change
| // @ts-ignore | |
| if (value !== body[key] && value !== this.originalBody[key]) { | |
| if (value !== (body as any)[key] && value !== this.originalBody[key]) { |
Contributor
Comment on lines
558
to
559
| // @ts-ignore | ||
| this[key] = samePattern[key]; |
Contributor
There was a problem hiding this comment.
Suggested change
| // @ts-ignore | |
| this[key] = samePattern[key]; | |
| (this as any)[key] = (samePattern as any)[key]; |
Contributor
💚 Build SucceededBuild metricspage load bundle size
History
To update your PR or re-run it, just comment with: |
mattkime
added a commit
to mattkime/kibana
that referenced
this pull request
Aug 27, 2020
…tic#76004) Index pattern class cleanup - remove _.apply and `any` instance # Conflicts: # docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.intervalname.md # docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md # src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts # src/plugins/data/public/public.api.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Index pattern class cleanup - remove _.apply and
anyinstance. Leaving[key: string]: any;means indexPatternInstance.somethingCrazy doesn't error in typescript.Checklist