-
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 field list - transition away from extending array - introduce and use getAll() #74718
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
💚 Build SucceededBuild metricsasync chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
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
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.
Overall LGTM.
Added one comment for your review.
@@ -149,7 +149,7 @@ export interface FieldSpecExportFmt { | |||
} | |||
|
|||
export interface FieldSpec { | |||
count: number; | |||
count?: number; |
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.
Looking at the changes in src/plugins/data/common/index_patterns/fields/index_pattern_field.ts
, it seems that both functions can't return undefined
. Can it be that you don't have to make these optional?
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.
@lizozom I'm making them optional so that someone defining a field doesn't have the burden of providing them - the expected defaults are obvious. Its not a necessary change but I think its still helpful.
…roduce and use getAll() (elastic#74718) - Introduce `indexPattern.fields.getAll()` and use where possible - Rename `index_patterns/fields/fields.mocks.ts.ts => index_patterns/fields/fields.mocks.ts` - FieldSpec - make `count` and `scripted` fields optional - use `indexPattern.fields.getByName` instead of filter where possible # Conflicts: # src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx
…roduce and use getAll() (#74718) (#74756) - Introduce `indexPattern.fields.getAll()` and use where possible - Rename `index_patterns/fields/fields.mocks.ts.ts => index_patterns/fields/fields.mocks.ts` - FieldSpec - make `count` and `scripted` fields optional - use `indexPattern.fields.getByName` instead of filter where possible
* master: (106 commits) [Functional Tests] Adds a wait time between setting the index pattern and the time field on TSVB (elastic#74736) [Lens] Add styling options for x and y axes on the settings popover (elastic#71829) [Maps] add initial location option that fits to data bounds (elastic#74583) theme function (elastic#73451) [data.ui.query] Write filters to query log from default editor. (elastic#74474) [data.search.SearchSource] Move some SearchSource dependencies to the server. (elastic#74607) [Canvas][tech-debt] Convert renderers (elastic#74134) [security solutions][lists] Adds end to end tests (elastic#74473) pluralized for occurrences vs occurrence (elastic#74564) Update links that pointed to CONTRIBUTING.md (elastic#74757) [Ingest pipelines] Implement tabs in processor flyout (elastic#74469) [Event log] Use Alerts client & Actions client when fetching these types of SOs (elastic#73257) Bump chalk to 4.1.0 (elastic#73397) Index pattern field list - transition away from extending array - introduce and use getAll() (elastic#74718) [SECURITY] Bugs css/inspect (elastic#74711) [telemetry] update README to downplay ui_metrics (elastic#74635) Fixed grammar (elastic#74725) [Telemetry][API Integration] size_in_bytes to be a number (elastic#74664) [ILM] Convert node details flyout to TS (elastic#73707) [Ingest Node Pipelines] Sentence-case processor names (elastic#74645) ...
Summary
Addressing #68020 - there will be a number of PRs that transition away from the field list extending the array class.
indexPattern.fields.getAll()
and use where possibleindex_patterns/fields/fields.mocks.ts.ts => index_patterns/fields/fields.mocks.ts
count
andscripted
fields optionalindexPattern.fields.getByName
instead of filter where possible