-
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
Migrate index pattern server side to typescript #43155
Migrate index pattern server side to typescript #43155
Conversation
} | ||
} | ||
}, | ||
}, | ||
}; |
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.
@lukeelmers There's an error I can't figure about the Request types here, can you take a look?
@@ -55,9 +72,10 @@ export function indexPatternsMixin(kbnServer, server) { | |||
* @method request.getIndexPatternsService | |||
* @type {IndexPatternsService} | |||
*/ | |||
server.addMemoizedFactoryToRequest('getIndexPatternsService', request => { | |||
server.addMemoizedFactoryToRequest('getIndexPatternsService', (request: Legacy.Request) => { |
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.
The addMemoizedFactoryToRequest
code doesn't seem to be present in any existing type definitions, what is it supposed to do?
@@ -72,7 +68,7 @@ describe('index_patterns/field_capabilities/field_capabilities', () => { | |||
describe('calls `readFieldCapsResponse`', () => { | |||
it('passes exact es response', async () => { | |||
stubDeps({ | |||
esResponse: footballs[0] | |||
esResponse: footballs[0], |
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.
@lukeelmers These test files are completely filled with errors because the way the code is called here is totally different from the actual code- suggestions?
.reduce( | ||
(acc, index, indexName) => acc.concat(indexName, Object.keys(index.aliases || {})), | ||
[] as string[] | ||
) |
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.
The .reduce(
call here is throwing a number of errors related to lodash that I don't understand- maybe we need to split it out into chain(aliases.reduce(...))
?
💔 Build Failed |
Summary
This is still a WIP change
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers