-
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
[rollup index patterns] don't show fields not present in field caps response #105533
[rollup index patterns] don't show fields not present in field caps response #105533
Conversation
@@ -56,16 +56,21 @@ export const mergeCapabilitiesWithFields = ( | |||
rollupFields.push( | |||
...fields | |||
.filter((field) => !rollupFieldNames.includes(field)) | |||
.map((field) => { | |||
.reduce<FieldDescriptor[]>((collector, 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.
Swapping map
for reduce
since we don't want to return fields missing in the field caps info.
Pinging @elastic/kibana-app-services (Team:AppServices) |
const fieldsForWildcard = body.fields.map((field) => field.name); | ||
expect(fieldsForWildcard.sort()).eql(propertiesWithMappings.sort()); | ||
expect(fieldsForWildcard.sort()).eql(['testCreatedField']); |
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 existing test relied on the broken behavior - returning fields that didn't have proper field caps entries. Simply adjusted the test to expect the field with complete info.
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Public APIs missing comments
Any counts in public APIs
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.
Tested before/after using steps in the description.
Nice small ts types improvements 👍
…esponse (elastic#105533) * remove fields not present in field caps response
…esponse (elastic#105533) * remove fields not present in field caps response
Summary
The index pattern field list will show rollup fields that don't exist in the field caps response (due to lack of data) as existing BUT without a field type. Such fields are useless....they don't even really exist. This PR removes them from the field list. There's also some typescript improvements.
To test (do on master and then this branch to see the problem and then to verify its resolved)
Closes: #104781