File tree Expand file tree Collapse file tree
x-pack/legacy/plugins/ml/public/application/components/anomalies_table Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,26 +255,7 @@ class LinksMenuUI extends Component {
255255 ) ;
256256 } ;
257257
258- function findFieldType ( index ) {
259- getFieldTypeFromMapping ( index , categorizationFieldName )
260- . then ( resp => {
261- if ( resp !== '' ) {
262- createAndOpenUrl ( index , resp ) ;
263- } else {
264- i ++ ;
265- if ( i < datafeedIndices . length ) {
266- findFieldType ( datafeedIndices [ i ] ) ;
267- } else {
268- error ( ) ;
269- }
270- }
271- } )
272- . catch ( ( ) => {
273- error ( ) ;
274- } ) ;
275- }
276-
277- function createAndOpenUrl ( index , categorizationFieldType ) {
258+ const createAndOpenUrl = ( index , categorizationFieldType ) => {
278259 // Find the ID of the index pattern with a title attribute which matches the
279260 // index configured in the datafeed. If a Kibana index pattern has not been created
280261 // for this index, then the user will see a warning message on the Discover tab advising
@@ -359,6 +340,25 @@ class LinksMenuUI extends Component {
359340 } )
360341 ) ;
361342 } ) ;
343+ } ;
344+
345+ function findFieldType ( index ) {
346+ getFieldTypeFromMapping ( index , categorizationFieldName )
347+ . then ( resp => {
348+ if ( resp !== '' ) {
349+ createAndOpenUrl ( index , resp ) ;
350+ } else {
351+ i ++ ;
352+ if ( i < datafeedIndices . length ) {
353+ findFieldType ( datafeedIndices [ i ] ) ;
354+ } else {
355+ error ( ) ;
356+ }
357+ }
358+ } )
359+ . catch ( ( ) => {
360+ error ( ) ;
361+ } ) ;
362362 }
363363 } ;
364364
You can’t perform that action at this time.
0 commit comments