-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
typescript indexPatterns service #39247
Conversation
Pinging @elastic/kibana-app-arch |
💔 Build Failed |
6056a39
to
6a003f3
Compare
💔 Build Failed |
6a003f3
to
a64988c
Compare
💔 Build Failed |
a64988c
to
4db7f3d
Compare
💔 Build Failed |
4db7f3d
to
9cab8f2
Compare
💔 Build Failed |
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.
Still reviewing, but I pushed a couple updates to fix some of the issues, including that one with formatHits. Still seeing weirdness in the jest tests, related to mocking the TS files. Didn't have time to do a thorough investigation on that yet.
|
||
function convert(hit, val, fieldName) { | ||
export function formatHitProvider(indexPattern: IndexPattern, defaultFormat: any) { | ||
function convert(hit: any, val: any, fieldName: 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.
hit
can be made slightly more restrictive here with Record<string, any>
, so I'll update this too.
export class FieldList extends IndexedArray<Field> { | ||
// makes typescript work, but breaks kibana | ||
//public byType: Record<string, Field[]> = {}; | ||
//public byName: Record<string, Field> = {}; |
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.
It's because these should really be in the IndexedArray
interface. I'll update this.
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
7b18cc2
to
d7d39e3
Compare
💚 Build Succeeded |
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.
Still lots of work ahead of us, but looks good.
I would put a list of open, unaddressed issues \ questions in the issue's description.
Otherwise, LGTM.
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.
LG(E)TM will revert my change in a follow up PR but this isn't broken so we're all good from my perspective for now
# Conflicts: # x-pack/legacy/plugins/ml/public/data_frame/pages/data_frame_new_pivot/components/source_index_preview/use_source_index_data.ts
💚 Build Succeeded |
💔 Build Failed |
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.
ML edits LGTM.
One quick question - does the type
field in the StaticIndexPattern
indicate if the index patten is a rollup type? We need this for the new ML job wizards.
retest |
💚 Build Succeeded |
💚 Build Succeeded |
@peteharverson Exactly, for rollups you should be able to check |
@peteharverson This also may be useful for reference: kibana/x-pack/legacy/plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js Lines 8 to 10 in 7ac8e4d
|
Summary
closes #39087 be removing
config
from this.Typescript for index patterns service
Some minor changes to API were done:
cache
is no longer exposed onindexPatterns
, rather there isclearCache()
methoddelete
method no longer exists onindexPatterns
, rather there you should callindexPattern.destroy()
Follow-up items to investigate:
src/legacy/ui/public/index_patterns/_field.ts
create_index_pattern_wizard/components/step_time_field/__jest__/__snapshots__/step_time_field.test.js.snap
were changed toisLoading=false
. this feels like the correct behavior but need to confirm it isn't a problem.src/legacy/ui/public/index_patterns/index_patterns.ts
, specifically if savedObject.find encounters an errorChecklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] Documentation was added for features that require explanation or tutorials[ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
[ ] This includes a feature addition or change that requires a release note and was labeled appropriatelyDev Docs
Minor changes to Index Patterns API
During our efforts to rewrite the index patterns service in TypeScript, we made a few minor changes to the API:
IndexPatterns.cache
has been deprecated in favor of the newIndexPatterns.clearCache
method.IndexPatterns.delete
has been deprecated. Instead, use theIndexPattern.destroy
method on the specific index pattern you which to remove.