index pattern(s) take dependencies as object#69055
Conversation
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
lukasolson
left a comment
There was a problem hiding this comment.
LGTM, added some feedback about the casts to any in tests below that would be nice to get rid of as part of this.
| savedObjectsClient as any, | ||
| const indexPattern = new IndexPattern(id, { | ||
| getConfig: (cfg: any) => config.get(cfg), | ||
| savedObjectsClient: savedObjectsClient as any, |
There was a problem hiding this comment.
Since you're already in this code could we get rid of these as any references? Seems like it should be fairly trivial to actually use the savedObjectsServiceMock.createStartContract() and then do something like savedObjectsClient.get.mockReturnValue(object), etc.
There was a problem hiding this comment.
I took a look at this but realized that these dependencies will be changing shortly. This is code in common but we don't have common mocks.
I improved the fieldForms mock as that is the same across public and server
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* index pattern(s) take dependencies as object # Conflicts: # docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md # docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md # src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts # src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts # src/plugins/data/common/index_patterns/index_patterns/index_patterns.test.ts # src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts # src/plugins/data/public/plugin.ts # src/plugins/data/public/public.api.md
* master: (91 commits) [Search][BUG] Call wrong search strategy recursively in async search (elastic#69116) [Observability] Create context container to enable Observability plugin registry function (elastic#68642) Rename space id for disabled index pattern test (elastic#68990) skip flaky suite (elastic#63339) Resolver Light Theme And Kibana Integration (elastic#67859) [kbn/dev-utils] expose public tooling_log module (elastic#68868) index pattern(s) take dependencies as object (elastic#69055) include ci-stats metrics in pr comment (elastic#68563) Bump webpack packages (elastic#68716) [Uptime] Fixed metric query broken because of missing mapping (elastic#68999) Added cloud as an optional dependency (elastic#69050) Fixed all external links (elastic#68614) [DOCS] Reorganizes doc nav to match new Kibana nav (elastic#69069) [Endpoint] Using the stats provided by the backend for resolver UI (elastic#68577) [DOCS] Removees 8.0 from Upgrade Assistant docs (elastic#69067) [ML] Fix cloud deployment ID check (elastic#68695) [DOCS] Move metrics app content to metrics monitoring guide (elastic#69033) Add ingest manager topic to docs (elastic#68980) [SECURITY SOLUTION] EMT-401: add policy data to metadata and fix tests (elastic#68582) [DOCS] Fixes POST request for saved objects (elastic#69036) ...
* master: (60 commits) Re-enable mistakenly skipped tests. (elastic#69123) [Search][BUG] Call wrong search strategy recursively in async search (elastic#69116) [Observability] Create context container to enable Observability plugin registry function (elastic#68642) Rename space id for disabled index pattern test (elastic#68990) skip flaky suite (elastic#63339) Resolver Light Theme And Kibana Integration (elastic#67859) [kbn/dev-utils] expose public tooling_log module (elastic#68868) index pattern(s) take dependencies as object (elastic#69055) include ci-stats metrics in pr comment (elastic#68563) Bump webpack packages (elastic#68716) [Uptime] Fixed metric query broken because of missing mapping (elastic#68999) Added cloud as an optional dependency (elastic#69050) Fixed all external links (elastic#68614) [DOCS] Reorganizes doc nav to match new Kibana nav (elastic#69069) [Endpoint] Using the stats provided by the backend for resolver UI (elastic#68577) [DOCS] Removees 8.0 from Upgrade Assistant docs (elastic#69067) [ML] Fix cloud deployment ID check (elastic#68695) [DOCS] Move metrics app content to metrics monitoring guide (elastic#69033) Add ingest manager topic to docs (elastic#68980) [SECURITY SOLUTION] EMT-401: add policy data to metadata and fix tests (elastic#68582) ...
Summary
Simple refactor so IndexPatterns and IndexPattern classes take their dependencies as an object instead of as numerous individual arguments. These classes take different numbers of args in 8.x vs 7.x due to a different number of UI callbacks. Time based index patterns are unsupported in 8.x while merely deprecated in 7.x
This PR will help prevent future merge conflicts.