public_org/build/elasticsearchPlugin.aae40212254ed8359ce4.js
/**
 * Modifies dataframe and adds dataLinks from the config.
 * Exported for tests.
 */
Modifies dataframe and adds dataLinks from the config.
Exported for tests.
Modifies dataframe and adds dataLinks from the config . Exported for tests .
function enhanceDataFrame(dataFrame, dataLinks) {
  if (dataLinks.length) {
    var _iteratorNormalCompletion6 = true;
    var _didIteratorError6 = false;
    var _iteratorError6 = undefined;
    try {
      var _loop = function _loop() {
        var field = _step6.value;
        var dataLinkConfig = dataLinks.find(function (dataLink) {
          return field.name && field.name.match(dataLink.field);
        });
        if (dataLinkConfig) {
          var link;
          if (dataLinkConfig.datasourceUid) {
            link = {
              title: '',
              url: '',
              internal: {
                query: {
                  query: dataLinkConfig.url
                },
                datasourceUid: dataLinkConfig.datasourceUid
              }
            };
          } else {
            link = {
              title: '',
              url: dataLinkConfig.url
            };
          }
          field.config = field.config || {};
          field.config.links = [].concat(_toConsumableArray(field.config.links || []), [link]);
        }
      };
      for (var _iterator6 = dataFrame.fields[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
        _loop();
      }
    } catch (err) {
      _didIteratorError6 = true;
      _iteratorError6 = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
          _iterator6.return();
        }
      } finally {
        if (_didIteratorError6) {
          throw _iteratorError6;
        }
      }
    }
  }
}
function enhanceDataFrame ( dataFrame , dataLinks ) { if ( dataLinks . length ) { var _iteratorNormalCompletion6 = true ; var _didIteratorError6 = false ; var _iteratorError6 = undefined ; try { var _loop = function _loop ( ) { var field = _step6 . value ; var dataLinkConfig = dataLinks . find ( function ( dataLink ) { return field . name && field . name . match ( dataLink . field ) ; } ) ; if ( dataLinkConfig ) { var link ; if ( dataLinkConfig . datasourceUid ) { link = { title : '' , url : '' , internal : { query : { query : dataLinkConfig . url } , datasourceUid : dataLinkConfig . datasourceUid } } ; } else { link = { title : '' , url : dataLinkConfig . url } ; } field . config = field . config || { } ; field . config . links = [ ] . concat ( _toConsumableArray ( field . config . links || [ ] ) , [ link ] ) ; } } ; for ( var _iterator6 = dataFrame . fields [ Symbol . iterator ] ( ) , _step6 ; ! ( _iteratorNormalCompletion6 = ( _step6 = _iterator6 . next ( ) ) . done ) ; _iteratorNormalCompletion6 = true ) { _loop ( ) ; } } catch ( err ) { _didIteratorError6 = true ; _iteratorError6 = err ; } finally { try { if ( ! _iteratorNormalCompletion6 && _iterator6 . return != null ) { _iterator6 . return ( ) ; } } finally { if ( _didIteratorError6 ) { throw _iteratorError6 ; } } } } }
Modifies dataframe and adds dataLinks from the config.
Modifies dataframe and adds dataLinks from the config .