@infinilabs/discover 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { o as __toESM, r as __export, t as __commonJSMin } from "./chunk-D-4zIDrl.js";
2
- import { C as BehaviorSubject, E as Subscription, T as operate, _ as onRedirectNoIndexPattern, b as FilterManager, d as baseFormattersPublic, f as getTimezone, g as onUnsupportedTimePattern, h as IndexPatternsApiClient, l as generateFilters, m as SavedObjectsClientPublicToCommon, n as search, p as deserializeFieldFormat, u as createSearchBar, v as TimeHistory, w as createOperatorSubscriber, x as AutocompleteService, y as Timefilter } from "./public-BlIKZ8cn.js";
2
+ import { C as BehaviorSubject, E as Subscription, T as operate, _ as onRedirectNoIndexPattern, b as FilterManager, d as baseFormattersPublic, f as getTimezone, g as onUnsupportedTimePattern, h as IndexPatternsApiClient, l as generateFilters, m as SavedObjectsClientPublicToCommon, n as search, p as deserializeFieldFormat, u as createSearchBar, v as TimeHistory, w as createOperatorSubscriber, x as AutocompleteService, y as Timefilter } from "./public-PTd5784r.js";
3
3
  import { a as createHashHistory, c as require_object_assign, d as FieldIcon, i as setIndexPatterns$1, l as require_url, o as _extends, t as getIndexPatterns, u as FieldButton } from "./services-C8UxrSbr.js";
4
4
  import { t as require_classnames } from "./classnames-BCXlvRQ0.js";
5
5
  import { t as require_lodash } from "./lodash-Gv_ptthU.js";
@@ -488,17 +488,17 @@ function DiscoverFieldBucket({ field: e, bucket: t, onAddFilter: n }) {
488
488
  }
489
489
  function DiscoverFieldDetails({ field: e, indexPattern: t, details: n, onAddFilter: i }) {
490
490
  let { i18n: a } = useContext(GlobalConfigContext), o = a?.field || {};
491
- return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs("div", {
491
+ return console.log("error", n.error), /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx("div", {
492
492
  className: "dscFieldDetails !p-12px",
493
- children: [n.error && /* @__PURE__ */ jsx(Typography.Text, {
493
+ children: n.error?.root_cause ? /* @__PURE__ */ jsx(Typography.Text, {
494
494
  className: "text-xs mb-12px",
495
495
  type: "danger",
496
- children: n.error
497
- }), !n.error && /* @__PURE__ */ jsxs(Fragment$1, { children: [n?.buckets?.map((t, n) => /* @__PURE__ */ jsx(DiscoverFieldBucket, {
496
+ children: JSON.stringify(n.error?.root_cause)
497
+ }) : Number.isInteger(n.total) ? /* @__PURE__ */ jsxs(Fragment$1, { children: [n?.buckets?.map((t, n) => /* @__PURE__ */ jsx(DiscoverFieldBucket, {
498
498
  bucket: t,
499
499
  field: e,
500
500
  onAddFilter: i
501
- }, `bucket${n}`)), /* @__PURE__ */ jsx(Typography.Text, { children: `${o.top_result_prefix || "Calculated from"} ${n.total} ${o.top_result_suffix || "sample records"}` })] })]
501
+ }, `bucket${n}`)), /* @__PURE__ */ jsx(Typography.Text, { children: `${o.top_result_prefix || "Calculated from"} ${n.total} ${o.top_result_suffix || "sample records"}` })] }) : /* @__PURE__ */ jsx(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE })
502
502
  }) });
503
503
  }
504
504
  var DOT_PREFIX_RE = /(.).+?\./g;
@@ -589,7 +589,7 @@ function DiscoverField({ field: e, indexPattern: t, onAddField: n, onRemoveField
589
589
  });
590
590
  } else m(n, () => {
591
591
  M(!0);
592
- }, (e, i) => {
592
+ }, (e, i, a) => {
593
593
  O({
594
594
  ...E,
595
595
  buckets: (e || []).map((e) => ({
@@ -598,9 +598,9 @@ function DiscoverField({ field: e, indexPattern: t, onAddField: n, onRemoveField
598
598
  count: e.doc_count,
599
599
  percent: (e.doc_count / i * 100).toFixed(1)
600
600
  })),
601
- exists: (e || []).map((e) => e.doc_count).reduce((e, t) => e + t),
601
+ exists: (e || []).map((e) => e.doc_count).reduce((e, t) => e + t, 0),
602
602
  total: i,
603
- columns: g
603
+ error: a
604
604
  }), M(!1);
605
605
  });
606
606
  };
@@ -51796,7 +51796,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51796
51796
  let { index: m, body: g } = f, y = await o(m, g);
51797
51797
  if (i) {
51798
51798
  let e = s.sampleRecords === "all" ? y?.aggregations?.top5?.buckets : y?.aggregations?.sample?.top5?.buckets, t = s.sampleRecords === "all" ? y?.aggregations?.top5?.sum_other_doc_count : y?.aggregations?.sample?.sample_count?.value;
51799
- i(e || [], t || 0);
51799
+ i(e || [], t || 0, y?.error);
51800
51800
  }
51801
51801
  }, cQ = async (e) => {
51802
51802
  I.unsubscribe(), t.timeFieldName = e, n(t);