Skip to content
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

Closed

Conversation

wylieconlon
Copy link
Contributor

Summary

This is still a WIP change

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@wylieconlon wylieconlon added the Feature:Data Views Data Views code and UI - index patterns before 8.0 label Aug 12, 2019
}
}
},
},
};
Copy link
Contributor Author

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) => {
Copy link
Contributor Author

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],
Copy link
Contributor Author

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[]
)
Copy link
Contributor Author

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(...))?

@elasticmachine
Copy link
Contributor

💔 Build Failed

@wylieconlon wylieconlon deleted the typescript-indexpattern-server branch October 29, 2019 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants