From ace50d8d2b4422ccb2b4a958ad00ea8083a87a9d Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 3 Jan 2020 14:19:19 -0500 Subject: [PATCH] [Maps] pass getFieldFormatter to DynamicTextProperty (#53937) * [Maps] pass getFieldFormatter to DynamicTextProperty * remove files from another PR --- .../maps/public/layers/styles/vector/vector_style.js | 8 +++++++- .../plugins/maps/public/layers/util/can_skip_fetch.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.js b/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.js index dc688d1291518..ae434f5002800 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.js +++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.js @@ -613,7 +613,13 @@ export class VectorStyle extends AbstractStyle { return new StaticTextProperty(descriptor.options, VECTOR_STYLES.LABEL_TEXT); } else if (descriptor.type === DynamicStyleProperty.type) { const field = this._makeField(descriptor.options.field); - return new DynamicTextProperty(descriptor.options, VECTOR_STYLES.LABEL_TEXT, field); + return new DynamicTextProperty( + descriptor.options, + VECTOR_STYLES.LABEL_TEXT, + field, + this._getFieldMeta, + this._getFieldFormatter + ); } else { throw new Error(`${descriptor} not implemented`); } diff --git a/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.js b/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.js index d9182be56a75f..7abfee1b184f0 100644 --- a/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.js +++ b/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.js @@ -168,5 +168,5 @@ export function canSkipFormattersUpdate({ prevDataRequest, nextMeta }) { return false; } - return !_.isEqual(prevMeta.fieldNames, nextMeta.fieldNames); + return _.isEqual(prevMeta.fieldNames, nextMeta.fieldNames); }