@databrainhq/plugin 0.17.9-beta.32 → 0.17.9-beta.34
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.
- package/dist/{Accordion-DwFCsJys.mjs → Accordion-DtzU-kv3.mjs} +1 -1
- package/dist/{Chart-DK90Btwz.mjs → Chart-BKjKglnR.mjs} +760 -760
- package/dist/{CreateGlobalFilter-CDz7kQ4l.mjs → CreateGlobalFilter-COJr9pxx.mjs} +195 -195
- package/dist/{CreateMetricV2-Dm-Yj526.mjs → CreateMetricV2-CfcDgw3E.mjs} +146 -146
- package/dist/{DraggableItem-zeUKOsQO.mjs → DraggableItem-B8IW0_no.mjs} +139 -139
- package/dist/{HorizontalStackTable-CRz3Ysjl.mjs → HorizontalStackTable-BgTor_KQ.mjs} +48 -48
- package/dist/{ManageMetricsV2-Do_l1O0Q.mjs → ManageMetricsV2-DM8gofxF.mjs} +3 -3
- package/dist/{MetricCardV2-DQ7__scR.mjs → MetricCardV2-Ff__3yWl.mjs} +146 -146
- package/dist/{NoDataFound-DqfFaDS2.mjs → NoDataFound-Ifpvns9-.mjs} +1 -1
- package/dist/{NoDataState-NCabdb95.mjs → NoDataState-DPVhHP6M.mjs} +2 -2
- package/dist/{Panel-DusYr6M8.mjs → Panel-BUwtA4r-.mjs} +1 -1
- package/dist/{PivotTableV2-C5p2Tm6Y.mjs → PivotTableV2-DQU2H33d.mjs} +2 -2
- package/dist/{PivotTableV3-DqbBVcNp.mjs → PivotTableV3-BLp5-cQr.mjs} +4 -4
- package/dist/{Portal-CsGzwm_y.mjs → Portal-BP2ivXF8.mjs} +2480 -2388
- package/dist/{RadioButton-CbCdIRZ-.mjs → RadioButton-oGBMxhHq.mjs} +2 -2
- package/dist/{ScheduleEmail-BAKc9_-V.mjs → ScheduleEmail-CiO6PMLd.mjs} +517 -517
- package/dist/{SearchMetricData-BhSQQqR8.mjs → SearchMetricData-C4stwNY9.mjs} +1272 -1272
- package/dist/{SortPanel-DAM5oTfq.mjs → SortPanel-Cy82r5dX.mjs} +1332 -1332
- package/dist/{Table-CbA0F_T-.mjs → Table-Cg4EZCAG.mjs} +296 -296
- package/dist/{TagInputField-BoexEOGa.mjs → TagInputField-DuY_whs7.mjs} +9 -9
- package/dist/{TextAreaField-BYWmVt9k.mjs → TextAreaField-D5O-kEVL.mjs} +297 -297
- package/dist/{TimeSeriesSettings-C8YubKkK.mjs → TimeSeriesSettings-TXu0_07R.mjs} +11 -11
- package/dist/{arrayToCsvString-D9T6ms_d.mjs → arrayToCsvString-Bj2E5XgM.mjs} +1 -1
- package/dist/{cardActions-BLBLsjcd.mjs → cardActions-BPRHHm2G.mjs} +21 -7
- package/dist/{cardQueryError-BQDAWqNF.mjs → cardQueryError-DFKFCfFx.mjs} +1274 -1274
- package/dist/{charts-CY0Vq7Bn.mjs → charts-C2loGjFP.mjs} +3 -3
- package/dist/{chevron-down-DAAEUsOt.mjs → chevron-down-BWD1dxqC.mjs} +6 -6
- package/dist/{conditionalFormatting-D6RjAw3N.mjs → conditionalFormatting-Ca-leGbK.mjs} +1 -1
- package/dist/{contrast-Clo5ZlPI.mjs → contrast-EppiiunY.mjs} +117 -112
- package/dist/{createGlobalFilter.module-BKBDNd1L.mjs → createGlobalFilter.module-B3yI7_04.mjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/{echarts-D2fgUAZU.mjs → echarts-CsSfDZ5q.mjs} +2 -2
- package/dist/{metric.mutation-CqBTyMb6.mjs → metric.mutation-hYspHj1p.mjs} +1 -1
- package/dist/{option-ywDB8mz_.mjs → option-B1zeYJnm.mjs} +1 -1
- package/dist/{permissions-BHlkdJ4i.mjs → permissions-Bc9NDT2w.mjs} +359 -359
- package/dist/{pluginV3Request-BlghXC7v.mjs → pluginV3Request-DFy6TETh.mjs} +1 -1
- package/dist/{renderer-BO0l-7XV.mjs → renderer-Bk8GbA94.mjs} +2 -2
- package/dist/{theme-CU-AvQm_.mjs → theme-BA-MvZE0.mjs} +1 -1
- package/dist/{timeseries-BBFyUgXR.mjs → timeseries-kGhqoQ6V.mjs} +1948 -1942
- package/dist/{toTasteAppearance-oR7SCi_i.mjs → toTasteAppearance-CGUd4zvZ.mjs} +1 -1
- package/dist/{useGuesTokenUsageLog-CUs9W4WA.mjs → useGuesTokenUsageLog-CVeQacbL.mjs} +1 -1
- package/dist/{usePublishArchivedMetrics-DQbGh3HA.mjs → usePublishArchivedMetrics-BGEBFLub.mjs} +2 -2
- package/dist/{useQuery-Cy8Ro28s.mjs → useQuery-CNVFkkjT.mjs} +1 -1
- package/dist/webcomponents.css +1 -1
- package/dist/webcomponents.es.js +3942 -3939
- package/dist/webcomponents.umd.js +185 -185
- package/package.json +2 -2
|
@@ -3,23 +3,23 @@ import "react-dom";
|
|
|
3
3
|
import "react-dom/client";
|
|
4
4
|
import { o as e } from "./rolldown-runtime-C1JUX4Ur.mjs";
|
|
5
5
|
import { c as t, s as n } from "./cardStates-DiUMQ7_o.mjs";
|
|
6
|
-
import { Bt as r, It as i, Vt as a, Zt as o, a as s, c, l, m as u, u as d, zt as f } from "./pluginV3Request-
|
|
7
|
-
import { $ as p, K as m, O as
|
|
8
|
-
import { $
|
|
9
|
-
import { t as
|
|
10
|
-
import { i as
|
|
11
|
-
import { n as
|
|
12
|
-
import { i as
|
|
13
|
-
import { a as
|
|
14
|
-
import { f as
|
|
15
|
-
import {
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import * as
|
|
19
|
-
import { createContext as
|
|
20
|
-
import { jsx as
|
|
6
|
+
import { Bt as r, It as i, Vt as a, Zt as o, a as s, c, l, m as u, u as d, zt as f } from "./pluginV3Request-DFy6TETh.mjs";
|
|
7
|
+
import { $ as p, K as m, O as h, Q as g, U as _, X as v, Y as y, Z as b, a as x, at as S, d as C, et as w, i as ee, l as T, lt as E, q as D, s as te, tt as O } from "./metric.mutation-hYspHj1p.mjs";
|
|
8
|
+
import { $t as ne, An as re, Ba as ie, Bt as ae, Cn as oe, Cr as se, Dn as ce, Gt as le, Ha as ue, Hn as de, Ht as fe, Ji as pe, Jn as me, Jt as he, Kn as ge, La as _e, Ln as k, Lt as ve, Mr as ye, Oa as be, Qn as xe, Ra as Se, Ri as Ce, Rt as we, Tt as Te, Vn as Ee, Wt as De, Xn as Oe, Xt as ke, Zn as Ae, Zt as je, _n as Me, an as Ne, bn as Pe, ci as Fe, dn as Ie, en as Le, er as Re, fn as ze, hn as Be, ja as A, jn as Ve, kn as He, on as Ue, pn as We, qn as Ge, s as Ke, tn as qe, ua as Je, ui as Ye, un as Xe, xn as Ze, yn as Qe, za as $e } from "./Portal-BP2ivXF8.mjs";
|
|
9
|
+
import { t as j } from "./useQuery-CNVFkkjT.mjs";
|
|
10
|
+
import { i as et } from "./chevron-down-BWD1dxqC.mjs";
|
|
11
|
+
import { n as tt } from "./timeseries-kGhqoQ6V.mjs";
|
|
12
|
+
import { i as nt } from "./text-CtrvkDIo.mjs";
|
|
13
|
+
import { a as rt, r as it, s as at } from "./permissions-Bc9NDT2w.mjs";
|
|
14
|
+
import { f as ot, o as st } from "./RadioButton-oGBMxhHq.mjs";
|
|
15
|
+
import { i as ct } from "./cardActions-BPRHHm2G.mjs";
|
|
16
|
+
import { t as lt } from "./TimeSeriesSettings-TXu0_07R.mjs";
|
|
17
|
+
import { t as ut } from "./createLucideIcon-C-N26TaJ.mjs";
|
|
18
|
+
import * as dt from "react";
|
|
19
|
+
import { createContext as ft, useCallback as M, useContext as pt, useEffect as N, useLayoutEffect as mt, useMemo as P, useRef as F, useState as I } from "react";
|
|
20
|
+
import { jsx as ht, jsxs as gt } from "react/jsx-runtime";
|
|
21
21
|
//#region src/helpers/getValidRlsConditionOptions.ts
|
|
22
|
-
var
|
|
22
|
+
var _t = (e, t) => {
|
|
23
23
|
if (!t?.[e.name]) return;
|
|
24
24
|
let n = t?.[e.name]?.defaultOption?.toString(), r = (t?.[e.name]?.options)?.filter((t) => {
|
|
25
25
|
if (t == null) return !1;
|
|
@@ -37,7 +37,7 @@ var ht = (e, t) => {
|
|
|
37
37
|
"last",
|
|
38
38
|
"this",
|
|
39
39
|
"custom"
|
|
40
|
-
].includes(e || "") || n && !
|
|
40
|
+
].includes(e || "") || n && !Re({
|
|
41
41
|
endDate: t.endDate ?? t.toDate,
|
|
42
42
|
endTime: t.endTime,
|
|
43
43
|
startDate: t.startDate ?? t.fromDate,
|
|
@@ -66,7 +66,7 @@ var ht = (e, t) => {
|
|
|
66
66
|
}) ? n : void 0,
|
|
67
67
|
options: r
|
|
68
68
|
};
|
|
69
|
-
},
|
|
69
|
+
}, vt = ({ rlsConditions: e, isFrontendApp: t }) => e.filter((e) => (t || !e.isAppFilter) && !e.isHiddenInUi), yt = ft({}), bt = () => pt(yt), xt = /* @__PURE__ */ e(ie()), St = /;\s*$/, Ct = (e) => e.replace(St, ""), wt = (e) => `${e?.token || ""}|${+!!e?.isFrontendApp}|${e?.clientId || ""}`, Tt = (e, t = {}) => e?.id ? e.drillConfig?.levels?.some((e) => !!e?.filters?.length) ? {
|
|
70
70
|
eligible: !1,
|
|
71
71
|
reason: "drill-filtered"
|
|
72
72
|
} : e.isEncrypted && !t.isGuestTokenSession ? {
|
|
@@ -75,14 +75,14 @@ var ht = (e, t) => {
|
|
|
75
75
|
} : { eligible: !0 } : {
|
|
76
76
|
eligible: !1,
|
|
77
77
|
reason: "no-metric-id"
|
|
78
|
-
},
|
|
78
|
+
}, Et = (e, t, n, r = "embed", i) => ({
|
|
79
79
|
key: e,
|
|
80
80
|
externalMetricId: t.id,
|
|
81
81
|
...r === "platform" && n ? { clientId: n } : {},
|
|
82
82
|
...r === "platform" && t.timezone ? { timezone: t.timezone } : {},
|
|
83
83
|
...t.isEncrypted && i ? {
|
|
84
|
-
rlsConditions: t.rlsConditions?.length ?
|
|
85
|
-
globalFilters: t.globalFilters?.filters?.length ?
|
|
84
|
+
rlsConditions: t.rlsConditions?.length ? Se(t.rlsConditions, i) : [],
|
|
85
|
+
globalFilters: t.globalFilters?.filters?.length ? Se(t.globalFilters, i) : {
|
|
86
86
|
tableName: "",
|
|
87
87
|
filters: []
|
|
88
88
|
}
|
|
@@ -104,7 +104,7 @@ var ht = (e, t) => {
|
|
|
104
104
|
comparisonCount: t.comparisonCount,
|
|
105
105
|
drillConfig: t.drillConfig,
|
|
106
106
|
...t.isEncrypted && i ? { isEncrypted: !0 } : {}
|
|
107
|
-
}),
|
|
107
|
+
}), Dt = (e) => {
|
|
108
108
|
let t = [];
|
|
109
109
|
if (typeof e.data == "string") try {
|
|
110
110
|
t = JSON.parse(e.data);
|
|
@@ -125,7 +125,7 @@ var ht = (e, t) => {
|
|
|
125
125
|
...e.notices ? { notices: e.notices } : {},
|
|
126
126
|
...e.error ? { error: e.error } : {}
|
|
127
127
|
};
|
|
128
|
-
},
|
|
128
|
+
}, Ot = 45e3, kt = 1e3, At = 1500, jt = class {
|
|
129
129
|
options;
|
|
130
130
|
queue = [];
|
|
131
131
|
flushScheduled = !1;
|
|
@@ -210,7 +210,7 @@ var ht = (e, t) => {
|
|
|
210
210
|
}
|
|
211
211
|
let n = /* @__PURE__ */ new Map();
|
|
212
212
|
e.forEach((e) => {
|
|
213
|
-
let t =
|
|
213
|
+
let t = wt(e.session), r = n.get(t);
|
|
214
214
|
r ? r.push(e) : n.set(t, [e]);
|
|
215
215
|
});
|
|
216
216
|
let { coldHeadSize: r, maxBatchSize: i } = this.options, a = t ? Math.min(r, i) : 0, o = [];
|
|
@@ -241,7 +241,7 @@ var ht = (e, t) => {
|
|
|
241
241
|
s = await this.options.transport(e.map((e) => e.request), t.signal, e[0]?.session || {}), i = !0, o();
|
|
242
242
|
} catch (t) {
|
|
243
243
|
if (i = !0, o(), r) {
|
|
244
|
-
let t = new
|
|
244
|
+
let t = new b(this.options.timeoutMs);
|
|
245
245
|
e.forEach((e) => {
|
|
246
246
|
e.reject(t);
|
|
247
247
|
});
|
|
@@ -285,51 +285,51 @@ var ht = (e, t) => {
|
|
|
285
285
|
this.settleWithFallback(e);
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
|
-
let r =
|
|
288
|
+
let r = Dt(n);
|
|
289
289
|
e.resolve(r);
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
292
|
settleWithFallback(e) {
|
|
293
293
|
e.fallback().then(e.resolve, e.reject);
|
|
294
294
|
}
|
|
295
|
-
},
|
|
295
|
+
}, Mt = "dbnMetricBatch", L = "@dbn:metricQueryBatch", Nt = () => {
|
|
296
296
|
try {
|
|
297
|
-
let e = window.localStorage.getItem(
|
|
297
|
+
let e = window.localStorage.getItem(L);
|
|
298
298
|
if (e === "on" || e === "off") return e;
|
|
299
299
|
} catch {}
|
|
300
300
|
return null;
|
|
301
|
-
},
|
|
301
|
+
}, Pt = (e) => {
|
|
302
302
|
try {
|
|
303
|
-
e === null ? window.localStorage.removeItem(
|
|
303
|
+
e === null ? window.localStorage.removeItem(L) : window.localStorage.setItem(L, e);
|
|
304
304
|
} catch {}
|
|
305
|
-
},
|
|
305
|
+
}, Ft = () => {
|
|
306
306
|
try {
|
|
307
|
-
let e = new URLSearchParams(window.location.search).get(
|
|
308
|
-
(e === "on" || e === "off") &&
|
|
307
|
+
let e = new URLSearchParams(window.location.search).get(Mt);
|
|
308
|
+
(e === "on" || e === "off") && Pt(e);
|
|
309
309
|
} catch {}
|
|
310
|
-
},
|
|
310
|
+
}, R = () => typeof window > "u" || window.dbn?.disableMetricQueryBatch ? "off" : (Ft(), Nt() ?? "auto"), It = () => R() !== "off", z = /* @__PURE__ */ new Set(), Lt = () => {
|
|
311
311
|
let e;
|
|
312
|
-
return
|
|
312
|
+
return z.forEach((t) => {
|
|
313
313
|
if (!e) try {
|
|
314
314
|
let n = t();
|
|
315
315
|
n && Object.keys(n).length && (e = n);
|
|
316
316
|
} catch {}
|
|
317
317
|
}), e;
|
|
318
|
-
},
|
|
318
|
+
}, Rt = "/hasuraActions/externalMetricQueryBatch", zt = "/api/v3/metric/queryBatch", Bt = [
|
|
319
319
|
404,
|
|
320
320
|
405,
|
|
321
321
|
501
|
|
322
|
-
],
|
|
322
|
+
], Vt = [
|
|
323
323
|
200,
|
|
324
324
|
400,
|
|
325
325
|
401,
|
|
326
326
|
403
|
|
327
|
-
],
|
|
328
|
-
let i =
|
|
329
|
-
if (!i) throw new
|
|
327
|
+
], B = (e) => !!e.token || !!(e.isFrontendApp && e.clientId), Ht = (e = {}) => typeof window > "u" || typeof fetch != "function" || window.dbn?.isEnableProxyAuth ? null : B(e) ? "embed" : Lt() ? "platform" : null, Ut = (e = "platform") => `${window.dbn?.baseUrl || u}${e === "embed" ? zt : Rt}`, Wt = async (e, t, r = {}) => {
|
|
328
|
+
let i = Ht(r);
|
|
329
|
+
if (!i) throw new y("No credentials available for batched queries");
|
|
330
330
|
let a;
|
|
331
331
|
if (i === "embed") a = await c({
|
|
332
|
-
path:
|
|
332
|
+
path: zt,
|
|
333
333
|
method: "POST",
|
|
334
334
|
signal: t,
|
|
335
335
|
token: r.token,
|
|
@@ -339,9 +339,9 @@ var ht = (e, t) => {
|
|
|
339
339
|
throwOnHttpError: !1
|
|
340
340
|
});
|
|
341
341
|
else {
|
|
342
|
-
let n =
|
|
343
|
-
if (!n) throw new
|
|
344
|
-
a = await fetch(
|
|
342
|
+
let n = Lt();
|
|
343
|
+
if (!n) throw new y("No access token available for batched queries");
|
|
344
|
+
a = await fetch(Ut(i), {
|
|
345
345
|
method: "POST",
|
|
346
346
|
signal: t,
|
|
347
347
|
headers: {
|
|
@@ -353,62 +353,62 @@ var ht = (e, t) => {
|
|
|
353
353
|
body: JSON.stringify({ input: { input: { requests: e } } })
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
|
-
if (
|
|
356
|
+
if (Bt.includes(a.status)) throw new v(`Batch endpoint responded ${a.status}`);
|
|
357
357
|
let o;
|
|
358
358
|
try {
|
|
359
359
|
o = await a.json();
|
|
360
360
|
} catch {
|
|
361
|
-
throw new
|
|
361
|
+
throw new v("Batch endpoint returned a non-JSON body");
|
|
362
362
|
}
|
|
363
363
|
let s = n(o);
|
|
364
364
|
if (s?.code === "UNAUTHORIZED_ORIGIN" || s?.details?.reason === "UNAUTHORIZED_ORIGIN") throw Object.assign(Error(s.message || "UNAUTHORIZED_ORIGIN"), s, { code: "UNAUTHORIZED_ORIGIN" });
|
|
365
365
|
let l = o?.error && typeof o.error == "object" ? o.error : void 0;
|
|
366
|
-
if (l &&
|
|
367
|
-
if (a.status === 401 || a.status === 403) throw new
|
|
366
|
+
if (l && Vt.includes(a.status)) throw new y(l.message || "Unauthorized request!");
|
|
367
|
+
if (a.status === 401 || a.status === 403) throw new y(`Batch endpoint responded ${a.status}`);
|
|
368
368
|
if (!a.ok) throw Error(o?.message || `Batch request failed with status ${a.status}`);
|
|
369
|
-
if (!Array.isArray(o?.results) && typeof o?.error != "string") throw new
|
|
369
|
+
if (!Array.isArray(o?.results) && typeof o?.error != "string") throw new v("Batch endpoint response did not match the expected shape");
|
|
370
370
|
return o;
|
|
371
|
-
},
|
|
372
|
-
transport:
|
|
371
|
+
}, Gt = null, Kt = 50, qt = 4, Jt = () => (Gt ||= new jt({
|
|
372
|
+
transport: Wt,
|
|
373
373
|
coalesceWindowMs: 500,
|
|
374
|
-
visibleCoalesceWindowMs:
|
|
375
|
-
coalesceIdleMs:
|
|
376
|
-
coalesceMaxWaitMs:
|
|
377
|
-
coldHeadSize:
|
|
378
|
-
}),
|
|
379
|
-
t !== void 0 &&
|
|
380
|
-
let u =
|
|
381
|
-
if (!
|
|
382
|
-
let d =
|
|
383
|
-
if (!d || !
|
|
374
|
+
visibleCoalesceWindowMs: Kt,
|
|
375
|
+
coalesceIdleMs: kt,
|
|
376
|
+
coalesceMaxWaitMs: At,
|
|
377
|
+
coldHeadSize: qt
|
|
378
|
+
}), Gt), Yt = async ({ payload: e, savedMetricQuery: t, dbName: n, savedMetricIdentifiers: r, clientId: i, key: a, hints: o, batchPolicy: s, session: c, single: l }) => {
|
|
379
|
+
t !== void 0 && ge(t, "metric.query", n), Ge(r);
|
|
380
|
+
let u = Oe(e);
|
|
381
|
+
if (!It()) return l(u);
|
|
382
|
+
let d = Ht(c);
|
|
383
|
+
if (!d || !Tt(u, o).eligible) return l(u);
|
|
384
384
|
let f = {
|
|
385
|
-
request:
|
|
385
|
+
request: Et(a, u, i, d, c?.token),
|
|
386
386
|
fallback: () => l(u),
|
|
387
387
|
batchPolicy: s,
|
|
388
388
|
session: c
|
|
389
389
|
};
|
|
390
|
-
return
|
|
391
|
-
},
|
|
390
|
+
return Jt().enqueue(f);
|
|
391
|
+
}, Xt = ft("standard"), Zt = 134217728, Qt = /* @__PURE__ */ new WeakMap(), $t = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
392
392
|
if (e == null) return 0;
|
|
393
393
|
if (typeof e == "string") return e.length * 2;
|
|
394
394
|
if (typeof e == "number" || typeof e == "bigint") return 8;
|
|
395
395
|
if (typeof e == "boolean") return 4;
|
|
396
396
|
if (typeof e != "object") return 0;
|
|
397
|
-
let n = e, r =
|
|
397
|
+
let n = e, r = Qt.get(n);
|
|
398
398
|
if (r !== void 0) return r;
|
|
399
399
|
if (t.has(n)) return 0;
|
|
400
400
|
t.add(n);
|
|
401
401
|
let i = 32;
|
|
402
|
-
if (Array.isArray(e)) for (let n of e) i += 8 +
|
|
403
|
-
else for (let [n, r] of Object.entries(e)) i += n.length * 2 + 8 +
|
|
404
|
-
return
|
|
405
|
-
},
|
|
402
|
+
if (Array.isArray(e)) for (let n of e) i += 8 + $t(n, t);
|
|
403
|
+
else for (let [n, r] of Object.entries(e)) i += n.length * 2 + 8 + $t(r, t);
|
|
404
|
+
return Qt.set(n, i), i;
|
|
405
|
+
}, en = (e, { maxEntries: t = 128, maxBytes: n = Zt } = {}) => {
|
|
406
406
|
let r = e.getQueryCache().findAll({
|
|
407
407
|
queryKey: [f],
|
|
408
408
|
type: "inactive"
|
|
409
409
|
}).map((e) => ({
|
|
410
410
|
query: e,
|
|
411
|
-
bytes:
|
|
411
|
+
bytes: $t(e.state.data)
|
|
412
412
|
})).sort((e, t) => e.query.state.dataUpdatedAt - t.query.state.dataUpdatedAt), i = r.reduce((e, t) => e + t.bytes, 0);
|
|
413
413
|
for (; r.length > t || i > n && r.length > 1;) {
|
|
414
414
|
let t = r.shift();
|
|
@@ -419,11 +419,11 @@ var ht = (e, t) => {
|
|
|
419
419
|
type: "inactive"
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
|
-
},
|
|
423
|
-
if (
|
|
424
|
-
|
|
422
|
+
}, V = /* @__PURE__ */ new WeakSet(), tn = (e) => {
|
|
423
|
+
if (V.has(e)) return;
|
|
424
|
+
V.add(e);
|
|
425
425
|
let t = () => {
|
|
426
|
-
|
|
426
|
+
V.delete(e), en(e);
|
|
427
427
|
}, n = globalThis.scheduler;
|
|
428
428
|
if (typeof n?.postTask == "function") {
|
|
429
429
|
n.postTask(t, { priority: "background" });
|
|
@@ -434,43 +434,43 @@ var ht = (e, t) => {
|
|
|
434
434
|
return;
|
|
435
435
|
}
|
|
436
436
|
setTimeout(t, 0);
|
|
437
|
-
},
|
|
437
|
+
}, H = (e) => {
|
|
438
438
|
let t = Object.getPrototypeOf(e);
|
|
439
439
|
return (t === Object.prototype || t === null) && !("toJSON" in e);
|
|
440
|
-
},
|
|
440
|
+
}, U = (e, t) => {
|
|
441
441
|
if (e === t) return !0;
|
|
442
442
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
443
443
|
if (Array.isArray(e)) {
|
|
444
444
|
if (!Array.isArray(t) || e.length !== t.length) return !1;
|
|
445
|
-
for (let n = 0; n < e.length; n += 1) if (!
|
|
445
|
+
for (let n = 0; n < e.length; n += 1) if (!U(e[n], t[n])) return !1;
|
|
446
446
|
return !0;
|
|
447
447
|
}
|
|
448
|
-
if (Array.isArray(t) || !
|
|
448
|
+
if (Array.isArray(t) || !H(e) || !H(t)) return !1;
|
|
449
449
|
let n = Object.keys(e);
|
|
450
450
|
if (n.length !== Object.keys(t).length) return !1;
|
|
451
|
-
for (let r of n) if (!Object.hasOwn(t, r) || !
|
|
451
|
+
for (let r of n) if (!Object.hasOwn(t, r) || !U(e[r], t[r])) return !1;
|
|
452
452
|
return !0;
|
|
453
|
-
},
|
|
453
|
+
}, nn = "dbn:metric-query:guest-principal:v1", rn = 8, W = /* @__PURE__ */ new Map(), an = (e) => {
|
|
454
454
|
if (!e) return;
|
|
455
|
-
let t =
|
|
455
|
+
let t = W.get(e);
|
|
456
456
|
if (t !== void 0) return t;
|
|
457
|
-
let n =
|
|
458
|
-
if (
|
|
459
|
-
let e =
|
|
460
|
-
e !== void 0 &&
|
|
457
|
+
let n = xt.default.HmacSHA256(e, nn).toString(xt.default.enc.Hex);
|
|
458
|
+
if (W.size >= rn) {
|
|
459
|
+
let e = W.keys().next().value;
|
|
460
|
+
e !== void 0 && W.delete(e);
|
|
461
461
|
}
|
|
462
|
-
return
|
|
463
|
-
},
|
|
462
|
+
return W.set(e, n), n;
|
|
463
|
+
}, on = "dbn:metric-query:client-scope:v1", sn = 16, cn = /* @__PURE__ */ new Map(), ln = (e) => {
|
|
464
464
|
if (!e) return;
|
|
465
|
-
let t =
|
|
465
|
+
let t = cn.get(e);
|
|
466
466
|
if (t !== void 0) return t;
|
|
467
|
-
let n =
|
|
468
|
-
if (
|
|
469
|
-
let e =
|
|
470
|
-
e !== void 0 &&
|
|
467
|
+
let n = xt.default.HmacSHA256(e, on).toString(xt.default.enc.Hex);
|
|
468
|
+
if (cn.size >= sn) {
|
|
469
|
+
let e = cn.keys().next().value;
|
|
470
|
+
e !== void 0 && cn.delete(e);
|
|
471
471
|
}
|
|
472
|
-
return
|
|
473
|
-
},
|
|
472
|
+
return cn.set(e, n), n;
|
|
473
|
+
}, un = [
|
|
474
474
|
"updatedAt",
|
|
475
475
|
"query",
|
|
476
476
|
"metricQuery",
|
|
@@ -483,56 +483,56 @@ var ht = (e, t) => {
|
|
|
483
483
|
"groupBy",
|
|
484
484
|
"selectedGroupBy",
|
|
485
485
|
"timeGrain"
|
|
486
|
-
],
|
|
486
|
+
], dn = /* @__PURE__ */ new WeakMap(), fn = (e) => {
|
|
487
487
|
if (!e) return;
|
|
488
|
-
let t =
|
|
488
|
+
let t = dn.get(e);
|
|
489
489
|
if (t !== void 0) return t;
|
|
490
|
-
let n = e, r =
|
|
491
|
-
return
|
|
492
|
-
},
|
|
490
|
+
let n = e, r = xt.default.SHA256(JSON.stringify(un.map((e) => n[e] ?? null))).toString(xt.default.enc.Hex).slice(0, 16);
|
|
491
|
+
return dn.set(e, r), r;
|
|
492
|
+
}, G = (e, t, n) => {
|
|
493
493
|
if (!t) return e;
|
|
494
|
-
let r =
|
|
494
|
+
let r = ln(n);
|
|
495
495
|
return r ? { clientScope: r } : e;
|
|
496
|
-
},
|
|
496
|
+
}, pn = ({ queryName: e, data: t, clientId: n, clientCacheScope: r, isFrontendApp: i, token: a, isFullScreen: o, metricRevision: s }) => [
|
|
497
497
|
e,
|
|
498
498
|
t,
|
|
499
|
-
|
|
499
|
+
G(n, i, r),
|
|
500
500
|
i,
|
|
501
|
-
a ? { guestPrincipal:
|
|
501
|
+
a ? { guestPrincipal: an(a) } : void 0,
|
|
502
502
|
o,
|
|
503
503
|
s
|
|
504
|
-
],
|
|
504
|
+
], mn = (e, t) => !e || !!t, hn = /* @__PURE__ */ new WeakMap(), gn = 512, _n = /* @__PURE__ */ new Map(), vn = (e) => {
|
|
505
505
|
switch (typeof e) {
|
|
506
506
|
case "string": return JSON.stringify(e);
|
|
507
507
|
case "boolean": return e ? "true" : "false";
|
|
508
508
|
case "undefined": return "null";
|
|
509
|
-
default: return
|
|
509
|
+
default: return h([e]).slice(1, -1);
|
|
510
510
|
}
|
|
511
|
-
},
|
|
512
|
-
if (
|
|
513
|
-
let e =
|
|
514
|
-
e !== void 0 &&
|
|
511
|
+
}, yn = (e, t, n) => {
|
|
512
|
+
if (_n.delete(e), _n.size >= gn) {
|
|
513
|
+
let e = _n.keys().next().value;
|
|
514
|
+
e !== void 0 && _n.delete(e);
|
|
515
515
|
}
|
|
516
|
-
|
|
516
|
+
_n.set(e, {
|
|
517
517
|
payload: t,
|
|
518
518
|
hash: n
|
|
519
519
|
});
|
|
520
|
-
},
|
|
521
|
-
if (typeof e != "object" || !e) return
|
|
522
|
-
let t =
|
|
520
|
+
}, bn = (e) => {
|
|
521
|
+
if (typeof e != "object" || !e) return vn(e);
|
|
522
|
+
let t = hn.get(e);
|
|
523
523
|
if (t !== void 0) return t;
|
|
524
|
-
let n = e.id, r = typeof n == "string" ?
|
|
525
|
-
return
|
|
526
|
-
},
|
|
524
|
+
let n = e.id, r = typeof n == "string" ? _n.get(n) : void 0, i = r && U(r.payload, e) ? r.hash : vn(e);
|
|
525
|
+
return hn.set(e, i), typeof n == "string" && yn(n, e, i), i;
|
|
526
|
+
}, xn = (e) => `[${e.map((e, t) => t === 1 ? bn(e) : vn(e)).join(",")}]`, K = ({ queryName: e, workspaceId: t, guestToken: n, isFrontendApp: r, encryptedClientId: i }) => [
|
|
527
527
|
e,
|
|
528
528
|
t,
|
|
529
529
|
{
|
|
530
|
-
guestPrincipal:
|
|
530
|
+
guestPrincipal: an(n),
|
|
531
531
|
isFrontendApp: r,
|
|
532
532
|
encryptedClientId: i
|
|
533
533
|
}
|
|
534
|
-
],
|
|
535
|
-
let
|
|
534
|
+
], Sn = ({ clientId: e, clientCacheScope: n, metricRevision: r, data: i, token: a, isFrontendApp: s, isFullScreen: c = "", batchHints: l, savedMetricQuery: u, savedMetricIdentifiers: d, dbName: m, timeoutMs: h = Ot }, v) => {
|
|
535
|
+
let y = _(), b = pt(Xt), x = !!i.id && !v?.isDisableQuery && (!s || !!e), S = pn({
|
|
536
536
|
queryName: f,
|
|
537
537
|
data: i,
|
|
538
538
|
clientId: e,
|
|
@@ -542,42 +542,42 @@ var ht = (e, t) => {
|
|
|
542
542
|
isFullScreen: c,
|
|
543
543
|
metricRevision: r
|
|
544
544
|
});
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
isQueryEnabled:
|
|
545
|
+
N(() => {
|
|
546
|
+
O() && p("metric-query-enabled-state", {
|
|
547
|
+
isQueryEnabled: x,
|
|
548
548
|
hasMetricId: !!i.id,
|
|
549
|
-
isDisableQuery: !!
|
|
549
|
+
isDisableQuery: !!v?.isDisableQuery,
|
|
550
550
|
isFrontendApp: s,
|
|
551
551
|
hasClientId: !!e,
|
|
552
552
|
hasToken: !!a,
|
|
553
553
|
isFullScreen: c,
|
|
554
|
-
payload:
|
|
554
|
+
payload: E(i)
|
|
555
555
|
});
|
|
556
556
|
}, [
|
|
557
|
-
|
|
557
|
+
x,
|
|
558
558
|
i,
|
|
559
|
-
|
|
559
|
+
v?.isDisableQuery,
|
|
560
560
|
s,
|
|
561
561
|
e,
|
|
562
562
|
a,
|
|
563
563
|
c
|
|
564
564
|
]);
|
|
565
|
-
let
|
|
565
|
+
let C = (t) => {
|
|
566
566
|
let n = t || i;
|
|
567
|
-
return
|
|
567
|
+
return O() && p("metric-query-fetch-start", {
|
|
568
568
|
path: o,
|
|
569
569
|
clientId: e,
|
|
570
570
|
isFrontendApp: s,
|
|
571
571
|
hasToken: !!a,
|
|
572
572
|
isFullScreen: c,
|
|
573
|
-
payload:
|
|
574
|
-
}),
|
|
573
|
+
payload: E(n)
|
|
574
|
+
}), D(o, {
|
|
575
575
|
method: "POST",
|
|
576
576
|
data: {
|
|
577
577
|
...n || {},
|
|
578
578
|
...!s && a ? {
|
|
579
|
-
...Array.isArray(n?.rlsConditions) && n.rlsConditions.length ? { rlsConditions:
|
|
580
|
-
...typeof n?.globalFilters == "object" && n.globalFilters !== null && "filters" in n.globalFilters && Array.isArray(n.globalFilters.filters) && n.globalFilters.filters.length ? { globalFilters:
|
|
579
|
+
...Array.isArray(n?.rlsConditions) && n.rlsConditions.length ? { rlsConditions: Se(n.rlsConditions, a) } : { rlsConditions: [] },
|
|
580
|
+
...typeof n?.globalFilters == "object" && n.globalFilters !== null && "filters" in n.globalFilters && Array.isArray(n.globalFilters.filters) && n.globalFilters.filters.length ? { globalFilters: Se(n.globalFilters, a) } : { globalFilters: {
|
|
581
581
|
tableName: "",
|
|
582
582
|
filters: []
|
|
583
583
|
} }
|
|
@@ -586,16 +586,16 @@ var ht = (e, t) => {
|
|
|
586
586
|
isFrontend: s,
|
|
587
587
|
clientId: e,
|
|
588
588
|
token: a,
|
|
589
|
-
timeoutMs:
|
|
589
|
+
timeoutMs: h
|
|
590
590
|
});
|
|
591
|
-
},
|
|
592
|
-
queryKey:
|
|
593
|
-
queryKeyHashFn:
|
|
594
|
-
queryFn: () => (
|
|
591
|
+
}, w = j({
|
|
592
|
+
queryKey: S,
|
|
593
|
+
queryKeyHashFn: xn,
|
|
594
|
+
queryFn: () => (O() && p("metric-query-dispatch", {
|
|
595
595
|
metricId: i?.id,
|
|
596
|
-
payload:
|
|
597
|
-
}),
|
|
598
|
-
batchPolicy:
|
|
596
|
+
payload: E(i)
|
|
597
|
+
}), Yt({
|
|
598
|
+
batchPolicy: b,
|
|
599
599
|
payload: i,
|
|
600
600
|
savedMetricQuery: u,
|
|
601
601
|
savedMetricIdentifiers: d,
|
|
@@ -611,63 +611,63 @@ var ht = (e, t) => {
|
|
|
611
611
|
isFrontendApp: s,
|
|
612
612
|
clientId: e
|
|
613
613
|
},
|
|
614
|
-
single:
|
|
614
|
+
single: C
|
|
615
615
|
})),
|
|
616
|
-
enabled:
|
|
617
|
-
meta: a || !
|
|
618
|
-
retry: (e, n) => t(n).code !== "UNAUTHORIZED_ORIGIN" && !
|
|
616
|
+
enabled: x,
|
|
617
|
+
meta: a || !mn(s, n) ? { persist: !1 } : void 0,
|
|
618
|
+
retry: (e, n) => t(n).code !== "UNAUTHORIZED_ORIGIN" && !g(n) && e < 2,
|
|
619
619
|
staleTime: 3e5,
|
|
620
620
|
gcTime: 9e5
|
|
621
|
-
}),
|
|
622
|
-
queryHash:
|
|
623
|
-
dataUpdatedAt:
|
|
624
|
-
errorUpdatedAt:
|
|
625
|
-
fetchStatus:
|
|
626
|
-
isSuccess:
|
|
627
|
-
isError:
|
|
628
|
-
data:
|
|
629
|
-
error:
|
|
621
|
+
}), ee = xn(S), T = P(() => ({
|
|
622
|
+
queryHash: ee,
|
|
623
|
+
dataUpdatedAt: w.dataUpdatedAt,
|
|
624
|
+
errorUpdatedAt: w.errorUpdatedAt,
|
|
625
|
+
fetchStatus: w.fetchStatus,
|
|
626
|
+
isSuccess: w.isSuccess,
|
|
627
|
+
isError: w.isError,
|
|
628
|
+
data: w.data,
|
|
629
|
+
error: w.error
|
|
630
630
|
}), [
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
]),
|
|
640
|
-
|
|
641
|
-
let
|
|
642
|
-
return
|
|
643
|
-
if (!
|
|
644
|
-
let e =
|
|
645
|
-
|
|
646
|
-
payload:
|
|
631
|
+
ee,
|
|
632
|
+
w.dataUpdatedAt,
|
|
633
|
+
w.errorUpdatedAt,
|
|
634
|
+
w.fetchStatus,
|
|
635
|
+
w.isSuccess,
|
|
636
|
+
w.isError,
|
|
637
|
+
w.data,
|
|
638
|
+
w.error
|
|
639
|
+
]), te = F(i);
|
|
640
|
+
te.current = i;
|
|
641
|
+
let ne = F(v);
|
|
642
|
+
return ne.current = v, N(() => {
|
|
643
|
+
if (!T.isSuccess || T.fetchStatus !== "idle") return;
|
|
644
|
+
let e = T.data;
|
|
645
|
+
O() && p("metric-query-success", {
|
|
646
|
+
payload: E(te.current),
|
|
647
647
|
responseDataType: typeof e?.data,
|
|
648
648
|
responseRowCount: Array.isArray(e?.data) ? e?.data?.length : void 0,
|
|
649
649
|
totalRecords: e?.totalRecords
|
|
650
|
-
}),
|
|
651
|
-
}, [
|
|
652
|
-
if (
|
|
653
|
-
let e =
|
|
654
|
-
|
|
655
|
-
payload:
|
|
650
|
+
}), ne.current?.onSuccess?.(e), tn(y);
|
|
651
|
+
}, [T, y]), N(() => () => tn(y), [y]), N(() => {
|
|
652
|
+
if (T.fetchStatus !== "idle" || !T.isSuccess && !T.isError) return;
|
|
653
|
+
let e = T.data, t = T.error;
|
|
654
|
+
O() && p("metric-query-settled", {
|
|
655
|
+
payload: E(te.current),
|
|
656
656
|
hasError: !!t,
|
|
657
657
|
errorMessage: t instanceof Error ? t.message : t?.message,
|
|
658
658
|
responseDataType: typeof e?.data,
|
|
659
659
|
responseRowCount: Array.isArray(e?.data) ? e?.data?.length : void 0
|
|
660
|
-
}),
|
|
661
|
-
}, [
|
|
662
|
-
},
|
|
660
|
+
}), ne.current?.onSettled?.(e, t);
|
|
661
|
+
}, [T]), w;
|
|
662
|
+
}, q = async ({ workspaceId: e, token: t, isFrontend: n, encryptedClientId: i }) => (n && await l(), D(`${r}?id=${e}`, {
|
|
663
663
|
method: "GET",
|
|
664
664
|
token: n ? "" : t || "",
|
|
665
665
|
isFrontend: n,
|
|
666
666
|
clientId: i
|
|
667
|
-
})),
|
|
668
|
-
let { token: i } =
|
|
669
|
-
return
|
|
670
|
-
queryKey:
|
|
667
|
+
})), Cn = (e, t, n, r) => {
|
|
668
|
+
let { token: i } = ue(), o = n ? "" : t || i || "";
|
|
669
|
+
return j({
|
|
670
|
+
queryKey: K({
|
|
671
671
|
queryName: a,
|
|
672
672
|
workspaceId: e,
|
|
673
673
|
guestToken: o,
|
|
@@ -675,7 +675,7 @@ var ht = (e, t) => {
|
|
|
675
675
|
encryptedClientId: r
|
|
676
676
|
}),
|
|
677
677
|
meta: { persist: !1 },
|
|
678
|
-
queryFn: () =>
|
|
678
|
+
queryFn: () => q({
|
|
679
679
|
workspaceId: e,
|
|
680
680
|
token: o,
|
|
681
681
|
isFrontend: n,
|
|
@@ -683,17 +683,17 @@ var ht = (e, t) => {
|
|
|
683
683
|
}),
|
|
684
684
|
enabled: !!e
|
|
685
685
|
});
|
|
686
|
-
},
|
|
686
|
+
}, wn = ({ language: e, translationDictionary: t }) => !e || !t ? !1 : Object.values(t).some((t) => !!t?.[e]), Tn = ({ language: e, translationDictionary: t }) => !wn({
|
|
687
687
|
language: e,
|
|
688
688
|
translationDictionary: t
|
|
689
|
-
}),
|
|
689
|
+
}), En = ({ language: e, tableLimit: t, translationDictionary: n }) => Tn({
|
|
690
690
|
language: e,
|
|
691
691
|
translationDictionary: n
|
|
692
692
|
}) ? {
|
|
693
693
|
limit: String(t.limit),
|
|
694
694
|
offset: String(t.offset)
|
|
695
|
-
} : {},
|
|
696
|
-
if (!
|
|
695
|
+
} : {}, J = ({ language: e, search: t, searchColumns: n, translationDictionary: r }) => {
|
|
696
|
+
if (!Tn({
|
|
697
697
|
language: e,
|
|
698
698
|
translationDictionary: r
|
|
699
699
|
})) return {};
|
|
@@ -702,13 +702,13 @@ var ht = (e, t) => {
|
|
|
702
702
|
search: i && a ? i : void 0,
|
|
703
703
|
searchColumns: i && a ? n : void 0
|
|
704
704
|
};
|
|
705
|
-
},
|
|
705
|
+
}, Dn = ({ currentSearchValue: e, nextValue: t, shouldUseServerSideSearch: n, tableLimit: r }) => {
|
|
706
706
|
let i = String(t).trim() !== (e || "").trim(), a = r.offset !== 0;
|
|
707
707
|
return {
|
|
708
708
|
shouldResetPageOffset: a,
|
|
709
709
|
shouldSetTablePending: a || n && i
|
|
710
710
|
};
|
|
711
|
-
},
|
|
711
|
+
}, On = ({ isPythonMode: e, search: t, shouldUseServerSideSearch: n }) => e ? !0 : !n, kn = ({ columnName: e, disableDownloadUnderlyingDataNoFilters: t, isLoading: n, isSingleValueChart: r }) => !n && !t && !!(e || r), An = ({ isPrev: e, nextOffset: t, prev: n, resetValue: r }) => r === void 0 ? t === void 0 ? {
|
|
712
712
|
limit: n.limit,
|
|
713
713
|
offset: e ? Math.max(n.offset - n.limit, 0) : n.offset + n.limit
|
|
714
714
|
} : {
|
|
@@ -717,15 +717,15 @@ var ht = (e, t) => {
|
|
|
717
717
|
} : {
|
|
718
718
|
limit: r,
|
|
719
719
|
offset: 0
|
|
720
|
-
},
|
|
721
|
-
let o =
|
|
720
|
+
}, jn = (e) => e == null ? e : k(e.toString()), Mn = (e, t) => [...e ?? [], ...t ?? []].some((e) => !!e?.columnName && e.value !== void 0), Nn = (e = []) => e.filter((e) => e?.columnName && e.value !== void 0), Y = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => {
|
|
721
|
+
let o = Nn(n);
|
|
722
722
|
return i || !e || a === void 0 ? o : [...o.filter((t) => t.columnName !== e || String(t.value) !== String(a)), {
|
|
723
723
|
columnName: e,
|
|
724
724
|
dataType: t,
|
|
725
725
|
expressionSql: r,
|
|
726
726
|
value: a
|
|
727
727
|
}];
|
|
728
|
-
},
|
|
728
|
+
}, Pn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => Y({
|
|
729
729
|
columnName: e,
|
|
730
730
|
dataType: t,
|
|
731
731
|
drillFilters: n,
|
|
@@ -736,30 +736,30 @@ var ht = (e, t) => {
|
|
|
736
736
|
columnName: e.columnName,
|
|
737
737
|
dataType: e.dataType,
|
|
738
738
|
expressionSql: e.expressionSql,
|
|
739
|
-
value:
|
|
740
|
-
})),
|
|
739
|
+
value: jn(e.value)
|
|
740
|
+
})), Fn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => Y({
|
|
741
741
|
columnName: e,
|
|
742
742
|
dataType: t,
|
|
743
743
|
drillFilters: n,
|
|
744
744
|
expressionSql: r,
|
|
745
745
|
isSingleValueChart: i,
|
|
746
746
|
value: a
|
|
747
|
-
}),
|
|
748
|
-
let i =
|
|
747
|
+
}), In = ({ query: e, limit: t, offset: n, dbName: r }) => {
|
|
748
|
+
let i = se === r?.toLowerCase(), a = [Ye, Fe].includes(r?.toLowerCase() || ""), o = Ce === r?.toLowerCase(), s = (e) => n ? `OFFSET ${n} LIMIT ${e}` : `LIMIT ${e}`, c = Ct(e), l = (c?.toLowerCase() ?? "").includes("order"), u = parseInt(t, 10);
|
|
749
749
|
if (c?.toLowerCase().includes("limit")) {
|
|
750
750
|
let e = parseInt(c?.toLowerCase().split("limit")?.[1]?.trim() ?? "0", 10), r = n ? t : Math.min(e, u);
|
|
751
751
|
o ? (c = c.replace(`limit ${e}`, s(r)), c = c.replace(`LIMIT ${e}`, s(r))) : a || i ? (c = c.replace(`limit ${e}`, `${l || i || o ? "" : "order by(select null)"} ${`offset ${n || 0} rows`} fetch next ${r} rows only`), c = c.replace(`LIMIT ${e}`, `${l || i || o ? "" : " ORDER BY(SELECT NULL) "} OFFSET ${n || 0} ROWS FETCH NEXT ${r} ROWS ONLY`)) : (c = c.replace(`limit ${e}`, `limit ${r} ${n ? `OFFSET ${n}` : ""}`), c = c.replace(`LIMIT ${e}`, `LIMIT ${r} ${n ? `OFFSET ${n}` : ""}`));
|
|
752
752
|
} else c?.toLowerCase().includes("fetch") || c?.toLowerCase().includes("limit") || (r?.toLowerCase() === "mssql" || r?.toLowerCase() === "athena" || r?.toLowerCase() === "microsoft fabric" ? c += ` ${l || i || o ? "" : " ORDER BY(SELECT NULL) "} ${`offset ${n || 0} rows`} fetch next ${u} rows only` : c += o ? ` ${s(u)}` : ` limit ${u} ${n ? `OFFSET ${n}` : ""}`);
|
|
753
753
|
return c;
|
|
754
|
-
},
|
|
754
|
+
}, Ln = (e) => {
|
|
755
755
|
try {
|
|
756
756
|
return JSON.stringify(e);
|
|
757
757
|
} catch {
|
|
758
758
|
return String(Date.now()) + ":" + Math.random().toString(36).slice(2);
|
|
759
759
|
}
|
|
760
|
-
},
|
|
760
|
+
}, Rn = (e, t) => {
|
|
761
761
|
if (t?.error && !(Array.isArray(t?.data) && t.data.length)) {
|
|
762
|
-
|
|
762
|
+
zn(e, t.error);
|
|
763
763
|
return;
|
|
764
764
|
}
|
|
765
765
|
let n = t?.data, r = typeof t?.totalRecords == "number" ? t.totalRecords : 0, i = n && Array.isArray(n) && n.length ? n : [];
|
|
@@ -767,36 +767,36 @@ var ht = (e, t) => {
|
|
|
767
767
|
e.setTotalRecords?.(r), e.setData(i), e.setLoading(!1);
|
|
768
768
|
});
|
|
769
769
|
};
|
|
770
|
-
function
|
|
770
|
+
function zn(e, t) {
|
|
771
771
|
e.forEach((e) => {
|
|
772
772
|
e.onError?.(t), e.setData([]), e.setLoading(!1), e.setTotalRecords?.(0);
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
|
-
var
|
|
776
|
-
let { mutateAsync:
|
|
775
|
+
var Bn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i, query: a, companyId: o, workspaceId: s, metricId: c, dashboardId: l, token: u, isFrontendApp: d, encryptedClientId: f, globalFilters: p, isAllClient: m, rlsConditions: h, dataMartRelationships: g, customSql: _, isEnableCustomSQL: v, drillFilters: y }) => {
|
|
776
|
+
let { mutateAsync: b } = T(), { data: x } = Cn(s, void 0, d, f), S = x?.weekStartDay === "sunday" ? "sunday" : "monday", C = F(/* @__PURE__ */ new Map()), w = F({
|
|
777
777
|
token: u,
|
|
778
778
|
epoch: 0
|
|
779
779
|
});
|
|
780
|
-
|
|
780
|
+
w.current.token !== u && (w.current = {
|
|
781
781
|
token: u,
|
|
782
|
-
epoch:
|
|
782
|
+
epoch: w.current.epoch + 1
|
|
783
783
|
});
|
|
784
|
-
let
|
|
785
|
-
return
|
|
786
|
-
let e =
|
|
784
|
+
let ee = w.current.epoch;
|
|
785
|
+
return N(() => {
|
|
786
|
+
let e = C.current;
|
|
787
787
|
return () => {
|
|
788
788
|
e.clear();
|
|
789
789
|
};
|
|
790
|
-
}, []), { getUnderlyingData:
|
|
791
|
-
let de = r === "MULTI_DATABASE" && t || "", fe =
|
|
790
|
+
}, []), { getUnderlyingData: M(({ columnName: x, dataType: w, expressionSql: T, value: E, setData: D, setLoading: te, isSingleValueChart: O, clientColumnType: ne, limit: re, offset: ie, search: ae, searchColumns: oe, setTotalRecords: se, pointFilters: ce, onError: le, withoutFilters: ue }) => {
|
|
791
|
+
let de = r === "MULTI_DATABASE" && t || "", fe = v && _ ? _ : re !== void 0 || ie !== void 0 ? a : In({
|
|
792
792
|
query: a,
|
|
793
793
|
limit: "5000",
|
|
794
794
|
dbName: n
|
|
795
795
|
}), pe = ue ? {
|
|
796
796
|
...p,
|
|
797
797
|
filters: p.filters.filter((e) => e.isVariableFilter)
|
|
798
|
-
} : p, me =
|
|
799
|
-
clientColumnType:
|
|
798
|
+
} : p, me = h, he = He({
|
|
799
|
+
clientColumnType: ne,
|
|
800
800
|
query: fe || "",
|
|
801
801
|
dbName: n,
|
|
802
802
|
rlsConditions: me,
|
|
@@ -805,116 +805,116 @@ var zn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
|
|
|
805
805
|
globalFilters: pe,
|
|
806
806
|
values: i,
|
|
807
807
|
isAllClient: m,
|
|
808
|
-
dataMartRelationships:
|
|
809
|
-
weekStartDay:
|
|
810
|
-
}), ge =
|
|
811
|
-
columnName:
|
|
812
|
-
dataType:
|
|
813
|
-
drillFilters: ce?.length ? [...
|
|
814
|
-
expressionSql:
|
|
815
|
-
isSingleValueChart:
|
|
816
|
-
value:
|
|
817
|
-
}) : [],
|
|
818
|
-
columnName:
|
|
808
|
+
dataMartRelationships: g,
|
|
809
|
+
weekStartDay: S
|
|
810
|
+
}), ge = O && !v ? ot(he) : he, _e = Mn(y, ce) ? Pn({
|
|
811
|
+
columnName: x,
|
|
812
|
+
dataType: w,
|
|
813
|
+
drillFilters: ce?.length ? [...y ?? [], ...ce] : y,
|
|
814
|
+
expressionSql: T,
|
|
815
|
+
isSingleValueChart: O,
|
|
816
|
+
value: E
|
|
817
|
+
}) : [], k = {
|
|
818
|
+
columnName: O ? void 0 : x,
|
|
819
819
|
companyId: o,
|
|
820
|
-
query:
|
|
821
|
-
dataType:
|
|
822
|
-
expressionSql:
|
|
823
|
-
value:
|
|
824
|
-
drillFilters:
|
|
820
|
+
query: $e(ge, o),
|
|
821
|
+
dataType: O ? void 0 : w,
|
|
822
|
+
expressionSql: O ? void 0 : T,
|
|
823
|
+
value: O ? void 0 : jn(E),
|
|
824
|
+
drillFilters: _e.length ? _e : void 0,
|
|
825
825
|
workspaceId: s,
|
|
826
826
|
metricId: c,
|
|
827
827
|
dashboardId: l,
|
|
828
|
-
isCustomSql:
|
|
828
|
+
isCustomSql: v && !!_,
|
|
829
829
|
databaseName: de,
|
|
830
830
|
datasourceId: e,
|
|
831
|
-
limit:
|
|
832
|
-
offset:
|
|
831
|
+
limit: re,
|
|
832
|
+
offset: ie,
|
|
833
833
|
search: ae,
|
|
834
834
|
searchColumns: oe,
|
|
835
835
|
globalFilters: pe,
|
|
836
836
|
rlsConditions: me,
|
|
837
837
|
filterValues: i,
|
|
838
|
-
isSingleValueChart:
|
|
838
|
+
isSingleValueChart: O && !v
|
|
839
839
|
};
|
|
840
|
-
|
|
841
|
-
let
|
|
842
|
-
columnName:
|
|
843
|
-
value:
|
|
844
|
-
dataType:
|
|
845
|
-
expressionSql:
|
|
846
|
-
drillFilters:
|
|
847
|
-
limit:
|
|
848
|
-
offset:
|
|
849
|
-
search:
|
|
850
|
-
searchColumns:
|
|
840
|
+
D([]), te(!0);
|
|
841
|
+
let ve = Ln({
|
|
842
|
+
columnName: k.columnName,
|
|
843
|
+
value: k.value,
|
|
844
|
+
dataType: k.dataType,
|
|
845
|
+
expressionSql: k.expressionSql,
|
|
846
|
+
drillFilters: k.drillFilters,
|
|
847
|
+
limit: k.limit,
|
|
848
|
+
offset: k.offset,
|
|
849
|
+
search: k.search,
|
|
850
|
+
searchColumns: k.searchColumns,
|
|
851
851
|
finalQuery: ge,
|
|
852
|
-
companyId:
|
|
853
|
-
workspaceId:
|
|
854
|
-
metricId:
|
|
855
|
-
dashboardId:
|
|
856
|
-
datasourceId:
|
|
857
|
-
databaseName:
|
|
858
|
-
isCustomSql:
|
|
859
|
-
isSingleValueChart:
|
|
860
|
-
principal: `${+!!d}|${f || ""}|${
|
|
861
|
-
}),
|
|
862
|
-
setData:
|
|
863
|
-
setLoading:
|
|
852
|
+
companyId: k.companyId,
|
|
853
|
+
workspaceId: k.workspaceId,
|
|
854
|
+
metricId: k.metricId,
|
|
855
|
+
dashboardId: k.dashboardId,
|
|
856
|
+
datasourceId: k.datasourceId,
|
|
857
|
+
databaseName: k.databaseName,
|
|
858
|
+
isCustomSql: k.isCustomSql,
|
|
859
|
+
isSingleValueChart: O,
|
|
860
|
+
principal: `${+!!d}|${f || ""}|${ee}`
|
|
861
|
+
}), ye = {
|
|
862
|
+
setData: D,
|
|
863
|
+
setLoading: te,
|
|
864
864
|
setTotalRecords: se,
|
|
865
865
|
onError: le
|
|
866
|
-
},
|
|
867
|
-
if (
|
|
868
|
-
|
|
866
|
+
}, be = C.current.get(ve);
|
|
867
|
+
if (be) {
|
|
868
|
+
be.subscribers.add(ye);
|
|
869
869
|
return;
|
|
870
870
|
}
|
|
871
|
-
let
|
|
872
|
-
|
|
873
|
-
data:
|
|
871
|
+
let xe = /* @__PURE__ */ new Set([ye]);
|
|
872
|
+
C.current.set(ve, { subscribers: xe }), b({
|
|
873
|
+
data: k,
|
|
874
874
|
token: u || "",
|
|
875
875
|
isFrontendApp: d,
|
|
876
876
|
encryptedClientId: d && f || ""
|
|
877
877
|
}).then((e) => {
|
|
878
|
-
let t =
|
|
879
|
-
|
|
878
|
+
let t = C.current.get(ve);
|
|
879
|
+
C.current.delete(ve), Rn(t?.subscribers ?? xe, e);
|
|
880
880
|
}).catch((e) => {
|
|
881
|
-
let t =
|
|
882
|
-
|
|
881
|
+
let t = C.current.get(ve);
|
|
882
|
+
C.current.delete(ve), zn(t?.subscribers ?? xe, e);
|
|
883
883
|
});
|
|
884
884
|
}, [
|
|
885
885
|
t,
|
|
886
886
|
o,
|
|
887
|
+
_,
|
|
887
888
|
g,
|
|
888
|
-
h,
|
|
889
889
|
e,
|
|
890
890
|
n,
|
|
891
|
-
|
|
891
|
+
y,
|
|
892
892
|
p,
|
|
893
893
|
m,
|
|
894
|
-
|
|
894
|
+
v,
|
|
895
895
|
c,
|
|
896
896
|
l,
|
|
897
897
|
u,
|
|
898
898
|
d,
|
|
899
899
|
f,
|
|
900
|
-
ne,
|
|
901
|
-
a,
|
|
902
900
|
ee,
|
|
901
|
+
a,
|
|
902
|
+
h,
|
|
903
903
|
r,
|
|
904
|
-
y,
|
|
905
|
-
i,
|
|
906
904
|
b,
|
|
905
|
+
i,
|
|
906
|
+
S,
|
|
907
907
|
s
|
|
908
908
|
]) };
|
|
909
|
-
},
|
|
909
|
+
}, Vn = [
|
|
910
910
|
"backend-cap",
|
|
911
911
|
"metric-limit",
|
|
912
912
|
"client-window",
|
|
913
913
|
"chart-coverage"
|
|
914
|
-
],
|
|
915
|
-
let t = e[0], n =
|
|
914
|
+
], Hn = (e) => typeof e == "string" && Vn.includes(e), Un = (e) => typeof e == "number" && Number.isFinite(e) && e >= 0, X = (e) => e.of === null ? Infinity : Math.max(0, e.of - e.at), Wn = (e) => {
|
|
915
|
+
let t = e[0], n = X(t);
|
|
916
916
|
for (let r = 1; r < e.length; r += 1) {
|
|
917
|
-
let i =
|
|
917
|
+
let i = X(e[r]);
|
|
918
918
|
i > n && (t = e[r], n = i);
|
|
919
919
|
}
|
|
920
920
|
return {
|
|
@@ -923,11 +923,11 @@ var zn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
|
|
|
923
923
|
by: t.by,
|
|
924
924
|
stages: e
|
|
925
925
|
};
|
|
926
|
-
},
|
|
926
|
+
}, Gn = (e) => ({
|
|
927
927
|
rows: e,
|
|
928
928
|
truncated: null
|
|
929
929
|
});
|
|
930
|
-
function
|
|
930
|
+
function Kn(e, t, n) {
|
|
931
931
|
let r = e.rows.length, i = n.length;
|
|
932
932
|
if (i >= r) return e;
|
|
933
933
|
let a = {
|
|
@@ -937,53 +937,53 @@ function Gn(e, t, n) {
|
|
|
937
937
|
};
|
|
938
938
|
return {
|
|
939
939
|
rows: n,
|
|
940
|
-
truncated:
|
|
940
|
+
truncated: Wn(e.truncated ? [...e.truncated.stages, a] : [a])
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function qn(e, t) {
|
|
944
944
|
if (!e || typeof e != "object") return null;
|
|
945
945
|
let n = e, r = Array.isArray(n.stages) ? n.stages : [], i = [];
|
|
946
946
|
for (let e of r) {
|
|
947
947
|
if (!e || typeof e != "object") continue;
|
|
948
948
|
let { by: t, at: n, of: r } = e;
|
|
949
|
-
|
|
949
|
+
Hn(t) && Un(n) && i.push({
|
|
950
950
|
by: t,
|
|
951
951
|
at: n,
|
|
952
|
-
of:
|
|
952
|
+
of: Un(r) ? r : null
|
|
953
953
|
});
|
|
954
954
|
}
|
|
955
955
|
if (!i.length) {
|
|
956
|
-
if (!
|
|
956
|
+
if (!Hn(n.by) || !Un(n.at)) return null;
|
|
957
957
|
i.push({
|
|
958
958
|
by: n.by,
|
|
959
959
|
at: n.at,
|
|
960
|
-
of:
|
|
960
|
+
of: Un(n.of) ? n.of : null
|
|
961
961
|
});
|
|
962
962
|
}
|
|
963
|
-
if (
|
|
963
|
+
if (Un(t)) {
|
|
964
964
|
let e = i[i.length - 1];
|
|
965
965
|
e.at !== t && (i[i.length - 1] = {
|
|
966
966
|
...e,
|
|
967
967
|
at: t
|
|
968
968
|
});
|
|
969
969
|
}
|
|
970
|
-
return
|
|
970
|
+
return Wn(i);
|
|
971
971
|
}
|
|
972
|
-
function
|
|
972
|
+
function Jn(e, t = (e) => e.toLocaleString()) {
|
|
973
973
|
return e ? e.of === null ? `Displaying the first ${t(e.at)} rows` : `Displaying ${t(e.at)} of ${t(e.of)}` : null;
|
|
974
974
|
}
|
|
975
975
|
//#endregion
|
|
976
976
|
//#region src/components/Chart/metricCardResult.ts
|
|
977
|
-
var
|
|
977
|
+
var Yn = { rows: [] }, Xn = {
|
|
978
978
|
rows: [],
|
|
979
979
|
error: {
|
|
980
980
|
code: "INVALID_METRIC_RESULT",
|
|
981
981
|
message: "Could not load chart data.",
|
|
982
982
|
hint: "Retry the chart. If it still fails, contact your workspace admin."
|
|
983
983
|
}
|
|
984
|
-
},
|
|
985
|
-
if (e == null) return
|
|
986
|
-
if (!
|
|
984
|
+
}, Zn = (e) => typeof e == "object" && !!e && !Array.isArray(e), Qn = (e) => {
|
|
985
|
+
if (e == null) return Yn;
|
|
986
|
+
if (!Zn(e)) return Xn;
|
|
987
987
|
let t = e.errorDetail ? n(e) ?? e.error : e.error, r = e.data;
|
|
988
988
|
if (typeof r == "string") try {
|
|
989
989
|
r = JSON.parse(r);
|
|
@@ -991,9 +991,9 @@ var Jn = { rows: [] }, Yn = {
|
|
|
991
991
|
return t ? {
|
|
992
992
|
rows: [],
|
|
993
993
|
error: t
|
|
994
|
-
} :
|
|
994
|
+
} : Xn;
|
|
995
995
|
}
|
|
996
|
-
if (
|
|
996
|
+
if (Zn(r) && (r.error || r.errorDetail)) return {
|
|
997
997
|
rows: [],
|
|
998
998
|
error: r.errorDetail ? n(r) ?? r.error : r.error
|
|
999
999
|
};
|
|
@@ -1001,35 +1001,35 @@ var Jn = { rows: [] }, Yn = {
|
|
|
1001
1001
|
rows: [],
|
|
1002
1002
|
error: t
|
|
1003
1003
|
};
|
|
1004
|
-
if (
|
|
1004
|
+
if (Zn(r) && typeof r.code == "string" && typeof r.message == "string") return {
|
|
1005
1005
|
rows: [],
|
|
1006
1006
|
error: {
|
|
1007
1007
|
code: r.code,
|
|
1008
1008
|
message: r.message
|
|
1009
1009
|
}
|
|
1010
1010
|
};
|
|
1011
|
-
if (!Array.isArray(r) || !r.every(
|
|
1012
|
-
let i = Array.isArray(e.notices) && e.notices.some((e) =>
|
|
1011
|
+
if (!Array.isArray(r) || !r.every(Zn)) return Xn;
|
|
1012
|
+
let i = Array.isArray(e.notices) && e.notices.some((e) => Zn(e) && e.code === "FILTER_NOT_APPLIED");
|
|
1013
1013
|
return {
|
|
1014
1014
|
rows: r,
|
|
1015
1015
|
...i ? { isFilterNotApplied: !0 } : {}
|
|
1016
1016
|
};
|
|
1017
|
-
},
|
|
1017
|
+
}, $n = "__dbnFullscreenDrillState", er = (e) => typeof e == "object" && !!e, tr = (e) => Array.isArray(e), nr = (e, t) => ({
|
|
1018
1018
|
...e,
|
|
1019
1019
|
...t,
|
|
1020
1020
|
metric: {
|
|
1021
1021
|
...e.metric,
|
|
1022
|
-
[
|
|
1022
|
+
[$n]: t
|
|
1023
1023
|
}
|
|
1024
|
-
}),
|
|
1025
|
-
let n =
|
|
1024
|
+
}), Z = (e, t = {}) => {
|
|
1025
|
+
let n = er(e) && er(e.__dbnFullscreenDrillState) ? e[$n] : {};
|
|
1026
1026
|
return {
|
|
1027
1027
|
drilledLevel: t.drilledLevel ?? (typeof n.drilledLevel == "number" ? n.drilledLevel : void 0),
|
|
1028
|
-
drillFilters: t.drillFilters ?? (
|
|
1028
|
+
drillFilters: t.drillFilters ?? (tr(n.drillFilters) ? n.drillFilters : void 0),
|
|
1029
1029
|
drillType: t.drillType ?? (typeof n.drillType == "string" ? n.drillType : void 0),
|
|
1030
|
-
underlyingDataDrillFilters: t.underlyingDataDrillFilters ?? (
|
|
1030
|
+
underlyingDataDrillFilters: t.underlyingDataDrillFilters ?? (tr(n.underlyingDataDrillFilters) ? n.underlyingDataDrillFilters : void 0)
|
|
1031
1031
|
};
|
|
1032
|
-
},
|
|
1032
|
+
}, rr = (e, t) => {
|
|
1033
1033
|
if (!e || e.isEnableGroupBy === !1 || t.drilledLevel === void 0 && t.drillFilters === void 0 && t.drillType === void 0 && t.underlyingDataDrillFilters === void 0) return e;
|
|
1034
1034
|
let n = e.configV2?.levels;
|
|
1035
1035
|
if (!n?.length) return t.drillType === void 0 ? e : {
|
|
@@ -1051,15 +1051,15 @@ var Jn = { rows: [] }, Yn = {
|
|
|
1051
1051
|
}))
|
|
1052
1052
|
}
|
|
1053
1053
|
};
|
|
1054
|
-
},
|
|
1054
|
+
}, ir = (e) => e.includes(";;") ? e.split(";;") : e, ar = (e, t) => e === void 0 ? t : [...Array.isArray(e) ? e : [e], ...Array.isArray(t) ? t : [t]], or = [
|
|
1055
1055
|
"dashboardId",
|
|
1056
1056
|
"configId",
|
|
1057
1057
|
"embed",
|
|
1058
1058
|
"isDbn"
|
|
1059
|
-
],
|
|
1059
|
+
], sr = (e) => `dbn.${e}.`, cr = "drill.", lr = (e) => {
|
|
1060
1060
|
let t = encodeURIComponent(e.levelIndex);
|
|
1061
1061
|
return e.filters?.length ? `${t}~${e.filters.map((e) => `${encodeURIComponent(e.columnName)}:${encodeURIComponent(String(e.value ?? ""))}`).join("|")}` : t;
|
|
1062
|
-
},
|
|
1062
|
+
}, ur = (e) => {
|
|
1063
1063
|
if (!e) return null;
|
|
1064
1064
|
let t = e.indexOf("~"), n = t === -1 ? e : e.slice(0, t), r = decodeURIComponent(n);
|
|
1065
1065
|
return r ? t === -1 ? {
|
|
@@ -1077,18 +1077,18 @@ var Jn = { rows: [] }, Yn = {
|
|
|
1077
1077
|
} : null;
|
|
1078
1078
|
}).filter((e) => e !== null)
|
|
1079
1079
|
} : null;
|
|
1080
|
-
},
|
|
1080
|
+
}, dr = (e, t) => {
|
|
1081
1081
|
if (!t) return {};
|
|
1082
|
-
let n = `${
|
|
1082
|
+
let n = `${sr(t)}${cr}`, r = {};
|
|
1083
1083
|
return new URLSearchParams(e).forEach((e, t) => {
|
|
1084
1084
|
if (!t.startsWith(n)) return;
|
|
1085
|
-
let i = t.slice(n.length), a =
|
|
1085
|
+
let i = t.slice(n.length), a = ur(e);
|
|
1086
1086
|
i && a && (r[i] = a);
|
|
1087
1087
|
}), r;
|
|
1088
|
-
},
|
|
1088
|
+
}, fr = ({ currentSearch: e, dashboardId: t, entries: n, legacyGlobals: r = {}, namespaced: i = !0 }) => {
|
|
1089
1089
|
if (!i) {
|
|
1090
1090
|
let e = new URLSearchParams();
|
|
1091
|
-
return
|
|
1091
|
+
return or.forEach((n) => {
|
|
1092
1092
|
let i = r[n];
|
|
1093
1093
|
if (n === "dashboardId") {
|
|
1094
1094
|
e.set(n, t ?? "");
|
|
@@ -1101,7 +1101,7 @@ var Jn = { rows: [] }, Yn = {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
let a = new URLSearchParams(e);
|
|
1103
1103
|
if (!t) return a;
|
|
1104
|
-
let o =
|
|
1104
|
+
let o = sr(t), s = [];
|
|
1105
1105
|
return a.forEach((e, t) => {
|
|
1106
1106
|
t.startsWith(o) && s.push(t);
|
|
1107
1107
|
}), s.forEach((e) => {
|
|
@@ -1109,7 +1109,7 @@ var Jn = { rows: [] }, Yn = {
|
|
|
1109
1109
|
}), n.forEach(({ key: e, value: t }) => {
|
|
1110
1110
|
a.set(`${o}${e}`, t);
|
|
1111
1111
|
}), a;
|
|
1112
|
-
},
|
|
1112
|
+
}, pr = (e, t) => {
|
|
1113
1113
|
let n = e?.levels;
|
|
1114
1114
|
if (!e || !n?.length) return null;
|
|
1115
1115
|
let r = n.findIndex((e) => e?.index === t.levelIndex);
|
|
@@ -1125,9 +1125,9 @@ var Jn = { rows: [] }, Yn = {
|
|
|
1125
1125
|
filters: n > r ? [] : e?.filters
|
|
1126
1126
|
})
|
|
1127
1127
|
};
|
|
1128
|
-
},
|
|
1129
|
-
let n = new URLSearchParams(e), r = {}, i = {}, a = t ?
|
|
1130
|
-
e[t] =
|
|
1128
|
+
}, mr = (e, t) => {
|
|
1129
|
+
let n = new URLSearchParams(e), r = {}, i = {}, a = t ? sr(t) : null, o = (e, t, n) => {
|
|
1130
|
+
e[t] = ar(e[t], ir(n));
|
|
1131
1131
|
};
|
|
1132
1132
|
return n.forEach((e, t) => {
|
|
1133
1133
|
if (a && t.startsWith(a)) {
|
|
@@ -1141,40 +1141,40 @@ var Jn = { rows: [] }, Yn = {
|
|
|
1141
1141
|
...r,
|
|
1142
1142
|
...i
|
|
1143
1143
|
};
|
|
1144
|
-
},
|
|
1145
|
-
function
|
|
1144
|
+
}, hr = Symbol("cross-filter-source-metric"), gr = (e, t) => (t && Object.defineProperty(e, hr, { value: t }), e);
|
|
1145
|
+
function _r({ filters: e, metricId: t, isGroupByEnabled: n, enableCrossFilterBeforeDrill: r = !1 }) {
|
|
1146
1146
|
return r ? (e || []).filter((e) => {
|
|
1147
|
-
let r = e[
|
|
1147
|
+
let r = e[hr];
|
|
1148
1148
|
return r ? r !== t : !n;
|
|
1149
1149
|
}) : n ? [] : e || [];
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1151
|
+
function vr(e, t, n) {
|
|
1152
1152
|
return t === "DATABASE" ? `${n}.${e?.split(".").slice(1).join(".")}` : e;
|
|
1153
1153
|
}
|
|
1154
|
-
var
|
|
1154
|
+
var yr = (e) => {
|
|
1155
1155
|
let t = e?.table?.schemaName, n = e?.table?.tableName;
|
|
1156
1156
|
if (t && n) return `${t}.${n}`;
|
|
1157
|
-
},
|
|
1158
|
-
if (!
|
|
1157
|
+
}, br = (e) => typeof e == "string" && !!e.trim(), xr = (e, t) => t?.find((t) => t?.alias === e || t?.name === e), Sr = ({ columnName: e, selectedDims: t }) => {
|
|
1158
|
+
if (!br(e)) return;
|
|
1159
1159
|
if (!t?.length) return e;
|
|
1160
|
-
let n =
|
|
1161
|
-
if (n &&
|
|
1162
|
-
},
|
|
1160
|
+
let n = xr(e, t);
|
|
1161
|
+
if (n && yr(n)) return br(n.name) ? n.name : e;
|
|
1162
|
+
}, Cr = "This filter column is no longer available. Refresh the metric and select a column before filtering.", wr = ({ columnName: e, rowFilters: t, selectedDims: n, requiresSchemaMetadata: r = !1 }) => {
|
|
1163
1163
|
let i = t?.length ? t.map((e) => e.columnName) : e === void 0 ? [] : [e];
|
|
1164
|
-
return i.some((e) => !
|
|
1164
|
+
return i.some((e) => !br(e)) || (t?.length || r) && !n?.length || i.some((e) => !!n?.length && !Sr({
|
|
1165
1165
|
columnName: e,
|
|
1166
1166
|
selectedDims: n
|
|
1167
|
-
})) ?
|
|
1167
|
+
})) ? Cr : void 0;
|
|
1168
1168
|
};
|
|
1169
|
-
function
|
|
1169
|
+
function Tr(e) {
|
|
1170
1170
|
let t = e.value === null || e.value === void 0, n = t ? "null" : e.value;
|
|
1171
|
-
return
|
|
1171
|
+
return gr({
|
|
1172
1172
|
columnName: e.columnName,
|
|
1173
1173
|
datatype: "string",
|
|
1174
1174
|
isAddOnMetrics: !0,
|
|
1175
1175
|
name: "cross-filter",
|
|
1176
1176
|
options: [n],
|
|
1177
|
-
tableName:
|
|
1177
|
+
tableName: vr(e.tableName, e.tenancyLevel, e.clientId),
|
|
1178
1178
|
value: [n],
|
|
1179
1179
|
...t ? { filterVariant: {
|
|
1180
1180
|
label: "IN",
|
|
@@ -1182,17 +1182,17 @@ function wr(e) {
|
|
|
1182
1182
|
} } : {}
|
|
1183
1183
|
}, e.sourceMetricId);
|
|
1184
1184
|
}
|
|
1185
|
-
function
|
|
1185
|
+
function Er({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filterValue: i, columnName: a, rowFilters: o, selectedDims: s, activeLevelTableName: c, tenancyLevel: l, clientId: u, sourceMetricId: d }) {
|
|
1186
1186
|
if (t || n) return [];
|
|
1187
|
-
let f = i != null &&
|
|
1187
|
+
let f = i != null && br(a);
|
|
1188
1188
|
if (!((f || o?.length) && r)) return [];
|
|
1189
1189
|
if (o?.length) {
|
|
1190
1190
|
let t = o.map((e) => {
|
|
1191
|
-
let t =
|
|
1191
|
+
let t = Sr({
|
|
1192
1192
|
columnName: e?.columnName,
|
|
1193
1193
|
selectedDims: s
|
|
1194
|
-
}), n =
|
|
1195
|
-
if (n && t) return
|
|
1194
|
+
}), n = yr(t ? xr(e.columnName, s) : void 0);
|
|
1195
|
+
if (n && t) return Tr({
|
|
1196
1196
|
columnName: t,
|
|
1197
1197
|
value: e?.value,
|
|
1198
1198
|
tableName: n,
|
|
@@ -1204,7 +1204,7 @@ function Tr({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
|
|
|
1204
1204
|
return [...e || [], ...t];
|
|
1205
1205
|
}
|
|
1206
1206
|
if (f) {
|
|
1207
|
-
if (d) return
|
|
1207
|
+
if (d) return Mr({
|
|
1208
1208
|
existing: e,
|
|
1209
1209
|
columnName: a,
|
|
1210
1210
|
value: i,
|
|
@@ -1213,11 +1213,11 @@ function Tr({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
|
|
|
1213
1213
|
clientId: u,
|
|
1214
1214
|
sourceMetricId: d
|
|
1215
1215
|
});
|
|
1216
|
-
let t =
|
|
1216
|
+
let t = Sr({
|
|
1217
1217
|
columnName: a,
|
|
1218
1218
|
selectedDims: s
|
|
1219
1219
|
});
|
|
1220
|
-
return t ? [...e || [],
|
|
1220
|
+
return t ? [...e || [], Tr({
|
|
1221
1221
|
columnName: t,
|
|
1222
1222
|
value: i,
|
|
1223
1223
|
tableName: c,
|
|
@@ -1228,42 +1228,42 @@ function Tr({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
|
|
|
1228
1228
|
}
|
|
1229
1229
|
return [];
|
|
1230
1230
|
}
|
|
1231
|
-
var
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1231
|
+
var Dr = /* @__PURE__ */ new Set([
|
|
1232
|
+
A.progressBar,
|
|
1233
|
+
A.progressBarV2,
|
|
1234
|
+
A.linearGauge,
|
|
1235
|
+
A.linearGaugeV2,
|
|
1236
|
+
A.gauge,
|
|
1237
|
+
A.gaugeV2
|
|
1238
1238
|
]);
|
|
1239
|
-
function
|
|
1239
|
+
function Or({ runtimeEnabled: e, metricEnabled: t }) {
|
|
1240
1240
|
return !!e || !!t;
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1243
|
-
if (e &&
|
|
1242
|
+
function kr({ chartType: e, isDrillEnabled: t, dimensions: n, drilledLevel: r, drillLevels: i }) {
|
|
1243
|
+
if (e && Dr.has(e)) return "terminal";
|
|
1244
1244
|
if (!t || (n?.length ?? 0) === r) return "none";
|
|
1245
1245
|
let a = i || [];
|
|
1246
1246
|
return a[a.length - 1]?.isEnable ? "none" : "drill";
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1249
|
-
return e ===
|
|
1248
|
+
function Ar({ chartType: e, params: t, rowFilters: n, dimensions: r }) {
|
|
1249
|
+
return e === A.table ? {
|
|
1250
1250
|
name: n?.find((e) => r?.some((t) => e?.columnName === t))?.value,
|
|
1251
1251
|
rowFilters: n
|
|
1252
1252
|
} : t;
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1255
|
-
if (!
|
|
1256
|
-
let n =
|
|
1257
|
-
return !!n && !!
|
|
1254
|
+
function jr(e, t) {
|
|
1255
|
+
if (!br(e)) return !1;
|
|
1256
|
+
let n = xr(e, t);
|
|
1257
|
+
return !!n && !!yr(n);
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1260
|
-
if (!
|
|
1261
|
-
let c =
|
|
1259
|
+
function Mr({ existing: e, columnName: t, value: n, mode: r = "only", selectedDims: i, tenancyLevel: a, clientId: o, sourceMetricId: s }) {
|
|
1260
|
+
if (!br(t) || n === void 0) return e || [];
|
|
1261
|
+
let c = xr(t, i), l = Sr({
|
|
1262
1262
|
columnName: t,
|
|
1263
1263
|
selectedDims: i
|
|
1264
|
-
}), u =
|
|
1264
|
+
}), u = yr(c);
|
|
1265
1265
|
if (!u || !l) return e || [];
|
|
1266
|
-
let d =
|
|
1266
|
+
let d = Tr({
|
|
1267
1267
|
columnName: l,
|
|
1268
1268
|
value: n,
|
|
1269
1269
|
tableName: u,
|
|
@@ -1274,41 +1274,41 @@ function jr({ existing: e, columnName: t, value: n, mode: r = "only", selectedDi
|
|
|
1274
1274
|
label: "NOT IN",
|
|
1275
1275
|
value: "NOT IN"
|
|
1276
1276
|
};
|
|
1277
|
-
return [...f, r === "exclude" ?
|
|
1277
|
+
return [...f, r === "exclude" ? gr({
|
|
1278
1278
|
...d,
|
|
1279
1279
|
filterVariant: p
|
|
1280
1280
|
}, s) : d];
|
|
1281
1281
|
}
|
|
1282
1282
|
//#endregion
|
|
1283
1283
|
//#region src/core/metric-builder/drillPoint.ts
|
|
1284
|
-
var
|
|
1284
|
+
var Nr = "Empty", Pr = (e) => e !== void 0 && (typeof e != "string" || e.trim() !== ""), Fr = (e) => !!e.columnName && Pr(e.value), Ir = (e, t) => ({
|
|
1285
1285
|
columnName: e,
|
|
1286
1286
|
value: t,
|
|
1287
1287
|
...t === null ? { operator: "isNull" } : {}
|
|
1288
|
-
}),
|
|
1288
|
+
}), Lr = (e, t = (e) => e) => {
|
|
1289
1289
|
let n = e?.dimensions || [], r = [], i = [];
|
|
1290
1290
|
return n.forEach((e) => {
|
|
1291
|
-
if (!
|
|
1291
|
+
if (!Fr(e)) {
|
|
1292
1292
|
e.columnName && i.push(e);
|
|
1293
1293
|
return;
|
|
1294
1294
|
}
|
|
1295
|
-
r.push(t(
|
|
1295
|
+
r.push(t(Ir(e.columnName, e.value)));
|
|
1296
1296
|
}), {
|
|
1297
1297
|
filters: r,
|
|
1298
1298
|
skipped: i
|
|
1299
1299
|
};
|
|
1300
|
-
},
|
|
1300
|
+
}, Rr = (e) => (e?.dimensions || []).filter((e) => e.value !== void 0).map((e) => ({
|
|
1301
1301
|
label: e.label || e.columnName,
|
|
1302
1302
|
value: e.formatted ?? (e.value === null ? "Empty" : String(e.value)),
|
|
1303
1303
|
role: e.role
|
|
1304
|
-
})),
|
|
1304
|
+
})), zr = (e) => {
|
|
1305
1305
|
let t = e?.measure;
|
|
1306
1306
|
if (t && t.value !== void 0) return t.formatted ?? String(t.value ?? "Empty");
|
|
1307
1307
|
let n = (e?.dimensions || []).find((e) => e.value !== void 0);
|
|
1308
1308
|
if (n) return n.formatted ?? String(n.value ?? "Empty");
|
|
1309
|
-
},
|
|
1309
|
+
}, Q = (e) => {
|
|
1310
1310
|
if (e !== void 0) return e === null ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : String(e);
|
|
1311
|
-
}, Br = (e) => e === void 0 ? void 0 : e === null ?
|
|
1311
|
+
}, Br = (e) => e === void 0 ? void 0 : e === null ? Nr : String(e), Vr = (e, t) => {
|
|
1312
1312
|
let n = Br(e);
|
|
1313
1313
|
if (!t || typeof e != "number") return n;
|
|
1314
1314
|
try {
|
|
@@ -1320,7 +1320,7 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
|
|
|
1320
1320
|
let a = e?.rowFilters;
|
|
1321
1321
|
if (a?.length) return {
|
|
1322
1322
|
dimensions: a.filter((e) => !!e?.columnName).map((e) => {
|
|
1323
|
-
let t =
|
|
1323
|
+
let t = Q(e.value);
|
|
1324
1324
|
return {
|
|
1325
1325
|
columnName: e.columnName,
|
|
1326
1326
|
value: t,
|
|
@@ -1332,7 +1332,7 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
|
|
|
1332
1332
|
};
|
|
1333
1333
|
let o = [];
|
|
1334
1334
|
if (t?.columnName) {
|
|
1335
|
-
let n =
|
|
1335
|
+
let n = Q(e?.name);
|
|
1336
1336
|
o.push({
|
|
1337
1337
|
columnName: t.columnName,
|
|
1338
1338
|
label: t.label,
|
|
@@ -1342,7 +1342,7 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
|
|
|
1342
1342
|
});
|
|
1343
1343
|
}
|
|
1344
1344
|
if (n?.columnName) {
|
|
1345
|
-
let t =
|
|
1345
|
+
let t = Q(e?.seriesName);
|
|
1346
1346
|
o.push({
|
|
1347
1347
|
columnName: n.columnName,
|
|
1348
1348
|
label: n.label,
|
|
@@ -1351,7 +1351,7 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
|
|
|
1351
1351
|
role: "series"
|
|
1352
1352
|
});
|
|
1353
1353
|
}
|
|
1354
|
-
let s =
|
|
1354
|
+
let s = Q(e?.value), c = { dimensions: o }, l = n?.columnName ? r?.columnName : r?.columnName ?? Q(e?.seriesName);
|
|
1355
1355
|
return (s !== void 0 || l) && (c.measure = {
|
|
1356
1356
|
columnName: typeof l == "string" ? l : void 0,
|
|
1357
1357
|
label: r?.label,
|
|
@@ -1579,14 +1579,14 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
|
|
|
1579
1579
|
comboAxisSymbols: i?.comboAxisSymbols,
|
|
1580
1580
|
switchAxisNumberFormatter: i?.switchAxisNumberFormatter,
|
|
1581
1581
|
...r.customSettings
|
|
1582
|
-
}, o = a.numberFormatter, s = e?.chartType ===
|
|
1582
|
+
}, o = a.numberFormatter, s = e?.chartType === A.singleValue, c = t?.customSettings?.labelPrefix ?? (s ? a.singleValuePrefix ?? a.labelPrefix : a.labelPrefix ?? a.singleValuePrefix), l = t?.customSettings?.labelSuffix ?? (s ? a.singleValueSuffix ?? a.labelSuffix : a.labelSuffix ?? a.singleValueSuffix), u = a.comboAxisSettings?.map((e) => ({
|
|
1583
1583
|
columns: e.measures,
|
|
1584
1584
|
formatter: e.numberFormatter || o,
|
|
1585
1585
|
prefix: e.prefix,
|
|
1586
1586
|
suffix: e.suffix
|
|
1587
1587
|
})) || [];
|
|
1588
1588
|
if (!o && !c && !l && !a.numberFormat && !u.length) return r;
|
|
1589
|
-
let d = r.tableSettings, f = t?.chartType ===
|
|
1589
|
+
let d = r.tableSettings, f = t?.chartType === A.table ? t.tableSettings : e?.chartType === A.table ? e.tableSettings : void 0;
|
|
1590
1590
|
return {
|
|
1591
1591
|
...r,
|
|
1592
1592
|
customSettings: a,
|
|
@@ -1665,7 +1665,7 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
|
|
|
1665
1665
|
outcome: "jump"
|
|
1666
1666
|
};
|
|
1667
1667
|
if (a) {
|
|
1668
|
-
let t = a.parentFilters || [], n = typeof r == "string" && r.trim() === "", i = r != null && !n && !!a.columnName, l = (e) => e.filter((e) =>
|
|
1668
|
+
let t = a.parentFilters || [], n = typeof r == "string" && r.trim() === "", i = r != null && !n && !!a.columnName, l = (e) => e.filter((e) => Pr(e.value)), u = l(a.pointFilters ?? []), d = l(p.map(li).map(o)), f = u.length ? [...t, ...u] : d.length ? [...t, ...d] : i ? [...t, o({
|
|
1669
1669
|
columnName: a.columnName,
|
|
1670
1670
|
value: r
|
|
1671
1671
|
})] : t;
|
|
@@ -1902,9 +1902,9 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
1902
1902
|
renderEmpty: !0,
|
|
1903
1903
|
missingField: "datasetMetricSettings.newDatasetSettings.selectedDims"
|
|
1904
1904
|
};
|
|
1905
|
-
}, Ti =
|
|
1906
|
-
let e =
|
|
1907
|
-
return
|
|
1905
|
+
}, Ti = ft([]), Ei = () => {
|
|
1906
|
+
let e = pt(Ti), { data: t } = ue(), n = t?.externalDashboard?.dashboardFiltersLayout;
|
|
1907
|
+
return P(() => e.length ? e : Array.isArray(n) ? n.filter((e) => typeof e == "string") : [], [e, n]);
|
|
1908
1908
|
}, Di = (e, t, n = []) => {
|
|
1909
1909
|
if (!t.length || e.length < 2) return e;
|
|
1910
1910
|
let r = (e) => {
|
|
@@ -1931,8 +1931,8 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
1931
1931
|
index: t
|
|
1932
1932
|
})).sort((e, t) => e.position >= 0 && t.position < 0 ? -1 : e.position < 0 && t.position >= 0 ? 1 : e.position === t.position ? e.index - t.index : e.position - t.position).map((e) => e.filter);
|
|
1933
1933
|
}, Oi = 100, ki = (e) => {
|
|
1934
|
-
let [t, n] =
|
|
1935
|
-
return
|
|
1934
|
+
let [t, n] = I(e);
|
|
1935
|
+
return N(() => {
|
|
1936
1936
|
if (e) {
|
|
1937
1937
|
n(!0);
|
|
1938
1938
|
return;
|
|
@@ -1950,18 +1950,18 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
1950
1950
|
clientId: t,
|
|
1951
1951
|
isFrontendApp: n
|
|
1952
1952
|
}
|
|
1953
|
-
}), Ni = (e, t) => e?.includes(t) ? e : [...e || [], t], Pi = (e, t) => e?.includes(t) ? e.filter((e) => e !== t) : e, Fi = (e, t) => !!(e && e.data?.data === t.data && e.data?.name === t.name && e.data?.description === t.description && e.isLoading === t.isLoading && e.key === t.key), Ii = (e) => e.isMetric !== !1 || e.elementSettings?.elementType?.value === "metricExpression", Li = ({ metric: e, isAllClient: t, tenancyLevel: n, appliedMetricFilters: r, firstLoadAppliedMetricFilters: i, tableColumnFilters: a, chartSettings: o, isPythonMode: s, globalFilters: c, filterValues: l, tableLimit: u, calendarType: d, comparisonCount: f, datasourceId: p, drillConfig: m, isFrontendApp:
|
|
1953
|
+
}), Ni = (e, t) => e?.includes(t) ? e : [...e || [], t], Pi = (e, t) => e?.includes(t) ? e.filter((e) => e !== t) : e, Fi = (e, t) => !!(e && e.data?.data === t.data && e.data?.name === t.name && e.data?.description === t.description && e.isLoading === t.isLoading && e.key === t.key), Ii = (e) => e.isMetric !== !1 || e.elementSettings?.elementType?.value === "metricExpression", Li = ({ metric: e, isAllClient: t, tenancyLevel: n, appliedMetricFilters: r, firstLoadAppliedMetricFilters: i, tableColumnFilters: a, chartSettings: o, isPythonMode: s, globalFilters: c, filterValues: l, tableLimit: u, calendarType: d, comparisonCount: f, datasourceId: p, drillConfig: m, isFrontendApp: h, guestToken: g }) => ({
|
|
1954
1954
|
isAllClient: t,
|
|
1955
1955
|
id: e?.id,
|
|
1956
1956
|
tenancyLevel: n,
|
|
1957
|
-
rlsConditions: [...(r?.length ? r : i) || [], ...o?.tableSettings?.isServerSidePagination && o?.chartType ===
|
|
1957
|
+
rlsConditions: [...(r?.length ? r : i) || [], ...o?.tableSettings?.isServerSidePagination && o?.chartType === A.table ? a.map((e) => e.condition).filter((e) => re(e)) : []],
|
|
1958
1958
|
globalFilters: s ? void 0 : {
|
|
1959
1959
|
...c,
|
|
1960
1960
|
filters: c?.filters?.filter((e) => Array.isArray(e?.value) ? e?.value?.length : e)
|
|
1961
1961
|
},
|
|
1962
1962
|
filterValues: s ? void 0 : l,
|
|
1963
|
-
limit: o?.tableSettings?.isServerSidePagination && o?.chartType ===
|
|
1964
|
-
offset: o?.tableSettings?.isServerSidePagination && o?.chartType ===
|
|
1963
|
+
limit: o?.tableSettings?.isServerSidePagination && o?.chartType === A.table ? Math.min(u.limit, 1e3) : void 0,
|
|
1964
|
+
offset: o?.tableSettings?.isServerSidePagination && o?.chartType === A.table ? u.offset : void 0,
|
|
1965
1965
|
disableStringify: !0,
|
|
1966
1966
|
pivotHeaders: o?.pivotTableSettings2?.headers || [],
|
|
1967
1967
|
timeseriesSettings: s ? void 0 : {
|
|
@@ -1972,29 +1972,29 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
1972
1972
|
chartSeriesField: o?.seriesField !== "ungrouped" && o?.seriesField && o?.isDynamicSeries ? o?.seriesField : void 0,
|
|
1973
1973
|
comparisonCount: f,
|
|
1974
1974
|
dynamicXAxis: {
|
|
1975
|
-
isEnable: !!(o?.dynamicXAxis?.isEnabled || o?.enduserMeasureAndDimensions?.isEnabled) &&
|
|
1975
|
+
isEnable: !!(o?.dynamicXAxis?.isEnabled || o?.enduserMeasureAndDimensions?.isEnabled) && pe.includes(o?.chartType || ""),
|
|
1976
1976
|
xaxis: o?.xAxis || "",
|
|
1977
1977
|
customField: o?.dynamicXAxis?.selectedOption?.column
|
|
1978
1978
|
},
|
|
1979
1979
|
dbId: p,
|
|
1980
1980
|
elementSettings: e?.elementSettings?.metricExpression,
|
|
1981
1981
|
drillConfig: vi(e?.datasetMetricSettings) ? bi(m) : m,
|
|
1982
|
-
isEncrypted: !(
|
|
1982
|
+
isEncrypted: !(h || !g)
|
|
1983
1983
|
}), Ri = (e) => {
|
|
1984
1984
|
let t = e.object.customTable?.query;
|
|
1985
1985
|
return e.object.wId ? !t || !t.includes("{{") : !1;
|
|
1986
|
-
}, zi = (e, t) => e.customTable ? "" : e.tableName ?
|
|
1987
|
-
if (!e.customColumnSql) return e.columnName ?
|
|
1986
|
+
}, zi = (e, t) => e.customTable ? "" : e.tableName ? $e(e.tableName, t) : e.tableName, Bi = (e, t) => {
|
|
1987
|
+
if (!e.customColumnSql) return e.columnName ? $e(e.columnName, t) : e.columnName;
|
|
1988
1988
|
}, Vi = (e) => {
|
|
1989
1989
|
let { object: t } = e, n = t.wId;
|
|
1990
1990
|
return {
|
|
1991
1991
|
...t,
|
|
1992
1992
|
tableName: zi(t, n),
|
|
1993
1993
|
columnName: Bi(t, n),
|
|
1994
|
-
filter: t.filter?.length ?
|
|
1994
|
+
filter: t.filter?.length ? Se(t.filter, n) : [],
|
|
1995
1995
|
customTable: t.customTable?.query ? {
|
|
1996
|
-
query:
|
|
1997
|
-
alias:
|
|
1996
|
+
query: $e(t.customTable.query, n),
|
|
1997
|
+
alias: $e(t.customTable.alias, n)
|
|
1998
1998
|
} : t.customTable
|
|
1999
1999
|
};
|
|
2000
2000
|
}, Hi = async (e, t, n) => {
|
|
@@ -2028,11 +2028,11 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2028
2028
|
o();
|
|
2029
2029
|
}
|
|
2030
2030
|
}, Wi = ({ savedDrillDownSettings: e, initialDrillState: t }) => {
|
|
2031
|
-
let [n, r] =
|
|
2031
|
+
let [n, r] = I([]), i = t.drillFilters ?? [], a = F(i), o = F(t.underlyingDataDrillFilters), s = rr(e, t), [c, l] = I(i), [u, d] = I(s ?? {
|
|
2032
2032
|
isEnableGroupBy: !1,
|
|
2033
2033
|
isEnableCrossFilter: !1,
|
|
2034
2034
|
drillType: ""
|
|
2035
|
-
}), [f, p] =
|
|
2035
|
+
}), [f, p] = I([]);
|
|
2036
2036
|
return {
|
|
2037
2037
|
drilldownCols: n,
|
|
2038
2038
|
setDrillDownCols: r,
|
|
@@ -2096,13 +2096,13 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2096
2096
|
error: "There is no data to summarize.",
|
|
2097
2097
|
empty: !0
|
|
2098
2098
|
}, ea = () => {
|
|
2099
|
-
let [e, t] =
|
|
2099
|
+
let [e, t] = I(Zi), n = F(null), r = F(null), i = M(() => {
|
|
2100
2100
|
let e = r.current;
|
|
2101
2101
|
r.current = null, n.current = null, e?.abort(), t(Zi);
|
|
2102
|
-
}, []), a =
|
|
2102
|
+
}, []), a = M(() => {
|
|
2103
2103
|
let e = r.current;
|
|
2104
2104
|
r.current = null, e?.abort(), t(Zi);
|
|
2105
|
-
}, []), o =
|
|
2105
|
+
}, []), o = M((e, i) => {
|
|
2106
2106
|
if (n.current === e) return;
|
|
2107
2107
|
if (n.current = e, r.current?.release(), r.current = null, !i) {
|
|
2108
2108
|
t($i);
|
|
@@ -2131,7 +2131,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2131
2131
|
r.current === a && t(s(e) ? Zi : Qi);
|
|
2132
2132
|
});
|
|
2133
2133
|
}, []);
|
|
2134
|
-
return
|
|
2134
|
+
return N(() => () => {
|
|
2135
2135
|
r.current?.release(), r.current = null, n.current = null;
|
|
2136
2136
|
}, []), {
|
|
2137
2137
|
state: e,
|
|
@@ -2140,13 +2140,13 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2140
2140
|
reset: i
|
|
2141
2141
|
};
|
|
2142
2142
|
}, ta = (e) => {
|
|
2143
|
-
let t =
|
|
2144
|
-
return t.current !== e && !
|
|
2143
|
+
let t = F(e);
|
|
2144
|
+
return t.current !== e && !U(t.current, e) && (t.current = e), t.current;
|
|
2145
2145
|
}, $ = (e) => {
|
|
2146
2146
|
if (!e) return null;
|
|
2147
2147
|
let t = new Date(e);
|
|
2148
2148
|
return t instanceof Date && !Number.isNaN(t.getTime()) ? t : null;
|
|
2149
|
-
}, na = (e) =>
|
|
2149
|
+
}, na = (e) => Te(e || {}) ? {
|
|
2150
2150
|
startTime: e?.startTime,
|
|
2151
2151
|
endTime: e?.endTime,
|
|
2152
2152
|
isTimeFilter: !0
|
|
@@ -2165,75 +2165,75 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2165
2165
|
...n
|
|
2166
2166
|
} : e;
|
|
2167
2167
|
}, la = ({ raw: e, selectedDims: t, selectedMetrics: n, datasetSettings: r, integrationName: i, isPythonMode: a }) => {
|
|
2168
|
-
let o =
|
|
2168
|
+
let o = Qn({ data: e });
|
|
2169
2169
|
if (!o.rows.length) return aa;
|
|
2170
2170
|
let s = ve(o.rows, t || [], n || []), c = s;
|
|
2171
2171
|
if (i?.toLowerCase() === "redshift" && !a) {
|
|
2172
|
-
let e = r?.selectedMetrics || [], t = [...((r?.selectedDims)?.filter((e) => !
|
|
2173
|
-
c =
|
|
2172
|
+
let e = r?.selectedMetrics || [], t = [...((r?.selectedDims)?.filter((e) => !nt(e?.alias)) || [])?.map((e) => e.alias), ...e?.map((e) => e.alias)];
|
|
2173
|
+
c = ze(t, s);
|
|
2174
2174
|
}
|
|
2175
|
-
let l =
|
|
2175
|
+
let l = at(c);
|
|
2176
2176
|
return !Array.isArray(l) || !l.length ? aa : l;
|
|
2177
2177
|
}, ua = ({ externalDashboardClientId: e, metric: t, globalFilters: n = {
|
|
2178
2178
|
tableName: "",
|
|
2179
2179
|
filters: []
|
|
2180
|
-
}, rlsFilters: r, clientId: a, tenancyLevel: o, isInternalApp: s, appFilters: c, setCrossDashboardFilters: l, crossDashboardFilters: u, enableCrossFilter: d, enableCrossFilterBeforeDrill: f = !1, metricFilterOptions:
|
|
2181
|
-
let [
|
|
2180
|
+
}, rlsFilters: r, clientId: a, tenancyLevel: o, isInternalApp: s, appFilters: c, setCrossDashboardFilters: l, crossDashboardFilters: u, enableCrossFilter: d, enableCrossFilterBeforeDrill: f = !1, metricFilterOptions: h, isAllClient: g, isFrontendApp: _, guestToken: v, encryptedClientId: y, clientCacheScope: b, dashboardId: T, workspaceId: D, metricStore: O, setMetricStore: ie, summaryReferencedMetricIds: se, onServerEvent: ue, clientColumnType: de, datasourceId: ge, appliedCardMetricFilters: k, onMetricFiltersChange: Se, language: Ce, translationDictionary: Te, calendarType: Oe, setLoadedCardMetadata: Fe, isRulePending: Re = !1, setSettledCardIds: ze, drillUrlState: Ge, isFullScreen: Ye, setMetricMetadata: $e, viewMetricData: j, generatingPdf: nt, dataMartTables: ot, isDisableQuery: ct = !1, token: ut, drilledLevel: dt, drillFilters: ft, drillType: pt, underlyingDataDrillFilters: ht }) => {
|
|
2181
|
+
let [gt, yt] = I(!1), bt = C(), [xt, St] = I(null), { state: Ct, start: wt, stop: Tt, reset: Et } = ea(), Dt = Ct.summary, Ot = Ct.error, kt = Ct.empty, At = Ct.status === "running", jt = F(null), Mt = F(null), [L, Nt] = I({
|
|
2182
2182
|
limit: parseInt(t?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
|
|
2183
2183
|
offset: 0
|
|
2184
|
-
}), [
|
|
2184
|
+
}), [Pt, Ft] = I(0), [R, It] = I(0), [z, Lt] = I(t?.rlsConditions || []), [Rt, zt] = I([]), [Bt, Vt] = I(!1), [B, Ht] = I(), [Ut, Wt] = I(""), [Gt, Kt] = I([]), [qt, Jt] = I({
|
|
2185
2185
|
isOpen: !1,
|
|
2186
2186
|
report: "",
|
|
2187
2187
|
isLoading: !1
|
|
2188
|
-
}), [
|
|
2188
|
+
}), [Yt, Xt] = I(!1), { drilldownCols: Zt, setDrillDownCols: Qt, initialDrillFiltersRef: $t, initialUnderlyingDataDrillFiltersRef: en, drillFilters: V, setDrillFilters: tn, drillDownSettings: H, setDrillDownSettings: U, adhocDrillDims: nn, setAdhocDrillDims: rn } = Wi({
|
|
2189
2189
|
savedDrillDownSettings: t?.drillDownSettings,
|
|
2190
2190
|
initialDrillState: {
|
|
2191
|
-
drilledLevel:
|
|
2192
|
-
drillFilters:
|
|
2193
|
-
drillType:
|
|
2194
|
-
underlyingDataDrillFilters:
|
|
2191
|
+
drilledLevel: dt,
|
|
2192
|
+
drillFilters: ft,
|
|
2193
|
+
drillType: pt,
|
|
2194
|
+
underlyingDataDrillFilters: ht
|
|
2195
2195
|
}
|
|
2196
|
-
}),
|
|
2196
|
+
}), W = !s && f === !0, an = Or({
|
|
2197
2197
|
runtimeEnabled: d,
|
|
2198
2198
|
metricEnabled: t?.drillDownSettings?.isEnableCrossFilter
|
|
2199
|
-
}), [
|
|
2200
|
-
|
|
2201
|
-
let
|
|
2202
|
-
|
|
2199
|
+
}), [on, sn] = I([]), [cn, ln] = I(!1), [un, dn] = I(!1), [G, pn] = I([]), mn = F(Se);
|
|
2200
|
+
mn.current = Se;
|
|
2201
|
+
let hn = M((e) => {
|
|
2202
|
+
pn((n) => {
|
|
2203
2203
|
let r = typeof e == "function" ? e(n) : e;
|
|
2204
2204
|
return Si({
|
|
2205
2205
|
metricId: t?.id,
|
|
2206
2206
|
filters: r,
|
|
2207
|
-
onChange:
|
|
2207
|
+
onChange: mn.current
|
|
2208
2208
|
}), r;
|
|
2209
2209
|
});
|
|
2210
|
-
}, [t?.id]), [
|
|
2210
|
+
}, [t?.id]), [gn, _n] = I({}), [vn, yn] = I(!1), [bn, xn] = I([]), [K, q] = I(ca(t?.chartOptions, t?.drillDownSettings)), wn = F(""), [Tn, En] = I({
|
|
2211
2211
|
data: [],
|
|
2212
2212
|
error: "",
|
|
2213
2213
|
isLoading: !1,
|
|
2214
2214
|
currentValue: ""
|
|
2215
|
-
}),
|
|
2215
|
+
}), J = P(() => !!t?.datasetMetricSettings?.newDatasetSettings?.isPythonMode, [t?.datasetMetricSettings?.newDatasetSettings?.isPythonMode]), Dn = P(() => vi(t?.datasetMetricSettings), [t?.datasetMetricSettings]), On = M((e) => re(e) ? !0 : e?.isAddOnMetrics && e?.datatype === "date" ? !1 : !!(e?.isAddOnMetrics && e?.client?.isEnable && e?.client?.columnName && e?.client?.as && !g && a), [a, g]), kn = P(() => t?.externalDashboardMetrics?.[0]?.externalDashboard?.companyWorkspace?.datamart?.datamartRelationships || [], [t]), An = P(() => {
|
|
2216
2216
|
let e = {};
|
|
2217
2217
|
if (r?.values) for (let t in r.values) {
|
|
2218
2218
|
let n = `${t}_variable`;
|
|
2219
2219
|
e[n] = r.values[t];
|
|
2220
2220
|
}
|
|
2221
2221
|
return e;
|
|
2222
|
-
}, [r?.values]),
|
|
2222
|
+
}, [r?.values]), jn = P(() => {
|
|
2223
2223
|
let e = t?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable;
|
|
2224
|
-
return (
|
|
2224
|
+
return (ot?.find((t) => t.tableName === e?.tableName))?.customColumnFields?.map((n) => ({
|
|
2225
2225
|
value: n?.columnName,
|
|
2226
2226
|
label: n?.columnName,
|
|
2227
2227
|
isCustomField: !0,
|
|
2228
2228
|
column: {
|
|
2229
|
-
uniqueId:
|
|
2229
|
+
uniqueId: De(10),
|
|
2230
2230
|
alias: n?.columnName,
|
|
2231
2231
|
configType: "DIMENSION",
|
|
2232
2232
|
datatype: n?.datatype,
|
|
2233
2233
|
dropType: "DIMENSION",
|
|
2234
2234
|
index: 1e3,
|
|
2235
2235
|
name: n?.columnName,
|
|
2236
|
-
parentAlias: `${
|
|
2236
|
+
parentAlias: `${Ue(e?.schemaName, t?.companyIntegration?.name || "")}_${e?.tableName?.replaceAll(" ", "_")?.replace("*", "_")}`,
|
|
2237
2237
|
table: t?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable,
|
|
2238
2238
|
type: "DEFAULT",
|
|
2239
2239
|
draggableItemData: {
|
|
@@ -2251,141 +2251,141 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2251
2251
|
}, [
|
|
2252
2252
|
t?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable,
|
|
2253
2253
|
t?.companyIntegration?.name,
|
|
2254
|
-
|
|
2255
|
-
]),
|
|
2254
|
+
ot
|
|
2255
|
+
]), Mn = P(() => {
|
|
2256
2256
|
let e = t?.drillDownSettings?.isEnableGroupBy;
|
|
2257
|
-
return (
|
|
2257
|
+
return (W ? [...z?.length ? z : [], ..._r({
|
|
2258
2258
|
filters: u,
|
|
2259
2259
|
metricId: t?.id,
|
|
2260
2260
|
isGroupByEnabled: e,
|
|
2261
2261
|
enableCrossFilterBeforeDrill: !0
|
|
2262
|
-
})] : e ?
|
|
2262
|
+
})] : e ? z || [] : [...z?.length ? z : [], ...u || []]).filter((e) => e.isAddOnMetrics).map((e) => s ? {
|
|
2263
2263
|
...e,
|
|
2264
|
-
dimensionColumn:
|
|
2265
|
-
measureColumn:
|
|
2264
|
+
dimensionColumn: K?.xAxis || "",
|
|
2265
|
+
measureColumn: K?.yAxisList?.[0] || "",
|
|
2266
2266
|
options: e.datatype === "date" ? e.options : [],
|
|
2267
2267
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2268
2268
|
} : {
|
|
2269
2269
|
...e,
|
|
2270
|
-
dimensionColumn:
|
|
2271
|
-
measureColumn:
|
|
2270
|
+
dimensionColumn: K?.xAxis || "",
|
|
2271
|
+
measureColumn: K?.yAxisList?.[0] || "",
|
|
2272
2272
|
value: e.isAppFilter ? e.datatype === "date" ? qe(c?.values?.[e.name], e?.datePresetOptions || e?.presetDateOptions) || (e?.options)?.find((t) => t.name === (c?.values?.[e.name] ?? e.value)) : c?.values?.[e.name] ?? e.value : e.value,
|
|
2273
|
-
options: e.datatype === "date" ? e?.options?.map((t) =>
|
|
2273
|
+
options: e.datatype === "date" ? e?.options?.map((t) => Oe === "ind" && e.datatype === "date" ? {
|
|
2274
2274
|
...t,
|
|
2275
2275
|
isFiscal: !0
|
|
2276
2276
|
} : t) : [],
|
|
2277
2277
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2278
|
-
}).filter((e) =>
|
|
2278
|
+
}).filter((e) => On(e));
|
|
2279
2279
|
}, [
|
|
2280
2280
|
c?.values,
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2281
|
+
Oe,
|
|
2282
|
+
K?.xAxis,
|
|
2283
|
+
K?.yAxisList,
|
|
2284
2284
|
u,
|
|
2285
2285
|
t?.id,
|
|
2286
|
-
|
|
2286
|
+
W,
|
|
2287
2287
|
s,
|
|
2288
2288
|
t?.drillDownSettings?.isEnableGroupBy,
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
]),
|
|
2289
|
+
z,
|
|
2290
|
+
On
|
|
2291
|
+
]), Nn = P(() => JSON.stringify(Rt), [Rt]), Y = ta(P(() => ({
|
|
2292
2292
|
...Li({
|
|
2293
2293
|
metric: t,
|
|
2294
|
-
isAllClient:
|
|
2294
|
+
isAllClient: g,
|
|
2295
2295
|
tenancyLevel: o,
|
|
2296
|
-
appliedMetricFilters:
|
|
2297
|
-
firstLoadAppliedMetricFilters:
|
|
2298
|
-
tableColumnFilters:
|
|
2299
|
-
chartSettings:
|
|
2300
|
-
isPythonMode:
|
|
2296
|
+
appliedMetricFilters: G,
|
|
2297
|
+
firstLoadAppliedMetricFilters: Mn,
|
|
2298
|
+
tableColumnFilters: Rt,
|
|
2299
|
+
chartSettings: K,
|
|
2300
|
+
isPythonMode: J,
|
|
2301
2301
|
globalFilters: n,
|
|
2302
|
-
filterValues:
|
|
2303
|
-
tableLimit:
|
|
2304
|
-
calendarType:
|
|
2305
|
-
comparisonCount:
|
|
2306
|
-
datasourceId:
|
|
2307
|
-
drillConfig:
|
|
2308
|
-
isFrontendApp:
|
|
2309
|
-
guestToken:
|
|
2302
|
+
filterValues: An,
|
|
2303
|
+
tableLimit: L,
|
|
2304
|
+
calendarType: Oe,
|
|
2305
|
+
comparisonCount: R,
|
|
2306
|
+
datasourceId: ge,
|
|
2307
|
+
drillConfig: H?.configV2,
|
|
2308
|
+
isFrontendApp: _,
|
|
2309
|
+
guestToken: v
|
|
2310
2310
|
}),
|
|
2311
|
-
dashboardId:
|
|
2311
|
+
dashboardId: T
|
|
2312
2312
|
}), [
|
|
2313
|
-
q,
|
|
2314
|
-
h,
|
|
2315
|
-
t,
|
|
2316
2313
|
K,
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2314
|
+
g,
|
|
2315
|
+
t,
|
|
2316
|
+
G,
|
|
2317
|
+
Mn,
|
|
2318
|
+
J,
|
|
2319
|
+
An,
|
|
2320
|
+
V,
|
|
2321
2321
|
o,
|
|
2322
2322
|
n,
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2323
|
+
L,
|
|
2324
|
+
R,
|
|
2325
|
+
pe,
|
|
2326
|
+
ge,
|
|
2327
|
+
Oe,
|
|
2328
|
+
H?.configV2,
|
|
2329
|
+
v,
|
|
2329
2330
|
_,
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
isFrontendApp: g
|
|
2337
|
-
}), [
|
|
2338
|
-
Rn,
|
|
2339
|
-
g,
|
|
2340
|
-
X
|
|
2341
|
-
]), Vn = I(() => ji({
|
|
2342
|
-
clientId: Rn,
|
|
2343
|
-
guestToken: _,
|
|
2344
|
-
isFrontendApp: g
|
|
2331
|
+
T,
|
|
2332
|
+
Nn
|
|
2333
|
+
])), Pn = P(() => JSON.stringify(Y), [Y]), Fn = wi(K, t?.datasetMetricSettings), In = t?.datasetMetricSettings, Ln = me(In), Rn = ct || Fn.renderEmpty || !!Ln, zn = _ ? y || "" : a || "", Vn = P(() => Mi({
|
|
2334
|
+
query: Y,
|
|
2335
|
+
clientId: zn,
|
|
2336
|
+
isFrontendApp: _
|
|
2345
2337
|
}), [
|
|
2346
|
-
|
|
2338
|
+
zn,
|
|
2347
2339
|
_,
|
|
2348
|
-
|
|
2340
|
+
Y
|
|
2341
|
+
]), Hn = P(() => ji({
|
|
2342
|
+
clientId: zn,
|
|
2343
|
+
guestToken: v,
|
|
2344
|
+
isFrontendApp: _
|
|
2345
|
+
}), [
|
|
2346
|
+
zn,
|
|
2347
|
+
v,
|
|
2348
|
+
_
|
|
2349
2349
|
]);
|
|
2350
|
-
|
|
2350
|
+
N(() => {
|
|
2351
2351
|
p("metric-query-payload-prepared", {
|
|
2352
2352
|
metricId: t?.id,
|
|
2353
2353
|
metricName: t?.name,
|
|
2354
|
-
chartType:
|
|
2355
|
-
payload:
|
|
2354
|
+
chartType: K?.chartType,
|
|
2355
|
+
payload: E(Y)
|
|
2356
2356
|
});
|
|
2357
2357
|
}, [
|
|
2358
|
-
|
|
2358
|
+
Y,
|
|
2359
2359
|
t?.id,
|
|
2360
2360
|
t?.name,
|
|
2361
|
-
|
|
2361
|
+
K?.chartType
|
|
2362
2362
|
]);
|
|
2363
|
-
let
|
|
2364
|
-
data:
|
|
2365
|
-
clientId:
|
|
2366
|
-
clientCacheScope:
|
|
2367
|
-
metricRevision:
|
|
2368
|
-
token:
|
|
2369
|
-
isFrontendApp:
|
|
2370
|
-
isFullScreen:
|
|
2371
|
-
savedMetricQuery: t?.isMetric === !1 || !t?.query ? void 0 :
|
|
2372
|
-
savedMetricIdentifiers:
|
|
2363
|
+
let Un = P(() => fn(t), [t]), { data: X, dataUpdatedAt: Wn, isFetching: Gn, isLoading: Kn, error: Yn, refetch: Xn } = Sn({
|
|
2364
|
+
data: Y,
|
|
2365
|
+
clientId: _ ? y || "" : a,
|
|
2366
|
+
clientCacheScope: _ ? b : void 0,
|
|
2367
|
+
metricRevision: Un,
|
|
2368
|
+
token: v,
|
|
2369
|
+
isFrontendApp: _,
|
|
2370
|
+
isFullScreen: Ye,
|
|
2371
|
+
savedMetricQuery: t?.isMetric === !1 || !t?.query ? void 0 : _e(t?.query, t?.companyId),
|
|
2372
|
+
savedMetricIdentifiers: In,
|
|
2373
2373
|
dbName: t?.companyIntegration?.name || t?.integrationName,
|
|
2374
2374
|
batchHints: {
|
|
2375
|
-
chartType:
|
|
2376
|
-
isEnableComparisonFilter: !!
|
|
2377
|
-
isMultiDimension: !!
|
|
2378
|
-
isDynamicSeries: !!
|
|
2379
|
-
seriesField:
|
|
2375
|
+
chartType: K?.chartType,
|
|
2376
|
+
isEnableComparisonFilter: !!K?.isEnableComparisonFilter,
|
|
2377
|
+
isMultiDimension: !!K?.isMultiDimension,
|
|
2378
|
+
isDynamicSeries: !!K?.isDynamicSeries,
|
|
2379
|
+
seriesField: K?.seriesField,
|
|
2380
2380
|
isDataMartQuery: !!(t?.datasetMetricSettings)?.newDatasetSettings?.isDataMartQuery
|
|
2381
2381
|
}
|
|
2382
2382
|
}, {
|
|
2383
|
-
isDisableQuery:
|
|
2383
|
+
isDisableQuery: Rn,
|
|
2384
2384
|
onSuccess: (e) => {
|
|
2385
|
-
let t =
|
|
2386
|
-
if (
|
|
2387
|
-
let e =
|
|
2388
|
-
|
|
2385
|
+
let t = Qn(e), n = at(t.rows), r = ia(ia(t.error, "details"), "legacyCode");
|
|
2386
|
+
if (Fe && ia(t.error, "code") !== "E1001" && r !== "E1001") {
|
|
2387
|
+
let e = Y?.id, t = !!n?.length && (K?.chartType !== A.singleValue || n?.[0]?.[K?.singleValue || ""] != null);
|
|
2388
|
+
Fe?.((n) => {
|
|
2389
2389
|
let r = n?.find((t) => t?.id === e);
|
|
2390
2390
|
return r && r.isDataFound === t ? n : [...n?.filter((t) => t?.id !== e) || [], {
|
|
2391
2391
|
id: e,
|
|
@@ -2395,77 +2395,77 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2395
2395
|
}
|
|
2396
2396
|
},
|
|
2397
2397
|
onSettled: () => {
|
|
2398
|
-
let e =
|
|
2399
|
-
|
|
2398
|
+
let e = Y?.id;
|
|
2399
|
+
ze && e && ze((t) => Ni(t, e));
|
|
2400
2400
|
}
|
|
2401
|
-
}),
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
}, [
|
|
2405
|
-
let
|
|
2406
|
-
raw:
|
|
2401
|
+
}), Zn = ki(Kn), $n = Gn && !Kn && Wn > 0, er = P(() => Qn(X), [X]), tr = !Rn && !Gn && !Yn && er.isFilterNotApplied ? "This drill filter could not be applied to a custom SQL metric." : void 0, nr = F(void 0);
|
|
2402
|
+
N(() => {
|
|
2403
|
+
tr && nr.current !== X && (nr.current = X, m("metric.filter_not_applied", { error_code: "FILTER_NOT_APPLIED" }));
|
|
2404
|
+
}, [tr, X]);
|
|
2405
|
+
let Z = P(() => la({
|
|
2406
|
+
raw: er.rows,
|
|
2407
2407
|
selectedDims: (t?.datasetMetricSettings)?.newDatasetSettings?.selectedDims,
|
|
2408
2408
|
selectedMetrics: (t?.datasetMetricSettings)?.newDatasetSettings?.selectedMetrics,
|
|
2409
2409
|
datasetSettings: t?.datasetMetricSettings?.newDatasetSettings,
|
|
2410
2410
|
integrationName: t?.companyIntegration?.name,
|
|
2411
|
-
isPythonMode:
|
|
2411
|
+
isPythonMode: J
|
|
2412
2412
|
}), [
|
|
2413
|
-
|
|
2413
|
+
er.rows,
|
|
2414
2414
|
t?.datasetMetricSettings,
|
|
2415
2415
|
t?.companyIntegration?.name,
|
|
2416
|
-
|
|
2417
|
-
]),
|
|
2418
|
-
|
|
2419
|
-
if (!
|
|
2420
|
-
let e =
|
|
2416
|
+
J
|
|
2417
|
+
]), ir = P(() => qn(X?.metaData?.truncation, Z.length), [X, Z]), ar = P(() => Jn(ir), [ir]), or = Ln || Yn || er.error;
|
|
2418
|
+
N(() => {
|
|
2419
|
+
if (!or) return;
|
|
2420
|
+
let e = or instanceof Error ? or.message : ia(or, "message"), n = ia(or, "context");
|
|
2421
2421
|
p("metric-query-error-observed", {
|
|
2422
2422
|
metricId: t?.id,
|
|
2423
2423
|
metricName: t?.name,
|
|
2424
|
-
chartType:
|
|
2424
|
+
chartType: K?.chartType,
|
|
2425
2425
|
message: e,
|
|
2426
2426
|
context: n,
|
|
2427
|
-
payload:
|
|
2427
|
+
payload: E(Y)
|
|
2428
2428
|
});
|
|
2429
2429
|
}, [
|
|
2430
|
-
|
|
2430
|
+
or,
|
|
2431
2431
|
t?.id,
|
|
2432
2432
|
t?.name,
|
|
2433
|
-
|
|
2434
|
-
]),
|
|
2435
|
-
let e =
|
|
2436
|
-
|
|
2433
|
+
K?.chartType
|
|
2434
|
+
]), N(() => {
|
|
2435
|
+
let e = Y?.id;
|
|
2436
|
+
Rn && ze && e && ze((t) => Ni(t, e));
|
|
2437
2437
|
}, [
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
]),
|
|
2442
|
-
let e =
|
|
2443
|
-
!
|
|
2438
|
+
Rn,
|
|
2439
|
+
Y?.id,
|
|
2440
|
+
ze
|
|
2441
|
+
]), N(() => {
|
|
2442
|
+
let e = Y?.id;
|
|
2443
|
+
!Rn && ze && e && ze((t) => Pi(t, e));
|
|
2444
2444
|
}, [
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2445
|
+
Rn,
|
|
2446
|
+
Pn,
|
|
2447
|
+
ze
|
|
2448
2448
|
]);
|
|
2449
|
-
let { data:
|
|
2450
|
-
metricViewFilters:
|
|
2451
|
-
xAxisSettings:
|
|
2452
|
-
yAxisSettings:
|
|
2449
|
+
let { data: sr } = Cn(D, void 0, _, y), cr = P(() => sr?.weekStartDay === "sunday" ? "sunday" : "monday", [sr]), { mutate: ur } = ee(), { mutateAsync: dr } = x(), fr = P(() => JSON.stringify({
|
|
2450
|
+
metricViewFilters: j?.metricViewFilters || [],
|
|
2451
|
+
xAxisSettings: j?.xAxisSettings || [],
|
|
2452
|
+
yAxisSettings: j?.yAxisSettings || []
|
|
2453
2453
|
}), [
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
]),
|
|
2458
|
-
|
|
2459
|
-
let
|
|
2460
|
-
|
|
2461
|
-
let
|
|
2462
|
-
|
|
2463
|
-
let e =
|
|
2464
|
-
|
|
2454
|
+
j?.metricViewFilters,
|
|
2455
|
+
j?.xAxisSettings,
|
|
2456
|
+
j?.yAxisSettings
|
|
2457
|
+
]), mr = P(() => JSON.stringify(k || []), [k]), hr = F(j);
|
|
2458
|
+
hr.current = j;
|
|
2459
|
+
let gr = F(k);
|
|
2460
|
+
gr.current = k;
|
|
2461
|
+
let vr = F(t?.id);
|
|
2462
|
+
vr.current = t?.id, N(() => {
|
|
2463
|
+
let e = hr.current, n = gr.current, r = vr.current, i = wn.current !== fr, s = [...e?.metricViewFilters?.find((e) => e.id === r)?.filters?.filter((e) => !n?.find((t) => e?.name === t?.name)) || [], ...n || []];
|
|
2464
|
+
Lt((e) => {
|
|
2465
2465
|
let n = t?.rlsConditions?.map((t) => {
|
|
2466
2466
|
let n = e?.find((e) => e.name === t.name && e.datatype === t.datatype && e.tableName === t.tableName && e.columnName === t.columnName), r = t;
|
|
2467
|
-
if (
|
|
2468
|
-
let e =
|
|
2467
|
+
if (h) {
|
|
2468
|
+
let e = _t(r, h);
|
|
2469
2469
|
if (e) {
|
|
2470
2470
|
let t = r.datatype === "date" ? e.options?.find((t) => t.name === e.value) : void 0;
|
|
2471
2471
|
r = {
|
|
@@ -2521,7 +2521,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2521
2521
|
...r?.selectedDropdownValue === void 0 && n?.selectedDropdownValue !== void 0 ? { selectedDropdownValue: n.selectedDropdownValue } : {},
|
|
2522
2522
|
...r?.selectedVariableValue === void 0 && n?.selectedVariableValue !== void 0 ? { selectedVariableValue: n.selectedVariableValue } : {}
|
|
2523
2523
|
}), r?.datatype === "date" && r?.options?.find((e) => e.range === "Custom Date") && r?.isEnableDynamicDate && r?.dynamicDate?.value) {
|
|
2524
|
-
let e = he(
|
|
2524
|
+
let e = he(Je?.find((e) => e.value === r?.dynamicDate?.value)?.count || 0), t = Ke(e), n = Ke(e);
|
|
2525
2525
|
r = {
|
|
2526
2526
|
...r,
|
|
2527
2527
|
options: r?.options?.map((r) => r.range === "Custom Date" ? {
|
|
@@ -2537,59 +2537,59 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2537
2537
|
tableName: `${a}.${t.tableName.split(".").slice(1).join(".")}`
|
|
2538
2538
|
} : r;
|
|
2539
2539
|
}) || [];
|
|
2540
|
-
return
|
|
2540
|
+
return we(e || [], n || []) ? e : n || [];
|
|
2541
2541
|
});
|
|
2542
2542
|
}, [
|
|
2543
2543
|
t?.rlsConditions,
|
|
2544
|
-
|
|
2544
|
+
h,
|
|
2545
2545
|
o,
|
|
2546
2546
|
a,
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
]),
|
|
2550
|
-
|
|
2551
|
-
}, [
|
|
2552
|
-
t?.id &&
|
|
2547
|
+
mr,
|
|
2548
|
+
fr
|
|
2549
|
+
]), N(() => {
|
|
2550
|
+
wn.current = fr;
|
|
2551
|
+
}, [fr]), N(() => {
|
|
2552
|
+
t?.id && $e && !J && t?.isMetric && $e?.((e) => {
|
|
2553
2553
|
let n = {
|
|
2554
|
-
filters: [...
|
|
2554
|
+
filters: [...G || [], ...K?.tableSettings?.isServerSidePagination && K?.chartType === A.table ? Rt?.map((e) => e.condition)?.filter((e) => re(e)) : []],
|
|
2555
2555
|
xAxisSettings: {
|
|
2556
|
-
isEnable: !!(
|
|
2557
|
-
xaxis:
|
|
2556
|
+
isEnable: !!(K?.dynamicXAxis?.isEnabled || K?.enduserMeasureAndDimensions?.isEnabled) && pe.includes(K?.chartType || ""),
|
|
2557
|
+
xaxis: K?.xAxis || ""
|
|
2558
2558
|
},
|
|
2559
2559
|
yAxisSettings: {
|
|
2560
|
-
isEnable: !(
|
|
2561
|
-
yAxis:
|
|
2560
|
+
isEnable: !(K?.dynamicYAxis?.isEnabled && K?.dynamicYAxis?.selectedOption && !Array.isArray(K?.dynamicYAxis?.selectedOption)),
|
|
2561
|
+
yAxis: K?.dynamicYAxis?.selectedOption || ""
|
|
2562
2562
|
},
|
|
2563
2563
|
id: t?.id,
|
|
2564
2564
|
metricRequestData: {
|
|
2565
|
-
isAllClient:
|
|
2566
|
-
timeseriesSettings:
|
|
2567
|
-
format:
|
|
2568
|
-
seriesField:
|
|
2569
|
-
isFiscal:
|
|
2565
|
+
isAllClient: g,
|
|
2566
|
+
timeseriesSettings: J ? void 0 : {
|
|
2567
|
+
format: K?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase() || "monthly",
|
|
2568
|
+
seriesField: K?.seriesField || "",
|
|
2569
|
+
isFiscal: Oe === "ind"
|
|
2570
2570
|
}
|
|
2571
2571
|
}
|
|
2572
2572
|
}, r = e?.find((e) => e.id === t?.id);
|
|
2573
|
-
return r &&
|
|
2573
|
+
return r && we(r, n) ? e : [...e?.filter((e) => e.id !== t?.id) || [], n];
|
|
2574
2574
|
});
|
|
2575
2575
|
}, [
|
|
2576
2576
|
t?.id,
|
|
2577
2577
|
t?.isMetric,
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
]),
|
|
2578
|
+
G,
|
|
2579
|
+
K?.timeSeriesSettings,
|
|
2580
|
+
K?.seriesField,
|
|
2581
|
+
J,
|
|
2582
|
+
Oe,
|
|
2583
|
+
g,
|
|
2584
|
+
Rt,
|
|
2585
|
+
K?.tableSettings?.isServerSidePagination,
|
|
2586
|
+
K?.chartType,
|
|
2587
|
+
K?.dynamicYAxis,
|
|
2588
|
+
K?.dynamicXAxis
|
|
2589
|
+
]), N(() => {
|
|
2590
2590
|
if (t?.drillDownSettings?.isEnableGroupBy) {
|
|
2591
2591
|
let e = t?.datasetMetricSettings;
|
|
2592
|
-
if (!t?.drillDownSettings?.configV2 && !
|
|
2592
|
+
if (!t?.drillDownSettings?.configV2 && !H?.configV2 && e?.newDatasetSettings?.selectedMetrics?.length && e?.newDatasetSettings?.selectedDims?.length) {
|
|
2593
2593
|
let n = {
|
|
2594
2594
|
...t?.drillDownSettings || {},
|
|
2595
2595
|
configV2: {
|
|
@@ -2597,47 +2597,47 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2597
2597
|
levels: oi({
|
|
2598
2598
|
selectedDims: e?.newDatasetSettings?.selectedDims,
|
|
2599
2599
|
selectedMetrics: e?.newDatasetSettings?.selectedMetrics,
|
|
2600
|
-
chartSettings:
|
|
2600
|
+
chartSettings: K,
|
|
2601
2601
|
drilldownChartSettings: t?.drillDownSettings?.drilldownChartSettings,
|
|
2602
|
-
makeIndex: () =>
|
|
2602
|
+
makeIndex: () => De(4)
|
|
2603
2603
|
})
|
|
2604
2604
|
}
|
|
2605
2605
|
};
|
|
2606
|
-
|
|
2607
|
-
drilledLevel:
|
|
2608
|
-
drillFilters:
|
|
2609
|
-
drillType:
|
|
2610
|
-
underlyingDataDrillFilters:
|
|
2606
|
+
U(() => rr(n, {
|
|
2607
|
+
drilledLevel: dt,
|
|
2608
|
+
drillFilters: ft,
|
|
2609
|
+
drillType: pt,
|
|
2610
|
+
underlyingDataDrillFilters: ht
|
|
2611
2611
|
}) ?? n);
|
|
2612
|
-
} else
|
|
2612
|
+
} else H?.isEnableGroupBy || U(t?.drillDownSettings);
|
|
2613
2613
|
}
|
|
2614
2614
|
}, [
|
|
2615
2615
|
t?.drillDownSettings?.isEnableGroupBy,
|
|
2616
2616
|
t?.drillDownSettings?.configV2,
|
|
2617
2617
|
t?.datasetMetricSettings,
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
lt,
|
|
2618
|
+
K,
|
|
2619
|
+
ft,
|
|
2621
2620
|
dt,
|
|
2622
2621
|
pt,
|
|
2623
|
-
|
|
2622
|
+
ht,
|
|
2623
|
+
U
|
|
2624
2624
|
]);
|
|
2625
|
-
let
|
|
2626
|
-
|
|
2627
|
-
if (
|
|
2628
|
-
let e =
|
|
2629
|
-
if (!
|
|
2630
|
-
let n =
|
|
2625
|
+
let yr = F(!1);
|
|
2626
|
+
N(() => {
|
|
2627
|
+
if (yr.current) return;
|
|
2628
|
+
let e = Ge?.position;
|
|
2629
|
+
if (!Ge?.enabled || !e || !t?.id) return;
|
|
2630
|
+
let n = H?.configV2;
|
|
2631
2631
|
if (!n?.levels?.length) return;
|
|
2632
|
-
|
|
2633
|
-
let r =
|
|
2632
|
+
yr.current = !0;
|
|
2633
|
+
let r = pr(n, e);
|
|
2634
2634
|
if (!r) return;
|
|
2635
|
-
|
|
2635
|
+
U((e) => ({
|
|
2636
2636
|
...e,
|
|
2637
2637
|
configV2: r
|
|
2638
2638
|
}));
|
|
2639
2639
|
let i = r.levels?.find((e) => e?.isEnable);
|
|
2640
|
-
i?.chartSettings &&
|
|
2640
|
+
i?.chartSettings && q((e) => ({
|
|
2641
2641
|
...e,
|
|
2642
2642
|
...i.chartSettings
|
|
2643
2643
|
})), p("drill-restored-from-url", {
|
|
@@ -2646,66 +2646,66 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2646
2646
|
filterCount: e.filters?.length || 0
|
|
2647
2647
|
});
|
|
2648
2648
|
}, [
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2649
|
+
Ge?.enabled,
|
|
2650
|
+
Ge?.position,
|
|
2651
|
+
H?.configV2,
|
|
2652
2652
|
t?.id,
|
|
2653
|
-
|
|
2653
|
+
U
|
|
2654
2654
|
]);
|
|
2655
|
-
let
|
|
2656
|
-
|
|
2657
|
-
if (!
|
|
2658
|
-
let e =
|
|
2655
|
+
let br = F(void 0);
|
|
2656
|
+
N(() => {
|
|
2657
|
+
if (!Ge?.enabled || !Ge.onChange || !t?.id) return;
|
|
2658
|
+
let e = H?.configV2?.levels || [], n = e.findIndex((e) => e?.isEnable), r = n >= 0 ? e[n] : void 0, i = n > 0 && r?.index ? lr({
|
|
2659
2659
|
levelIndex: r.index,
|
|
2660
2660
|
filters: (r.filters || []).filter((e) => e?.columnName).map((e) => ({
|
|
2661
2661
|
columnName: String(e.columnName),
|
|
2662
2662
|
value: String(e.value ?? "")
|
|
2663
2663
|
}))
|
|
2664
2664
|
}) : null;
|
|
2665
|
-
|
|
2665
|
+
br.current !== i && (br.current = i, Ge.onChange(t.id, i));
|
|
2666
2666
|
}, [
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2667
|
+
Ge?.enabled,
|
|
2668
|
+
Ge?.onChange,
|
|
2669
|
+
H?.configV2,
|
|
2670
2670
|
t?.id
|
|
2671
2671
|
]);
|
|
2672
|
-
let { mutateAsync:
|
|
2672
|
+
let { mutateAsync: xr } = te(), Sr = P(() => JSON.stringify(n?.filters), [n?.filters]), Cr = P(() => {
|
|
2673
2673
|
let e = t?.datasetMetricSettings?.metricVariables || [];
|
|
2674
2674
|
if (!e || !Array.isArray(e) || !e?.length) return [];
|
|
2675
2675
|
let r = [];
|
|
2676
2676
|
for (let i = 0; i < e?.length; i++) {
|
|
2677
2677
|
let s = e[i], c = s.type.value === "custom" && s.customQuery && s.customColumnName, l = c ? {
|
|
2678
|
-
query:
|
|
2678
|
+
query: He({
|
|
2679
2679
|
query: s?.customQuery || "",
|
|
2680
2680
|
tenancyLevel: o,
|
|
2681
2681
|
clientId: a,
|
|
2682
|
-
isAllClient:
|
|
2683
|
-
clientColumnType:
|
|
2682
|
+
isAllClient: g,
|
|
2683
|
+
clientColumnType: de || "STRING",
|
|
2684
2684
|
dbName: t?.companyIntegration?.name,
|
|
2685
|
-
rlsConditions:
|
|
2685
|
+
rlsConditions: G?.filter((e) => e.isVariableFilter),
|
|
2686
2686
|
globalFilters: {
|
|
2687
2687
|
...n,
|
|
2688
2688
|
filters: n?.filters?.filter((e) => e?.isVariableFilter && !!(Array.isArray(e?.value) ? e?.value?.length : e))
|
|
2689
2689
|
},
|
|
2690
|
-
weekStartDay:
|
|
2690
|
+
weekStartDay: cr
|
|
2691
2691
|
}),
|
|
2692
|
-
alias:
|
|
2693
|
-
} : void 0, u = s.dependOnOptions?.length ?
|
|
2694
|
-
let t =
|
|
2692
|
+
alias: ye
|
|
2693
|
+
} : void 0, u = s.dependOnOptions?.length ? G?.filter((e) => s.dependOnOptions.some((t) => t.type === "metric" && t.filter?.value === e.name && t.column)) : [], d = s.dependOnOptions?.length ? n?.filters?.filter((e) => Array.isArray(e?.value) ? e?.value?.length : e && s.dependOnOptions.some((t) => t.type === "dashboard" && t.filter?.value === e.label && t.column)) : [], f = u?.map((e) => {
|
|
2694
|
+
let t = xe(e);
|
|
2695
2695
|
return e.datatype === "date" && t === void 0 ? null : {
|
|
2696
2696
|
columnName: s.dependOnOptions.find((t) => e.name === t.filter?.value)?.column || "",
|
|
2697
2697
|
value: t,
|
|
2698
2698
|
as: e.datatype
|
|
2699
2699
|
};
|
|
2700
2700
|
}).filter(Boolean), p = d?.map((e) => {
|
|
2701
|
-
let t = e.as === "date" ?
|
|
2701
|
+
let t = e.as === "date" ? Ae(e) : Ve(e?.value);
|
|
2702
2702
|
return e.as === "date" && t === void 0 ? null : {
|
|
2703
2703
|
columnName: s.dependOnOptions.find((t) => e.label === t.filter?.value)?.column || "",
|
|
2704
2704
|
value: t,
|
|
2705
2705
|
as: e.as
|
|
2706
2706
|
};
|
|
2707
2707
|
}).filter(Boolean);
|
|
2708
|
-
s.isClientScoped && a &&
|
|
2708
|
+
s.isClientScoped && a && de && !g && o === "TABLE" && s.clientColumn?.name?.value && s.clientColumn?.datatype?.value && f.push({
|
|
2709
2709
|
columnName: s.clientColumn?.name?.value,
|
|
2710
2710
|
value: a,
|
|
2711
2711
|
as: s.clientColumn?.datatype?.value
|
|
@@ -2713,14 +2713,14 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2713
2713
|
let m = [...f, ...p];
|
|
2714
2714
|
r.push({
|
|
2715
2715
|
object: {
|
|
2716
|
-
wId:
|
|
2716
|
+
wId: D,
|
|
2717
2717
|
tableName: c ? "" : s?.table?.value,
|
|
2718
2718
|
columnName: c ? s?.customColumnName || "" : s?.column?.value || "",
|
|
2719
2719
|
filter: m,
|
|
2720
2720
|
customTable: l,
|
|
2721
2721
|
aggregate: c ? "" : s?.column?.aggregate || "",
|
|
2722
2722
|
limit: "1",
|
|
2723
|
-
datasourceId:
|
|
2723
|
+
datasourceId: ge,
|
|
2724
2724
|
databaseName: o === "MULTI_DATABASE" && a || ""
|
|
2725
2725
|
},
|
|
2726
2726
|
element: s
|
|
@@ -2729,177 +2729,177 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2729
2729
|
return r;
|
|
2730
2730
|
}, [
|
|
2731
2731
|
t?.datasetMetricSettings?.metricVariables,
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2732
|
+
Sr,
|
|
2733
|
+
G,
|
|
2734
|
+
de,
|
|
2735
|
+
D,
|
|
2736
2736
|
o,
|
|
2737
2737
|
a,
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
]),
|
|
2738
|
+
g,
|
|
2739
|
+
ge
|
|
2740
|
+
]), Tr = P(() => JSON.stringify(Cr), [Cr]), Dr = F(null), kr = F(0), Ar = F({
|
|
2741
2741
|
clientId: a,
|
|
2742
|
-
encryptedClientId:
|
|
2743
|
-
isFrontendApp:
|
|
2744
|
-
token:
|
|
2742
|
+
encryptedClientId: y,
|
|
2743
|
+
isFrontendApp: _,
|
|
2744
|
+
token: ut
|
|
2745
2745
|
});
|
|
2746
|
-
|
|
2747
|
-
let
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
let e =
|
|
2751
|
-
if (
|
|
2752
|
-
let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } =
|
|
2746
|
+
Ar.current.clientId = a, Ar.current.encryptedClientId = y, Ar.current.isFrontendApp = _, Ar.current.token = ut;
|
|
2747
|
+
let jr = F(xr);
|
|
2748
|
+
jr.current = xr, N(() => {
|
|
2749
|
+
kr.current += 1;
|
|
2750
|
+
let e = kr.current, t = () => kr.current !== e;
|
|
2751
|
+
if (Cr?.length) {
|
|
2752
|
+
let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } = Ar.current;
|
|
2753
2753
|
Ui({
|
|
2754
|
-
entries:
|
|
2755
|
-
fetchColumnValues:
|
|
2754
|
+
entries: Cr,
|
|
2755
|
+
fetchColumnValues: jr.current,
|
|
2756
2756
|
ctx: {
|
|
2757
2757
|
clientId: e,
|
|
2758
2758
|
encryptedClientId: n,
|
|
2759
2759
|
isFrontendApp: r,
|
|
2760
2760
|
token: i
|
|
2761
2761
|
},
|
|
2762
|
-
onSeed: (e) =>
|
|
2763
|
-
onResolved: (e, t) =>
|
|
2762
|
+
onSeed: (e) => _n(e),
|
|
2763
|
+
onResolved: (e, t) => _n((n) => ({
|
|
2764
2764
|
...n,
|
|
2765
2765
|
[e]: t
|
|
2766
2766
|
})),
|
|
2767
|
-
onLoading: (e) =>
|
|
2767
|
+
onLoading: (e) => yt(e),
|
|
2768
2768
|
onSettle: () => {
|
|
2769
|
-
|
|
2770
|
-
|
|
2769
|
+
Dr.current && clearTimeout(Dr.current), Dr.current = setTimeout(() => {
|
|
2770
|
+
Dr.current = null, yt(!1);
|
|
2771
2771
|
}, 200);
|
|
2772
2772
|
},
|
|
2773
2773
|
isCancelled: t
|
|
2774
2774
|
}).catch(() => {});
|
|
2775
2775
|
}
|
|
2776
2776
|
return () => {
|
|
2777
|
-
|
|
2777
|
+
kr.current += 1, Dr.current &&= (clearTimeout(Dr.current), null);
|
|
2778
2778
|
};
|
|
2779
|
-
}, [
|
|
2780
|
-
let
|
|
2781
|
-
|
|
2782
|
-
let
|
|
2779
|
+
}, [Tr]);
|
|
2780
|
+
let Nr = P(() => (t?.datasetMetricSettings)?.newDatasetSettings?.selectedDims?.[0]?.name, [t]);
|
|
2781
|
+
P(() => ne(t?.datasetMetricSettings?.selectedDimensions?.[V.length < t?.datasetMetricSettings?.selectedDimensions?.length ? V.length : 0] || ""), [t?.datasetMetricSettings, V]);
|
|
2782
|
+
let Pr = P(() => {
|
|
2783
2783
|
let e = t?.drillDownSettings?.isEnableGroupBy;
|
|
2784
|
-
return
|
|
2784
|
+
return W ? [...z?.length ? z : [], ..._r({
|
|
2785
2785
|
filters: u,
|
|
2786
2786
|
metricId: t?.id,
|
|
2787
2787
|
isGroupByEnabled: e,
|
|
2788
2788
|
enableCrossFilterBeforeDrill: !0
|
|
2789
|
-
})] : e ?
|
|
2789
|
+
})] : e ? z || [] : [...z?.length ? z : [], ...u || []];
|
|
2790
2790
|
}, [
|
|
2791
2791
|
u,
|
|
2792
2792
|
t?.id,
|
|
2793
|
-
|
|
2793
|
+
W,
|
|
2794
2794
|
t?.drillDownSettings?.isEnableGroupBy,
|
|
2795
|
-
|
|
2796
|
-
]),
|
|
2795
|
+
z
|
|
2796
|
+
]), Fr = M((e = []) => e.filter((e) => e.isAddOnMetrics).map((e) => s ? {
|
|
2797
2797
|
...e,
|
|
2798
|
-
dimensionColumn:
|
|
2799
|
-
measureColumn:
|
|
2798
|
+
dimensionColumn: K?.xAxis || "",
|
|
2799
|
+
measureColumn: K?.yAxisList?.[0] || "",
|
|
2800
2800
|
options: e.datatype === "date" ? e.options : [],
|
|
2801
2801
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2802
2802
|
} : {
|
|
2803
2803
|
...e,
|
|
2804
|
-
dimensionColumn:
|
|
2805
|
-
measureColumn:
|
|
2804
|
+
dimensionColumn: K?.xAxis || "",
|
|
2805
|
+
measureColumn: K?.yAxisList?.[0] || "",
|
|
2806
2806
|
value: e.isAppFilter ? e.datatype === "date" ? qe(c?.values?.[e.name], e?.datePresetOptions || e?.presetDateOptions) || (e?.options)?.find((t) => t.name === (c?.values?.[e.name] ?? e.value)) : c?.values?.[e.name] ?? e.value : e.value,
|
|
2807
|
-
options: e.datatype === "date" ? e?.options?.map((t) =>
|
|
2807
|
+
options: e.datatype === "date" ? e?.options?.map((t) => Oe === "ind" && e.datatype === "date" ? {
|
|
2808
2808
|
...t,
|
|
2809
2809
|
isFiscal: !0
|
|
2810
2810
|
} : t) : [],
|
|
2811
2811
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2812
|
-
}).filter((e) =>
|
|
2812
|
+
}).filter((e) => On(e)), [
|
|
2813
2813
|
c?.values,
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2814
|
+
Oe,
|
|
2815
|
+
K?.xAxis,
|
|
2816
|
+
K?.yAxisList,
|
|
2817
2817
|
s,
|
|
2818
|
-
|
|
2818
|
+
On
|
|
2819
2819
|
]);
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
}, [
|
|
2823
|
-
let
|
|
2824
|
-
|
|
2825
|
-
let e =
|
|
2826
|
-
if (
|
|
2820
|
+
P(() => Fr(Pr), [Fr, Pr]), N(() => {
|
|
2821
|
+
Pr?.some((e) => e.isAddOnMetrics) ? hn(Fr(Pr)) : hn([]);
|
|
2822
|
+
}, [Fr, Pr]);
|
|
2823
|
+
let Ir = P(() => K?.chartType === A.singleValue && !!K?.customSettings?.comparisonValueShow && !!K?.customSettings?.comparisonTimeGrain && !!K?.customSettings?.comparisonTimePeriod && !!K?.singleValue, [K]);
|
|
2824
|
+
N(() => {
|
|
2825
|
+
let e = X;
|
|
2826
|
+
if (En({
|
|
2827
2827
|
data: [],
|
|
2828
2828
|
error: "",
|
|
2829
2829
|
isLoading: !1,
|
|
2830
2830
|
currentValue: ""
|
|
2831
|
-
}),
|
|
2831
|
+
}), K?.chartType === A.table) {
|
|
2832
2832
|
let t = e?.totalRecords;
|
|
2833
|
-
typeof t == "number" &&
|
|
2833
|
+
typeof t == "number" && Ft(t);
|
|
2834
2834
|
}
|
|
2835
2835
|
p("metric-query-response-applied", {
|
|
2836
2836
|
metricId: t?.id,
|
|
2837
2837
|
metricName: t?.name,
|
|
2838
|
-
chartType:
|
|
2839
|
-
rowCount:
|
|
2840
|
-
columns: Object.keys(
|
|
2838
|
+
chartType: K?.chartType,
|
|
2839
|
+
rowCount: Z?.length || 0,
|
|
2840
|
+
columns: Object.keys(Z?.[0] || {}),
|
|
2841
2841
|
totalRecords: e?.totalRecords,
|
|
2842
|
-
truncation:
|
|
2843
|
-
drillConfig:
|
|
2842
|
+
truncation: ir,
|
|
2843
|
+
drillConfig: S(H?.configV2)
|
|
2844
2844
|
});
|
|
2845
|
-
let n = !!
|
|
2846
|
-
if (t?.datasetMetricSettings?.isUseRawSQL && !(
|
|
2847
|
-
let e = Object.keys(
|
|
2848
|
-
|
|
2845
|
+
let n = !!H?.isEnableGroupBy && !!H?.configV2?.isEnable && !!H?.configV2?.levels?.some((e) => e?.isEnable);
|
|
2846
|
+
if (t?.datasetMetricSettings?.isUseRawSQL && !(Dn && n)) {
|
|
2847
|
+
let e = Object.keys(Z?.[0] || {});
|
|
2848
|
+
q((t) => ({
|
|
2849
2849
|
...t,
|
|
2850
2850
|
yAxisList: e.length ? e : t?.yAxisList || []
|
|
2851
2851
|
}));
|
|
2852
2852
|
}
|
|
2853
2853
|
let r = e?.metaData;
|
|
2854
|
-
|
|
2854
|
+
sn(Le(r?.groupbyColumnList)), Jt((e) => ({
|
|
2855
2855
|
...e,
|
|
2856
2856
|
report: "",
|
|
2857
2857
|
isLoading: e?.isLoading,
|
|
2858
2858
|
isOpen: e?.isOpen
|
|
2859
2859
|
}));
|
|
2860
2860
|
}, [
|
|
2861
|
-
|
|
2861
|
+
X,
|
|
2862
2862
|
t?.datasetMetricSettings,
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
]),
|
|
2869
|
-
t?.datasetMetricSettings?.createdSorts?.length ?
|
|
2870
|
-
}, [t?.datasetMetricSettings?.createdSorts?.length]),
|
|
2871
|
-
|
|
2863
|
+
Z,
|
|
2864
|
+
ir,
|
|
2865
|
+
Dn,
|
|
2866
|
+
H?.isEnableGroupBy,
|
|
2867
|
+
H?.configV2
|
|
2868
|
+
]), N(() => {
|
|
2869
|
+
t?.datasetMetricSettings?.createdSorts?.length ? yn(!0) : yn(!1);
|
|
2870
|
+
}, [t?.datasetMetricSettings?.createdSorts?.length]), N(() => {
|
|
2871
|
+
K?.chartType === A.timeSeries && K?.timeSeriesSettings?.groupBySettings?.value && !J && q((e) => ({
|
|
2872
2872
|
...e,
|
|
2873
|
-
xAxis: `${
|
|
2873
|
+
xAxis: `${K?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase()} of ${Nr}`
|
|
2874
2874
|
}));
|
|
2875
2875
|
}, [
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
]),
|
|
2881
|
-
if (
|
|
2882
|
-
let e = t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics || [], n = Object?.keys(
|
|
2883
|
-
|
|
2876
|
+
Z,
|
|
2877
|
+
K?.chartType,
|
|
2878
|
+
K?.timeSeriesSettings,
|
|
2879
|
+
J
|
|
2880
|
+
]), N(() => {
|
|
2881
|
+
if (K?.isEnableComparisonFilter && [A.line].includes(K?.chartType)) {
|
|
2882
|
+
let e = t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics || [], n = Object?.keys(Z?.[0] || {});
|
|
2883
|
+
q((t) => ({
|
|
2884
2884
|
...t,
|
|
2885
2885
|
yAxisList: [...n.filter((t) => e?.some((e) => t.startsWith(e.alias)))]
|
|
2886
2886
|
}));
|
|
2887
2887
|
}
|
|
2888
2888
|
}, [
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2889
|
+
Z,
|
|
2890
|
+
K?.isEnableComparisonFilter,
|
|
2891
|
+
R,
|
|
2892
|
+
K?.chartType
|
|
2893
2893
|
]);
|
|
2894
|
-
let
|
|
2895
|
-
|
|
2894
|
+
let Rr = M((e, n, r, a, o, s) => {
|
|
2895
|
+
w("metric-filter-applied", {
|
|
2896
2896
|
metricId: t?.id,
|
|
2897
2897
|
hasCustomValue: !!a,
|
|
2898
2898
|
hasStringValues: !!o?.length,
|
|
2899
2899
|
stringValueCount: o?.length || 0,
|
|
2900
2900
|
hasTimeGrain: !!s,
|
|
2901
|
-
rlsConditionCount:
|
|
2902
|
-
}),
|
|
2901
|
+
rlsConditionCount: z?.length || 0
|
|
2902
|
+
}), ue?.(i, t?.id), Lt(a ? (t) => t?.map((t) => t.name === e ? {
|
|
2903
2903
|
...t,
|
|
2904
2904
|
value: n,
|
|
2905
2905
|
options: t.options?.map((e) => n === e.name ? {
|
|
@@ -2936,95 +2936,95 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
2936
2936
|
label: r || n
|
|
2937
2937
|
}
|
|
2938
2938
|
} : t));
|
|
2939
|
-
}, []),
|
|
2939
|
+
}, []), zr = M((e) => {
|
|
2940
2940
|
e?.event && e?.event?.event?.preventDefault(), p("chart-click-params-captured", {
|
|
2941
2941
|
metricId: t?.id,
|
|
2942
2942
|
metricName: t?.name,
|
|
2943
|
-
chartType:
|
|
2943
|
+
chartType: K?.chartType,
|
|
2944
2944
|
name: e?.name,
|
|
2945
2945
|
value: e?.value,
|
|
2946
2946
|
seriesName: e?.seriesName,
|
|
2947
2947
|
dataIndex: e?.dataIndex,
|
|
2948
|
-
drillConfig:
|
|
2949
|
-
}),
|
|
2948
|
+
drillConfig: S(H?.configV2)
|
|
2949
|
+
}), Ht(e);
|
|
2950
2950
|
}, [
|
|
2951
2951
|
t?.id,
|
|
2952
2952
|
t?.name,
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
]),
|
|
2956
|
-
let e = Array.isArray(
|
|
2953
|
+
K?.chartType,
|
|
2954
|
+
H?.configV2
|
|
2955
|
+
]), Q = P(() => {
|
|
2956
|
+
let e = Array.isArray(Z) && Z.length && B?.name != null ? Z?.map((e) => Object.entries(e).find(([, e]) => (typeof e == "number" && typeof B?.name == "string" ? e?.toString() : e) === B.name)?.[0]).filter((e) => e)[0] : "";
|
|
2957
2957
|
if (!e) return e;
|
|
2958
|
-
let n = t?.datasetMetricSettings?.newDatasetSettings, r = [...n?.selectedDims || [], ...n?.selectedMetrics || []], i =
|
|
2959
|
-
return
|
|
2958
|
+
let n = t?.datasetMetricSettings?.newDatasetSettings, r = [...n?.selectedDims || [], ...n?.selectedMetrics || []], i = H?.configV2?.levels?.flatMap((e) => e?.dimensions || []) || [];
|
|
2959
|
+
return Qe(e, {
|
|
2960
2960
|
selectedColumns: r,
|
|
2961
2961
|
levelColumns: i,
|
|
2962
2962
|
dbName: t?.companyIntegration?.name
|
|
2963
2963
|
});
|
|
2964
2964
|
}, [
|
|
2965
|
-
|
|
2966
|
-
|
|
2965
|
+
Z,
|
|
2966
|
+
B?.name,
|
|
2967
2967
|
t?.datasetMetricSettings,
|
|
2968
2968
|
t?.companyIntegration?.name,
|
|
2969
|
-
|
|
2970
|
-
]), Br =
|
|
2971
|
-
if (!
|
|
2972
|
-
let e =
|
|
2969
|
+
H?.configV2?.levels
|
|
2970
|
+
]), Br = P(() => {
|
|
2971
|
+
if (!B) return;
|
|
2972
|
+
let e = K?.isMultiDimension || K?.isDynamicSeries ? K?.seriesField : void 0, t = e === "ungrouped" ? void 0 : e, n = !t && typeof B.seriesName == "string" ? B.seriesName : K?.yAxisList?.[0] || K?.singleValue, r = et(K);
|
|
2973
2973
|
return Hr({
|
|
2974
|
-
params:
|
|
2975
|
-
axisDimension:
|
|
2974
|
+
params: B,
|
|
2975
|
+
axisDimension: Q ? { columnName: Q } : void 0,
|
|
2976
2976
|
seriesDimension: t ? { columnName: t } : void 0,
|
|
2977
2977
|
measure: n ? { columnName: n } : void 0,
|
|
2978
2978
|
formatMeasure: r ? (e) => r(e, n) : void 0
|
|
2979
2979
|
});
|
|
2980
2980
|
}, [
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
]), Vr =
|
|
2981
|
+
B,
|
|
2982
|
+
Q,
|
|
2983
|
+
K
|
|
2984
|
+
]), Vr = P(() => {
|
|
2985
2985
|
let e = t?.datasetMetricSettings?.newDatasetSettings;
|
|
2986
2986
|
return {
|
|
2987
2987
|
selectedDims: e?.selectedDims,
|
|
2988
2988
|
selectedMetrics: e?.selectedMetrics,
|
|
2989
|
-
levelDimensions:
|
|
2989
|
+
levelDimensions: H?.configV2?.levels?.flatMap((e) => e?.dimensions || []) || []
|
|
2990
2990
|
};
|
|
2991
|
-
}, [
|
|
2991
|
+
}, [H?.configV2?.levels, t?.datasetMetricSettings]), Ur = M((e) => ae({
|
|
2992
2992
|
filter: e,
|
|
2993
2993
|
...Vr
|
|
2994
|
-
}), [Vr]), Wr =
|
|
2995
|
-
if (
|
|
2996
|
-
let e =
|
|
2997
|
-
return (e.length ? e :
|
|
2994
|
+
}), [Vr]), Wr = P(() => {
|
|
2995
|
+
if (en.current !== void 0 && V === $t.current) return en.current;
|
|
2996
|
+
let e = H?.configV2?.levels?.find((e) => e?.isEnable)?.filters || [];
|
|
2997
|
+
return (e.length ? e : V).map(Ur);
|
|
2998
2998
|
}, [
|
|
2999
|
-
|
|
3000
|
-
|
|
2999
|
+
H?.configV2?.levels,
|
|
3000
|
+
V,
|
|
3001
3001
|
Ur,
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
]), Gr =
|
|
3005
|
-
columnName:
|
|
3002
|
+
$t,
|
|
3003
|
+
en
|
|
3004
|
+
]), Gr = P(() => Pe({
|
|
3005
|
+
columnName: Q,
|
|
3006
3006
|
...Vr
|
|
3007
|
-
}), [
|
|
3007
|
+
}), [Q, Vr]), { getUnderlyingData: Kr } = Bn({
|
|
3008
3008
|
clientName: a,
|
|
3009
3009
|
dbName: t?.companyIntegration?.name,
|
|
3010
3010
|
tenancyType: o,
|
|
3011
|
-
values:
|
|
3011
|
+
values: An,
|
|
3012
3012
|
companyId: t?.companyId,
|
|
3013
|
-
query:
|
|
3014
|
-
workspaceId:
|
|
3013
|
+
query: _e(t?.query, t?.companyId),
|
|
3014
|
+
workspaceId: D,
|
|
3015
3015
|
metricId: t?.id,
|
|
3016
|
-
dashboardId:
|
|
3017
|
-
rlsConditions:
|
|
3016
|
+
dashboardId: T,
|
|
3017
|
+
rlsConditions: G,
|
|
3018
3018
|
globalFilters: n,
|
|
3019
|
-
isAllClient: !!
|
|
3020
|
-
dataMartRelationships:
|
|
3019
|
+
isAllClient: !!g,
|
|
3020
|
+
dataMartRelationships: kn,
|
|
3021
3021
|
customSql: t?.clickActions?.underlyingData?.sql,
|
|
3022
|
-
isEnableCustomSQL:
|
|
3023
|
-
datasourceId:
|
|
3022
|
+
isEnableCustomSQL: K?.chartType === A.singleValue && t?.clickActions?.underlyingData?.isEnable && t?.clickActions?.underlyingData?.sql,
|
|
3023
|
+
datasourceId: ge,
|
|
3024
3024
|
drillFilters: Wr,
|
|
3025
|
-
token:
|
|
3026
|
-
isFrontendApp:
|
|
3027
|
-
encryptedClientId:
|
|
3025
|
+
token: ut || "",
|
|
3026
|
+
isFrontendApp: _,
|
|
3027
|
+
encryptedClientId: _ ? y || "" : a || ""
|
|
3028
3028
|
}), qr = async (e, n, r, i, s, c) => {
|
|
3029
3029
|
p("drill-config-change-start", {
|
|
3030
3030
|
metricId: t?.id,
|
|
@@ -3034,14 +3034,14 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3034
3034
|
clickName: n?.name,
|
|
3035
3035
|
clickValue: n?.value,
|
|
3036
3036
|
rowFilters: n?.rowFilters,
|
|
3037
|
-
incomingConfig:
|
|
3038
|
-
stateConfig:
|
|
3037
|
+
incomingConfig: S(e),
|
|
3038
|
+
stateConfig: S(H?.configV2)
|
|
3039
3039
|
});
|
|
3040
3040
|
let d = t?.datasetMetricSettings;
|
|
3041
|
-
if (!e || !
|
|
3041
|
+
if (!e || !Dn && !d?.newDatasetSettings?.configuration || !t?.companyIntegration?.name) {
|
|
3042
3042
|
p("drill-config-change-skipped", {
|
|
3043
3043
|
metricId: t?.id,
|
|
3044
|
-
hasStateConfig: !!
|
|
3044
|
+
hasStateConfig: !!H?.configV2,
|
|
3045
3045
|
hasIncomingConfig: !!e,
|
|
3046
3046
|
hasDatasetConfiguration: !!d?.newDatasetSettings?.configuration,
|
|
3047
3047
|
integrationName: t?.companyIntegration?.name
|
|
@@ -3051,8 +3051,8 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3051
3051
|
});
|
|
3052
3052
|
return;
|
|
3053
3053
|
}
|
|
3054
|
-
let f = n?.name,
|
|
3055
|
-
config:
|
|
3054
|
+
let f = n?.name, h = (e?.levels || []).find((e) => r ? e?.index === r : e?.isEnable), g = h?.dimensions?.[0]?.alias, _ = n?.rowFilters || [], { config: v, outcome: y } = ui({
|
|
3055
|
+
config: Dn && bi(e) || e,
|
|
3056
3056
|
clickedLevelIndex: r,
|
|
3057
3057
|
isReset: i,
|
|
3058
3058
|
clickedValue: f,
|
|
@@ -3063,12 +3063,12 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3063
3063
|
if (p("drill-config-level-change-resolved", {
|
|
3064
3064
|
metricId: t?.id,
|
|
3065
3065
|
clickedLevelIndex: r,
|
|
3066
|
-
outcome:
|
|
3066
|
+
outcome: y,
|
|
3067
3067
|
filterValue: f,
|
|
3068
3068
|
rowFilters: n?.rowFilters,
|
|
3069
|
-
resolvedConfig:
|
|
3070
|
-
}),
|
|
3071
|
-
|
|
3069
|
+
resolvedConfig: S(v)
|
|
3070
|
+
}), y === "unrepresentable") {
|
|
3071
|
+
St(hi({
|
|
3072
3072
|
kind: "none",
|
|
3073
3073
|
reason: "blank-value"
|
|
3074
3074
|
})), m("metric.drill_blocked", {
|
|
@@ -3077,15 +3077,15 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3077
3077
|
});
|
|
3078
3078
|
return;
|
|
3079
3079
|
}
|
|
3080
|
-
let
|
|
3081
|
-
if (
|
|
3082
|
-
config:
|
|
3083
|
-
selectedDims:
|
|
3080
|
+
let b = v, x = [...s || [], ...nn], C = x.length ? [...d?.newDatasetSettings?.selectedDims || [], ...x] : d?.newDatasetSettings?.selectedDims;
|
|
3081
|
+
if (b = Dn ? b : Be({
|
|
3082
|
+
config: b,
|
|
3083
|
+
selectedDims: C,
|
|
3084
3084
|
selectedMetrics: d?.newDatasetSettings?.selectedMetrics,
|
|
3085
|
-
previousSelectedDims:
|
|
3085
|
+
previousSelectedDims: C,
|
|
3086
3086
|
previousSelectedMetrics: d?.newDatasetSettings?.selectedMetrics
|
|
3087
|
-
}) ||
|
|
3088
|
-
|
|
3087
|
+
}) || b, y === "descend" && si(b?.levels?.find((e) => e?.isEnable))) {
|
|
3088
|
+
St(hi({
|
|
3089
3089
|
kind: "none",
|
|
3090
3090
|
reason: "level-without-measure"
|
|
3091
3091
|
})), m("metric.drill_blocked", {
|
|
@@ -3094,76 +3094,76 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3094
3094
|
});
|
|
3095
3095
|
return;
|
|
3096
3096
|
}
|
|
3097
|
-
|
|
3098
|
-
let
|
|
3099
|
-
parentSettings:
|
|
3100
|
-
levelSettings:
|
|
3101
|
-
measures:
|
|
3102
|
-
}) ||
|
|
3103
|
-
...
|
|
3104
|
-
xAxis:
|
|
3105
|
-
yAxisList:
|
|
3106
|
-
chartType:
|
|
3107
|
-
},
|
|
3097
|
+
St(null);
|
|
3098
|
+
let w = b?.levels?.find((e) => e?.isEnable), ee = !!b?.levels?.[b?.levels?.length - 1]?.isEnable, T = b?.levels?.[0]?.isEnable, E = ii({
|
|
3099
|
+
parentSettings: K,
|
|
3100
|
+
levelSettings: w?.chartSettings,
|
|
3101
|
+
measures: w?.measures
|
|
3102
|
+
}) || K, D = E?.chartType === A.table, te = [...w?.dimensions?.map((e) => e.alias) || [], ...w?.measures?.map((e) => e.alias) || []], O = {
|
|
3103
|
+
...E,
|
|
3104
|
+
xAxis: w?.dimensions?.[0]?.alias || "",
|
|
3105
|
+
yAxisList: ee && !E?.chartType || D ? te : w?.measures?.map((e) => e.alias) || [],
|
|
3106
|
+
chartType: ee && !E?.chartType ? A.table : E?.chartType
|
|
3107
|
+
}, ne = `${w?.dimensions?.[0]?.table?.schemaName}.${w?.dimensions?.[0]?.table?.tableName}`;
|
|
3108
3108
|
if (p("drill-config-next-state-ready", {
|
|
3109
3109
|
metricId: t?.id,
|
|
3110
3110
|
activeLevel: {
|
|
3111
|
-
index:
|
|
3112
|
-
name:
|
|
3113
|
-
filters:
|
|
3111
|
+
index: w?.index,
|
|
3112
|
+
name: w?.name,
|
|
3113
|
+
filters: w?.filters
|
|
3114
3114
|
},
|
|
3115
|
-
isLastLevel:
|
|
3116
|
-
isFirstLevelActive:
|
|
3117
|
-
chartType:
|
|
3118
|
-
xAxis:
|
|
3119
|
-
yAxisList:
|
|
3120
|
-
tableColumns:
|
|
3121
|
-
updatedConfig: b
|
|
3122
|
-
}),
|
|
3115
|
+
isLastLevel: ee,
|
|
3116
|
+
isFirstLevelActive: T,
|
|
3117
|
+
chartType: O?.chartType,
|
|
3118
|
+
xAxis: O?.xAxis,
|
|
3119
|
+
yAxisList: O?.yAxisList,
|
|
3120
|
+
tableColumns: te,
|
|
3121
|
+
updatedConfig: S(b)
|
|
3122
|
+
}), U((e) => ({
|
|
3123
3123
|
...e,
|
|
3124
3124
|
configV2: {
|
|
3125
|
-
...
|
|
3126
|
-
levels:
|
|
3125
|
+
...b || {},
|
|
3126
|
+
levels: b?.levels?.map((e) => e.index === w?.index ? {
|
|
3127
3127
|
...e,
|
|
3128
|
-
chartSettings:
|
|
3128
|
+
chartSettings: O
|
|
3129
3129
|
} : e) || []
|
|
3130
3130
|
}
|
|
3131
|
-
})),
|
|
3132
|
-
let e =
|
|
3131
|
+
})), q((e) => O), y === "descend" || y === "adhoc-descend") {
|
|
3132
|
+
let e = Mt.current, t = e ? e.querySelector("[data-chart-engine=\"v2\"]") ? "v2" : "v1" : void 0;
|
|
3133
3133
|
m("metric.drilled", {
|
|
3134
|
-
level:
|
|
3134
|
+
level: b.levels?.findIndex((e) => e.isEnable) ?? -1,
|
|
3135
3135
|
...t ? { engine: t } : {}
|
|
3136
3136
|
});
|
|
3137
3137
|
}
|
|
3138
3138
|
if (p("drill-config-state-committed", {
|
|
3139
3139
|
metricId: t?.id,
|
|
3140
|
-
chartType:
|
|
3141
|
-
activeLevelIndex:
|
|
3142
|
-
drillConfig: b
|
|
3143
|
-
}),
|
|
3144
|
-
let e =
|
|
3140
|
+
chartType: O?.chartType,
|
|
3141
|
+
activeLevelIndex: w?.index,
|
|
3142
|
+
drillConfig: S(b)
|
|
3143
|
+
}), an && !Dn) {
|
|
3144
|
+
let e = Er({
|
|
3145
3145
|
existing: u,
|
|
3146
3146
|
isReset: i,
|
|
3147
3147
|
levelIndex: r,
|
|
3148
|
-
hasCurrentLevel: !!
|
|
3148
|
+
hasCurrentLevel: !!h,
|
|
3149
3149
|
filterValue: f,
|
|
3150
|
-
columnName:
|
|
3151
|
-
rowFilters:
|
|
3150
|
+
columnName: g,
|
|
3151
|
+
rowFilters: _,
|
|
3152
3152
|
selectedDims: d?.newDatasetSettings?.selectedDims,
|
|
3153
|
-
activeLevelTableName:
|
|
3153
|
+
activeLevelTableName: ne,
|
|
3154
3154
|
tenancyLevel: o,
|
|
3155
3155
|
clientId: a,
|
|
3156
|
-
sourceMetricId:
|
|
3157
|
-
}), n = !i && !r ?
|
|
3158
|
-
columnName:
|
|
3159
|
-
rowFilters:
|
|
3156
|
+
sourceMetricId: W ? t?.id : void 0
|
|
3157
|
+
}), n = !i && !r ? wr({
|
|
3158
|
+
columnName: g,
|
|
3159
|
+
rowFilters: _,
|
|
3160
3160
|
selectedDims: d?.newDatasetSettings?.selectedDims
|
|
3161
3161
|
}) : void 0;
|
|
3162
3162
|
p("drill-cross-filter-state-committed", {
|
|
3163
3163
|
metricId: t?.id,
|
|
3164
3164
|
crossFilterCount: e?.length || 0,
|
|
3165
3165
|
drillCrossFilters: e
|
|
3166
|
-
}), n ? (
|
|
3166
|
+
}), n ? (St({
|
|
3167
3167
|
title: "Filter unavailable",
|
|
3168
3168
|
body: n
|
|
3169
3169
|
}), m("metric.drill_blocked", {
|
|
@@ -3173,14 +3173,14 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3173
3173
|
})) : l?.(e);
|
|
3174
3174
|
}
|
|
3175
3175
|
}, Jr = ({ columnName: e, value: n, mode: r = "only" }) => {
|
|
3176
|
-
if (!
|
|
3177
|
-
let i = t?.datasetMetricSettings, s =
|
|
3176
|
+
if (!an) return;
|
|
3177
|
+
let i = t?.datasetMetricSettings, s = wr({
|
|
3178
3178
|
columnName: e,
|
|
3179
3179
|
selectedDims: i?.newDatasetSettings?.selectedDims,
|
|
3180
3180
|
requiresSchemaMetadata: !0
|
|
3181
3181
|
});
|
|
3182
3182
|
if (s) {
|
|
3183
|
-
|
|
3183
|
+
St({
|
|
3184
3184
|
title: "Filter unavailable",
|
|
3185
3185
|
body: s
|
|
3186
3186
|
}), m("metric.drill_blocked", {
|
|
@@ -3190,7 +3190,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3190
3190
|
});
|
|
3191
3191
|
return;
|
|
3192
3192
|
}
|
|
3193
|
-
let c =
|
|
3193
|
+
let c = Mr({
|
|
3194
3194
|
existing: u,
|
|
3195
3195
|
columnName: e,
|
|
3196
3196
|
value: n,
|
|
@@ -3198,7 +3198,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3198
3198
|
selectedDims: i?.newDatasetSettings?.selectedDims,
|
|
3199
3199
|
tenancyLevel: o,
|
|
3200
3200
|
clientId: a,
|
|
3201
|
-
sourceMetricId:
|
|
3201
|
+
sourceMetricId: W ? t?.id : void 0
|
|
3202
3202
|
});
|
|
3203
3203
|
p("point-cross-filter-committed", {
|
|
3204
3204
|
metricId: t?.id,
|
|
@@ -3208,13 +3208,13 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3208
3208
|
}), l?.(c);
|
|
3209
3209
|
}, Yr = ({ columnName: e, value: n, mode: r = "only" }) => {
|
|
3210
3210
|
if (!t?.id) return;
|
|
3211
|
-
let i = t?.datasetMetricSettings, s =
|
|
3211
|
+
let i = t?.datasetMetricSettings, s = wr({
|
|
3212
3212
|
columnName: e,
|
|
3213
3213
|
selectedDims: i?.newDatasetSettings?.selectedDims,
|
|
3214
3214
|
requiresSchemaMetadata: !0
|
|
3215
3215
|
});
|
|
3216
3216
|
if (s) {
|
|
3217
|
-
|
|
3217
|
+
St({
|
|
3218
3218
|
title: "Filter unavailable",
|
|
3219
3219
|
body: s
|
|
3220
3220
|
}), m("metric.drill_blocked", {
|
|
@@ -3224,8 +3224,8 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3224
3224
|
});
|
|
3225
3225
|
return;
|
|
3226
3226
|
}
|
|
3227
|
-
let c =
|
|
3228
|
-
existing:
|
|
3227
|
+
let c = Mr({
|
|
3228
|
+
existing: k,
|
|
3229
3229
|
columnName: e,
|
|
3230
3230
|
value: n,
|
|
3231
3231
|
mode: r,
|
|
@@ -3238,7 +3238,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3238
3238
|
columnName: e,
|
|
3239
3239
|
mode: r,
|
|
3240
3240
|
filterCount: c?.length || 0
|
|
3241
|
-
}),
|
|
3241
|
+
}), Se?.(t.id, c);
|
|
3242
3242
|
}, Xr = async (e, n) => {
|
|
3243
3243
|
p("drill-down-handler-start", {
|
|
3244
3244
|
metricId: t?.id,
|
|
@@ -3247,21 +3247,21 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3247
3247
|
paramsValue: e?.value,
|
|
3248
3248
|
paramsSeriesName: e?.seriesName,
|
|
3249
3249
|
rowFilters: e?.rowFilters || n,
|
|
3250
|
-
drillConfig:
|
|
3251
|
-
}), await qr(
|
|
3250
|
+
drillConfig: S(H?.configV2)
|
|
3251
|
+
}), await qr(H?.configV2, e), p("drill-down-handler-complete", {
|
|
3252
3252
|
metricId: t?.id,
|
|
3253
3253
|
metricName: t?.name
|
|
3254
3254
|
});
|
|
3255
3255
|
}, Zr = async ({ dimension: e, params: n, point: r }) => {
|
|
3256
3256
|
if (!e?.alias) return;
|
|
3257
|
-
let i = t?.datasetMetricSettings, a =
|
|
3257
|
+
let i = t?.datasetMetricSettings, a = H?.configV2, o = a?.levels || [], s = o.findIndex((e) => e?.isEnable), c = (s >= 0 ? o.slice(0, s + 1) : []).map((e) => ({
|
|
3258
3258
|
...e,
|
|
3259
3259
|
isEnable: !1
|
|
3260
3260
|
})), l = ai({
|
|
3261
3261
|
dimension: e,
|
|
3262
3262
|
measures: i?.newDatasetSettings?.selectedMetrics || [],
|
|
3263
|
-
index:
|
|
3264
|
-
chartSettings:
|
|
3263
|
+
index: De(4),
|
|
3264
|
+
chartSettings: K
|
|
3265
3265
|
}), u = {
|
|
3266
3266
|
...a || {},
|
|
3267
3267
|
isEnable: !0,
|
|
@@ -3269,33 +3269,33 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3269
3269
|
}, d = c[c.length - 1], f = {
|
|
3270
3270
|
columnName: d?.dimensions?.[0]?.alias || i?.newDatasetSettings?.selectedDims?.[0]?.alias,
|
|
3271
3271
|
parentFilters: d?.filters || [],
|
|
3272
|
-
pointFilters:
|
|
3272
|
+
pointFilters: Lr(r, Ur).filters
|
|
3273
3273
|
};
|
|
3274
3274
|
p("adhoc-drill-start", {
|
|
3275
3275
|
metricId: t?.id,
|
|
3276
3276
|
dimensionAlias: e?.alias,
|
|
3277
3277
|
clickedValue: n?.name,
|
|
3278
3278
|
seededConfig: !a,
|
|
3279
|
-
drillConfig:
|
|
3280
|
-
}),
|
|
3279
|
+
drillConfig: S(u)
|
|
3280
|
+
}), rn((t) => t.some((t) => t?.alias === e?.alias) ? t : [...t, e]), U((e) => ({
|
|
3281
3281
|
...e,
|
|
3282
3282
|
isEnableGroupBy: !0,
|
|
3283
3283
|
configV2: u
|
|
3284
3284
|
})), await qr(u, n, void 0, !1, [e], f);
|
|
3285
3285
|
}, Qr = ({ filters: e, nextLevel: r, currentValue: i }) => {
|
|
3286
|
-
let o = t?.datasetMetricSettings?.newDatasetSettings, s = o?.configuration, c = o?.selectedDims || [], l = o?.selectedMetrics || [], u = t?.datasetMetricSettings?.createdSorts || [], { headerColumns: d, nonHeaderColumns: f } = c.reduce((e, t) => (
|
|
3286
|
+
let o = t?.datasetMetricSettings?.newDatasetSettings, s = o?.configuration, c = o?.selectedDims || [], l = o?.selectedMetrics || [], u = t?.datasetMetricSettings?.createdSorts || [], { headerColumns: d, nonHeaderColumns: f } = c.reduce((e, t) => (K?.pivotTableSettings2?.headers?.includes(t.alias) ? e.headerColumns.push(t) : e.nonHeaderColumns.push(t), e), {
|
|
3287
3287
|
headerColumns: [],
|
|
3288
3288
|
nonHeaderColumns: []
|
|
3289
3289
|
}), p = e?.map((e) => `${e.columnName};;${e.value}`).join(";;");
|
|
3290
|
-
|
|
3290
|
+
En((e) => ({
|
|
3291
3291
|
...e,
|
|
3292
3292
|
data: e.data.filter((e) => e.key !== p),
|
|
3293
3293
|
error: "",
|
|
3294
3294
|
isLoading: !0,
|
|
3295
3295
|
currentValue: i
|
|
3296
3296
|
}));
|
|
3297
|
-
let m = f.slice(0, r),
|
|
3298
|
-
let t = c.find((t) => t.alias === e.columnName ||
|
|
3297
|
+
let m = f.slice(0, r), h = e?.map((e) => {
|
|
3298
|
+
let t = c.find((t) => t.alias === e.columnName || je(t) === e.columnName);
|
|
3299
3299
|
if (t) return {
|
|
3300
3300
|
alias: t.alias || "",
|
|
3301
3301
|
columnName: t.name,
|
|
@@ -3306,43 +3306,43 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3306
3306
|
value: e.value,
|
|
3307
3307
|
relationOperator: "AND"
|
|
3308
3308
|
};
|
|
3309
|
-
}).filter((e) => e),
|
|
3309
|
+
}).filter((e) => e), g = [
|
|
3310
3310
|
...m,
|
|
3311
3311
|
...l,
|
|
3312
3312
|
...d
|
|
3313
|
-
], { aggregates:
|
|
3313
|
+
], { aggregates: b, dimensions: x } = ke(g), S = fe(u), C = it(S, g), w = {
|
|
3314
3314
|
...s,
|
|
3315
|
-
dimensions:
|
|
3316
|
-
aggregates:
|
|
3317
|
-
filters: [...s.filters, ...
|
|
3318
|
-
orders:
|
|
3315
|
+
dimensions: x,
|
|
3316
|
+
aggregates: b,
|
|
3317
|
+
filters: [...s.filters, ...h],
|
|
3318
|
+
orders: C,
|
|
3319
3319
|
isApplyGlobalFilter: !0,
|
|
3320
3320
|
isApplyMetricFilter: !0,
|
|
3321
3321
|
globalFilters: n,
|
|
3322
|
-
rlsConditions:
|
|
3322
|
+
rlsConditions: G
|
|
3323
3323
|
};
|
|
3324
|
-
|
|
3324
|
+
ur({
|
|
3325
3325
|
data: {
|
|
3326
|
-
configuration:
|
|
3327
|
-
id:
|
|
3328
|
-
datasourceId:
|
|
3326
|
+
configuration: w,
|
|
3327
|
+
id: D,
|
|
3328
|
+
datasourceId: ge,
|
|
3329
3329
|
dashboardId: "",
|
|
3330
3330
|
isCreateMetric: !0
|
|
3331
3331
|
},
|
|
3332
|
-
clientId:
|
|
3333
|
-
token:
|
|
3334
|
-
isFrontendApp:
|
|
3332
|
+
clientId: _ ? y || "" : a,
|
|
3333
|
+
token: v || "",
|
|
3334
|
+
isFrontendApp: _
|
|
3335
3335
|
}, { onSuccess(e) {
|
|
3336
3336
|
let n = e?.error, r = e?.data;
|
|
3337
|
-
if (n?.message)
|
|
3337
|
+
if (n?.message) En((e) => ({
|
|
3338
3338
|
...e,
|
|
3339
3339
|
error: n?.message,
|
|
3340
3340
|
isLoading: !1,
|
|
3341
3341
|
currentValue: ""
|
|
3342
3342
|
}));
|
|
3343
3343
|
else {
|
|
3344
|
-
let e = ve(Array.isArray(r) ? r : [], c, l), n =
|
|
3345
|
-
|
|
3344
|
+
let e = ve(Array.isArray(r) ? r : [], c, l), n = at(e);
|
|
3345
|
+
En((e) => ({
|
|
3346
3346
|
data: [...e.data, {
|
|
3347
3347
|
key: p,
|
|
3348
3348
|
data: n
|
|
@@ -3350,81 +3350,81 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3350
3350
|
error: "",
|
|
3351
3351
|
isLoading: !1,
|
|
3352
3352
|
currentValue: ""
|
|
3353
|
-
})),
|
|
3353
|
+
})), q((e) => ({
|
|
3354
3354
|
...e,
|
|
3355
3355
|
pivotTableSettings2: {
|
|
3356
|
-
...
|
|
3357
|
-
dimensions:
|
|
3358
|
-
headers:
|
|
3356
|
+
...K?.pivotTableSettings2,
|
|
3357
|
+
dimensions: le(f, t?.companyIntegration?.name || ""),
|
|
3358
|
+
headers: le(d, t?.companyIntegration?.name || "")
|
|
3359
3359
|
}
|
|
3360
3360
|
}));
|
|
3361
3361
|
}
|
|
3362
3362
|
} });
|
|
3363
|
-
}, $r =
|
|
3363
|
+
}, $r = M(async (e, n) => {
|
|
3364
3364
|
p("drill-level-click-handler-start", {
|
|
3365
3365
|
metricId: t?.id,
|
|
3366
3366
|
metricName: t?.name,
|
|
3367
3367
|
clickedLevelIndex: e,
|
|
3368
3368
|
isReset: !!n,
|
|
3369
|
-
drillConfig:
|
|
3370
|
-
}), n &&
|
|
3369
|
+
drillConfig: S(H?.configV2)
|
|
3370
|
+
}), n && rn([]), St(null), await qr(H?.configV2, void 0, e, n), p("drill-level-click-handler-complete", {
|
|
3371
3371
|
metricId: t?.id,
|
|
3372
3372
|
metricName: t?.name,
|
|
3373
3373
|
clickedLevelIndex: e,
|
|
3374
3374
|
isReset: !!n
|
|
3375
3375
|
});
|
|
3376
3376
|
}, [
|
|
3377
|
-
|
|
3377
|
+
H?.configV2,
|
|
3378
3378
|
t?.id,
|
|
3379
3379
|
t?.name,
|
|
3380
|
-
|
|
3381
|
-
]), ei =
|
|
3382
|
-
if (e)
|
|
3380
|
+
rn
|
|
3381
|
+
]), ei = M((e) => {
|
|
3382
|
+
if (e) Lt((e) => [...e?.filter((e) => e.group !== `${R}`)]), It((e) => e - 1);
|
|
3383
3383
|
else {
|
|
3384
|
-
let e =
|
|
3384
|
+
let e = z.filter((e) => !e?.group)?.map((e) => ({
|
|
3385
3385
|
...e,
|
|
3386
|
-
name: `${e?.name}_${
|
|
3387
|
-
group: `${
|
|
3386
|
+
name: `${e?.name}_${R + 1}`,
|
|
3387
|
+
group: `${R + 1}`,
|
|
3388
3388
|
dependOn: e.dependOn ? {
|
|
3389
|
-
value: `${e.dependOn?.value}_${
|
|
3390
|
-
label: `${e.dependOn?.label}_${
|
|
3389
|
+
value: `${e.dependOn?.value}_${R + 1}`,
|
|
3390
|
+
label: `${e.dependOn?.label}_${R + 1}`,
|
|
3391
3391
|
customColumnName: e.dependOn?.customColumnName
|
|
3392
3392
|
} : void 0,
|
|
3393
3393
|
dependOns: e?.dependOns?.map((e) => ({
|
|
3394
|
-
value: `${e?.value}_${
|
|
3395
|
-
label: `${e?.label}_${
|
|
3394
|
+
value: `${e?.value}_${R + 1}`,
|
|
3395
|
+
label: `${e?.label}_${R + 1}`,
|
|
3396
3396
|
customColumnName: e?.customColumnName
|
|
3397
3397
|
})) || []
|
|
3398
3398
|
}));
|
|
3399
|
-
e.length && (
|
|
3399
|
+
e.length && (Lt((t) => [...t, ...e]), It((e) => e + 1));
|
|
3400
3400
|
}
|
|
3401
|
-
}, [
|
|
3402
|
-
|
|
3401
|
+
}, [z]), ti = M(async () => {
|
|
3402
|
+
qt.report ? Jt((e) => ({
|
|
3403
3403
|
...e,
|
|
3404
3404
|
isOpen: !0
|
|
3405
|
-
})) : (
|
|
3405
|
+
})) : (Jt({
|
|
3406
3406
|
report: "",
|
|
3407
3407
|
isLoading: !0,
|
|
3408
3408
|
isOpen: !0
|
|
3409
|
-
}), await
|
|
3409
|
+
}), await dr({
|
|
3410
3410
|
data: {
|
|
3411
|
-
data:
|
|
3412
|
-
wId:
|
|
3411
|
+
data: Z,
|
|
3412
|
+
wId: D
|
|
3413
3413
|
},
|
|
3414
|
-
clientId:
|
|
3415
|
-
token:
|
|
3416
|
-
isFrontendApp:
|
|
3414
|
+
clientId: _ ? y || "" : a,
|
|
3415
|
+
token: v || "",
|
|
3416
|
+
isFrontendApp: _
|
|
3417
3417
|
}, {
|
|
3418
3418
|
onSuccess(e) {
|
|
3419
3419
|
let t = e?.content;
|
|
3420
|
-
|
|
3420
|
+
Jt((e) => ({
|
|
3421
3421
|
...e,
|
|
3422
3422
|
report: t || "",
|
|
3423
3423
|
isLoading: !1
|
|
3424
3424
|
}));
|
|
3425
3425
|
},
|
|
3426
3426
|
onError() {
|
|
3427
|
-
|
|
3427
|
+
Jt((e) => ({
|
|
3428
3428
|
...e,
|
|
3429
3429
|
report: "",
|
|
3430
3430
|
isLoading: !1
|
|
@@ -3432,74 +3432,74 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3432
3432
|
}
|
|
3433
3433
|
}));
|
|
3434
3434
|
}, [
|
|
3435
|
-
|
|
3435
|
+
Z,
|
|
3436
3436
|
a,
|
|
3437
|
-
g,
|
|
3438
3437
|
_,
|
|
3439
3438
|
v,
|
|
3439
|
+
y,
|
|
3440
3440
|
a,
|
|
3441
|
-
|
|
3442
|
-
]), ni =
|
|
3443
|
-
let e = t?.datasetMetricSettings?.newDatasetSettings, n = e?.configuration, r =
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3441
|
+
qt
|
|
3442
|
+
]), ni = P(() => {
|
|
3443
|
+
let e = t?.datasetMetricSettings?.newDatasetSettings, n = e?.configuration, r = ce(Z || []), i = r, a = e?.selectedDims?.some((e) => Ie(e?.datatype)) || Xe(Z?.[0] || ""), o = e?.selectedDims?.length > 1 && e?.selectedMetrics?.length > 0, s = [
|
|
3444
|
+
A.pivot,
|
|
3445
|
+
A.pivotV2,
|
|
3446
|
+
A.pivotV3,
|
|
3447
|
+
A.timeSeries,
|
|
3448
|
+
A.treeMap,
|
|
3449
|
+
A.indianMap,
|
|
3450
|
+
A.geoBarMap,
|
|
3451
|
+
A.geoMap,
|
|
3452
|
+
A.geoScatterMap,
|
|
3453
|
+
A.worldMap
|
|
3454
3454
|
], c = !!n?.aggregates?.length && !!n?.dimensions?.length;
|
|
3455
|
-
return c && a && (i = [...r?.filter((e) => !s?.includes(e)), ...s]), c && !a && (i = [...r?.filter((e) => !s?.includes(e)), ...s?.filter((e) => e !==
|
|
3455
|
+
return c && a && (i = [...r?.filter((e) => !s?.includes(e)), ...s]), c && !a && (i = [...r?.filter((e) => !s?.includes(e)), ...s?.filter((e) => e !== A.timeSeries)]), !c && a && (i = [...r?.filter((e) => !s?.includes(e)), A.timeSeries]), !c && !a && (i = r?.filter((e) => !s?.includes(e))), H?.isEnableGroupBy && H?.configV2 && (i = i?.filter((e) => be?.includes(e))), o || (i = i?.filter((e) => e !== A.bubbleV2)), i;
|
|
3456
3456
|
}, [
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3457
|
+
Z,
|
|
3458
|
+
K?.xAxis,
|
|
3459
|
+
H?.isEnableGroupBy,
|
|
3460
|
+
H?.configV2,
|
|
3461
3461
|
t?.datasetMetricSettings?.newDatasetSettings?.configuration?.aggregates,
|
|
3462
3462
|
t?.datasetMetricSettings?.newDatasetSettings?.configuration?.dimensions
|
|
3463
3463
|
]), ri = (e) => {
|
|
3464
|
-
let n = t?.datasetMetricSettings?.newDatasetSettings, r = n?.configuration, i = n?.selectedDims || [], a = n?.selectedMetrics || [], o = t?.companyIntegration?.name, s =
|
|
3465
|
-
|
|
3466
|
-
chartAggregateColumns:
|
|
3467
|
-
chartDimensions:
|
|
3468
|
-
chartMetrics:
|
|
3469
|
-
chartSettings:
|
|
3470
|
-
chartTimeColumns:
|
|
3464
|
+
let n = t?.datasetMetricSettings?.newDatasetSettings, r = n?.configuration, i = n?.selectedDims || [], a = n?.selectedMetrics || [], o = t?.companyIntegration?.name, s = K?.enduserMeasureAndDimensions?.isEnabled;
|
|
3465
|
+
Ze({
|
|
3466
|
+
chartAggregateColumns: Ne(le(a?.filter((e) => e.configType === "AGGREGATE" && s ? K?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias) : !0) || [], o), Z || []),
|
|
3467
|
+
chartDimensions: Ne(le(i?.filter((e) => !s || K?.enduserMeasureAndDimensions?.dimensions?.some((t) => t.value === e.alias)) || [], o), Z || []),
|
|
3468
|
+
chartMetrics: Ne(le(a?.filter((e) => !s || K?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias)) || [], o), Z || []),
|
|
3469
|
+
chartSettings: K,
|
|
3470
|
+
chartTimeColumns: le(i?.filter((e) => Ie(e.datatype)), o),
|
|
3471
3471
|
chartType: e,
|
|
3472
3472
|
configAggregates: r?.aggregates,
|
|
3473
3473
|
configuration: n?.configuration,
|
|
3474
3474
|
dbName: o,
|
|
3475
3475
|
pivotHeaderColumns: [],
|
|
3476
|
-
resultData:
|
|
3477
|
-
setChartSettings:
|
|
3476
|
+
resultData: Z || [],
|
|
3477
|
+
setChartSettings: q
|
|
3478
3478
|
});
|
|
3479
|
-
}, ci =
|
|
3480
|
-
|
|
3481
|
-
|
|
3479
|
+
}, ci = P(() => Ee(z.filter((e) => e.group && e.isAddOnMetrics && !e.isHiddenInUi && !e.isAppFilter), "group"), [z]), li = P(() => K?.customSettings?.comparisonValueShow && K?.chartType === A.singleValue ? n?.filters?.find((e) => e?.as === "date") : void 0, [
|
|
3480
|
+
K?.customSettings?.comparisonValueShow,
|
|
3481
|
+
K?.chartType,
|
|
3482
3482
|
n?.filters?.find((e) => e?.as === "date")
|
|
3483
3483
|
]);
|
|
3484
|
-
|
|
3485
|
-
|
|
3484
|
+
N(() => {
|
|
3485
|
+
Z?.length && on.length ? ln(!0) : ln(!1);
|
|
3486
3486
|
}, [
|
|
3487
|
-
|
|
3488
|
-
|
|
3487
|
+
Z,
|
|
3488
|
+
on.length,
|
|
3489
3489
|
t?.integrationName,
|
|
3490
3490
|
t?.query
|
|
3491
3491
|
]);
|
|
3492
|
-
let di =
|
|
3492
|
+
let di = P(() => t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.some((e) => e.configType === "AGGREGATE") && t?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.map((e) => ({
|
|
3493
3493
|
value: e.alias,
|
|
3494
3494
|
label: e.alias
|
|
3495
|
-
})) || [], [t?.datasetMetricSettings?.newDatasetSettings]), fi =
|
|
3495
|
+
})) || [], [t?.datasetMetricSettings?.newDatasetSettings]), fi = P(() => t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.map((e) => ({
|
|
3496
3496
|
value: e?.alias || e?.name,
|
|
3497
3497
|
label: e?.alias || e?.name
|
|
3498
|
-
})) || [], [t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), pi = Ei(), { metricFilters: mi, leftPositionedMetricFilters: gi, rightPositionedMetricFilters: _i } =
|
|
3499
|
-
let r =
|
|
3500
|
-
rlsConditions:
|
|
3501
|
-
isFrontendApp:
|
|
3502
|
-
}), i =
|
|
3498
|
+
})) || [], [t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), pi = Ei(), { metricFilters: mi, leftPositionedMetricFilters: gi, rightPositionedMetricFilters: _i } = P(() => {
|
|
3499
|
+
let r = vt({
|
|
3500
|
+
rlsConditions: z,
|
|
3501
|
+
isFrontendApp: _
|
|
3502
|
+
}), i = st({
|
|
3503
3503
|
metric: {
|
|
3504
3504
|
clientId: t?.clientId,
|
|
3505
3505
|
isCreatedByClient: t?.isCreatedByClient
|
|
@@ -3507,14 +3507,14 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3507
3507
|
dashboard: { createdBy: e },
|
|
3508
3508
|
principal: {
|
|
3509
3509
|
clientId: a,
|
|
3510
|
-
isAllClient:
|
|
3510
|
+
isAllClient: g
|
|
3511
3511
|
},
|
|
3512
3512
|
tenancyLevel: o,
|
|
3513
3513
|
rlsConditions: r,
|
|
3514
|
-
clientColumnType:
|
|
3515
|
-
dataMartTables:
|
|
3514
|
+
clientColumnType: de,
|
|
3515
|
+
dataMartTables: ot
|
|
3516
3516
|
}).rls, s = i.filter((e) => e.isAddOnMetrics);
|
|
3517
|
-
|
|
3517
|
+
nt && (s = s.filter((e) => re(e, !0)));
|
|
3518
3518
|
let c = [], l = [];
|
|
3519
3519
|
return s = Di(s, pi, n?.filters), s.forEach((e) => {
|
|
3520
3520
|
e.position === "top-right" ? l.push(e) : c.push(e);
|
|
@@ -3524,70 +3524,70 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3524
3524
|
rightPositionedMetricFilters: l
|
|
3525
3525
|
};
|
|
3526
3526
|
}, [
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3527
|
+
z,
|
|
3528
|
+
_,
|
|
3529
|
+
nt,
|
|
3530
3530
|
t?.isCreatedByClient,
|
|
3531
3531
|
t?.clientId,
|
|
3532
3532
|
e,
|
|
3533
3533
|
o,
|
|
3534
3534
|
a,
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3535
|
+
g,
|
|
3536
|
+
de,
|
|
3537
|
+
ot,
|
|
3538
3538
|
pi,
|
|
3539
3539
|
n?.filters
|
|
3540
3540
|
]), yi = [
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
].includes(
|
|
3541
|
+
A.pie,
|
|
3542
|
+
A.doughnut,
|
|
3543
|
+
A.rose,
|
|
3544
|
+
A.funnel,
|
|
3545
|
+
A.singleValue,
|
|
3546
|
+
A.table,
|
|
3547
|
+
A.pivot,
|
|
3548
|
+
A.horizontalStackTable,
|
|
3549
|
+
A.geoBarMap,
|
|
3550
|
+
A.geoMap,
|
|
3551
|
+
A.geoScatterMap,
|
|
3552
|
+
A.sankey,
|
|
3553
|
+
A.timeSeries,
|
|
3554
|
+
A.geoBarMap,
|
|
3555
|
+
A.geoMap,
|
|
3556
|
+
A.geoScatterMap,
|
|
3557
|
+
A.worldMap,
|
|
3558
|
+
A.boxplot,
|
|
3559
|
+
A.timeSeries,
|
|
3560
|
+
A.gantt
|
|
3561
|
+
].includes(K?.chartType) || (K?.isMultiDimension || K?.isDynamicSeries) && K?.seriesField !== "ungrouped", xi = M((e) => {
|
|
3562
3562
|
let n = t?.dataSecuritySettings?.csvColumns || [];
|
|
3563
3563
|
return e?.length ? e?.map((e) => {
|
|
3564
3564
|
let t = {};
|
|
3565
3565
|
for (let r in e) n?.includes(r) || (t[r] = e[r]);
|
|
3566
3566
|
return t;
|
|
3567
3567
|
}) : [];
|
|
3568
|
-
}, [t?.dataSecuritySettings]), Ci =
|
|
3569
|
-
|
|
3570
|
-
|
|
3568
|
+
}, [t?.dataSecuritySettings]), Ci = P(() => xi(Z), [Z, xi]);
|
|
3569
|
+
N(() => {
|
|
3570
|
+
K || (q(t?.chartOptions), Nt({
|
|
3571
3571
|
limit: parseInt(t?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
|
|
3572
3572
|
offset: 0
|
|
3573
3573
|
}));
|
|
3574
|
-
}, [t?.chartOptions,
|
|
3575
|
-
|
|
3576
|
-
limit: parseInt(
|
|
3574
|
+
}, [t?.chartOptions, K]), N(() => {
|
|
3575
|
+
K?.tableSettings?.isServerSidePagination && K?.chartType === A.table && Nt({
|
|
3576
|
+
limit: parseInt(K?.tableSettings?.defaultRowSize || "100", 10),
|
|
3577
3577
|
offset: 0
|
|
3578
3578
|
});
|
|
3579
3579
|
}, [
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3580
|
+
K?.tableSettings?.isServerSidePagination,
|
|
3581
|
+
K?.chartType,
|
|
3582
|
+
K?.tableSettings?.defaultRowSize
|
|
3583
3583
|
]);
|
|
3584
|
-
let Ti =
|
|
3585
|
-
Ti.current = n,
|
|
3586
|
-
if (
|
|
3587
|
-
let e = Ti.current?.filters?.find((e) => e.label ===
|
|
3584
|
+
let Ti = F(n);
|
|
3585
|
+
Ti.current = n, N(() => {
|
|
3586
|
+
if (K?.chartType === A.timeSeries && K?.timeSeriesSettings?.groupBySettings?.isGlobalFilter && Nr) {
|
|
3587
|
+
let e = Ti.current?.filters?.find((e) => e.label === K?.timeSeriesSettings?.groupBySettings?.globalFilterOption?.value)?.value;
|
|
3588
3588
|
if ((typeof e == "string" || typeof e == "object" && e?.value) && e) {
|
|
3589
|
-
let t = typeof e == "string" ?
|
|
3590
|
-
|
|
3589
|
+
let t = typeof e == "string" ? Ve(e)?.toLowerCase() : K?.timeSeriesSettings?.groupBySettings?.formatWithValue?.find((t) => t.value === Ve(e?.value))?.format?.toLowerCase() || "";
|
|
3590
|
+
lt?.find((e) => e?.value?.toLowerCase() === t) && q((e) => ({
|
|
3591
3591
|
...e,
|
|
3592
3592
|
timeSeriesSettings: {
|
|
3593
3593
|
...e?.timeSeriesSettings,
|
|
@@ -3596,109 +3596,109 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3596
3596
|
value: t
|
|
3597
3597
|
}
|
|
3598
3598
|
},
|
|
3599
|
-
xAxis:
|
|
3599
|
+
xAxis: J ? e.xAxis : `${t} of ${Nr}`
|
|
3600
3600
|
}));
|
|
3601
3601
|
}
|
|
3602
3602
|
}
|
|
3603
3603
|
}, [
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
]),
|
|
3610
|
-
|
|
3604
|
+
Sr,
|
|
3605
|
+
K?.chartType,
|
|
3606
|
+
K?.timeSeriesSettings?.groupBySettings?.isGlobalFilter,
|
|
3607
|
+
K?.timeSeriesSettings?.groupBySettings?.globalFilterOption,
|
|
3608
|
+
Nr
|
|
3609
|
+
]), N(() => {
|
|
3610
|
+
K?.isDynamicSeries && (K?.seriesOptions?.includes("ungrouped") ? K?.ungroupedAlias ? xn(K?.seriesOptions?.map((e) => e === "ungrouped" ? {
|
|
3611
3611
|
value: e,
|
|
3612
|
-
label:
|
|
3612
|
+
label: K?.ungroupedAlias
|
|
3613
3613
|
} : {
|
|
3614
3614
|
value: e,
|
|
3615
3615
|
label: e
|
|
3616
|
-
})) :
|
|
3616
|
+
})) : xn(K?.seriesOptions?.map((e) => ({
|
|
3617
3617
|
value: e,
|
|
3618
3618
|
label: e
|
|
3619
|
-
}))) :
|
|
3619
|
+
}))) : xn([...K?.seriesOptions?.map((e) => ({
|
|
3620
3620
|
value: e,
|
|
3621
3621
|
label: e
|
|
3622
3622
|
})) ?? []]));
|
|
3623
3623
|
}, [
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3624
|
+
K?.seriesOptions,
|
|
3625
|
+
K?.isDynamicSeries,
|
|
3626
|
+
K?.ungroupedAlias
|
|
3627
3627
|
]);
|
|
3628
|
-
let [Oi, Ri] =
|
|
3628
|
+
let [Oi, Ri] = I(!1), zi = (e) => {
|
|
3629
3629
|
e.key === "Control" && Ri(!0);
|
|
3630
3630
|
}, Bi = (e) => {
|
|
3631
3631
|
e.key === "Control" && Ri(!1);
|
|
3632
3632
|
};
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
}, [
|
|
3633
|
+
N(() => {
|
|
3634
|
+
Z?.length && Kt(Object.keys(Z?.[0] || {}));
|
|
3635
|
+
}, [Z?.length]), N(() => (K?.customSettings?.chartZoom?.isZoomEnabled && (window.addEventListener("keydown", zi), window.addEventListener("keyup", Bi)), () => {
|
|
3636
3636
|
window.removeEventListener("keydown", zi), window.removeEventListener("keyup", Bi);
|
|
3637
3637
|
}), []);
|
|
3638
|
-
let Vi =
|
|
3638
|
+
let Vi = P(() => {
|
|
3639
3639
|
let e = !1;
|
|
3640
|
-
if (
|
|
3641
|
-
let t =
|
|
3642
|
-
e =
|
|
3640
|
+
if (Z?.length) {
|
|
3641
|
+
let t = K?.singleValue;
|
|
3642
|
+
e = Z[0][t] === null && K?.chartType === A.singleValue;
|
|
3643
3643
|
}
|
|
3644
3644
|
return e;
|
|
3645
3645
|
}, [
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
]), Hi =
|
|
3650
|
-
chartOptions:
|
|
3651
|
-
data:
|
|
3646
|
+
Z?.length,
|
|
3647
|
+
K?.singleValue,
|
|
3648
|
+
K?.chartType === A.singleValue
|
|
3649
|
+
]), Hi = P(() => tt({
|
|
3650
|
+
chartOptions: K,
|
|
3651
|
+
data: Z || []
|
|
3652
3652
|
}), [
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
]), Gi =
|
|
3664
|
-
text:
|
|
3665
|
-
selectedLanguage:
|
|
3666
|
-
translationDictionary:
|
|
3653
|
+
Z,
|
|
3654
|
+
K?.xAxis,
|
|
3655
|
+
K?.yAxisList,
|
|
3656
|
+
K?.dynamicXAxis?.isEnabled,
|
|
3657
|
+
K?.chartType,
|
|
3658
|
+
K?.seriesField,
|
|
3659
|
+
K?.customSettings?.cumulativeBar,
|
|
3660
|
+
K?.isGroupXAxis,
|
|
3661
|
+
K?.timeSeriesSettings?.seriesType[0],
|
|
3662
|
+
K?.timeSeriesSettings?.groupBySettings?.fillXAxis
|
|
3663
|
+
]), Gi = P(() => oe({
|
|
3664
|
+
text: Me(t?.name || "", gn) || "",
|
|
3665
|
+
selectedLanguage: Ce,
|
|
3666
|
+
translationDictionary: Te
|
|
3667
3667
|
}), [
|
|
3668
3668
|
t?.name,
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
]), Ki =
|
|
3673
|
-
text:
|
|
3674
|
-
selectedLanguage:
|
|
3675
|
-
translationDictionary:
|
|
3669
|
+
gn,
|
|
3670
|
+
Te,
|
|
3671
|
+
Ce
|
|
3672
|
+
]), Ki = P(() => oe({
|
|
3673
|
+
text: Me(t?.longDescription || "", gn) || "",
|
|
3674
|
+
selectedLanguage: Ce,
|
|
3675
|
+
translationDictionary: Te
|
|
3676
3676
|
}), [
|
|
3677
3677
|
t?.longDescription,
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
]), qi =
|
|
3682
|
-
text:
|
|
3683
|
-
selectedLanguage:
|
|
3684
|
-
translationDictionary:
|
|
3678
|
+
gn,
|
|
3679
|
+
Ce,
|
|
3680
|
+
Te
|
|
3681
|
+
]), qi = P(() => oe({
|
|
3682
|
+
text: Me(t?.description || "", gn) || "",
|
|
3683
|
+
selectedLanguage: Ce,
|
|
3684
|
+
translationDictionary: Te
|
|
3685
3685
|
}), [
|
|
3686
3686
|
t?.description,
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
]), Ji =
|
|
3691
|
-
text:
|
|
3692
|
-
selectedLanguage:
|
|
3693
|
-
translationDictionary:
|
|
3687
|
+
gn,
|
|
3688
|
+
Ce,
|
|
3689
|
+
Te
|
|
3690
|
+
]), Ji = P(() => oe({
|
|
3691
|
+
text: Me(t?.footNote || "", gn) || "",
|
|
3692
|
+
selectedLanguage: Ce,
|
|
3693
|
+
translationDictionary: Te
|
|
3694
3694
|
}), [
|
|
3695
3695
|
t?.footNote,
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
]), Yi =
|
|
3696
|
+
gn,
|
|
3697
|
+
Ce,
|
|
3698
|
+
Te
|
|
3699
|
+
]), Yi = P(() => `${Z?.[0]?.dbn_metric_expression_data || "No Data Found"}`, [Z]), Xi = P(() => t?.rlsConditions?.map((e) => {
|
|
3700
3700
|
if (e?.datatype === "date" && e?.options?.find((e) => e.range === "Custom Date") && e?.isEnableDynamicDate && e?.dynamicDate?.value) {
|
|
3701
|
-
let t = he(
|
|
3701
|
+
let t = he(Je?.find((t) => t.value === e?.dynamicDate?.value)?.count || 0), n = Ke(t), r = Ke(t);
|
|
3702
3702
|
return {
|
|
3703
3703
|
...e,
|
|
3704
3704
|
options: e?.options?.map((e) => e.range === "Custom Date" ? {
|
|
@@ -3711,9 +3711,9 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3711
3711
|
}
|
|
3712
3712
|
return e;
|
|
3713
3713
|
}), [t?.rlsConditions]);
|
|
3714
|
-
|
|
3715
|
-
if (
|
|
3716
|
-
if (Ai(e?.get(t?.id),
|
|
3714
|
+
mt(() => {
|
|
3715
|
+
if (Kn && ie?.((e) => {
|
|
3716
|
+
if (Ai(e?.get(t?.id), Vn)) return e;
|
|
3717
3717
|
let n = new Map(e);
|
|
3718
3718
|
return n.set(t?.id, {
|
|
3719
3719
|
data: {
|
|
@@ -3721,18 +3721,18 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3721
3721
|
name: "",
|
|
3722
3722
|
description: ""
|
|
3723
3723
|
},
|
|
3724
|
-
isLoading:
|
|
3725
|
-
key:
|
|
3724
|
+
isLoading: Kn,
|
|
3725
|
+
key: Vn
|
|
3726
3726
|
}), n;
|
|
3727
|
-
}),
|
|
3728
|
-
let e = da(t?.id,
|
|
3729
|
-
|
|
3727
|
+
}), X?.data && O) {
|
|
3728
|
+
let e = da(t?.id, se) ? X?.data : void 0;
|
|
3729
|
+
ie?.((n) => {
|
|
3730
3730
|
if (Fi(n?.get(t?.id), {
|
|
3731
3731
|
data: e,
|
|
3732
3732
|
name: t?.name || "",
|
|
3733
3733
|
description: t?.description || "",
|
|
3734
|
-
isLoading:
|
|
3735
|
-
key:
|
|
3734
|
+
isLoading: Kn,
|
|
3735
|
+
key: Vn
|
|
3736
3736
|
})) return n;
|
|
3737
3737
|
let r = new Map(n);
|
|
3738
3738
|
return r.set(t?.id, {
|
|
@@ -3741,16 +3741,16 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3741
3741
|
name: t?.name || "",
|
|
3742
3742
|
description: t?.description || ""
|
|
3743
3743
|
},
|
|
3744
|
-
isLoading:
|
|
3745
|
-
key:
|
|
3744
|
+
isLoading: Kn,
|
|
3745
|
+
key: Vn
|
|
3746
3746
|
}), r;
|
|
3747
3747
|
});
|
|
3748
3748
|
}
|
|
3749
|
-
if (!
|
|
3749
|
+
if (!Kn && or) {
|
|
3750
3750
|
let e = Ii(t);
|
|
3751
|
-
|
|
3751
|
+
ie?.((n) => {
|
|
3752
3752
|
let r = n?.get(t?.id);
|
|
3753
|
-
if (r && !r.isLoading && !!r.error === e && r.key ===
|
|
3753
|
+
if (r && !r.isLoading && !!r.error === e && r.key === Vn) return n;
|
|
3754
3754
|
let i = new Map(n);
|
|
3755
3755
|
return i.set(t?.id, {
|
|
3756
3756
|
data: r?.data ?? {
|
|
@@ -3759,23 +3759,23 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3759
3759
|
description: ""
|
|
3760
3760
|
},
|
|
3761
3761
|
isLoading: !1,
|
|
3762
|
-
key:
|
|
3762
|
+
key: Vn,
|
|
3763
3763
|
...e ? { error: "failed" } : {}
|
|
3764
3764
|
}), i;
|
|
3765
3765
|
});
|
|
3766
3766
|
}
|
|
3767
3767
|
}, [
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3768
|
+
X?.data,
|
|
3769
|
+
Kn,
|
|
3770
|
+
Vn,
|
|
3771
|
+
or
|
|
3772
3772
|
]);
|
|
3773
|
-
let Zi =
|
|
3773
|
+
let Zi = F(t?.id);
|
|
3774
3774
|
Zi.current = t?.id;
|
|
3775
|
-
let Qi =
|
|
3776
|
-
Qi.current =
|
|
3777
|
-
let $i =
|
|
3778
|
-
$i.current =
|
|
3775
|
+
let Qi = F(O);
|
|
3776
|
+
Qi.current = O;
|
|
3777
|
+
let $i = F(ie);
|
|
3778
|
+
$i.current = ie, N(() => () => {
|
|
3779
3779
|
let e = Zi.current, t = Qi.current, n = $i.current;
|
|
3780
3780
|
e && t && n && t.get(e)?.data?.data && n((t) => {
|
|
3781
3781
|
let n = t.get(e);
|
|
@@ -3790,30 +3790,30 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3790
3790
|
}), r;
|
|
3791
3791
|
});
|
|
3792
3792
|
}, []);
|
|
3793
|
-
let aa = !!t?.elementSettings?.summary?.metricList?.length, [ua, fa] =
|
|
3794
|
-
|
|
3795
|
-
let e =
|
|
3793
|
+
let aa = !!t?.elementSettings?.summary?.metricList?.length, [ua, fa] = I(0);
|
|
3794
|
+
N(() => {
|
|
3795
|
+
let e = O?.subscribe;
|
|
3796
3796
|
if (aa && typeof e == "function") return e(() => fa((e) => e + 1));
|
|
3797
|
-
}, [
|
|
3798
|
-
|
|
3799
|
-
}, [
|
|
3800
|
-
let pa = () => !!t?.elementSettings?.summary?.metricList?.some((e) =>
|
|
3801
|
-
|
|
3797
|
+
}, [O, aa]), mt(() => {
|
|
3798
|
+
jt.current !== Hn && (jt.current = Hn, Et());
|
|
3799
|
+
}, [Hn, Et]);
|
|
3800
|
+
let pa = () => !!t?.elementSettings?.summary?.metricList?.some((e) => O?.get(e.value)?.isLoading === !0);
|
|
3801
|
+
mt(() => {
|
|
3802
3802
|
let e = t?.elementSettings?.summary;
|
|
3803
|
-
if (!e?.metricList?.length || !
|
|
3804
|
-
let n = e.metricList.map((e) =>
|
|
3803
|
+
if (!e?.metricList?.length || !O?.get(t?.id)) return;
|
|
3804
|
+
let n = e.metricList.map((e) => O.get(e.value));
|
|
3805
3805
|
if (n.some((e) => e?.isLoading)) return;
|
|
3806
3806
|
let r = JSON.stringify({
|
|
3807
3807
|
keys: n.map((e) => [e?.key, !!e?.data?.data?.length]),
|
|
3808
3808
|
prompt: e.summaryPrompt,
|
|
3809
3809
|
id: t?.id,
|
|
3810
|
-
identity:
|
|
3810
|
+
identity: Hn
|
|
3811
3811
|
}), i = n.map((e) => ({
|
|
3812
3812
|
data: e?.data?.data || [],
|
|
3813
3813
|
metricName: e?.data?.name,
|
|
3814
3814
|
metricDescription: e?.data?.description
|
|
3815
3815
|
})), o = i.every((e) => e.data.length > 0);
|
|
3816
|
-
|
|
3816
|
+
wt(r, o ? (r) => bt.mutateAsync({
|
|
3817
3817
|
signal: r,
|
|
3818
3818
|
data: {
|
|
3819
3819
|
metricData: i,
|
|
@@ -3822,43 +3822,43 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3822
3822
|
filters: n.map((e) => e?.key).join("###"),
|
|
3823
3823
|
name: t?.name,
|
|
3824
3824
|
description: t?.description,
|
|
3825
|
-
workspaceId:
|
|
3825
|
+
workspaceId: D
|
|
3826
3826
|
},
|
|
3827
|
-
token:
|
|
3828
|
-
clientId:
|
|
3829
|
-
isFrontendApp:
|
|
3827
|
+
token: v || "",
|
|
3828
|
+
clientId: _ ? y || "" : a,
|
|
3829
|
+
isFrontendApp: _
|
|
3830
3830
|
}) : void 0);
|
|
3831
3831
|
}, [
|
|
3832
3832
|
t?.elementSettings,
|
|
3833
3833
|
t?.id,
|
|
3834
3834
|
t?.name,
|
|
3835
3835
|
t?.description,
|
|
3836
|
-
|
|
3836
|
+
O,
|
|
3837
3837
|
ua,
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
_,
|
|
3843
|
-
g,
|
|
3838
|
+
Hn,
|
|
3839
|
+
wt,
|
|
3840
|
+
bt,
|
|
3841
|
+
D,
|
|
3844
3842
|
v,
|
|
3843
|
+
_,
|
|
3844
|
+
y,
|
|
3845
3845
|
a
|
|
3846
|
-
]),
|
|
3847
|
-
let e =
|
|
3848
|
-
if (
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
].includes(
|
|
3853
|
-
let e =
|
|
3854
|
-
|
|
3846
|
+
]), N(() => {
|
|
3847
|
+
let e = rt(K?.customSettings?.comboAxisSettings || []), t = e?.flatMap((e) => e?.measures), n = K?.yAxisList?.every((e) => t?.includes(e));
|
|
3848
|
+
if (K?.yAxisList?.length && K?.yAxisList?.length !== t?.length && !t?.length && [
|
|
3849
|
+
A.combo,
|
|
3850
|
+
A.timeSeries,
|
|
3851
|
+
A.horizontalCombo
|
|
3852
|
+
].includes(K?.chartType || "")) {
|
|
3853
|
+
let e = K?.yAxisList?.filter((e) => !K?.comboBarList?.includes(e))?.filter((e) => !t?.includes(e)), n = K?.customSettings?.comboStackAxisSymbols?.name || "", r = K?.customSettings?.comboLabelFormatter?.find((e) => e.axis === (n || "stack"))?.formatter, i = K?.comboBarList?.join(" and "), a = K?.customSettings?.comboLabelFormatter?.find((e) => e.axis === i)?.formatter;
|
|
3854
|
+
q((t) => ({
|
|
3855
3855
|
...t,
|
|
3856
3856
|
customSettings: {
|
|
3857
3857
|
...t.customSettings,
|
|
3858
|
-
comboAxisSettings:
|
|
3858
|
+
comboAxisSettings: rt([
|
|
3859
3859
|
...t.customSettings?.comboAxisSettings || [],
|
|
3860
3860
|
...e?.map((e) => {
|
|
3861
|
-
let t =
|
|
3861
|
+
let t = K?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = K?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
|
|
3862
3862
|
return {
|
|
3863
3863
|
axis: e,
|
|
3864
3864
|
measures: [e],
|
|
@@ -3866,36 +3866,36 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3866
3866
|
axis: e,
|
|
3867
3867
|
type: "line"
|
|
3868
3868
|
}],
|
|
3869
|
-
numberFormatter:
|
|
3869
|
+
numberFormatter: K?.customSettings?.numberFormatter,
|
|
3870
3870
|
labelFormatter: t,
|
|
3871
3871
|
prefix: n?.prefix || "",
|
|
3872
3872
|
suffix: n?.suffix || "",
|
|
3873
3873
|
isEnableLabelFormatter: !!t?.length
|
|
3874
3874
|
};
|
|
3875
3875
|
}),
|
|
3876
|
-
...
|
|
3877
|
-
axis:
|
|
3878
|
-
measures:
|
|
3879
|
-
chartTypes:
|
|
3876
|
+
...K?.comboBarList?.length && (K?.customSettings?.isCombineBarAxis || K?.customSettings?.isStackBar) ? [{
|
|
3877
|
+
axis: K?.customSettings?.isStackBar && n || i,
|
|
3878
|
+
measures: K?.comboBarList,
|
|
3879
|
+
chartTypes: K?.comboBarList?.map((e) => ({
|
|
3880
3880
|
axis: e,
|
|
3881
3881
|
type: "bar"
|
|
3882
3882
|
})),
|
|
3883
|
-
isEnableStackBar:
|
|
3884
|
-
numberFormatter:
|
|
3885
|
-
...
|
|
3886
|
-
prefix:
|
|
3887
|
-
suffix:
|
|
3883
|
+
isEnableStackBar: K?.customSettings?.isStackBar,
|
|
3884
|
+
numberFormatter: K?.customSettings?.numberFormatter,
|
|
3885
|
+
...K?.customSettings?.isStackBar ? {
|
|
3886
|
+
prefix: K?.customSettings?.comboStackAxisSymbols?.prefix || "",
|
|
3887
|
+
suffix: K?.customSettings?.comboStackAxisSymbols?.suffix || "",
|
|
3888
3888
|
labelFormatter: r,
|
|
3889
3889
|
isEnableLabelFormatter: !!r?.length
|
|
3890
3890
|
} : {
|
|
3891
|
-
prefix:
|
|
3892
|
-
suffix:
|
|
3891
|
+
prefix: K?.customSettings?.combinedAxisPrefix || "",
|
|
3892
|
+
suffix: K?.customSettings?.combinedAxisSuffix || "",
|
|
3893
3893
|
labelFormatter: a,
|
|
3894
3894
|
isEnableLabelFormatter: !!a?.length
|
|
3895
3895
|
}
|
|
3896
3896
|
}] : [],
|
|
3897
|
-
...
|
|
3898
|
-
let t =
|
|
3897
|
+
...K?.comboBarList?.length && !K?.customSettings?.isCombineBarAxis && !K?.customSettings?.isStackBar ? K?.comboBarList?.map((e) => {
|
|
3898
|
+
let t = K?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = K?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
|
|
3899
3899
|
return {
|
|
3900
3900
|
axis: e,
|
|
3901
3901
|
measures: [e],
|
|
@@ -3903,7 +3903,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3903
3903
|
axis: e,
|
|
3904
3904
|
type: "bar"
|
|
3905
3905
|
}],
|
|
3906
|
-
numberFormatter:
|
|
3906
|
+
numberFormatter: K?.customSettings?.numberFormatter,
|
|
3907
3907
|
labelFormatter: t,
|
|
3908
3908
|
prefix: n?.prefix || "",
|
|
3909
3909
|
suffix: n?.suffix || "",
|
|
@@ -3922,29 +3922,29 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3922
3922
|
comboBarList: []
|
|
3923
3923
|
}));
|
|
3924
3924
|
}
|
|
3925
|
-
if (t?.length &&
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
].includes(
|
|
3930
|
-
let e =
|
|
3931
|
-
(t?.filter((e) => !
|
|
3932
|
-
let t =
|
|
3933
|
-
|
|
3925
|
+
if (t?.length && K?.yAxisList?.length && (K?.yAxisList?.length !== t?.length || K?.yAxisList?.length === t?.length && !n) && [
|
|
3926
|
+
A.combo,
|
|
3927
|
+
A.timeSeries,
|
|
3928
|
+
A.horizontalCombo
|
|
3929
|
+
].includes(K?.chartType || "")) {
|
|
3930
|
+
let e = K?.yAxisList?.filter((e) => !t?.includes(e));
|
|
3931
|
+
(t?.filter((e) => !K?.yAxisList?.includes(e)))?.forEach((e) => {
|
|
3932
|
+
let t = K?.customSettings?.comboAxisSettings?.find((t) => t.measures?.includes(e)), n = t?.axis, r = (t?.measures?.length || 0) > 1;
|
|
3933
|
+
q((t) => ({
|
|
3934
3934
|
...t,
|
|
3935
3935
|
customSettings: {
|
|
3936
3936
|
...t.customSettings,
|
|
3937
|
-
comboAxisSettings:
|
|
3937
|
+
comboAxisSettings: rt(r ? t.customSettings?.comboAxisSettings?.map((t) => t.axis === n ? {
|
|
3938
3938
|
...t,
|
|
3939
3939
|
measures: t?.measures?.filter((t) => t !== e)
|
|
3940
3940
|
} : t)?.filter((e) => e?.measures?.length) || [] : t.customSettings?.comboAxisSettings?.filter((e) => e.axis !== n && e?.measures?.length) || [])
|
|
3941
3941
|
}
|
|
3942
3942
|
}));
|
|
3943
|
-
}), e?.length &&
|
|
3943
|
+
}), e?.length && q((t) => ({
|
|
3944
3944
|
...t,
|
|
3945
3945
|
customSettings: {
|
|
3946
3946
|
...t.customSettings,
|
|
3947
|
-
comboAxisSettings:
|
|
3947
|
+
comboAxisSettings: rt([...t.customSettings?.comboAxisSettings || [], ...e?.map((e) => ({
|
|
3948
3948
|
axis: e,
|
|
3949
3949
|
measures: [e],
|
|
3950
3950
|
chartTypes: [{
|
|
@@ -3955,11 +3955,11 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3955
3955
|
}
|
|
3956
3956
|
}));
|
|
3957
3957
|
}
|
|
3958
|
-
t?.length &&
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
].includes(
|
|
3958
|
+
t?.length && K?.yAxisList?.length && K?.yAxisList?.length === t?.length && n && [
|
|
3959
|
+
A.combo,
|
|
3960
|
+
A.timeSeries,
|
|
3961
|
+
A.horizontalCombo
|
|
3962
|
+
].includes(K?.chartType || "") && K?.customSettings?.comboAxisSettings?.length !== e?.length && q((t) => ({
|
|
3963
3963
|
...t,
|
|
3964
3964
|
customSettings: {
|
|
3965
3965
|
...t?.customSettings,
|
|
@@ -3967,43 +3967,43 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
3967
3967
|
}
|
|
3968
3968
|
}));
|
|
3969
3969
|
}, [
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
]),
|
|
3985
|
-
|
|
3970
|
+
K?.yAxisList,
|
|
3971
|
+
K?.customSettings?.comboAxisSettings,
|
|
3972
|
+
K?.comboBarList,
|
|
3973
|
+
K?.customSettings?.isCombineBarAxis,
|
|
3974
|
+
K?.customSettings?.isStackBar,
|
|
3975
|
+
K?.customSettings?.comboStackAxisSymbols?.name,
|
|
3976
|
+
K?.customSettings?.comboStackAxisSymbols?.prefix,
|
|
3977
|
+
K?.customSettings?.comboStackAxisSymbols?.suffix,
|
|
3978
|
+
K?.customSettings?.comboLabelFormatter,
|
|
3979
|
+
K?.customSettings?.comboAxisSymbols,
|
|
3980
|
+
K?.customSettings?.numberFormatter,
|
|
3981
|
+
K?.customSettings?.combinedAxisPrefix,
|
|
3982
|
+
K?.customSettings?.combinedAxisSuffix,
|
|
3983
|
+
K?.chartType
|
|
3984
|
+
]), N(() => {
|
|
3985
|
+
K?.yAxisList?.length && K?.yAxisList?.length < 5 && K?.chartType === A.boxplot && q((e) => ({
|
|
3986
3986
|
...e,
|
|
3987
|
-
chartType:
|
|
3988
|
-
})), !
|
|
3987
|
+
chartType: A.line
|
|
3988
|
+
})), !K?.yAxisList?.length && K?.chartType === A.funnelV2 && q((e) => ({
|
|
3989
3989
|
...e,
|
|
3990
|
-
chartType:
|
|
3990
|
+
chartType: A.singleValue
|
|
3991
3991
|
}));
|
|
3992
|
-
}, [
|
|
3992
|
+
}, [K?.chartType, K?.yAxisList?.length]);
|
|
3993
3993
|
let ma = ({ columnAlias: e, value: n, isClear: r = !1 }) => {
|
|
3994
3994
|
let i = t?.datasetMetricSettings;
|
|
3995
|
-
i &&
|
|
3995
|
+
i && We({
|
|
3996
3996
|
columnAlias: e,
|
|
3997
3997
|
datasetSettings: i,
|
|
3998
|
-
setTableColumnFilters:
|
|
3998
|
+
setTableColumnFilters: zt,
|
|
3999
3999
|
value: n,
|
|
4000
4000
|
isClear: r
|
|
4001
4001
|
});
|
|
4002
4002
|
};
|
|
4003
|
-
|
|
4004
|
-
if (!
|
|
4005
|
-
let e =
|
|
4006
|
-
|
|
4003
|
+
N(() => {
|
|
4004
|
+
if (!K?.dynamicYAxis?.isEnabled || !K?.dynamicYAxis?.selectedOption || Array.isArray(K?.dynamicYAxis?.selectedOption)) return;
|
|
4005
|
+
let e = K?.dynamicYAxis?.selectedOption;
|
|
4006
|
+
q((t) => ({
|
|
4007
4007
|
...t,
|
|
4008
4008
|
dynamicYAxis: {
|
|
4009
4009
|
...t?.dynamicYAxis,
|
|
@@ -4011,14 +4011,14 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
4011
4011
|
},
|
|
4012
4012
|
yAxisList: [e?.value]
|
|
4013
4013
|
}));
|
|
4014
|
-
}, [
|
|
4015
|
-
let e =
|
|
4016
|
-
if (!
|
|
4017
|
-
|
|
4014
|
+
}, [K?.dynamicYAxis?.selectedOption, K?.dynamicYAxis?.isEnabled]), N(() => {
|
|
4015
|
+
let e = j?.yAxisSettings?.find((e) => e?.yAxisSettings?.isEnable && e?.id === t?.id && e?.yAxisSettings?.yAxis && Array.isArray(e?.yAxisSettings?.yAxis) && e?.yAxisSettings?.yAxis?.length > 0), n = j?.xAxisSettings?.find((e) => e?.xAxisSettings?.isEnable && e?.id === t?.id && e?.xAxisSettings?.xaxis), r = H?.configV2?.levels?.length ? H : t?.drillDownSettings, i = ca(t?.chartOptions, r), a = i !== t?.chartOptions;
|
|
4016
|
+
if (!K?.dynamicYAxis?.isEnabled && !K?.dynamicXAxis?.isEnabled && !a || !e && !n && !a) {
|
|
4017
|
+
q((e) => t?.chartOptions || e);
|
|
4018
4018
|
return;
|
|
4019
4019
|
}
|
|
4020
4020
|
let o = e?.yAxisSettings?.yAxis?.[0];
|
|
4021
|
-
|
|
4021
|
+
q((e) => {
|
|
4022
4022
|
let t = a ? {
|
|
4023
4023
|
...e,
|
|
4024
4024
|
...i
|
|
@@ -4041,18 +4041,18 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
4041
4041
|
};
|
|
4042
4042
|
});
|
|
4043
4043
|
}, [
|
|
4044
|
-
|
|
4044
|
+
j?.yAxisSettings,
|
|
4045
4045
|
t?.id,
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4046
|
+
j?.xAxisSettings,
|
|
4047
|
+
K?.dynamicYAxis?.isEnabled,
|
|
4048
|
+
K?.dynamicXAxis?.isEnabled,
|
|
4049
|
+
H,
|
|
4050
|
+
H?.configV2?.isEnable,
|
|
4051
|
+
H?.configV2?.levels,
|
|
4052
4052
|
t?.chartOptions,
|
|
4053
4053
|
t?.drillDownSettings
|
|
4054
|
-
]),
|
|
4055
|
-
|
|
4054
|
+
]), N(() => {
|
|
4055
|
+
K?.customSettings?.isShowDuration && K?.chartType === A.gantt && !K?.customSettings?.ganttTooltipKeys?.includes("Duration") && q((e) => ({
|
|
4056
4056
|
...e,
|
|
4057
4057
|
customSettings: {
|
|
4058
4058
|
...e?.customSettings,
|
|
@@ -4060,59 +4060,59 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
4060
4060
|
}
|
|
4061
4061
|
}));
|
|
4062
4062
|
}, [
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4063
|
+
K?.customSettings?.isShowDuration,
|
|
4064
|
+
K?.chartType,
|
|
4065
|
+
K?.customSettings?.ganttTooltipKeys
|
|
4066
4066
|
]);
|
|
4067
|
-
let ha =
|
|
4067
|
+
let ha = P(() => t?.datasetMetricSettings?.selectedDimensions?.map((e) => ne(e || "none")) || sa, [t?.datasetMetricSettings?.selectedDimensions]);
|
|
4068
4068
|
return {
|
|
4069
|
-
drillBlockedNotice:
|
|
4070
|
-
filterNotAppliedNotice:
|
|
4071
|
-
dismissDrillBlockedNotice: () =>
|
|
4072
|
-
elementSummary:
|
|
4073
|
-
elementSummaryError:
|
|
4074
|
-
elementSummaryEmpty:
|
|
4075
|
-
isLoadingSummary:
|
|
4076
|
-
stopSummary:
|
|
4069
|
+
drillBlockedNotice: xt,
|
|
4070
|
+
filterNotAppliedNotice: tr,
|
|
4071
|
+
dismissDrillBlockedNotice: () => St(null),
|
|
4072
|
+
elementSummary: Dt,
|
|
4073
|
+
elementSummaryError: Ot,
|
|
4074
|
+
elementSummaryEmpty: kt,
|
|
4075
|
+
isLoadingSummary: At,
|
|
4076
|
+
stopSummary: Tt,
|
|
4077
4077
|
isMetricListLoading: pa,
|
|
4078
4078
|
onDrillLevelClick: $r,
|
|
4079
4079
|
onDrillDown: Xr,
|
|
4080
4080
|
onFilterDashboardTo: Jr,
|
|
4081
4081
|
onFilterMetricTo: Yr,
|
|
4082
|
-
handleChartClick:
|
|
4083
|
-
dataDb:
|
|
4084
|
-
truncation:
|
|
4085
|
-
truncationNotice:
|
|
4082
|
+
handleChartClick: zr,
|
|
4083
|
+
dataDb: Z,
|
|
4084
|
+
truncation: ir,
|
|
4085
|
+
truncationNotice: ar,
|
|
4086
4086
|
getUnderlyingData: Kr,
|
|
4087
|
-
onChangeFilterValue:
|
|
4088
|
-
isShowChartPopup:
|
|
4089
|
-
setShowChartPopup:
|
|
4090
|
-
columnName:
|
|
4087
|
+
onChangeFilterValue: Rr,
|
|
4088
|
+
isShowChartPopup: Bt,
|
|
4089
|
+
setShowChartPopup: Vt,
|
|
4090
|
+
columnName: Q,
|
|
4091
4091
|
underlyingDataPoint: Br,
|
|
4092
|
-
chartParams:
|
|
4093
|
-
isQueryLoading: !
|
|
4094
|
-
isMetricUpdating:
|
|
4092
|
+
chartParams: B,
|
|
4093
|
+
isQueryLoading: !Ln && (Kn || gt || Zn || Re && (!Z?.length || Vi)),
|
|
4094
|
+
isMetricUpdating: $n,
|
|
4095
4095
|
isSingleValueNull: Vi,
|
|
4096
|
-
dynamicOptions:
|
|
4097
|
-
chartSettings:
|
|
4098
|
-
setChartSettings:
|
|
4096
|
+
dynamicOptions: bn,
|
|
4097
|
+
chartSettings: K,
|
|
4098
|
+
setChartSettings: q,
|
|
4099
4099
|
isEnableZoom: Oi,
|
|
4100
|
-
filterValues:
|
|
4101
|
-
containerRef:
|
|
4102
|
-
drilledLevel:
|
|
4100
|
+
filterValues: An,
|
|
4101
|
+
containerRef: Mt,
|
|
4102
|
+
drilledLevel: V.length,
|
|
4103
4103
|
dimensions: ha,
|
|
4104
|
-
rlsConditions:
|
|
4105
|
-
setRlsConditions:
|
|
4106
|
-
setTableLimit:
|
|
4107
|
-
isEnableNextBtn:
|
|
4108
|
-
isEnablePrevBtn:
|
|
4104
|
+
rlsConditions: z,
|
|
4105
|
+
setRlsConditions: Lt,
|
|
4106
|
+
setTableLimit: Nt,
|
|
4107
|
+
isEnableNextBtn: Pt > L?.limit + L?.offset,
|
|
4108
|
+
isEnablePrevBtn: L?.offset !== 0,
|
|
4109
4109
|
paginationInfo: {
|
|
4110
|
-
limit:
|
|
4111
|
-
offset:
|
|
4112
|
-
totalRecords:
|
|
4110
|
+
limit: L?.limit,
|
|
4111
|
+
offset: L?.offset,
|
|
4112
|
+
totalRecords: Pt
|
|
4113
4113
|
},
|
|
4114
4114
|
onChangePage: (e, t, n) => {
|
|
4115
|
-
|
|
4115
|
+
Nt(t ? {
|
|
4116
4116
|
limit: t,
|
|
4117
4117
|
offset: 0
|
|
4118
4118
|
} : (t) => {
|
|
@@ -4123,13 +4123,13 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
4123
4123
|
};
|
|
4124
4124
|
});
|
|
4125
4125
|
},
|
|
4126
|
-
isExternalChart:
|
|
4127
|
-
isEnablePivotTable:
|
|
4128
|
-
groupByList:
|
|
4126
|
+
isExternalChart: K?.tableSettings?.isServerSidePagination && K?.chartType === A.table,
|
|
4127
|
+
isEnablePivotTable: cn,
|
|
4128
|
+
groupByList: on,
|
|
4129
4129
|
hasNumberKeys: !0,
|
|
4130
4130
|
isEnableGauge: !0,
|
|
4131
4131
|
updateFilter: (e) => {
|
|
4132
|
-
|
|
4132
|
+
Lt((t) => t?.map((t) => t.name === e.name && t.datatype === e.datatype && t.tableName === e.tableName && t.columnName === e.columnName ? {
|
|
4133
4133
|
...t,
|
|
4134
4134
|
isAddOnMetrics: !t.isAddOnMetrics
|
|
4135
4135
|
} : t));
|
|
@@ -4137,55 +4137,55 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
|
|
|
4137
4137
|
metricFilters: mi,
|
|
4138
4138
|
leftPositionedMetricFilters: gi,
|
|
4139
4139
|
rightPositionedMetricFilters: _i,
|
|
4140
|
-
drillFilters:
|
|
4140
|
+
drillFilters: V,
|
|
4141
4141
|
underlyingDataColumnMetadata: Gr,
|
|
4142
4142
|
underlyingDataDrillFilters: Wr,
|
|
4143
|
-
drillType:
|
|
4143
|
+
drillType: H?.drillType,
|
|
4144
4144
|
tableResultsDownloadData: Ci,
|
|
4145
4145
|
filterCsvColumns: xi,
|
|
4146
|
-
appliedMetricFilters:
|
|
4146
|
+
appliedMetricFilters: G,
|
|
4147
4147
|
pivotHeaderOptions: di,
|
|
4148
|
-
pivotDrillState:
|
|
4148
|
+
pivotDrillState: Tn,
|
|
4149
4149
|
onDrillPivotTable: Qr,
|
|
4150
4150
|
legendData: Hi,
|
|
4151
|
-
timeseriesDimension:
|
|
4152
|
-
isPythonMode:
|
|
4153
|
-
sortOrder:
|
|
4154
|
-
setSortOrder:
|
|
4155
|
-
isNotFirstRender:
|
|
4156
|
-
setNotFirstRender:
|
|
4157
|
-
isSorted:
|
|
4151
|
+
timeseriesDimension: Nr,
|
|
4152
|
+
isPythonMode: J,
|
|
4153
|
+
sortOrder: Ut,
|
|
4154
|
+
setSortOrder: Wt,
|
|
4155
|
+
isNotFirstRender: Yt,
|
|
4156
|
+
setNotFirstRender: Xt,
|
|
4157
|
+
isSorted: vn,
|
|
4158
4158
|
isInavlidForSort: yi,
|
|
4159
4159
|
onAddComparison: ei,
|
|
4160
4160
|
groupedRlsConditions: ci,
|
|
4161
4161
|
onGenerateMetricSummary: ti,
|
|
4162
|
-
summary:
|
|
4163
|
-
setSummary:
|
|
4164
|
-
dataMartRelationships:
|
|
4162
|
+
summary: qt,
|
|
4163
|
+
setSummary: Jt,
|
|
4164
|
+
dataMartRelationships: kn,
|
|
4165
4165
|
onChartChange: ri,
|
|
4166
|
-
isCompareValue:
|
|
4167
|
-
isShowChartPropertyPanel:
|
|
4168
|
-
setShowChartPropertyPanel:
|
|
4169
|
-
columnList:
|
|
4170
|
-
variables:
|
|
4166
|
+
isCompareValue: Ir,
|
|
4167
|
+
isShowChartPropertyPanel: un,
|
|
4168
|
+
setShowChartPropertyPanel: dn,
|
|
4169
|
+
columnList: Gt,
|
|
4170
|
+
variables: gn,
|
|
4171
4171
|
metricName: Gi,
|
|
4172
4172
|
longDescription: Ki,
|
|
4173
4173
|
footNote: Ji,
|
|
4174
4174
|
description: qi,
|
|
4175
|
-
drilldownCols:
|
|
4175
|
+
drilldownCols: Zt,
|
|
4176
4176
|
switchMeasureOptions: fi,
|
|
4177
4177
|
metricExpressionResult: Yi,
|
|
4178
4178
|
dateFilter: li,
|
|
4179
|
-
drillDownSettings:
|
|
4179
|
+
drillDownSettings: H,
|
|
4180
4180
|
onDrillIntoDimension: Zr,
|
|
4181
|
-
adhocDrillDims:
|
|
4181
|
+
adhocDrillDims: nn,
|
|
4182
4182
|
enabledCharts: ni,
|
|
4183
|
-
tableColumnFilters:
|
|
4183
|
+
tableColumnFilters: Rt,
|
|
4184
4184
|
onChangePaginationColumnFilters: ma,
|
|
4185
|
-
queryError:
|
|
4186
|
-
queryPermissionDenied: !!
|
|
4187
|
-
refetchMetricData:
|
|
4188
|
-
customSwitchXAxis:
|
|
4185
|
+
queryError: or,
|
|
4186
|
+
queryPermissionDenied: !!Yn?.isBatchAuth,
|
|
4187
|
+
refetchMetricData: Xn,
|
|
4188
|
+
customSwitchXAxis: jn,
|
|
4189
4189
|
savedMetricFilters: Xi || oa
|
|
4190
4190
|
};
|
|
4191
4191
|
};
|
|
@@ -4224,7 +4224,7 @@ var fa = (e) => !!e && e !== "null" && e !== "undefined", pa = (e) => {
|
|
|
4224
4224
|
a.forEach((e) => {
|
|
4225
4225
|
o.set(e.column, e.value);
|
|
4226
4226
|
});
|
|
4227
|
-
let s = `/externalDashboard/${encodeURIComponent(e.dashboardId)}/?${o.toString()}`, c =
|
|
4227
|
+
let s = `/externalDashboard/${encodeURIComponent(e.dashboardId)}/?${o.toString()}`, c = ct(s, { routeType: "internal" });
|
|
4228
4228
|
return c.ok ? {
|
|
4229
4229
|
ok: !0,
|
|
4230
4230
|
intent: {
|
|
@@ -4250,7 +4250,7 @@ var fa = (e) => !!e && e !== "null" && e !== "undefined", pa = (e) => {
|
|
|
4250
4250
|
if (r && r.name !== void 0 && r.name !== null) return n(r.name);
|
|
4251
4251
|
let o = (i ?? []).find((e) => e?.value !== void 0 && e?.value !== null);
|
|
4252
4252
|
return o ? n(o.value) : null;
|
|
4253
|
-
}, ga =
|
|
4253
|
+
}, ga = ut("triangle-alert", [
|
|
4254
4254
|
["path", {
|
|
4255
4255
|
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
4256
4256
|
key: "wmoenq"
|
|
@@ -4266,14 +4266,14 @@ var fa = (e) => !!e && e !== "null" && e !== "undefined", pa = (e) => {
|
|
|
4266
4266
|
]), _a = {
|
|
4267
4267
|
notice: "_notice_vwpz7_1",
|
|
4268
4268
|
icon: "_icon_vwpz7_15"
|
|
4269
|
-
}, va = ({ text: e }) => e ? /* @__PURE__ */
|
|
4269
|
+
}, va = ({ text: e }) => e ? /* @__PURE__ */ gt("div", {
|
|
4270
4270
|
className: _a.notice,
|
|
4271
4271
|
role: "status",
|
|
4272
4272
|
"data-testid": "custom-sql-filter-notice",
|
|
4273
|
-
children: [/* @__PURE__ */
|
|
4273
|
+
children: [/* @__PURE__ */ ht(ga, {
|
|
4274
4274
|
className: _a.icon,
|
|
4275
4275
|
"aria-hidden": "true"
|
|
4276
|
-
}), /* @__PURE__ */
|
|
4276
|
+
}), /* @__PURE__ */ ht("span", { children: e })]
|
|
4277
4277
|
}) : null, ya = (e) => {
|
|
4278
4278
|
let t = e.value ?? e.selectedVariableValue?.value;
|
|
4279
4279
|
return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim().length > 0 : t != null;
|
|
@@ -4282,7 +4282,7 @@ var fa = (e) => !!e && e !== "null" && e !== "undefined", pa = (e) => {
|
|
|
4282
4282
|
return typeof t == "string" && t.trim() ? t.trim() : "Filter";
|
|
4283
4283
|
}, xa = ({ isCustomSqlMetric: e, query: t, metricId: n, filters: r }) => {
|
|
4284
4284
|
if (!e) return [];
|
|
4285
|
-
let i =
|
|
4285
|
+
let i = de(t || "");
|
|
4286
4286
|
return (r || []).flatMap((e) => {
|
|
4287
4287
|
let t = e.restrictedMetrics?.some((e) => e.value === n);
|
|
4288
4288
|
if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !ya(e)) return [];
|
|
@@ -4299,14 +4299,14 @@ var fa = (e) => !!e && e !== "null" && e !== "undefined", pa = (e) => {
|
|
|
4299
4299
|
return n.length ? `${r} Add ${Sa(n)} to the metric SQL.` : `${r} Configure matching filter variables in the metric SQL.`;
|
|
4300
4300
|
}, wa = ({ chart: e, valueColumn: t, isDrillEnabled: n, drilledLevel: r, dimensionCount: i, params: a, passAllData: o }) => {
|
|
4301
4301
|
let s = e?.chartType;
|
|
4302
|
-
return s ===
|
|
4302
|
+
return s === A.table || s === A.singleValue || n && r === i ? o ? a?.reduce((e, t) => (e[t.columnName] = t.value, e), {}) : a?.find((e) => e.columnName === t)?.value : [A.sankey, A.treeMap].includes(s) ? o ? {
|
|
4303
4303
|
name: a?.name,
|
|
4304
4304
|
value: a?.value
|
|
4305
4305
|
} : a?.value : o ? {
|
|
4306
4306
|
name: a?.name,
|
|
4307
4307
|
value: a?.value,
|
|
4308
4308
|
columnName: a?.seriesName
|
|
4309
|
-
} : t === e?.xAxis || s ===
|
|
4309
|
+
} : t === e?.xAxis || s === A.gauge && t === e?.gaugeSettings?.dimensions?.join(", ") ? a?.name : a?.seriesName === t || s === A.gauge && t === e?.gaugeSettings?.metric || [A.funnel].includes(s) ? a?.value : null;
|
|
4310
4310
|
}, Ta = (e, t, n) => !e || t === n, Ea = ({ chart: e, chartWithMetric: t, chartWithDashboard: n, isDrillEnabled: r, drilledLevel: i, dimensionCount: a, isLastConfiguredDrillLevel: o, isTableRedirectAllowed: s = !0 }) => {
|
|
4311
4311
|
let c = Ta(r, i, a), l = c || !!o, u = !!e?.isEnable && l && s, d = e?.routeType === "user";
|
|
4312
4312
|
return {
|
|
@@ -4315,11 +4315,11 @@ var fa = (e) => !!e && e !== "null" && e !== "undefined", pa = (e) => {
|
|
|
4315
4315
|
openNestedMetric: !!t?.isEnable && c,
|
|
4316
4316
|
openDashboard: !!n?.isEnable && l
|
|
4317
4317
|
};
|
|
4318
|
-
}, Da =
|
|
4318
|
+
}, Da = dt.createContext({
|
|
4319
4319
|
navigate: null,
|
|
4320
4320
|
carryFilters: []
|
|
4321
4321
|
}), Oa = [], ka = ({ children: e, isEnabled: t = !1, onNavigate: n, carryFilters: r }) => {
|
|
4322
|
-
let i = r?.length ? r : Oa, a =
|
|
4322
|
+
let i = r?.length ? r : Oa, a = dt.useMemo(() => ({
|
|
4323
4323
|
navigate: t && n ? n : null,
|
|
4324
4324
|
carryFilters: i
|
|
4325
4325
|
}), [
|
|
@@ -4327,12 +4327,12 @@ var fa = (e) => !!e && e !== "null" && e !== "undefined", pa = (e) => {
|
|
|
4327
4327
|
n,
|
|
4328
4328
|
i
|
|
4329
4329
|
]);
|
|
4330
|
-
return /* @__PURE__ */
|
|
4330
|
+
return /* @__PURE__ */ ht(Da.Provider, {
|
|
4331
4331
|
value: a,
|
|
4332
4332
|
children: e
|
|
4333
4333
|
});
|
|
4334
4334
|
}, Aa = () => {
|
|
4335
|
-
let { navigate: e, carryFilters: t } =
|
|
4335
|
+
let { navigate: e, carryFilters: t } = dt.useContext(Da), n = dt.useCallback((n, r) => {
|
|
4336
4336
|
if (!e) return !1;
|
|
4337
4337
|
let i = n?.clickActions?.chartWithDashboard;
|
|
4338
4338
|
if (!i?.isEnable) return !1;
|
|
@@ -4359,4 +4359,4 @@ var fa = (e) => !!e && e !== "null" && e !== "undefined", pa = (e) => {
|
|
|
4359
4359
|
return n.code === "JOIN_COLUMN_HIDDEN" ? t(Ma("column")) : n.code === "JOIN_PATH_MISSING" ? t(Ma("join")) : n;
|
|
4360
4360
|
};
|
|
4361
4361
|
//#endregion
|
|
4362
|
-
export {
|
|
4362
|
+
export { bt as $, Or as A, Gn as B, Nr as C, Hr as D, Lr as E, mr as F, An as G, Kn as H, dr as I, Dn as J, Fn as K, Z as L, cr as M, fr as N, Ar as O, sr as P, yt as Q, rr as R, Gr as S, zr as T, kn as U, Jn as V, Tn as W, On as X, J as Y, Cn as Z, Ur as _, Aa as a, ci as b, Ca as c, ma as d, vt as et, ua as f, hi as g, pi as h, ja as i, kr as j, jr as k, va as l, xi as m, Na as n, Ea as o, Gi as p, En as q, ka as r, wa as s, Ma as t, ga as u, ni as v, Rr as w, Xr as x, ri as y, nr as z };
|