Skip to content

[aggs] use getFieldDisplayName and getField helpers#8717

Merged
spalger merged 4 commits intoelastic:masterfrom
spalger:cleanup/use-field-displayname-getter
Oct 18, 2016
Merged

[aggs] use getFieldDisplayName and getField helpers#8717
spalger merged 4 commits intoelastic:masterfrom
spalger:cleanup/use-field-displayname-getter

Conversation

@spalger
Copy link
Contributor

@spalger spalger commented Oct 17, 2016

While working to fix #8643 it became possible for a saved aggregation config to have an invalid field. Rather than put the invalid field back into the aggConfig, the field param is set to null and the form validation directs the user to specify a new field. This caused a slew of "Cannot read property XYZ of undefined" errors as there are many places directly accessing the field on the aggConfig.params.

This is why the field() and fieldDisplayName() getters were defined, so I first updated those to use the getXYZ() naming that we use everywhere else and they updated the components that were reaching in for these properties to use the getters.

@spalger spalger changed the title Cleanup/use field displayname getter [aggs] use getFieldDisplayName and getField helpers Oct 17, 2016
@spalger spalger force-pushed the cleanup/use-field-displayname-getter branch from 688c02b to 51cc35b Compare October 17, 2016 21:26
@lukasolson lukasolson self-assigned this Oct 17, 2016
@tylersmalley tylersmalley self-assigned this Oct 17, 2016
Copy link
Member

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. There are some opportunities for cleanup but are outside of the scope of these changes.

@spalger
Copy link
Contributor Author

spalger commented Oct 18, 2016

👍

@spalger spalger merged commit 3bb4fd7 into elastic:master Oct 18, 2016
elastic-jasper added a commit that referenced this pull request Oct 18, 2016
---------

**Commit 1:**
[aggConfig] use `getField`/`getFieldDisplayName` helpers

* Original sha: 0190cda
* Authored by spalger <email@spalger.com> on 2016-10-17T20:21:08Z

**Commit 2:**
[aggParams/field] throw better error when field missing

* Original sha: 1ee969c
* Authored by spalger <email@spalger.com> on 2016-10-17T20:33:26Z

**Commit 3:**
[tests] update tests that depended on `aggConfig#field()`

* Original sha: 51cc35b
* Authored by spalger <email@spalger.com> on 2016-10-17T21:26:31Z

**Commit 4:**
[aggTypes/percentile] fix reference to aggConfig.fieldDisplayName()

* Original sha: ae32232
* Authored by spalger <email@spalger.com> on 2016-10-18T02:06:27Z
elastic-jasper added a commit that referenced this pull request Oct 18, 2016
---------

**Commit 1:**
[aggConfig] use `getField`/`getFieldDisplayName` helpers

* Original sha: 0190cda
* Authored by spalger <email@spalger.com> on 2016-10-17T20:21:08Z

**Commit 2:**
[aggParams/field] throw better error when field missing

* Original sha: 1ee969c
* Authored by spalger <email@spalger.com> on 2016-10-17T20:33:26Z

**Commit 3:**
[tests] update tests that depended on `aggConfig#field()`

* Original sha: 51cc35b
* Authored by spalger <email@spalger.com> on 2016-10-17T21:26:31Z

**Commit 4:**
[aggTypes/percentile] fix reference to aggConfig.fieldDisplayName()

* Original sha: ae32232
* Authored by spalger <email@spalger.com> on 2016-10-18T02:06:27Z
spalger added a commit that referenced this pull request Oct 19, 2016
@spalger spalger removed the v5.0.0 label Oct 24, 2016
@epixa epixa added v5.1.1 and removed v5.1.0 labels Dec 8, 2016
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
---------

**Commit 1:**
[aggConfig] use `getField`/`getFieldDisplayName` helpers

* Original sha: a2d1986dc71d022084fded04f3a235333dce2258 [formerly 0190cda]
* Authored by spalger <email@spalger.com> on 2016-10-17T20:21:08Z

**Commit 2:**
[aggParams/field] throw better error when field missing

* Original sha: c6731d820815afb408ecd35ad9ace24a9b604b2a [formerly 1ee969c]
* Authored by spalger <email@spalger.com> on 2016-10-17T20:33:26Z

**Commit 3:**
[tests] update tests that depended on `aggConfig#field()`

* Original sha: 2a6b7f9dcca1db1b341a5273eb7381c0362fd92d [formerly 51cc35b]
* Authored by spalger <email@spalger.com> on 2016-10-17T21:26:31Z

**Commit 4:**
[aggTypes/percentile] fix reference to aggConfig.fieldDisplayName()

* Original sha: ab166f5c3c88bbe59fbb00487b15c526f3c39d86 [formerly ae32232]
* Authored by spalger <email@spalger.com> on 2016-10-18T02:06:27Z


Former-commit-id: 6c2a806
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
@spalger spalger deleted the cleanup/use-field-displayname-getter branch October 18, 2019 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disallow scripted fields in significant terms agg

5 participants