-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Index pattern class cleanup - remove _.apply and any
instance
#76004
Index pattern class cleanup - remove _.apply and any
instance
#76004
Conversation
any
instance
Pinging @elastic/kibana-app-arch (Team:AppArch) |
|
||
const serverChangedKeys: string[] = []; | ||
Object.entries(updatedBody).forEach(([key, value]) => { | ||
// @ts-ignore |
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 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.
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.
Code LGTM, but I see there is one functional test that needs fixing.
// @ts-ignore | ||
if (value !== body[key] && value !== this.originalBody[key]) { |
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.
Better use casting:
// @ts-ignore | |
if (value !== body[key] && value !== this.originalBody[key]) { | |
if (value !== (body as any)[key] && value !== this.originalBody[key]) { |
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.
// @ts-ignore | ||
this[key] = samePattern[key]; |
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.
// @ts-ignore | |
this[key] = samePattern[key]; | |
(this as any)[key] = (samePattern as any)[key]; |
💚 Build SucceededBuild metricspage load bundle size
History
To update your PR or re-run it, just comment with: |
…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
Summary
Index pattern class cleanup - remove _.apply and
any
instance. Leaving[key: string]: any;
means indexPatternInstance.somethingCrazy doesn't error in typescript.Checklist