mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Discover] Switch from "at" to "charAt" for better browser support (#156474)
From the community forum: users can't access Discover on older browsers. ``` TypeError: t.at is not a function at http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312992 at Array.forEach () at n (http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312956) at s (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10138) at http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10215 at Array.map () at a (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10207) at http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:8442 at http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:27724 at t.s._next (http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:33456) ``` - https://discuss.elastic.co/t/update-to-8-7-0/329525 - https://discuss.elastic.co/t/elastic-8-7-0-error-in-discover-tab/332329/2 ## Summary This PR replaces `String` `.at` usage with `.charAt` so it does not require a polyfill for older browsers.
This commit is contained in:
parent
0a9bbe7c1f
commit
396a2b63d4
2 changed files with 4 additions and 2 deletions
|
@ -200,6 +200,7 @@ describe('tabify_docs', () => {
|
|||
_size: 12,
|
||||
_score: 77,
|
||||
_source: {},
|
||||
invalid_meta: 'test',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -216,7 +217,7 @@ describe('tabify_docs', () => {
|
|||
},
|
||||
},
|
||||
},
|
||||
metaFields: ['_id', '_index', '_score', '_type', '_size'],
|
||||
metaFields: ['_id', '_index', '_score', '_type', '_size', 'invalid_meta'],
|
||||
fieldFormats: fieldFormats as any,
|
||||
});
|
||||
const table = tabifyDocs(responsePlugin, dataView);
|
||||
|
|
|
@ -107,7 +107,8 @@ export function flattenHit(hit: Hit, indexPattern?: DataView, params?: TabifyDoc
|
|||
|
||||
// Merge all valid meta fields into the flattened object
|
||||
indexPattern?.metaFields?.forEach((fieldName) => {
|
||||
const isExcludedMetaField = EXCLUDED_META_FIELDS.includes(fieldName) || fieldName.at(0) !== '_';
|
||||
const isExcludedMetaField =
|
||||
EXCLUDED_META_FIELDS.includes(fieldName) || fieldName.charAt(0) !== '_';
|
||||
if (isExcludedMetaField) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue