@databrainhq/plugin 0.17.9-beta.49 → 0.17.9-beta.50
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.
|
@@ -4,17 +4,17 @@ import "react-dom/client";
|
|
|
4
4
|
import { o as e, t } from "./rolldown-runtime-C1JUX4Ur.mjs";
|
|
5
5
|
import { c as n, l as r } from "./cardStates-pxkuDK8H.mjs";
|
|
6
6
|
import { Bt as i, It as a, Vt as o, Zt as s, a as c, c as l, l as u, m as d, u as f, zt as p } from "./pluginV3Request-vedxVBZb.mjs";
|
|
7
|
-
import { $ as m, K as h, O as g, Q as _, U as v, X as y, Y as b, Z as x, a as S, at as C, d as w, et as ee, i as
|
|
8
|
-
import { $a as
|
|
9
|
-
import { t as
|
|
10
|
-
import { s as
|
|
11
|
-
import { y as
|
|
12
|
-
import { n as
|
|
13
|
-
import { i as
|
|
14
|
-
import { E as
|
|
15
|
-
import { f as
|
|
16
|
-
import { t as
|
|
17
|
-
import { createContext as
|
|
7
|
+
import { $ as m, K as h, O as g, Q as _, U as v, X as y, Y as b, Z as x, a as S, at as C, d as w, et as ee, i as te, l as T, lt as ne, q as E, s as D, tt as O } from "./metric.mutation-CpTlOouC.mjs";
|
|
8
|
+
import { $a as k, $n as re, $t as A, At as ie, Br as ae, En as oe, Fn as se, Gt as ce, Hn as le, Ht as ue, In as de, Ja as j, Ki as fe, Kn as pe, La as me, Mn as M, On as he, Pn as ge, Qn as _e, Sn as ve, Tn as ye, Tr as be, Ut as xe, Va as N, Xa as Se, Xt as Ce, Ya as P, Yt as we, Za as Te, Zn as Ee, _n as De, an as Oe, ar as ke, bn as Ae, dn as je, gi as Me, gn as Ne, hn as Pe, in as Fe, jr as Ie, nn as Le, nr as Re, on as ze, or as F, qa as Be, qn as Ve, qt as He, ra as Ue, rr as We, s as Ge, tn as Ke, tr as qe, un as Je, ur as Ye, vi as Xe, vn as Ze, wn as Qe, ya as $e } from "./Portal-rrOaB4Bd.mjs";
|
|
9
|
+
import { t as et } from "./useQuery-D8fC1CBL.mjs";
|
|
10
|
+
import { s as tt } from "./toTasteAppearance-B4_PDCSX.mjs";
|
|
11
|
+
import { y as nt } from "./option-B1zeYJnm.mjs";
|
|
12
|
+
import { n as rt } from "./timeseries-zAu_-AJo.mjs";
|
|
13
|
+
import { i as it } from "./text-CtrvkDIo.mjs";
|
|
14
|
+
import { E as at, M as ot, O as st, T as ct, a as lt, c as ut, f as dt, k as ft, m as pt, p as mt, u as ht, v as gt, y as _t } from "./permissions-tSNA3qFl.mjs";
|
|
15
|
+
import { f as vt, o as yt } from "./RadioButton-CdjohtqA.mjs";
|
|
16
|
+
import { t as bt } from "./TimeSeriesSettings-Cf0qN7IA.mjs";
|
|
17
|
+
import { createContext as xt, useCallback as I, useContext as St, useEffect as L, useLayoutEffect as Ct, useMemo as R, useRef as z, useState as B, useSyncExternalStore as wt } from "react";
|
|
18
18
|
import { jsx as Tt, jsxs as Et } from "react/jsx-runtime";
|
|
19
19
|
//#region src/helpers/getValidRlsConditionOptions.ts
|
|
20
20
|
var Dt = (e, t) => {
|
|
@@ -35,7 +35,7 @@ var Dt = (e, t) => {
|
|
|
35
35
|
"last",
|
|
36
36
|
"this",
|
|
37
37
|
"custom"
|
|
38
|
-
].includes(e || "") || n && !
|
|
38
|
+
].includes(e || "") || n && !ke({
|
|
39
39
|
endDate: t.endDate ?? t.toDate,
|
|
40
40
|
endTime: t.endTime,
|
|
41
41
|
startDate: t.startDate ?? t.fromDate,
|
|
@@ -64,7 +64,7 @@ var Dt = (e, t) => {
|
|
|
64
64
|
}) ? n : void 0,
|
|
65
65
|
options: r
|
|
66
66
|
};
|
|
67
|
-
}, Ot = ({ rlsConditions: e, isFrontendApp: t }) => e.filter((e) => (t || !e.isAppFilter) && !e.isHiddenInUi), kt =
|
|
67
|
+
}, Ot = ({ rlsConditions: e, isFrontendApp: t }) => e.filter((e) => (t || !e.isAppFilter) && !e.isHiddenInUi), kt = xt({}), At = () => St(kt), jt = /;\s*$/, Mt = (e) => e.replace(jt, ""), Nt = (e) => `${e?.token || ""}|${+!!e?.isFrontendApp}|${e?.clientId || ""}`, Pt = (e, t = {}) => e?.id ? e.drillConfig?.levels?.some((e) => !!e?.filters?.length) ? {
|
|
68
68
|
eligible: !1,
|
|
69
69
|
reason: "drill-filtered"
|
|
70
70
|
} : e.isEncrypted && !t.isGuestTokenSession ? {
|
|
@@ -79,8 +79,8 @@ var Dt = (e, t) => {
|
|
|
79
79
|
...r === "platform" && n ? { clientId: n } : {},
|
|
80
80
|
...r === "platform" && t.timezone ? { timezone: t.timezone } : {},
|
|
81
81
|
...t.isEncrypted && i ? {
|
|
82
|
-
rlsConditions: t.rlsConditions?.length ?
|
|
83
|
-
globalFilters: t.globalFilters?.filters?.length ?
|
|
82
|
+
rlsConditions: t.rlsConditions?.length ? j(t.rlsConditions, i) : [],
|
|
83
|
+
globalFilters: t.globalFilters?.filters?.length ? j(t.globalFilters, i) : {
|
|
84
84
|
tableName: "",
|
|
85
85
|
filters: []
|
|
86
86
|
}
|
|
@@ -121,7 +121,10 @@ var Dt = (e, t) => {
|
|
|
121
121
|
totalRecords: e.totalRecords,
|
|
122
122
|
metaData: e.metaData,
|
|
123
123
|
...e.notices ? { notices: e.notices } : {},
|
|
124
|
-
...e.error ? { error: e.error } : {}
|
|
124
|
+
...e.error ? { error: e.error } : {},
|
|
125
|
+
...e.cacheHit === void 0 ? {} : { cacheHit: e.cacheHit },
|
|
126
|
+
...e.dataAsOf === void 0 ? {} : { dataAsOf: e.dataAsOf },
|
|
127
|
+
...e.cacheEnabled === void 0 ? {} : { cacheEnabled: e.cacheEnabled }
|
|
125
128
|
};
|
|
126
129
|
}, Lt = 45e3, Rt = 1e3, zt = 1500, Bt = class {
|
|
127
130
|
options;
|
|
@@ -297,44 +300,44 @@ var Dt = (e, t) => {
|
|
|
297
300
|
settleWithFallback(e) {
|
|
298
301
|
e.fallback().then(e.resolve, e.reject);
|
|
299
302
|
}
|
|
300
|
-
}, Vt = "dbnMetricBatch",
|
|
303
|
+
}, Vt = "dbnMetricBatch", Ht = "@dbn:metricQueryBatch", V = () => {
|
|
301
304
|
try {
|
|
302
|
-
let e = window.localStorage.getItem(
|
|
305
|
+
let e = window.localStorage.getItem(Ht);
|
|
303
306
|
if (e === "on" || e === "off") return e;
|
|
304
307
|
} catch {}
|
|
305
308
|
return null;
|
|
306
|
-
},
|
|
309
|
+
}, Ut = (e) => {
|
|
307
310
|
try {
|
|
308
|
-
e === null ? window.localStorage.removeItem(
|
|
311
|
+
e === null ? window.localStorage.removeItem(Ht) : window.localStorage.setItem(Ht, e);
|
|
309
312
|
} catch {}
|
|
310
|
-
},
|
|
313
|
+
}, Wt = () => {
|
|
311
314
|
try {
|
|
312
315
|
let e = new URLSearchParams(window.location.search).get(Vt);
|
|
313
|
-
(e === "on" || e === "off") &&
|
|
316
|
+
(e === "on" || e === "off") && Ut(e);
|
|
314
317
|
} catch {}
|
|
315
|
-
},
|
|
318
|
+
}, Gt = () => typeof window > "u" || window.dbn?.disableMetricQueryBatch ? "off" : (Wt(), V() ?? "auto"), Kt = () => Gt() !== "off", qt = /* @__PURE__ */ new Set(), H = () => {
|
|
316
319
|
let e;
|
|
317
|
-
return
|
|
320
|
+
return qt.forEach((t) => {
|
|
318
321
|
if (!e) try {
|
|
319
322
|
let n = t();
|
|
320
323
|
n && Object.keys(n).length && (e = n);
|
|
321
324
|
} catch {}
|
|
322
325
|
}), e;
|
|
323
|
-
},
|
|
326
|
+
}, Jt = "/hasuraActions/externalMetricQueryBatch", Yt = "/api/v3/metric/queryBatch", Xt = [
|
|
324
327
|
404,
|
|
325
328
|
405,
|
|
326
329
|
501
|
|
327
|
-
],
|
|
330
|
+
], Zt = [
|
|
328
331
|
200,
|
|
329
332
|
400,
|
|
330
333
|
401,
|
|
331
334
|
403
|
|
332
|
-
],
|
|
333
|
-
let i =
|
|
335
|
+
], Qt = (e) => !!e.token || !!(e.isFrontendApp && e.clientId), $t = (e = {}) => typeof window > "u" || typeof fetch != "function" || window.dbn?.isEnableProxyAuth ? null : Qt(e) ? "embed" : H() ? "platform" : null, en = (e = "platform") => `${window.dbn?.baseUrl || d}${e === "embed" ? Yt : Jt}`, tn = async (e, t, r = {}) => {
|
|
336
|
+
let i = $t(r);
|
|
334
337
|
if (!i) throw new b("No credentials available for batched queries");
|
|
335
338
|
let a;
|
|
336
339
|
if (i === "embed") a = await l({
|
|
337
|
-
path:
|
|
340
|
+
path: Yt,
|
|
338
341
|
method: "POST",
|
|
339
342
|
signal: t,
|
|
340
343
|
token: r.token,
|
|
@@ -344,9 +347,9 @@ var Dt = (e, t) => {
|
|
|
344
347
|
throwOnHttpError: !1
|
|
345
348
|
});
|
|
346
349
|
else {
|
|
347
|
-
let n =
|
|
350
|
+
let n = H();
|
|
348
351
|
if (!n) throw new b("No access token available for batched queries");
|
|
349
|
-
a = await fetch(
|
|
352
|
+
a = await fetch(en(i), {
|
|
350
353
|
method: "POST",
|
|
351
354
|
signal: t,
|
|
352
355
|
headers: {
|
|
@@ -358,7 +361,7 @@ var Dt = (e, t) => {
|
|
|
358
361
|
body: JSON.stringify({ input: { input: { requests: e } } })
|
|
359
362
|
});
|
|
360
363
|
}
|
|
361
|
-
if (
|
|
364
|
+
if (Xt.includes(a.status)) throw new y(`Batch endpoint responded ${a.status}`);
|
|
362
365
|
let o;
|
|
363
366
|
try {
|
|
364
367
|
o = await a.json();
|
|
@@ -368,23 +371,23 @@ var Dt = (e, t) => {
|
|
|
368
371
|
let s = n(o);
|
|
369
372
|
if (s?.code === "UNAUTHORIZED_ORIGIN" || s?.details?.reason === "UNAUTHORIZED_ORIGIN") throw Object.assign(Error(s.message || "UNAUTHORIZED_ORIGIN"), s, { code: "UNAUTHORIZED_ORIGIN" });
|
|
370
373
|
let c = o?.error && typeof o.error == "object" ? o.error : void 0;
|
|
371
|
-
if (c &&
|
|
374
|
+
if (c && Zt.includes(a.status)) throw new b(c.message || "Unauthorized request!");
|
|
372
375
|
if (a.status === 401 || a.status === 403) throw new b(`Batch endpoint responded ${a.status}`);
|
|
373
376
|
if (!a.ok) throw Error(o?.message || `Batch request failed with status ${a.status}`);
|
|
374
377
|
if (!Array.isArray(o?.results) && typeof o?.error != "string") throw new y("Batch endpoint response did not match the expected shape");
|
|
375
378
|
return o;
|
|
376
|
-
},
|
|
377
|
-
transport:
|
|
379
|
+
}, nn = null, rn = 50, an = 4, on = () => (nn ||= new Bt({
|
|
380
|
+
transport: tn,
|
|
378
381
|
coalesceWindowMs: 500,
|
|
379
|
-
visibleCoalesceWindowMs:
|
|
382
|
+
visibleCoalesceWindowMs: rn,
|
|
380
383
|
coalesceIdleMs: Rt,
|
|
381
384
|
coalesceMaxWaitMs: zt,
|
|
382
|
-
coldHeadSize:
|
|
383
|
-
}),
|
|
384
|
-
t !== void 0 &&
|
|
385
|
-
let u =
|
|
386
|
-
if (!
|
|
387
|
-
let d =
|
|
385
|
+
coldHeadSize: an
|
|
386
|
+
}), nn), sn = async ({ payload: e, savedMetricQuery: t, dbName: n, savedMetricIdentifiers: r, clientId: i, key: a, hints: o, batchPolicy: s, session: c, single: l }) => {
|
|
387
|
+
t !== void 0 && Ee(t, "metric.query", n), _e(r);
|
|
388
|
+
let u = qe(e);
|
|
389
|
+
if (!Kt()) return l(u);
|
|
390
|
+
let d = $t(c);
|
|
388
391
|
if (!d || !Pt(u, o).eligible) return l(u);
|
|
389
392
|
let f = {
|
|
390
393
|
request: Ft(a, u, i, d, c?.token),
|
|
@@ -392,28 +395,41 @@ var Dt = (e, t) => {
|
|
|
392
395
|
batchPolicy: s,
|
|
393
396
|
session: c
|
|
394
397
|
};
|
|
395
|
-
return
|
|
396
|
-
},
|
|
398
|
+
return on().enqueue(f);
|
|
399
|
+
}, U = xt("standard"), cn = xt(void 0), W = 8, G = /* @__PURE__ */ new Map(), ln = /* @__PURE__ */ new Set(), un = (e, t) => {
|
|
400
|
+
if (!e || typeof t != "boolean") return;
|
|
401
|
+
let n = t ? "cached" : "live";
|
|
402
|
+
if (G.get(e) !== n) {
|
|
403
|
+
if (G.delete(e), G.size >= W) {
|
|
404
|
+
let e = G.keys().next().value;
|
|
405
|
+
e !== void 0 && G.delete(e);
|
|
406
|
+
}
|
|
407
|
+
G.set(e, n);
|
|
408
|
+
for (let e of ln) e();
|
|
409
|
+
}
|
|
410
|
+
}, dn = (e) => (ln.add(e), () => {
|
|
411
|
+
ln.delete(e);
|
|
412
|
+
}), fn = (e) => e ? G.get(e) : void 0, pn = 134217728, mn = /* @__PURE__ */ new WeakMap(), hn = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
397
413
|
if (e == null) return 0;
|
|
398
414
|
if (typeof e == "string") return e.length * 2;
|
|
399
415
|
if (typeof e == "number" || typeof e == "bigint") return 8;
|
|
400
416
|
if (typeof e == "boolean") return 4;
|
|
401
417
|
if (typeof e != "object") return 0;
|
|
402
|
-
let n = e, r =
|
|
418
|
+
let n = e, r = mn.get(n);
|
|
403
419
|
if (r !== void 0) return r;
|
|
404
420
|
if (t.has(n)) return 0;
|
|
405
421
|
t.add(n);
|
|
406
422
|
let i = 32;
|
|
407
|
-
if (Array.isArray(e)) for (let n of e) i += 8 +
|
|
408
|
-
else for (let [n, r] of Object.entries(e)) i += n.length * 2 + 8 +
|
|
409
|
-
return
|
|
410
|
-
},
|
|
423
|
+
if (Array.isArray(e)) for (let n of e) i += 8 + hn(n, t);
|
|
424
|
+
else for (let [n, r] of Object.entries(e)) i += n.length * 2 + 8 + hn(r, t);
|
|
425
|
+
return mn.set(n, i), i;
|
|
426
|
+
}, gn = (e, { maxEntries: t = 128, maxBytes: n = pn } = {}) => {
|
|
411
427
|
let r = e.getQueryCache().findAll({
|
|
412
428
|
queryKey: [p],
|
|
413
429
|
type: "inactive"
|
|
414
430
|
}).map((e) => ({
|
|
415
431
|
query: e,
|
|
416
|
-
bytes:
|
|
432
|
+
bytes: hn(e.state.data)
|
|
417
433
|
})).sort((e, t) => e.query.state.dataUpdatedAt - t.query.state.dataUpdatedAt), i = r.reduce((e, t) => e + t.bytes, 0);
|
|
418
434
|
for (; r.length > t || i > n && r.length > 1;) {
|
|
419
435
|
let t = r.shift();
|
|
@@ -424,11 +440,11 @@ var Dt = (e, t) => {
|
|
|
424
440
|
type: "inactive"
|
|
425
441
|
});
|
|
426
442
|
}
|
|
427
|
-
},
|
|
428
|
-
if (
|
|
429
|
-
|
|
443
|
+
}, _n = /* @__PURE__ */ new WeakSet(), vn = (e) => {
|
|
444
|
+
if (_n.has(e)) return;
|
|
445
|
+
_n.add(e);
|
|
430
446
|
let t = () => {
|
|
431
|
-
|
|
447
|
+
_n.delete(e), gn(e);
|
|
432
448
|
}, n = globalThis.scheduler;
|
|
433
449
|
if (typeof n?.postTask == "function") {
|
|
434
450
|
n.postTask(t, { priority: "background" });
|
|
@@ -439,15 +455,15 @@ var Dt = (e, t) => {
|
|
|
439
455
|
return;
|
|
440
456
|
}
|
|
441
457
|
setTimeout(t, 0);
|
|
442
|
-
},
|
|
458
|
+
}, K = /* @__PURE__ */ t(((e, t) => {
|
|
443
459
|
(function(n, r) {
|
|
444
|
-
typeof e == "object" ? t.exports = e = r(
|
|
460
|
+
typeof e == "object" ? t.exports = e = r(Te()) : typeof define == "function" && define.amd ? define(["./core"], r) : r(n.CryptoJS);
|
|
445
461
|
})(e, function(e) {
|
|
446
462
|
return e.enc.Hex;
|
|
447
463
|
});
|
|
448
|
-
})),
|
|
464
|
+
})), yn = /* @__PURE__ */ t(((e, t) => {
|
|
449
465
|
(function(n, r) {
|
|
450
|
-
typeof e == "object" ? t.exports = e = r(
|
|
466
|
+
typeof e == "object" ? t.exports = e = r(Te()) : typeof define == "function" && define.amd ? define(["./core"], r) : r(n.CryptoJS);
|
|
451
467
|
})(e, function(e) {
|
|
452
468
|
return (function(t) {
|
|
453
469
|
var n = e, r = n.lib, i = r.WordArray, a = r.Hasher, o = n.algo, s = [], c = [];
|
|
@@ -489,9 +505,9 @@ var Dt = (e, t) => {
|
|
|
489
505
|
n.SHA256 = a._createHelper(u), n.HmacSHA256 = a._createHmacHelper(u);
|
|
490
506
|
})(Math), e.SHA256;
|
|
491
507
|
});
|
|
492
|
-
})),
|
|
508
|
+
})), bn = /* @__PURE__ */ t(((e, t) => {
|
|
493
509
|
(function(n, r, i) {
|
|
494
|
-
typeof e == "object" ? t.exports = e = r(
|
|
510
|
+
typeof e == "object" ? t.exports = e = r(Te(), yn(), Se()) : typeof define == "function" && define.amd ? define([
|
|
495
511
|
"./core",
|
|
496
512
|
"./sha256",
|
|
497
513
|
"./hmac"
|
|
@@ -499,43 +515,43 @@ var Dt = (e, t) => {
|
|
|
499
515
|
})(e, function(e) {
|
|
500
516
|
return e.HmacSHA256;
|
|
501
517
|
});
|
|
502
|
-
})),
|
|
518
|
+
})), xn = /* @__PURE__ */ e(K()), Sn = /* @__PURE__ */ e(yn()), Cn = /* @__PURE__ */ e(bn()), wn = (e) => {
|
|
503
519
|
let t = Object.getPrototypeOf(e);
|
|
504
520
|
return (t === Object.prototype || t === null) && !("toJSON" in e);
|
|
505
|
-
},
|
|
521
|
+
}, Tn = (e, t) => {
|
|
506
522
|
if (e === t) return !0;
|
|
507
523
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
508
524
|
if (Array.isArray(e)) {
|
|
509
525
|
if (!Array.isArray(t) || e.length !== t.length) return !1;
|
|
510
|
-
for (let n = 0; n < e.length; n += 1) if (!
|
|
526
|
+
for (let n = 0; n < e.length; n += 1) if (!Tn(e[n], t[n])) return !1;
|
|
511
527
|
return !0;
|
|
512
528
|
}
|
|
513
|
-
if (Array.isArray(t) || !
|
|
529
|
+
if (Array.isArray(t) || !wn(e) || !wn(t)) return !1;
|
|
514
530
|
let n = Object.keys(e);
|
|
515
531
|
if (n.length !== Object.keys(t).length) return !1;
|
|
516
|
-
for (let r of n) if (!Object.hasOwn(t, r) || !
|
|
532
|
+
for (let r of n) if (!Object.hasOwn(t, r) || !Tn(e[r], t[r])) return !1;
|
|
517
533
|
return !0;
|
|
518
|
-
},
|
|
534
|
+
}, En = "dbn:metric-query:guest-principal:v1", Dn = 8, q = /* @__PURE__ */ new Map(), J = (e) => {
|
|
519
535
|
if (!e) return;
|
|
520
|
-
let t =
|
|
536
|
+
let t = q.get(e);
|
|
521
537
|
if (t !== void 0) return t;
|
|
522
|
-
let n = (0,
|
|
523
|
-
if (
|
|
524
|
-
let e =
|
|
525
|
-
e !== void 0 &&
|
|
538
|
+
let n = (0, Cn.default)(e, En).toString(xn.default);
|
|
539
|
+
if (q.size >= Dn) {
|
|
540
|
+
let e = q.keys().next().value;
|
|
541
|
+
e !== void 0 && q.delete(e);
|
|
526
542
|
}
|
|
527
|
-
return
|
|
528
|
-
},
|
|
543
|
+
return q.set(e, n), n;
|
|
544
|
+
}, On = "dbn:metric-query:client-scope:v1", kn = 16, An = /* @__PURE__ */ new Map(), Y = (e) => {
|
|
529
545
|
if (!e) return;
|
|
530
|
-
let t =
|
|
546
|
+
let t = An.get(e);
|
|
531
547
|
if (t !== void 0) return t;
|
|
532
|
-
let n = (0,
|
|
533
|
-
if (
|
|
534
|
-
let e =
|
|
535
|
-
e !== void 0 &&
|
|
548
|
+
let n = (0, Cn.default)(e, On).toString(xn.default);
|
|
549
|
+
if (An.size >= kn) {
|
|
550
|
+
let e = An.keys().next().value;
|
|
551
|
+
e !== void 0 && An.delete(e);
|
|
536
552
|
}
|
|
537
|
-
return
|
|
538
|
-
},
|
|
553
|
+
return An.set(e, n), n;
|
|
554
|
+
}, jn = [
|
|
539
555
|
"updatedAt",
|
|
540
556
|
"query",
|
|
541
557
|
"metricQuery",
|
|
@@ -548,56 +564,56 @@ var Dt = (e, t) => {
|
|
|
548
564
|
"groupBy",
|
|
549
565
|
"selectedGroupBy",
|
|
550
566
|
"timeGrain"
|
|
551
|
-
],
|
|
567
|
+
], Mn = /* @__PURE__ */ new WeakMap(), Nn = (e) => {
|
|
552
568
|
if (!e) return;
|
|
553
|
-
let t =
|
|
569
|
+
let t = Mn.get(e);
|
|
554
570
|
if (t !== void 0) return t;
|
|
555
|
-
let n = e, r = (0,
|
|
556
|
-
return
|
|
557
|
-
},
|
|
571
|
+
let n = e, r = (0, Sn.default)(JSON.stringify(jn.map((e) => n[e] ?? null))).toString(xn.default).slice(0, 16);
|
|
572
|
+
return Mn.set(e, r), r;
|
|
573
|
+
}, Pn = (e, t, n) => {
|
|
558
574
|
if (!t) return e;
|
|
559
|
-
let r =
|
|
575
|
+
let r = Y(n);
|
|
560
576
|
return r ? { clientScope: r } : e;
|
|
561
|
-
},
|
|
577
|
+
}, Fn = ({ queryName: e, data: t, clientId: n, clientCacheScope: r, isFrontendApp: i, token: a, isFullScreen: o, metricRevision: s }) => [
|
|
562
578
|
e,
|
|
563
579
|
t,
|
|
564
|
-
|
|
580
|
+
Pn(n, i, r),
|
|
565
581
|
i,
|
|
566
|
-
a ? { guestPrincipal:
|
|
582
|
+
a ? { guestPrincipal: J(a) } : void 0,
|
|
567
583
|
o,
|
|
568
584
|
s
|
|
569
|
-
],
|
|
585
|
+
], In = (e, t) => !e || !!t, Ln = /* @__PURE__ */ new WeakMap(), Rn = 512, X = /* @__PURE__ */ new Map(), zn = (e) => {
|
|
570
586
|
switch (typeof e) {
|
|
571
587
|
case "string": return JSON.stringify(e);
|
|
572
588
|
case "boolean": return e ? "true" : "false";
|
|
573
589
|
case "undefined": return "null";
|
|
574
590
|
default: return g([e]).slice(1, -1);
|
|
575
591
|
}
|
|
576
|
-
},
|
|
577
|
-
if (
|
|
578
|
-
let e =
|
|
579
|
-
e !== void 0 &&
|
|
592
|
+
}, Bn = (e, t, n) => {
|
|
593
|
+
if (X.delete(e), X.size >= Rn) {
|
|
594
|
+
let e = X.keys().next().value;
|
|
595
|
+
e !== void 0 && X.delete(e);
|
|
580
596
|
}
|
|
581
|
-
|
|
597
|
+
X.set(e, {
|
|
582
598
|
payload: t,
|
|
583
599
|
hash: n
|
|
584
600
|
});
|
|
585
|
-
},
|
|
586
|
-
if (typeof e != "object" || !e) return
|
|
587
|
-
let t =
|
|
601
|
+
}, Vn = (e) => {
|
|
602
|
+
if (typeof e != "object" || !e) return zn(e);
|
|
603
|
+
let t = Ln.get(e);
|
|
588
604
|
if (t !== void 0) return t;
|
|
589
|
-
let n = e.id, r = typeof n == "string" ?
|
|
590
|
-
return
|
|
591
|
-
},
|
|
605
|
+
let n = e.id, r = typeof n == "string" ? X.get(n) : void 0, i = r && Tn(r.payload, e) ? r.hash : zn(e);
|
|
606
|
+
return Ln.set(e, i), typeof n == "string" && Bn(n, e, i), i;
|
|
607
|
+
}, Hn = (e) => `[${e.map((e, t) => t === 1 ? Vn(e) : zn(e)).join(",")}]`, Un = ({ queryName: e, workspaceId: t, guestToken: n, isFrontendApp: r, encryptedClientId: i }) => [
|
|
592
608
|
e,
|
|
593
609
|
t,
|
|
594
610
|
{
|
|
595
|
-
guestPrincipal:
|
|
611
|
+
guestPrincipal: J(n),
|
|
596
612
|
isFrontendApp: r,
|
|
597
613
|
encryptedClientId: i
|
|
598
614
|
}
|
|
599
|
-
],
|
|
600
|
-
let y = v(), b =
|
|
615
|
+
], Wn = ({ clientId: e, clientCacheScope: t, metricRevision: n, data: i, token: a, isFrontendApp: o, isFullScreen: c = "", batchHints: l, savedMetricQuery: u, savedMetricIdentifiers: d, dbName: f, timeoutMs: h = Lt }, g) => {
|
|
616
|
+
let y = v(), b = St(U), x = St(cn), S = J(a), C = I(() => fn(S), [S]), w = wt(dn, C, C), ee = (x ?? w) === "live", te = !!i.id && !g?.isDisableQuery && (!o || !!e), T = Fn({
|
|
601
617
|
queryName: p,
|
|
602
618
|
data: i,
|
|
603
619
|
clientId: e,
|
|
@@ -607,19 +623,19 @@ var Dt = (e, t) => {
|
|
|
607
623
|
isFullScreen: c,
|
|
608
624
|
metricRevision: n
|
|
609
625
|
});
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
isQueryEnabled:
|
|
626
|
+
L(() => {
|
|
627
|
+
O() && m("metric-query-enabled-state", {
|
|
628
|
+
isQueryEnabled: te,
|
|
613
629
|
hasMetricId: !!i.id,
|
|
614
630
|
isDisableQuery: !!g?.isDisableQuery,
|
|
615
631
|
isFrontendApp: o,
|
|
616
632
|
hasClientId: !!e,
|
|
617
633
|
hasToken: !!a,
|
|
618
634
|
isFullScreen: c,
|
|
619
|
-
payload:
|
|
635
|
+
payload: ne(i)
|
|
620
636
|
});
|
|
621
637
|
}, [
|
|
622
|
-
|
|
638
|
+
te,
|
|
623
639
|
i,
|
|
624
640
|
g?.isDisableQuery,
|
|
625
641
|
o,
|
|
@@ -627,22 +643,22 @@ var Dt = (e, t) => {
|
|
|
627
643
|
a,
|
|
628
644
|
c
|
|
629
645
|
]);
|
|
630
|
-
let
|
|
646
|
+
let D = (t) => {
|
|
631
647
|
let n = t || i;
|
|
632
|
-
return
|
|
648
|
+
return O() && m("metric-query-fetch-start", {
|
|
633
649
|
path: s,
|
|
634
650
|
clientId: e,
|
|
635
651
|
isFrontendApp: o,
|
|
636
652
|
hasToken: !!a,
|
|
637
653
|
isFullScreen: c,
|
|
638
|
-
payload:
|
|
639
|
-
}),
|
|
654
|
+
payload: ne(n)
|
|
655
|
+
}), E(s, {
|
|
640
656
|
method: "POST",
|
|
641
657
|
data: {
|
|
642
658
|
...n || {},
|
|
643
659
|
...!o && a ? {
|
|
644
|
-
...Array.isArray(n?.rlsConditions) && n.rlsConditions.length ? { rlsConditions:
|
|
645
|
-
...typeof n?.globalFilters == "object" && n.globalFilters !== null && "filters" in n.globalFilters && Array.isArray(n.globalFilters.filters) && n.globalFilters.filters.length ? { globalFilters:
|
|
660
|
+
...Array.isArray(n?.rlsConditions) && n.rlsConditions.length ? { rlsConditions: j(n.rlsConditions, a) } : { rlsConditions: [] },
|
|
661
|
+
...typeof n?.globalFilters == "object" && n.globalFilters !== null && "filters" in n.globalFilters && Array.isArray(n.globalFilters.filters) && n.globalFilters.filters.length ? { globalFilters: j(n.globalFilters, a) } : { globalFilters: {
|
|
646
662
|
tableName: "",
|
|
647
663
|
filters: []
|
|
648
664
|
} }
|
|
@@ -653,13 +669,13 @@ var Dt = (e, t) => {
|
|
|
653
669
|
token: a,
|
|
654
670
|
timeoutMs: h
|
|
655
671
|
});
|
|
656
|
-
},
|
|
657
|
-
queryKey:
|
|
658
|
-
queryKeyHashFn:
|
|
659
|
-
queryFn: () => (
|
|
672
|
+
}, k = et({
|
|
673
|
+
queryKey: T,
|
|
674
|
+
queryKeyHashFn: Hn,
|
|
675
|
+
queryFn: () => (O() && m("metric-query-dispatch", {
|
|
660
676
|
metricId: i?.id,
|
|
661
|
-
payload:
|
|
662
|
-
}),
|
|
677
|
+
payload: ne(i)
|
|
678
|
+
}), sn({
|
|
663
679
|
batchPolicy: b,
|
|
664
680
|
payload: i,
|
|
665
681
|
savedMetricQuery: u,
|
|
@@ -676,63 +692,67 @@ var Dt = (e, t) => {
|
|
|
676
692
|
isFrontendApp: o,
|
|
677
693
|
clientId: e
|
|
678
694
|
},
|
|
679
|
-
single:
|
|
695
|
+
single: D
|
|
680
696
|
})),
|
|
681
|
-
enabled:
|
|
682
|
-
meta: a || !
|
|
697
|
+
enabled: te,
|
|
698
|
+
meta: a || ee || !In(o, t) ? { persist: !1 } : void 0,
|
|
683
699
|
retry: (e, t) => r(t).code !== "UNAUTHORIZED_ORIGIN" && !_(t) && e < 2,
|
|
684
|
-
staleTime: 3e5,
|
|
700
|
+
staleTime: ee ? 3e4 : 3e5,
|
|
685
701
|
gcTime: 9e5
|
|
686
|
-
}),
|
|
687
|
-
queryHash:
|
|
688
|
-
dataUpdatedAt:
|
|
689
|
-
errorUpdatedAt:
|
|
690
|
-
fetchStatus:
|
|
691
|
-
isSuccess:
|
|
692
|
-
isError:
|
|
693
|
-
data:
|
|
694
|
-
error:
|
|
702
|
+
}), re = Hn(T), A = R(() => ({
|
|
703
|
+
queryHash: re,
|
|
704
|
+
dataUpdatedAt: k.dataUpdatedAt,
|
|
705
|
+
errorUpdatedAt: k.errorUpdatedAt,
|
|
706
|
+
fetchStatus: k.fetchStatus,
|
|
707
|
+
isSuccess: k.isSuccess,
|
|
708
|
+
isError: k.isError,
|
|
709
|
+
data: k.data,
|
|
710
|
+
error: k.error
|
|
695
711
|
}), [
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
]),
|
|
705
|
-
|
|
706
|
-
let
|
|
707
|
-
return
|
|
708
|
-
if (!
|
|
709
|
-
let e =
|
|
710
|
-
|
|
711
|
-
payload:
|
|
712
|
+
re,
|
|
713
|
+
k.dataUpdatedAt,
|
|
714
|
+
k.errorUpdatedAt,
|
|
715
|
+
k.fetchStatus,
|
|
716
|
+
k.isSuccess,
|
|
717
|
+
k.isError,
|
|
718
|
+
k.data,
|
|
719
|
+
k.error
|
|
720
|
+
]), ie = z(i);
|
|
721
|
+
ie.current = i;
|
|
722
|
+
let ae = z(g);
|
|
723
|
+
return ae.current = g, L(() => {
|
|
724
|
+
if (!A.isSuccess || A.fetchStatus !== "idle") return;
|
|
725
|
+
let e = A.data;
|
|
726
|
+
O() && m("metric-query-success", {
|
|
727
|
+
payload: ne(ie.current),
|
|
712
728
|
responseDataType: typeof e?.data,
|
|
713
729
|
responseRowCount: Array.isArray(e?.data) ? e?.data?.length : void 0,
|
|
714
730
|
totalRecords: e?.totalRecords
|
|
715
|
-
}),
|
|
716
|
-
}, [
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
731
|
+
}), un(S, e?.cacheEnabled), ae.current?.onSuccess?.(e), vn(y);
|
|
732
|
+
}, [
|
|
733
|
+
A,
|
|
734
|
+
S,
|
|
735
|
+
y
|
|
736
|
+
]), L(() => () => vn(y), [y]), L(() => {
|
|
737
|
+
if (A.fetchStatus !== "idle" || !A.isSuccess && !A.isError) return;
|
|
738
|
+
let e = A.data, t = A.error;
|
|
739
|
+
O() && m("metric-query-settled", {
|
|
740
|
+
payload: ne(ie.current),
|
|
721
741
|
hasError: !!t,
|
|
722
742
|
errorMessage: t instanceof Error ? t.message : t?.message,
|
|
723
743
|
responseDataType: typeof e?.data,
|
|
724
744
|
responseRowCount: Array.isArray(e?.data) ? e?.data?.length : void 0
|
|
725
|
-
}),
|
|
726
|
-
}, [
|
|
727
|
-
},
|
|
745
|
+
}), ae.current?.onSettled?.(e, t);
|
|
746
|
+
}, [A]), k;
|
|
747
|
+
}, Gn = async ({ workspaceId: e, token: t, isFrontend: n, encryptedClientId: r }) => (n && await u(), E(`${i}?id=${e}`, {
|
|
728
748
|
method: "GET",
|
|
729
749
|
token: n ? "" : t || "",
|
|
730
750
|
isFrontend: n,
|
|
731
751
|
clientId: r
|
|
732
|
-
})),
|
|
733
|
-
let { token: i } =
|
|
734
|
-
return
|
|
735
|
-
queryKey:
|
|
752
|
+
})), Kn = (e, t, n, r) => {
|
|
753
|
+
let { token: i } = k(), a = n ? "" : t || i || "";
|
|
754
|
+
return et({
|
|
755
|
+
queryKey: Un({
|
|
736
756
|
queryName: o,
|
|
737
757
|
workspaceId: e,
|
|
738
758
|
guestToken: a,
|
|
@@ -740,7 +760,7 @@ var Dt = (e, t) => {
|
|
|
740
760
|
encryptedClientId: r
|
|
741
761
|
}),
|
|
742
762
|
meta: { persist: !1 },
|
|
743
|
-
queryFn: () =>
|
|
763
|
+
queryFn: () => Gn({
|
|
744
764
|
workspaceId: e,
|
|
745
765
|
token: a,
|
|
746
766
|
isFrontend: n,
|
|
@@ -748,17 +768,17 @@ var Dt = (e, t) => {
|
|
|
748
768
|
}),
|
|
749
769
|
enabled: !!e
|
|
750
770
|
});
|
|
751
|
-
},
|
|
771
|
+
}, qn = ({ language: e, translationDictionary: t }) => !e || !t ? !1 : Object.values(t).some((t) => !!t?.[e]), Jn = ({ language: e, translationDictionary: t }) => !qn({
|
|
752
772
|
language: e,
|
|
753
773
|
translationDictionary: t
|
|
754
|
-
}),
|
|
774
|
+
}), Yn = ({ language: e, tableLimit: t, translationDictionary: n }) => Jn({
|
|
755
775
|
language: e,
|
|
756
776
|
translationDictionary: n
|
|
757
777
|
}) ? {
|
|
758
778
|
limit: String(t.limit),
|
|
759
779
|
offset: String(t.offset)
|
|
760
|
-
} : {},
|
|
761
|
-
if (!
|
|
780
|
+
} : {}, Z = ({ language: e, search: t, searchColumns: n, translationDictionary: r }) => {
|
|
781
|
+
if (!Jn({
|
|
762
782
|
language: e,
|
|
763
783
|
translationDictionary: r
|
|
764
784
|
})) return {};
|
|
@@ -767,13 +787,13 @@ var Dt = (e, t) => {
|
|
|
767
787
|
search: i && a ? i : void 0,
|
|
768
788
|
searchColumns: i && a ? n : void 0
|
|
769
789
|
};
|
|
770
|
-
},
|
|
790
|
+
}, Xn = ({ currentSearchValue: e, nextValue: t, shouldUseServerSideSearch: n, tableLimit: r }) => {
|
|
771
791
|
let i = String(t).trim() !== (e || "").trim(), a = r.offset !== 0;
|
|
772
792
|
return {
|
|
773
793
|
shouldResetPageOffset: a,
|
|
774
794
|
shouldSetTablePending: a || n && i
|
|
775
795
|
};
|
|
776
|
-
},
|
|
796
|
+
}, Zn = ({ isPythonMode: e, search: t, shouldUseServerSideSearch: n }) => e ? !0 : !n, Qn = ({ columnName: e, disableDownloadUnderlyingDataNoFilters: t, isLoading: n, isSingleValueChart: r }) => !n && !t && !!(e || r), $n = ({ isPrev: e, nextOffset: t, prev: n, resetValue: r }) => r === void 0 ? t === void 0 ? {
|
|
777
797
|
limit: n.limit,
|
|
778
798
|
offset: e ? Math.max(n.offset - n.limit, 0) : n.offset + n.limit
|
|
779
799
|
} : {
|
|
@@ -782,15 +802,15 @@ var Dt = (e, t) => {
|
|
|
782
802
|
} : {
|
|
783
803
|
limit: r,
|
|
784
804
|
offset: 0
|
|
785
|
-
},
|
|
786
|
-
let o =
|
|
805
|
+
}, er = (e) => e == null ? e : le(e.toString()), tr = (e, t) => [...e ?? [], ...t ?? []].some((e) => !!e?.columnName && e.value !== void 0), nr = (e = []) => e.filter((e) => e?.columnName && e.value !== void 0), rr = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => {
|
|
806
|
+
let o = nr(n);
|
|
787
807
|
return i || !e || a === void 0 ? o : [...o.filter((t) => t.columnName !== e || String(t.value) !== String(a)), {
|
|
788
808
|
columnName: e,
|
|
789
809
|
dataType: t,
|
|
790
810
|
expressionSql: r,
|
|
791
811
|
value: a
|
|
792
812
|
}];
|
|
793
|
-
},
|
|
813
|
+
}, ir = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => rr({
|
|
794
814
|
columnName: e,
|
|
795
815
|
dataType: t,
|
|
796
816
|
drillFilters: n,
|
|
@@ -801,30 +821,30 @@ var Dt = (e, t) => {
|
|
|
801
821
|
columnName: e.columnName,
|
|
802
822
|
dataType: e.dataType,
|
|
803
823
|
expressionSql: e.expressionSql,
|
|
804
|
-
value:
|
|
805
|
-
})),
|
|
824
|
+
value: er(e.value)
|
|
825
|
+
})), ar = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => rr({
|
|
806
826
|
columnName: e,
|
|
807
827
|
dataType: t,
|
|
808
828
|
drillFilters: n,
|
|
809
829
|
expressionSql: r,
|
|
810
830
|
isSingleValueChart: i,
|
|
811
831
|
value: a
|
|
812
|
-
}),
|
|
813
|
-
let i =
|
|
832
|
+
}), or = ({ query: e, limit: t, offset: n, dbName: r }) => {
|
|
833
|
+
let i = Ie === r?.toLowerCase(), a = [Xe, Me].includes(r?.toLowerCase() || ""), o = fe === r?.toLowerCase(), s = (e) => n ? `OFFSET ${n} LIMIT ${e}` : `LIMIT ${e}`, c = Mt(e), l = (c?.toLowerCase() ?? "").includes("order"), u = parseInt(t, 10);
|
|
814
834
|
if (c?.toLowerCase().includes("limit")) {
|
|
815
835
|
let e = parseInt(c?.toLowerCase().split("limit")?.[1]?.trim() ?? "0", 10), r = n ? t : Math.min(e, u);
|
|
816
836
|
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}` : ""}`));
|
|
817
837
|
} 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}` : ""}`);
|
|
818
838
|
return c;
|
|
819
|
-
},
|
|
839
|
+
}, Q = (e) => {
|
|
820
840
|
try {
|
|
821
841
|
return JSON.stringify(e);
|
|
822
842
|
} catch {
|
|
823
843
|
return String(Date.now()) + ":" + Math.random().toString(36).slice(2);
|
|
824
844
|
}
|
|
825
|
-
},
|
|
845
|
+
}, sr = (e, t) => {
|
|
826
846
|
if (t?.error && !(Array.isArray(t?.data) && t.data.length)) {
|
|
827
|
-
|
|
847
|
+
cr(e, t.error);
|
|
828
848
|
return;
|
|
829
849
|
}
|
|
830
850
|
let n = t?.data, r = typeof t?.totalRecords == "number" ? t.totalRecords : 0, i = n && Array.isArray(n) && n.length ? n : [];
|
|
@@ -832,13 +852,13 @@ var Dt = (e, t) => {
|
|
|
832
852
|
e.setTotalRecords?.(r), e.setData(i), e.setLoading(!1);
|
|
833
853
|
});
|
|
834
854
|
};
|
|
835
|
-
function
|
|
855
|
+
function cr(e, t) {
|
|
836
856
|
e.forEach((e) => {
|
|
837
857
|
e.onError?.(t), e.setData([]), e.setLoading(!1), e.setTotalRecords?.(0);
|
|
838
858
|
});
|
|
839
859
|
}
|
|
840
|
-
var
|
|
841
|
-
let { mutateAsync: b } =
|
|
860
|
+
var lr = ({ 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 }) => {
|
|
861
|
+
let { mutateAsync: b } = T(), { data: x } = Kn(s, void 0, d, f), S = x?.weekStartDay === "sunday" ? "sunday" : "monday", C = z(/* @__PURE__ */ new Map()), w = z({
|
|
842
862
|
token: u,
|
|
843
863
|
epoch: 0
|
|
844
864
|
});
|
|
@@ -847,104 +867,104 @@ var rr = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
|
|
|
847
867
|
epoch: w.current.epoch + 1
|
|
848
868
|
});
|
|
849
869
|
let ee = w.current.epoch;
|
|
850
|
-
return
|
|
870
|
+
return L(() => {
|
|
851
871
|
let e = C.current;
|
|
852
872
|
return () => {
|
|
853
873
|
e.clear();
|
|
854
874
|
};
|
|
855
|
-
}, []), { getUnderlyingData:
|
|
856
|
-
let
|
|
875
|
+
}, []), { getUnderlyingData: I(({ columnName: x, dataType: w, expressionSql: te, value: T, setData: ne, setLoading: E, isSingleValueChart: D, clientColumnType: O, limit: k, offset: re, search: A, searchColumns: ie, setTotalRecords: ae, pointFilters: oe, onError: se, withoutFilters: ce }) => {
|
|
876
|
+
let le = r === "MULTI_DATABASE" && t || "", ue = v && _ ? _ : k !== void 0 || re !== void 0 ? a : or({
|
|
857
877
|
query: a,
|
|
858
878
|
limit: "5000",
|
|
859
879
|
dbName: n
|
|
860
|
-
}),
|
|
880
|
+
}), de = ce ? {
|
|
861
881
|
...p,
|
|
862
882
|
filters: p.filters.filter((e) => e.isVariableFilter)
|
|
863
|
-
} : p,
|
|
864
|
-
clientColumnType:
|
|
865
|
-
query:
|
|
883
|
+
} : p, j = h, fe = ge({
|
|
884
|
+
clientColumnType: O,
|
|
885
|
+
query: ue || "",
|
|
866
886
|
dbName: n,
|
|
867
|
-
rlsConditions:
|
|
887
|
+
rlsConditions: j,
|
|
868
888
|
tenancyLevel: r || "TABLE",
|
|
869
889
|
clientId: t,
|
|
870
|
-
globalFilters:
|
|
890
|
+
globalFilters: de,
|
|
871
891
|
values: i,
|
|
872
892
|
isAllClient: m,
|
|
873
893
|
dataMartRelationships: g,
|
|
874
894
|
weekStartDay: S
|
|
875
|
-
}),
|
|
895
|
+
}), pe = D && !v ? vt(fe) : fe, me = tr(y, oe) ? ir({
|
|
876
896
|
columnName: x,
|
|
877
897
|
dataType: w,
|
|
878
|
-
drillFilters:
|
|
879
|
-
expressionSql:
|
|
880
|
-
isSingleValueChart:
|
|
881
|
-
value:
|
|
882
|
-
}) : [],
|
|
883
|
-
columnName:
|
|
898
|
+
drillFilters: oe?.length ? [...y ?? [], ...oe] : y,
|
|
899
|
+
expressionSql: te,
|
|
900
|
+
isSingleValueChart: D,
|
|
901
|
+
value: T
|
|
902
|
+
}) : [], M = {
|
|
903
|
+
columnName: D ? void 0 : x,
|
|
884
904
|
companyId: o,
|
|
885
|
-
query:
|
|
886
|
-
dataType:
|
|
887
|
-
expressionSql:
|
|
888
|
-
value:
|
|
889
|
-
drillFilters:
|
|
905
|
+
query: P(pe, o),
|
|
906
|
+
dataType: D ? void 0 : w,
|
|
907
|
+
expressionSql: D ? void 0 : te,
|
|
908
|
+
value: D ? void 0 : er(T),
|
|
909
|
+
drillFilters: me.length ? me : void 0,
|
|
890
910
|
workspaceId: s,
|
|
891
911
|
metricId: c,
|
|
892
912
|
dashboardId: l,
|
|
893
913
|
isCustomSql: v && !!_,
|
|
894
|
-
databaseName:
|
|
914
|
+
databaseName: le,
|
|
895
915
|
datasourceId: e,
|
|
896
|
-
limit:
|
|
916
|
+
limit: k,
|
|
897
917
|
offset: re,
|
|
898
|
-
search:
|
|
899
|
-
searchColumns:
|
|
900
|
-
globalFilters:
|
|
901
|
-
rlsConditions:
|
|
918
|
+
search: A,
|
|
919
|
+
searchColumns: ie,
|
|
920
|
+
globalFilters: de,
|
|
921
|
+
rlsConditions: j,
|
|
902
922
|
filterValues: i,
|
|
903
|
-
isSingleValueChart:
|
|
923
|
+
isSingleValueChart: D && !v
|
|
904
924
|
};
|
|
905
|
-
|
|
906
|
-
let
|
|
907
|
-
columnName:
|
|
908
|
-
value:
|
|
909
|
-
dataType:
|
|
910
|
-
expressionSql:
|
|
911
|
-
drillFilters:
|
|
912
|
-
limit:
|
|
913
|
-
offset:
|
|
914
|
-
search:
|
|
915
|
-
searchColumns:
|
|
916
|
-
finalQuery:
|
|
917
|
-
companyId:
|
|
918
|
-
workspaceId:
|
|
919
|
-
metricId:
|
|
920
|
-
dashboardId:
|
|
921
|
-
datasourceId:
|
|
922
|
-
databaseName:
|
|
923
|
-
isCustomSql:
|
|
924
|
-
isSingleValueChart:
|
|
925
|
+
ne([]), E(!0);
|
|
926
|
+
let he = Q({
|
|
927
|
+
columnName: M.columnName,
|
|
928
|
+
value: M.value,
|
|
929
|
+
dataType: M.dataType,
|
|
930
|
+
expressionSql: M.expressionSql,
|
|
931
|
+
drillFilters: M.drillFilters,
|
|
932
|
+
limit: M.limit,
|
|
933
|
+
offset: M.offset,
|
|
934
|
+
search: M.search,
|
|
935
|
+
searchColumns: M.searchColumns,
|
|
936
|
+
finalQuery: pe,
|
|
937
|
+
companyId: M.companyId,
|
|
938
|
+
workspaceId: M.workspaceId,
|
|
939
|
+
metricId: M.metricId,
|
|
940
|
+
dashboardId: M.dashboardId,
|
|
941
|
+
datasourceId: M.datasourceId,
|
|
942
|
+
databaseName: M.databaseName,
|
|
943
|
+
isCustomSql: M.isCustomSql,
|
|
944
|
+
isSingleValueChart: D,
|
|
925
945
|
principal: `${+!!d}|${f || ""}|${ee}`
|
|
926
|
-
}),
|
|
927
|
-
setData:
|
|
928
|
-
setLoading:
|
|
929
|
-
setTotalRecords:
|
|
930
|
-
onError:
|
|
931
|
-
},
|
|
932
|
-
if (
|
|
933
|
-
|
|
946
|
+
}), _e = {
|
|
947
|
+
setData: ne,
|
|
948
|
+
setLoading: E,
|
|
949
|
+
setTotalRecords: ae,
|
|
950
|
+
onError: se
|
|
951
|
+
}, ve = C.current.get(he);
|
|
952
|
+
if (ve) {
|
|
953
|
+
ve.subscribers.add(_e);
|
|
934
954
|
return;
|
|
935
955
|
}
|
|
936
|
-
let
|
|
937
|
-
C.current.set(
|
|
938
|
-
data:
|
|
956
|
+
let ye = /* @__PURE__ */ new Set([_e]);
|
|
957
|
+
C.current.set(he, { subscribers: ye }), b({
|
|
958
|
+
data: M,
|
|
939
959
|
token: u || "",
|
|
940
960
|
isFrontendApp: d,
|
|
941
961
|
encryptedClientId: d && f || ""
|
|
942
962
|
}).then((e) => {
|
|
943
|
-
let t = C.current.get(
|
|
944
|
-
C.current.delete(
|
|
963
|
+
let t = C.current.get(he);
|
|
964
|
+
C.current.delete(he), sr(t?.subscribers ?? ye, e);
|
|
945
965
|
}).catch((e) => {
|
|
946
|
-
let t = C.current.get(
|
|
947
|
-
C.current.delete(
|
|
966
|
+
let t = C.current.get(he);
|
|
967
|
+
C.current.delete(he), cr(t?.subscribers ?? ye, e);
|
|
948
968
|
});
|
|
949
969
|
}, [
|
|
950
970
|
t,
|
|
@@ -971,7 +991,7 @@ var rr = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
|
|
|
971
991
|
S,
|
|
972
992
|
s
|
|
973
993
|
]) };
|
|
974
|
-
},
|
|
994
|
+
}, ur = new Set([
|
|
975
995
|
"bar",
|
|
976
996
|
"row",
|
|
977
997
|
"stack",
|
|
@@ -985,47 +1005,47 @@ var rr = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
|
|
|
985
1005
|
"doughnut",
|
|
986
1006
|
"rose",
|
|
987
1007
|
"table"
|
|
988
|
-
].map((e) =>
|
|
1008
|
+
].map((e) => be(e))), dr = /\border\s+by\b/i, fr = /\bunion\b/i, pr = (e) => {
|
|
989
1009
|
let t = 0, n = null, r = "";
|
|
990
1010
|
for (let i of e) n ? (i === n && (n = null), r += " ") : i === "'" || i === "\"" || i === "`" ? (n = i, r += t ? " " : i) : (i === "(" && (t += 1), r += t ? " " : i, i === ")" && (t = Math.max(0, t - 1)));
|
|
991
1011
|
return r;
|
|
992
|
-
},
|
|
993
|
-
let t =
|
|
1012
|
+
}, mr = /^(?:(?:"[^"]*"|`[^`]*`|\[[^\]]*\]|[\w$]+)\.)*(?:"([^"]+)"|`([^`]+)`|\[([^\]]+)\]|([\w$]+))$/, hr = /\s+(asc|desc)?\s*(nulls\s+(first|last))?\s*$/i, gr = (e) => {
|
|
1013
|
+
let t = pr(e), n = [...t.matchAll(/\border\s+by\b/gi)], r = n[n.length - 1];
|
|
994
1014
|
if (r?.index === void 0) return null;
|
|
995
1015
|
let i = r.index + r[0].length, a = t.slice(i).search(/\b(limit|offset|fetch)\b|;/i), o = a < 0 ? e.length : i + a, s = [], c = i;
|
|
996
1016
|
for (let n = i; n <= o; n += 1) {
|
|
997
1017
|
if (n < o && t[n] !== ",") continue;
|
|
998
|
-
let r = e.slice(c, n).replace(
|
|
1018
|
+
let r = e.slice(c, n).replace(hr, "").trim();
|
|
999
1019
|
if (c = n + 1, /^\d+$/.test(r)) {
|
|
1000
1020
|
s.push(Number(r));
|
|
1001
1021
|
continue;
|
|
1002
1022
|
}
|
|
1003
|
-
let i =
|
|
1023
|
+
let i = mr.exec(r);
|
|
1004
1024
|
if (!i) return null;
|
|
1005
1025
|
s.push(i[1] ?? i[2] ?? i[3] ?? i[4]);
|
|
1006
1026
|
}
|
|
1007
1027
|
return s.length ? s : null;
|
|
1008
|
-
},
|
|
1009
|
-
if (n || r || typeof e != "string" || !e.trim() ||
|
|
1010
|
-
let i =
|
|
1028
|
+
}, _r = ({ query: e, chartType: t, isDrilled: n, isPythonMode: r }) => {
|
|
1029
|
+
if (n || r || typeof e != "string" || !e.trim() || fr.test(e) || !ur.has(be(t)) || !dr.test(e)) return null;
|
|
1030
|
+
let i = gr(e);
|
|
1011
1031
|
return i ? { orderBy: i } : null;
|
|
1012
|
-
},
|
|
1013
|
-
let n =
|
|
1014
|
-
return n || r ? n === r ? 0 : n ? 1 : -1 :
|
|
1015
|
-
},
|
|
1016
|
-
function
|
|
1032
|
+
}, vr = (e) => e == null || e === "", yr = (e, t) => {
|
|
1033
|
+
let n = vr(e), r = vr(t);
|
|
1034
|
+
return n || r ? n === r ? 0 : n ? 1 : -1 : nt(typeof e == "number" ? e : String(e), typeof t == "number" ? t : String(t));
|
|
1035
|
+
}, br = (e, t) => typeof e == "number" ? t[e - 1] : t.find((t) => t.toLowerCase() === e.toLowerCase());
|
|
1036
|
+
function xr(e, t = { orderBy: [] }) {
|
|
1017
1037
|
if (!Array.isArray(e) || e.length < 2) return e;
|
|
1018
1038
|
let n = Object.keys(e[0] ?? {});
|
|
1019
1039
|
if (!n.length) return e;
|
|
1020
|
-
let r = t.orderBy.map((e) =>
|
|
1040
|
+
let r = t.orderBy.map((e) => br(e, n));
|
|
1021
1041
|
if (r.some((e) => e === void 0)) return e;
|
|
1022
1042
|
let i = (t, r) => {
|
|
1023
1043
|
for (let i of n) {
|
|
1024
|
-
let n =
|
|
1044
|
+
let n = yr(e[t]?.[i], e[r]?.[i]);
|
|
1025
1045
|
if (n !== 0) return n;
|
|
1026
1046
|
}
|
|
1027
1047
|
return t - r;
|
|
1028
|
-
}, a = (t, n) => r.every((r) =>
|
|
1048
|
+
}, a = (t, n) => r.every((r) => yr(e[t]?.[r], e[n]?.[r]) === 0), o = [];
|
|
1029
1049
|
for (let t = 0; t < e.length;) {
|
|
1030
1050
|
let n = t + 1;
|
|
1031
1051
|
for (; n < e.length && a(t, n);) n += 1;
|
|
@@ -1037,16 +1057,16 @@ function pr(e, t = { orderBy: [] }) {
|
|
|
1037
1057
|
}
|
|
1038
1058
|
//#endregion
|
|
1039
1059
|
//#region src/components/Chart/metricCardResult.ts
|
|
1040
|
-
var
|
|
1060
|
+
var Sr = { rows: [] }, Cr = {
|
|
1041
1061
|
rows: [],
|
|
1042
1062
|
error: {
|
|
1043
1063
|
code: "INVALID_METRIC_RESULT",
|
|
1044
1064
|
message: "Could not load chart data.",
|
|
1045
1065
|
hint: "Retry the chart. If it still fails, contact your workspace admin."
|
|
1046
1066
|
}
|
|
1047
|
-
},
|
|
1048
|
-
if (e == null) return
|
|
1049
|
-
if (!
|
|
1067
|
+
}, wr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Tr = (e) => {
|
|
1068
|
+
if (e == null) return Sr;
|
|
1069
|
+
if (!wr(e)) return Cr;
|
|
1050
1070
|
let t = e.errorDetail ? n(e) ?? e.error : e.error, r = e.data;
|
|
1051
1071
|
if (typeof r == "string") try {
|
|
1052
1072
|
r = JSON.parse(r);
|
|
@@ -1054,9 +1074,9 @@ var mr = { rows: [] }, hr = {
|
|
|
1054
1074
|
return t ? {
|
|
1055
1075
|
rows: [],
|
|
1056
1076
|
error: t
|
|
1057
|
-
} :
|
|
1077
|
+
} : Cr;
|
|
1058
1078
|
}
|
|
1059
|
-
if (
|
|
1079
|
+
if (wr(r) && (r.error || r.errorDetail)) return {
|
|
1060
1080
|
rows: [],
|
|
1061
1081
|
error: r.errorDetail ? n(r) ?? r.error : r.error
|
|
1062
1082
|
};
|
|
@@ -1064,53 +1084,53 @@ var mr = { rows: [] }, hr = {
|
|
|
1064
1084
|
rows: [],
|
|
1065
1085
|
error: t
|
|
1066
1086
|
};
|
|
1067
|
-
if (
|
|
1087
|
+
if (wr(r) && typeof r.code == "string" && typeof r.message == "string") return {
|
|
1068
1088
|
rows: [],
|
|
1069
1089
|
error: {
|
|
1070
1090
|
code: r.code,
|
|
1071
1091
|
message: r.message
|
|
1072
1092
|
}
|
|
1073
1093
|
};
|
|
1074
|
-
if (!Array.isArray(r) || !r.every(
|
|
1075
|
-
let i = Array.isArray(e.notices) && e.notices.some((e) =>
|
|
1094
|
+
if (!Array.isArray(r) || !r.every(wr)) return Cr;
|
|
1095
|
+
let i = Array.isArray(e.notices) && e.notices.some((e) => wr(e) && e.code === "FILTER_NOT_APPLIED");
|
|
1076
1096
|
return {
|
|
1077
1097
|
rows: r,
|
|
1078
1098
|
...i ? { isFilterNotApplied: !0 } : {}
|
|
1079
1099
|
};
|
|
1080
|
-
},
|
|
1081
|
-
function
|
|
1100
|
+
}, Er = (e) => typeof e == "object" && !!e && "configType" in e && e.configType === "AGGREGATE", Dr = Symbol("cross-filter-source-metric"), Or = (e, t) => (t && Object.defineProperty(e, Dr, { value: t }), e);
|
|
1101
|
+
function kr({ filters: e, metricId: t, isGroupByEnabled: n, enableCrossFilterBeforeDrill: r = !1 }) {
|
|
1082
1102
|
return r ? (e || []).filter((e) => {
|
|
1083
|
-
let r = e[
|
|
1103
|
+
let r = e[Dr];
|
|
1084
1104
|
return r ? r !== t : !n;
|
|
1085
1105
|
}) : n ? [] : e || [];
|
|
1086
1106
|
}
|
|
1087
|
-
function
|
|
1107
|
+
function Ar(e, t, n) {
|
|
1088
1108
|
return t === "DATABASE" ? `${n}.${e?.split(".").slice(1).join(".")}` : e;
|
|
1089
1109
|
}
|
|
1090
|
-
var
|
|
1110
|
+
var jr = (e) => {
|
|
1091
1111
|
let t = e?.table?.schemaName, n = e?.table?.tableName;
|
|
1092
1112
|
if (t && n) return `${t}.${n}`;
|
|
1093
|
-
},
|
|
1094
|
-
if (!
|
|
1113
|
+
}, Mr = (e) => typeof e == "string" && !!e.trim(), Nr = (e, t) => t?.find((t) => t?.alias === e || t?.name === e), Pr = ({ columnName: e, selectedDims: t }) => {
|
|
1114
|
+
if (!Mr(e)) return;
|
|
1095
1115
|
if (!t?.length) return e;
|
|
1096
|
-
let n =
|
|
1097
|
-
if (n &&
|
|
1098
|
-
},
|
|
1116
|
+
let n = Nr(e, t);
|
|
1117
|
+
if (n && jr(n)) return Mr(n.name) ? n.name : e;
|
|
1118
|
+
}, Fr = "This filter column is no longer available. Refresh the metric and select a column before filtering.", Ir = ({ columnName: e, rowFilters: t, selectedDims: n, requiresSchemaMetadata: r = !1 }) => {
|
|
1099
1119
|
let i = t?.length ? t.map((e) => e.columnName) : e === void 0 ? [] : [e];
|
|
1100
|
-
return i.some((e) => !
|
|
1120
|
+
return i.some((e) => !Mr(e)) || (t?.length || r) && !n?.length || i.some((e) => !!n?.length && !Pr({
|
|
1101
1121
|
columnName: e,
|
|
1102
1122
|
selectedDims: n
|
|
1103
|
-
})) ?
|
|
1123
|
+
})) ? Fr : void 0;
|
|
1104
1124
|
};
|
|
1105
|
-
function
|
|
1125
|
+
function Lr(e) {
|
|
1106
1126
|
let t = e.value === null || e.value === void 0, n = t ? "null" : e.value;
|
|
1107
|
-
return
|
|
1127
|
+
return Or({
|
|
1108
1128
|
columnName: e.columnName,
|
|
1109
1129
|
datatype: "string",
|
|
1110
1130
|
isAddOnMetrics: !0,
|
|
1111
1131
|
name: "cross-filter",
|
|
1112
1132
|
options: [n],
|
|
1113
|
-
tableName:
|
|
1133
|
+
tableName: Ar(e.tableName, e.tenancyLevel, e.clientId),
|
|
1114
1134
|
value: [n],
|
|
1115
1135
|
...t ? { filterVariant: {
|
|
1116
1136
|
label: "IN",
|
|
@@ -1118,17 +1138,17 @@ function kr(e) {
|
|
|
1118
1138
|
} } : {}
|
|
1119
1139
|
}, e.sourceMetricId);
|
|
1120
1140
|
}
|
|
1121
|
-
function
|
|
1141
|
+
function Rr({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filterValue: i, columnName: a, rowFilters: o, selectedDims: s, activeLevelTableName: c, tenancyLevel: l, clientId: u, sourceMetricId: d }) {
|
|
1122
1142
|
if (t || n) return [];
|
|
1123
|
-
let f = i != null &&
|
|
1143
|
+
let f = i != null && Mr(a);
|
|
1124
1144
|
if (!((f || o?.length) && r)) return [];
|
|
1125
1145
|
if (o?.length) {
|
|
1126
1146
|
let t = o.map((e) => {
|
|
1127
|
-
let t =
|
|
1147
|
+
let t = Pr({
|
|
1128
1148
|
columnName: e?.columnName,
|
|
1129
1149
|
selectedDims: s
|
|
1130
|
-
}), n =
|
|
1131
|
-
if (n && t) return
|
|
1150
|
+
}), n = jr(t ? Nr(e.columnName, s) : void 0);
|
|
1151
|
+
if (n && t) return Lr({
|
|
1132
1152
|
columnName: t,
|
|
1133
1153
|
value: e?.value,
|
|
1134
1154
|
tableName: n,
|
|
@@ -1140,7 +1160,7 @@ function Ar({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
|
|
|
1140
1160
|
return [...e || [], ...t];
|
|
1141
1161
|
}
|
|
1142
1162
|
if (f) {
|
|
1143
|
-
if (d) return
|
|
1163
|
+
if (d) return Wr({
|
|
1144
1164
|
existing: e,
|
|
1145
1165
|
columnName: a,
|
|
1146
1166
|
value: i,
|
|
@@ -1149,11 +1169,11 @@ function Ar({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
|
|
|
1149
1169
|
clientId: u,
|
|
1150
1170
|
sourceMetricId: d
|
|
1151
1171
|
});
|
|
1152
|
-
let t =
|
|
1172
|
+
let t = Pr({
|
|
1153
1173
|
columnName: a,
|
|
1154
1174
|
selectedDims: s
|
|
1155
1175
|
});
|
|
1156
|
-
return t ? [...e || [],
|
|
1176
|
+
return t ? [...e || [], Lr({
|
|
1157
1177
|
columnName: t,
|
|
1158
1178
|
value: i,
|
|
1159
1179
|
tableName: c,
|
|
@@ -1164,42 +1184,42 @@ function Ar({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
|
|
|
1164
1184
|
}
|
|
1165
1185
|
return [];
|
|
1166
1186
|
}
|
|
1167
|
-
var
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1187
|
+
var zr = /* @__PURE__ */ new Set([
|
|
1188
|
+
N.progressBar,
|
|
1189
|
+
N.progressBarV2,
|
|
1190
|
+
N.linearGauge,
|
|
1191
|
+
N.linearGaugeV2,
|
|
1192
|
+
N.gauge,
|
|
1193
|
+
N.gaugeV2
|
|
1174
1194
|
]);
|
|
1175
|
-
function
|
|
1195
|
+
function Br({ runtimeEnabled: e, metricEnabled: t }) {
|
|
1176
1196
|
return !!e || !!t;
|
|
1177
1197
|
}
|
|
1178
|
-
function
|
|
1179
|
-
if (e &&
|
|
1198
|
+
function Vr({ chartType: e, isDrillEnabled: t, dimensions: n, drilledLevel: r, drillLevels: i }) {
|
|
1199
|
+
if (e && zr.has(e)) return "terminal";
|
|
1180
1200
|
if (!t || (n?.length ?? 0) === r) return "none";
|
|
1181
1201
|
let a = i || [];
|
|
1182
1202
|
return a[a.length - 1]?.isEnable ? "none" : "drill";
|
|
1183
1203
|
}
|
|
1184
|
-
function
|
|
1185
|
-
return e ===
|
|
1204
|
+
function Hr({ chartType: e, params: t, rowFilters: n, dimensions: r }) {
|
|
1205
|
+
return e === N.table ? {
|
|
1186
1206
|
name: n?.find((e) => r?.some((t) => e?.columnName === t))?.value,
|
|
1187
1207
|
rowFilters: n
|
|
1188
1208
|
} : t;
|
|
1189
1209
|
}
|
|
1190
|
-
function
|
|
1191
|
-
if (!
|
|
1192
|
-
let n =
|
|
1193
|
-
return !!n && !!
|
|
1210
|
+
function Ur(e, t) {
|
|
1211
|
+
if (!Mr(e)) return !1;
|
|
1212
|
+
let n = Nr(e, t);
|
|
1213
|
+
return !!n && !!jr(n);
|
|
1194
1214
|
}
|
|
1195
|
-
function
|
|
1196
|
-
if (!
|
|
1197
|
-
let c =
|
|
1215
|
+
function Wr({ existing: e, columnName: t, value: n, mode: r = "only", selectedDims: i, tenancyLevel: a, clientId: o, sourceMetricId: s }) {
|
|
1216
|
+
if (!Mr(t) || n === void 0) return e || [];
|
|
1217
|
+
let c = Nr(t, i), l = Pr({
|
|
1198
1218
|
columnName: t,
|
|
1199
1219
|
selectedDims: i
|
|
1200
|
-
}), u =
|
|
1220
|
+
}), u = jr(c);
|
|
1201
1221
|
if (!u || !l) return e || [];
|
|
1202
|
-
let d =
|
|
1222
|
+
let d = Lr({
|
|
1203
1223
|
columnName: l,
|
|
1204
1224
|
value: n,
|
|
1205
1225
|
tableName: u,
|
|
@@ -1210,29 +1230,29 @@ function Ir({ existing: e, columnName: t, value: n, mode: r = "only", selectedDi
|
|
|
1210
1230
|
label: "NOT IN",
|
|
1211
1231
|
value: "NOT IN"
|
|
1212
1232
|
};
|
|
1213
|
-
return [...f, r === "exclude" ?
|
|
1233
|
+
return [...f, r === "exclude" ? Or({
|
|
1214
1234
|
...d,
|
|
1215
1235
|
filterVariant: p
|
|
1216
1236
|
}, s) : d];
|
|
1217
1237
|
}
|
|
1218
1238
|
//#endregion
|
|
1219
1239
|
//#region src/core/metric-builder/terminalAction.ts
|
|
1220
|
-
var
|
|
1240
|
+
var Gr = {
|
|
1221
1241
|
"no-subset": "no-subset",
|
|
1222
1242
|
"no-reachable-columns": "no-reachable-columns",
|
|
1223
1243
|
"all-dimensions-used": "all-dimensions-used",
|
|
1224
1244
|
"max-depth-reached": "max-depth-reached",
|
|
1225
1245
|
"custom-sql": "custom-sql"
|
|
1226
|
-
},
|
|
1246
|
+
}, Kr = ({ position: e, hasAuthoredNextLevel: t, pool: n, canDrillIntoAnyDimension: r }) => {
|
|
1227
1247
|
if (t) return "underlying-data-not-permitted";
|
|
1228
1248
|
if (r) {
|
|
1229
1249
|
if (n?.groups?.length) return "underlying-data-not-permitted";
|
|
1230
|
-
if (n?.unavailableReason) return
|
|
1250
|
+
if (n?.unavailableReason) return Gr[n.unavailableReason];
|
|
1231
1251
|
if (e.currentDepth >= 3) return "max-depth-reached";
|
|
1232
1252
|
}
|
|
1233
1253
|
return "hierarchy-exhausted";
|
|
1234
1254
|
};
|
|
1235
|
-
function
|
|
1255
|
+
function qr(e) {
|
|
1236
1256
|
if (e.resultState === "failed") return {
|
|
1237
1257
|
kind: "none",
|
|
1238
1258
|
reason: "query-failed"
|
|
@@ -1251,10 +1271,10 @@ function zr(e) {
|
|
|
1251
1271
|
isOpenInNewTab: t.isOpenInNewTab
|
|
1252
1272
|
} : e.canViewUnderlyingData ? { kind: "viewRecords" } : {
|
|
1253
1273
|
kind: "none",
|
|
1254
|
-
reason:
|
|
1274
|
+
reason: Kr(e)
|
|
1255
1275
|
};
|
|
1256
1276
|
}
|
|
1257
|
-
var
|
|
1277
|
+
var Jr = {
|
|
1258
1278
|
"hierarchy-exhausted": {
|
|
1259
1279
|
title: "There is nothing further to break this down by",
|
|
1260
1280
|
body: "This is the whole breakdown this chart is set up for."
|
|
@@ -1300,7 +1320,7 @@ var Br = {
|
|
|
1300
1320
|
body: "Try again, or go back a step."
|
|
1301
1321
|
}
|
|
1302
1322
|
};
|
|
1303
|
-
function
|
|
1323
|
+
function Yr(e) {
|
|
1304
1324
|
switch (e.kind) {
|
|
1305
1325
|
case "viewRecords": return {
|
|
1306
1326
|
title: "Look at the rows behind this",
|
|
@@ -1317,38 +1337,38 @@ function Vr(e) {
|
|
|
1317
1337
|
body: "Another chart is set up to pick up from what you picked here.",
|
|
1318
1338
|
cta: "Open chart"
|
|
1319
1339
|
};
|
|
1320
|
-
default: return
|
|
1340
|
+
default: return Jr[e.reason];
|
|
1321
1341
|
}
|
|
1322
1342
|
}
|
|
1323
1343
|
//#endregion
|
|
1324
1344
|
//#region src/helpers/customSqlDrill.ts
|
|
1325
|
-
var
|
|
1326
|
-
if (!
|
|
1327
|
-
let t =
|
|
1328
|
-
return t.isPythonMode === !0 &&
|
|
1329
|
-
},
|
|
1345
|
+
var Xr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Zr = (e) => typeof e == "string" ? e : "", Qr = (e) => {
|
|
1346
|
+
if (!Xr(e)) return !1;
|
|
1347
|
+
let t = Xr(e.newDatasetSettings) ? e.newDatasetSettings : {};
|
|
1348
|
+
return t.isPythonMode === !0 && Zr(t.pythonCode).trim() || e.isUseRawSQL !== !0 && t.isSqlMode !== !0 ? !1 : !Xr((Xr(t.configuration) ? t.configuration : {}).table);
|
|
1349
|
+
}, $r = (e) => {
|
|
1330
1350
|
let t = e?.name || e?.alias;
|
|
1331
1351
|
return t ? {
|
|
1332
1352
|
...e,
|
|
1333
1353
|
name: t,
|
|
1334
1354
|
alias: t
|
|
1335
1355
|
} : e;
|
|
1336
|
-
},
|
|
1356
|
+
}, ei = (e) => e?.levels?.length ? {
|
|
1337
1357
|
...e,
|
|
1338
1358
|
levels: e.levels.map((e) => ({
|
|
1339
1359
|
...e,
|
|
1340
|
-
dimensions: (e?.dimensions || []).map(
|
|
1341
|
-
measures: (e?.measures || []).map(
|
|
1360
|
+
dimensions: (e?.dimensions || []).map($r),
|
|
1361
|
+
measures: (e?.measures || []).map($r)
|
|
1342
1362
|
}))
|
|
1343
|
-
} : e,
|
|
1363
|
+
} : e, ti = (e, t, n) => n?.length ? {
|
|
1344
1364
|
...e,
|
|
1345
1365
|
[t]: n
|
|
1346
|
-
} : Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)),
|
|
1366
|
+
} : Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)), ni = ({ metricId: e, filters: t, onChange: n }) => {
|
|
1347
1367
|
e && n?.(e, t);
|
|
1348
|
-
},
|
|
1368
|
+
}, ri = (e) => e.find(([, e, t]) => !Array.isArray(e) || !t && e.length === 0)?.[0], ii = (e, t) => {
|
|
1349
1369
|
let n = e?.chartType, r = n === "pivotV2" || n === "pivot table 2";
|
|
1350
1370
|
if (!r && n !== "pivotV3" && n !== "pivot table 3") return { renderEmpty: !1 };
|
|
1351
|
-
let i =
|
|
1371
|
+
let i = ri(r ? [
|
|
1352
1372
|
["chartOptions.pivotTableSettings2.dimensions", e?.pivotTableSettings2?.dimensions],
|
|
1353
1373
|
[
|
|
1354
1374
|
"chartOptions.pivotTableSettings2.headers",
|
|
@@ -1378,7 +1398,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1378
1398
|
renderEmpty: !0,
|
|
1379
1399
|
missingField: i
|
|
1380
1400
|
};
|
|
1381
|
-
let a = t?.newDatasetSettings, o =
|
|
1401
|
+
let a = t?.newDatasetSettings, o = ri([
|
|
1382
1402
|
[
|
|
1383
1403
|
"datasetMetricSettings.newDatasetSettings.selectedDims",
|
|
1384
1404
|
a?.selectedDims,
|
|
@@ -1402,10 +1422,10 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1402
1422
|
renderEmpty: !0,
|
|
1403
1423
|
missingField: "datasetMetricSettings.newDatasetSettings.selectedDims"
|
|
1404
1424
|
};
|
|
1405
|
-
},
|
|
1406
|
-
let e =
|
|
1407
|
-
return
|
|
1408
|
-
},
|
|
1425
|
+
}, ai = xt([]), oi = () => {
|
|
1426
|
+
let e = St(ai), { data: t } = k(), n = t?.externalDashboard?.dashboardFiltersLayout;
|
|
1427
|
+
return R(() => e.length ? e : Array.isArray(n) ? n.filter((e) => typeof e == "string") : [], [e, n]);
|
|
1428
|
+
}, si = (e, t, n = []) => {
|
|
1409
1429
|
if (!t.length || e.length < 2) return e;
|
|
1410
1430
|
let r = (e) => {
|
|
1411
1431
|
let r = n.find((t) => t.name && t.name === e.name || !!t.columnName && t.columnName === e.columnName && (!t.tableName || !e.tableName || t.tableName === e.tableName)), i = [
|
|
@@ -1430,38 +1450,38 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1430
1450
|
...e,
|
|
1431
1451
|
index: t
|
|
1432
1452
|
})).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);
|
|
1433
|
-
},
|
|
1434
|
-
let [t, n] =
|
|
1435
|
-
return
|
|
1453
|
+
}, ci = 100, li = (e) => {
|
|
1454
|
+
let [t, n] = B(e);
|
|
1455
|
+
return L(() => {
|
|
1436
1456
|
if (e) {
|
|
1437
1457
|
n(!0);
|
|
1438
1458
|
return;
|
|
1439
1459
|
}
|
|
1440
|
-
let t = setTimeout(() => n(!1),
|
|
1460
|
+
let t = setTimeout(() => n(!1), ci);
|
|
1441
1461
|
return () => clearTimeout(t);
|
|
1442
1462
|
}, [e]), t;
|
|
1443
|
-
},
|
|
1463
|
+
}, ui = (e, t) => !(!e || e.isLoading !== !0 || e.key !== t || e.data?.data?.length), di = ({ clientId: e, guestToken: t, isFrontendApp: n }) => JSON.stringify({
|
|
1444
1464
|
clientId: e,
|
|
1445
1465
|
guestToken: t || "",
|
|
1446
1466
|
isFrontendApp: n
|
|
1447
|
-
}),
|
|
1467
|
+
}), fi = ({ query: e, clientId: t, isFrontendApp: n }) => JSON.stringify({
|
|
1448
1468
|
query: e,
|
|
1449
1469
|
tenant: {
|
|
1450
1470
|
clientId: t,
|
|
1451
1471
|
isFrontendApp: n
|
|
1452
1472
|
}
|
|
1453
|
-
}),
|
|
1473
|
+
}), pi = (e, t) => e?.includes(t) ? e : [...e || [], t], mi = (e, t) => e?.includes(t) ? e.filter((e) => e !== t) : e, hi = (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), gi = (e) => e.isMetric !== !1 || e.elementSettings?.elementType?.value === "metricExpression", _i = ({ 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 }) => ({
|
|
1454
1474
|
isAllClient: t,
|
|
1455
1475
|
id: e?.id,
|
|
1456
1476
|
tenancyLevel: n,
|
|
1457
|
-
rlsConditions: [...(r?.length ? r : i) || [], ...o?.tableSettings?.isServerSidePagination && o?.chartType ===
|
|
1477
|
+
rlsConditions: [...(r?.length ? r : i) || [], ...o?.tableSettings?.isServerSidePagination && o?.chartType === N.table ? a.map((e) => e.condition).filter((e) => se(e)) : []],
|
|
1458
1478
|
globalFilters: s ? void 0 : {
|
|
1459
1479
|
...c,
|
|
1460
1480
|
filters: c?.filters?.filter((e) => Array.isArray(e?.value) ? e?.value?.length : e)
|
|
1461
1481
|
},
|
|
1462
1482
|
filterValues: s ? void 0 : l,
|
|
1463
|
-
limit: o?.tableSettings?.isServerSidePagination && o?.chartType ===
|
|
1464
|
-
offset: o?.tableSettings?.isServerSidePagination && o?.chartType ===
|
|
1483
|
+
limit: o?.tableSettings?.isServerSidePagination && o?.chartType === N.table ? Math.min(u.limit, 1e3) : void 0,
|
|
1484
|
+
offset: o?.tableSettings?.isServerSidePagination && o?.chartType === N.table ? u.offset : void 0,
|
|
1465
1485
|
disableStringify: !0,
|
|
1466
1486
|
pivotHeaders: o?.pivotTableSettings2?.headers || [],
|
|
1467
1487
|
timeseriesSettings: s ? void 0 : {
|
|
@@ -1472,35 +1492,35 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1472
1492
|
chartSeriesField: o?.seriesField !== "ungrouped" && o?.seriesField && o?.isDynamicSeries ? o?.seriesField : void 0,
|
|
1473
1493
|
comparisonCount: f,
|
|
1474
1494
|
dynamicXAxis: {
|
|
1475
|
-
isEnable: !!(o?.dynamicXAxis?.isEnabled || o?.enduserMeasureAndDimensions?.isEnabled) &&
|
|
1495
|
+
isEnable: !!(o?.dynamicXAxis?.isEnabled || o?.enduserMeasureAndDimensions?.isEnabled) && Ue.includes(o?.chartType || ""),
|
|
1476
1496
|
xaxis: o?.xAxis || "",
|
|
1477
1497
|
customField: o?.dynamicXAxis?.selectedOption?.column
|
|
1478
1498
|
},
|
|
1479
1499
|
dbId: p,
|
|
1480
1500
|
elementSettings: e?.elementSettings?.metricExpression,
|
|
1481
|
-
drillConfig:
|
|
1501
|
+
drillConfig: Qr(e?.datasetMetricSettings) ? ei(m) : m,
|
|
1482
1502
|
isEncrypted: !(h || !g)
|
|
1483
|
-
}),
|
|
1503
|
+
}), vi = (e) => {
|
|
1484
1504
|
let t = e.object.customTable?.query;
|
|
1485
1505
|
return e.object.wId ? !t || !t.includes("{{") : !1;
|
|
1486
|
-
},
|
|
1487
|
-
if (!e.customColumnSql) return e.columnName ?
|
|
1488
|
-
},
|
|
1506
|
+
}, yi = (e, t) => e.customTable ? "" : e.tableName ? P(e.tableName, t) : e.tableName, bi = (e, t) => {
|
|
1507
|
+
if (!e.customColumnSql) return e.columnName ? P(e.columnName, t) : e.columnName;
|
|
1508
|
+
}, xi = (e) => {
|
|
1489
1509
|
let { object: t } = e, n = t.wId;
|
|
1490
1510
|
return {
|
|
1491
1511
|
...t,
|
|
1492
|
-
tableName:
|
|
1493
|
-
columnName:
|
|
1494
|
-
filter: t.filter?.length ?
|
|
1512
|
+
tableName: yi(t, n),
|
|
1513
|
+
columnName: bi(t, n),
|
|
1514
|
+
filter: t.filter?.length ? j(t.filter, n) : [],
|
|
1495
1515
|
customTable: t.customTable?.query ? {
|
|
1496
|
-
query:
|
|
1497
|
-
alias:
|
|
1516
|
+
query: P(t.customTable.query, n),
|
|
1517
|
+
alias: P(t.customTable.alias, n)
|
|
1498
1518
|
} : t.customTable
|
|
1499
1519
|
};
|
|
1500
|
-
},
|
|
1501
|
-
if (
|
|
1520
|
+
}, Si = async (e, t, n) => {
|
|
1521
|
+
if (vi(e)) try {
|
|
1502
1522
|
let r = await t({
|
|
1503
|
-
data:
|
|
1523
|
+
data: xi(e),
|
|
1504
1524
|
encryptedClientId: n.isFrontendApp ? n.encryptedClientId || "" : n.clientId || "",
|
|
1505
1525
|
isFrontendApp: !!n.isFrontendApp,
|
|
1506
1526
|
token: n.token || ""
|
|
@@ -1509,7 +1529,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1509
1529
|
} catch {
|
|
1510
1530
|
return;
|
|
1511
1531
|
}
|
|
1512
|
-
},
|
|
1532
|
+
}, Ci = async ({ entries: e, fetchColumnValues: t, ctx: n, onSeed: r, onResolved: i, onLoading: a, onSettle: o, isCancelled: s }) => {
|
|
1513
1533
|
a(!0);
|
|
1514
1534
|
let c = {};
|
|
1515
1535
|
e?.forEach((e) => {
|
|
@@ -1520,29 +1540,29 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1520
1540
|
if (s()) return;
|
|
1521
1541
|
let o = e[r];
|
|
1522
1542
|
a(!0);
|
|
1523
|
-
let c = await
|
|
1543
|
+
let c = await Si(o, t, n);
|
|
1524
1544
|
if (s()) return;
|
|
1525
1545
|
c !== void 0 && i(o.element.name, c);
|
|
1526
1546
|
}
|
|
1527
1547
|
} finally {
|
|
1528
1548
|
o();
|
|
1529
1549
|
}
|
|
1530
|
-
},
|
|
1550
|
+
}, wi = "__dbnFullscreenDrillState", Ti = (e) => typeof e == "object" && !!e, Ei = (e) => Array.isArray(e), Di = (e, t) => ({
|
|
1531
1551
|
...e,
|
|
1532
1552
|
...t,
|
|
1533
1553
|
metric: {
|
|
1534
1554
|
...e.metric,
|
|
1535
|
-
[
|
|
1555
|
+
[wi]: t
|
|
1536
1556
|
}
|
|
1537
|
-
}),
|
|
1538
|
-
let n =
|
|
1557
|
+
}), Oi = (e, t = {}) => {
|
|
1558
|
+
let n = Ti(e) && Ti(e.__dbnFullscreenDrillState) ? e[wi] : {};
|
|
1539
1559
|
return {
|
|
1540
1560
|
drilledLevel: t.drilledLevel ?? (typeof n.drilledLevel == "number" ? n.drilledLevel : void 0),
|
|
1541
|
-
drillFilters: t.drillFilters ?? (
|
|
1561
|
+
drillFilters: t.drillFilters ?? (Ei(n.drillFilters) ? n.drillFilters : void 0),
|
|
1542
1562
|
drillType: t.drillType ?? (typeof n.drillType == "string" ? n.drillType : void 0),
|
|
1543
|
-
underlyingDataDrillFilters: t.underlyingDataDrillFilters ?? (
|
|
1563
|
+
underlyingDataDrillFilters: t.underlyingDataDrillFilters ?? (Ei(n.underlyingDataDrillFilters) ? n.underlyingDataDrillFilters : void 0)
|
|
1544
1564
|
};
|
|
1545
|
-
},
|
|
1565
|
+
}, ki = (e, t) => {
|
|
1546
1566
|
if (!e || e.isEnableGroupBy === !1 || t.drilledLevel === void 0 && t.drillFilters === void 0 && t.drillType === void 0 && t.underlyingDataDrillFilters === void 0) return e;
|
|
1547
1567
|
let n = e.configV2?.levels;
|
|
1548
1568
|
if (!n?.length) return t.drillType === void 0 ? e : {
|
|
@@ -1564,18 +1584,18 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1564
1584
|
}))
|
|
1565
1585
|
}
|
|
1566
1586
|
};
|
|
1567
|
-
},
|
|
1568
|
-
let n =
|
|
1569
|
-
if (n.mode !== "large") return n.mode === "all" ?
|
|
1570
|
-
},
|
|
1587
|
+
}, Ai = (e) => e.includes(";;") ? e.split(";;") : e, ji = (e, t) => e === void 0 ? t : [...Array.isArray(e) ? e : [e], ...Array.isArray(t) ? t : [t]], Mi = (e, t) => {
|
|
1588
|
+
let n = Ye(e);
|
|
1589
|
+
if (n.mode !== "large") return n.mode === "all" ? F : n.mode === "some" && Array.isArray(e) && e.length && t?.toUpperCase() === "NOT IN" ? [F, ...e] : e;
|
|
1590
|
+
}, Ni = [
|
|
1571
1591
|
"dashboardId",
|
|
1572
1592
|
"configId",
|
|
1573
1593
|
"embed",
|
|
1574
1594
|
"isDbn"
|
|
1575
|
-
],
|
|
1595
|
+
], Pi = (e) => `dbn.${e}.`, Fi = "drill.", Ii = (e) => {
|
|
1576
1596
|
let t = encodeURIComponent(e.levelIndex);
|
|
1577
1597
|
return e.filters?.length ? `${t}~${e.filters.map((e) => `${encodeURIComponent(e.columnName)}:${encodeURIComponent(String(e.value ?? ""))}`).join("|")}` : t;
|
|
1578
|
-
},
|
|
1598
|
+
}, Li = (e) => {
|
|
1579
1599
|
if (!e) return null;
|
|
1580
1600
|
let t = e.indexOf("~"), n = t === -1 ? e : e.slice(0, t), r = decodeURIComponent(n);
|
|
1581
1601
|
return r ? t === -1 ? {
|
|
@@ -1593,18 +1613,18 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1593
1613
|
} : null;
|
|
1594
1614
|
}).filter((e) => e !== null)
|
|
1595
1615
|
} : null;
|
|
1596
|
-
},
|
|
1616
|
+
}, Ri = (e, t) => {
|
|
1597
1617
|
if (!t) return {};
|
|
1598
|
-
let n = `${
|
|
1618
|
+
let n = `${Pi(t)}${Fi}`, r = {};
|
|
1599
1619
|
return new URLSearchParams(e).forEach((e, t) => {
|
|
1600
1620
|
if (!t.startsWith(n)) return;
|
|
1601
|
-
let i = t.slice(n.length), a =
|
|
1621
|
+
let i = t.slice(n.length), a = Li(e);
|
|
1602
1622
|
i && a && (r[i] = a);
|
|
1603
1623
|
}), r;
|
|
1604
|
-
},
|
|
1624
|
+
}, zi = ({ currentSearch: e, dashboardId: t, entries: n, legacyGlobals: r = {}, namespaced: i = !0 }) => {
|
|
1605
1625
|
if (!i) {
|
|
1606
1626
|
let e = new URLSearchParams();
|
|
1607
|
-
return
|
|
1627
|
+
return Ni.forEach((n) => {
|
|
1608
1628
|
let i = r[n];
|
|
1609
1629
|
if (n === "dashboardId") {
|
|
1610
1630
|
e.set(n, t ?? "");
|
|
@@ -1617,7 +1637,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1617
1637
|
}
|
|
1618
1638
|
let a = new URLSearchParams(e);
|
|
1619
1639
|
if (!t) return a;
|
|
1620
|
-
let o =
|
|
1640
|
+
let o = Pi(t), s = [];
|
|
1621
1641
|
return a.forEach((e, t) => {
|
|
1622
1642
|
t.startsWith(o) && s.push(t);
|
|
1623
1643
|
}), s.forEach((e) => {
|
|
@@ -1625,7 +1645,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1625
1645
|
}), n.forEach(({ key: e, value: t }) => {
|
|
1626
1646
|
a.set(`${o}${e}`, t);
|
|
1627
1647
|
}), a;
|
|
1628
|
-
},
|
|
1648
|
+
}, Bi = (e, t) => {
|
|
1629
1649
|
let n = e?.levels;
|
|
1630
1650
|
if (!e || !n?.length) return null;
|
|
1631
1651
|
let r = n.findIndex((e) => e?.index === t.levelIndex);
|
|
@@ -1641,9 +1661,9 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1641
1661
|
filters: n > r ? [] : e?.filters
|
|
1642
1662
|
})
|
|
1643
1663
|
};
|
|
1644
|
-
},
|
|
1645
|
-
let n = new URLSearchParams(e), r = {}, i = {}, a = t ?
|
|
1646
|
-
e[t] =
|
|
1664
|
+
}, Vi = (e, t) => {
|
|
1665
|
+
let n = new URLSearchParams(e), r = {}, i = {}, a = t ? Pi(t) : null, o = (e, t, n) => {
|
|
1666
|
+
e[t] = ji(e[t], Ai(n));
|
|
1647
1667
|
};
|
|
1648
1668
|
return n.forEach((e, t) => {
|
|
1649
1669
|
if (a && t.startsWith(a)) {
|
|
@@ -1657,12 +1677,12 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1657
1677
|
...r,
|
|
1658
1678
|
...i
|
|
1659
1679
|
};
|
|
1660
|
-
},
|
|
1661
|
-
let [n, r] =
|
|
1680
|
+
}, Hi = ({ savedDrillDownSettings: e, initialDrillState: t }) => {
|
|
1681
|
+
let [n, r] = B([]), i = t.drillFilters ?? [], a = z(i), o = z(t.underlyingDataDrillFilters), s = ki(e, t), [c, l] = B(i), [u, d] = B(s ?? {
|
|
1662
1682
|
isEnableGroupBy: !1,
|
|
1663
1683
|
isEnableCrossFilter: !1,
|
|
1664
1684
|
drillType: ""
|
|
1665
|
-
}), [f, p] =
|
|
1685
|
+
}), [f, p] = B([]);
|
|
1666
1686
|
return {
|
|
1667
1687
|
drilldownCols: n,
|
|
1668
1688
|
setDrillDownCols: r,
|
|
@@ -1675,8 +1695,8 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1675
1695
|
adhocDrillDims: f,
|
|
1676
1696
|
setAdhocDrillDims: p
|
|
1677
1697
|
};
|
|
1678
|
-
},
|
|
1679
|
-
|
|
1698
|
+
}, Ui = ({ metric: e, chartSettings: t, drillDownSettings: n, setDrillDownSettings: r, initialDrilledLevel: i, initialDrillFiltersProp: a, initialDrillType: o, initialUnderlyingDataDrillFilters: s }) => {
|
|
1699
|
+
L(() => {
|
|
1680
1700
|
if (e?.drillDownSettings?.isEnableGroupBy) {
|
|
1681
1701
|
let c = e?.datasetMetricSettings;
|
|
1682
1702
|
if (!e?.drillDownSettings?.configV2 && !n?.configV2 && c?.newDatasetSettings?.selectedMetrics?.length && c?.newDatasetSettings?.selectedDims?.length) {
|
|
@@ -1684,16 +1704,16 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1684
1704
|
...e?.drillDownSettings || {},
|
|
1685
1705
|
configV2: {
|
|
1686
1706
|
isEnable: !!e?.drillDownSettings?.isEnableGroupBy,
|
|
1687
|
-
levels:
|
|
1707
|
+
levels: pt({
|
|
1688
1708
|
selectedDims: c?.newDatasetSettings?.selectedDims,
|
|
1689
1709
|
selectedMetrics: c?.newDatasetSettings?.selectedMetrics,
|
|
1690
1710
|
chartSettings: t,
|
|
1691
1711
|
drilldownChartSettings: e?.drillDownSettings?.drilldownChartSettings,
|
|
1692
|
-
makeIndex: () =>
|
|
1712
|
+
makeIndex: () => we(4)
|
|
1693
1713
|
})
|
|
1694
1714
|
}
|
|
1695
1715
|
};
|
|
1696
|
-
r(() =>
|
|
1716
|
+
r(() => ki(n, {
|
|
1697
1717
|
drilledLevel: i,
|
|
1698
1718
|
drillFilters: a,
|
|
1699
1719
|
drillType: o,
|
|
@@ -1712,16 +1732,16 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1712
1732
|
s,
|
|
1713
1733
|
r
|
|
1714
1734
|
]);
|
|
1715
|
-
},
|
|
1716
|
-
let a =
|
|
1717
|
-
|
|
1735
|
+
}, Wi = ({ drillUrlState: e, metric: t, drillDownSettings: n, setDrillDownSettings: r, setChartSettings: i }) => {
|
|
1736
|
+
let a = z(!1);
|
|
1737
|
+
L(() => {
|
|
1718
1738
|
if (a.current) return;
|
|
1719
1739
|
let o = e?.position;
|
|
1720
1740
|
if (!e?.enabled || !o || !t?.id) return;
|
|
1721
1741
|
let s = n?.configV2;
|
|
1722
1742
|
if (!s?.levels?.length) return;
|
|
1723
1743
|
a.current = !0;
|
|
1724
|
-
let c =
|
|
1744
|
+
let c = Bi(s, o);
|
|
1725
1745
|
if (!c) return;
|
|
1726
1746
|
r((e) => ({
|
|
1727
1747
|
...e,
|
|
@@ -1744,10 +1764,10 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1744
1764
|
r,
|
|
1745
1765
|
i
|
|
1746
1766
|
]);
|
|
1747
|
-
let o =
|
|
1748
|
-
|
|
1767
|
+
let o = z(void 0);
|
|
1768
|
+
L(() => {
|
|
1749
1769
|
if (!e?.enabled || !e.onChange || !t?.id) return;
|
|
1750
|
-
let r = n?.configV2?.levels || [], i = r.findIndex((e) => e?.isEnable), a = i >= 0 ? r[i] : void 0, s = i > 0 && a?.index ?
|
|
1770
|
+
let r = n?.configV2?.levels || [], i = r.findIndex((e) => e?.isEnable), a = i >= 0 ? r[i] : void 0, s = i > 0 && a?.index ? Ii({
|
|
1751
1771
|
levelIndex: a.index,
|
|
1752
1772
|
filters: (a.filters || []).filter((e) => e?.columnName).map((e) => ({
|
|
1753
1773
|
columnName: String(e.columnName),
|
|
@@ -1761,13 +1781,13 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1761
1781
|
n?.configV2,
|
|
1762
1782
|
t?.id
|
|
1763
1783
|
]);
|
|
1764
|
-
},
|
|
1765
|
-
let r =
|
|
1784
|
+
}, Gi = ({ metric: e, metricStore: t, setMetricStore: n }) => {
|
|
1785
|
+
let r = z(e?.id);
|
|
1766
1786
|
r.current = e?.id;
|
|
1767
|
-
let i =
|
|
1787
|
+
let i = z(t);
|
|
1768
1788
|
i.current = t;
|
|
1769
|
-
let a =
|
|
1770
|
-
a.current = n,
|
|
1789
|
+
let a = z(n);
|
|
1790
|
+
a.current = n, L(() => () => {
|
|
1771
1791
|
let e = r.current, t = i.current, n = a.current;
|
|
1772
1792
|
e && t && n && t.get(e)?.data?.data && n((t) => {
|
|
1773
1793
|
let n = t.get(e);
|
|
@@ -1782,23 +1802,23 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1782
1802
|
}), r;
|
|
1783
1803
|
});
|
|
1784
1804
|
}, []);
|
|
1785
|
-
},
|
|
1786
|
-
let n = !!e?.elementSettings?.summary?.metricList?.length, [r, i] =
|
|
1787
|
-
return
|
|
1805
|
+
}, Ki = ({ metric: e, metricStore: t }) => {
|
|
1806
|
+
let n = !!e?.elementSettings?.summary?.metricList?.length, [r, i] = B(0);
|
|
1807
|
+
return L(() => {
|
|
1788
1808
|
let e = t?.subscribe;
|
|
1789
1809
|
if (n && typeof e == "function") return e(() => i((e) => e + 1));
|
|
1790
1810
|
}, [t, n]), r;
|
|
1791
|
-
},
|
|
1792
|
-
|
|
1793
|
-
},
|
|
1794
|
-
|
|
1795
|
-
t.settledAt !== void 0 && e - t.settledAt >= 3e4 &&
|
|
1796
|
-
}), !(
|
|
1797
|
-
|
|
1811
|
+
}, qi = "Could not generate this metric summary. Try again.", Ji = 1500, Yi = /* @__PURE__ */ new Map(), Xi = (e, t) => {
|
|
1812
|
+
Yi.get(e) === t && Yi.delete(e), t.abandonTimer && clearTimeout(t.abandonTimer), t.abandonTimer = void 0;
|
|
1813
|
+
}, Zi = (e) => {
|
|
1814
|
+
Yi.forEach((t, n) => {
|
|
1815
|
+
t.settledAt !== void 0 && e - t.settledAt >= 3e4 && Xi(n, t);
|
|
1816
|
+
}), !(Yi.size <= 24) && [...Yi.entries()].filter(([, e]) => e.settledAt !== void 0).sort(([, e], [, t]) => (e.settledAt ?? 0) - (t.settledAt ?? 0)).slice(0, Math.max(0, Yi.size - 24)).forEach(([e, t]) => {
|
|
1817
|
+
Xi(e, t);
|
|
1798
1818
|
});
|
|
1799
|
-
},
|
|
1800
|
-
|
|
1801
|
-
let r =
|
|
1819
|
+
}, Qi = (e, t, n = Date.now) => {
|
|
1820
|
+
Zi(n());
|
|
1821
|
+
let r = Yi.get(e);
|
|
1802
1822
|
if (r) r.abandonTimer && (clearTimeout(r.abandonTimer), r.abandonTimer = void 0);
|
|
1803
1823
|
else {
|
|
1804
1824
|
let i = new AbortController(), a = {
|
|
@@ -1807,74 +1827,74 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1807
1827
|
promise: Promise.resolve()
|
|
1808
1828
|
};
|
|
1809
1829
|
a.promise = t(i.signal).then((e) => (a.settledAt = n(), e), (t) => {
|
|
1810
|
-
throw
|
|
1811
|
-
}), a.promise.catch(() => void 0),
|
|
1830
|
+
throw Xi(e, a), t;
|
|
1831
|
+
}), a.promise.catch(() => void 0), Yi.set(e, a), r = a;
|
|
1812
1832
|
}
|
|
1813
1833
|
let i = r;
|
|
1814
1834
|
i.holders += 1;
|
|
1815
1835
|
let a = !1, o = () => {
|
|
1816
1836
|
a || (a = !0, --i.holders, !(i.holders > 0 || i.settledAt !== void 0) && (i.abandonTimer ||= setTimeout(() => {
|
|
1817
|
-
i.abandonTimer = void 0, !(i.holders > 0) && (i.controller.abort(),
|
|
1818
|
-
},
|
|
1837
|
+
i.abandonTimer = void 0, !(i.holders > 0) && (i.controller.abort(), Xi(e, i));
|
|
1838
|
+
}, Ji)));
|
|
1819
1839
|
};
|
|
1820
1840
|
return {
|
|
1821
1841
|
promise: i.promise,
|
|
1822
1842
|
release: o,
|
|
1823
1843
|
abort: () => {
|
|
1824
|
-
o(), i.controller.abort(),
|
|
1844
|
+
o(), i.controller.abort(), Xi(e, i);
|
|
1825
1845
|
}
|
|
1826
1846
|
};
|
|
1827
|
-
},
|
|
1847
|
+
}, $i = {
|
|
1828
1848
|
status: "idle",
|
|
1829
1849
|
summary: "",
|
|
1830
1850
|
error: "",
|
|
1831
1851
|
empty: !1
|
|
1832
|
-
},
|
|
1833
|
-
|
|
1852
|
+
}, ea = {
|
|
1853
|
+
...$i,
|
|
1834
1854
|
status: "failed",
|
|
1835
|
-
error:
|
|
1836
|
-
},
|
|
1855
|
+
error: qi
|
|
1856
|
+
}, ta = {
|
|
1837
1857
|
status: "done",
|
|
1838
1858
|
summary: "",
|
|
1839
1859
|
error: "There is no data to summarize.",
|
|
1840
1860
|
empty: !0
|
|
1841
|
-
},
|
|
1842
|
-
let [e, t] =
|
|
1861
|
+
}, na = () => {
|
|
1862
|
+
let [e, t] = B($i), n = z(null), r = z(null), i = I(() => {
|
|
1843
1863
|
let e = r.current;
|
|
1844
|
-
r.current = null, n.current = null, e?.abort(), t(
|
|
1845
|
-
}, []), a =
|
|
1864
|
+
r.current = null, n.current = null, e?.abort(), t($i);
|
|
1865
|
+
}, []), a = I(() => {
|
|
1846
1866
|
let e = r.current;
|
|
1847
|
-
r.current = null, e?.abort(), t(
|
|
1848
|
-
}, []), o =
|
|
1867
|
+
r.current = null, e?.abort(), t($i);
|
|
1868
|
+
}, []), o = I((e, i) => {
|
|
1849
1869
|
if (n.current === e) return;
|
|
1850
1870
|
if (n.current = e, r.current?.release(), r.current = null, !i) {
|
|
1851
|
-
t(
|
|
1871
|
+
t(ta);
|
|
1852
1872
|
return;
|
|
1853
1873
|
}
|
|
1854
1874
|
t({
|
|
1855
|
-
|
|
1875
|
+
...$i,
|
|
1856
1876
|
status: "running"
|
|
1857
1877
|
});
|
|
1858
|
-
let a =
|
|
1878
|
+
let a = Qi(e, async (e) => {
|
|
1859
1879
|
try {
|
|
1860
1880
|
let t = await i(e), n = t && typeof t == "object" && "summary" in t && typeof t.summary == "string" ? t.summary.trim() : "";
|
|
1861
1881
|
return n ? {
|
|
1862
|
-
|
|
1882
|
+
...$i,
|
|
1863
1883
|
status: "done",
|
|
1864
1884
|
summary: n
|
|
1865
|
-
} :
|
|
1885
|
+
} : ta;
|
|
1866
1886
|
} catch (e) {
|
|
1867
1887
|
if (c(e)) throw e;
|
|
1868
|
-
return
|
|
1888
|
+
return ea;
|
|
1869
1889
|
}
|
|
1870
1890
|
});
|
|
1871
1891
|
r.current = a, a.promise.then((e) => {
|
|
1872
1892
|
r.current === a && t(e);
|
|
1873
1893
|
}, (e) => {
|
|
1874
|
-
r.current === a && t(c(e) ?
|
|
1894
|
+
r.current === a && t(c(e) ? $i : ea);
|
|
1875
1895
|
});
|
|
1876
1896
|
}, []);
|
|
1877
|
-
return
|
|
1897
|
+
return L(() => () => {
|
|
1878
1898
|
r.current?.release(), r.current = null, n.current = null;
|
|
1879
1899
|
}, []), {
|
|
1880
1900
|
state: e,
|
|
@@ -1882,101 +1902,101 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1882
1902
|
stop: a,
|
|
1883
1903
|
reset: i
|
|
1884
1904
|
};
|
|
1885
|
-
},
|
|
1886
|
-
let t =
|
|
1887
|
-
return t.current !== e && !
|
|
1905
|
+
}, ra = (e) => {
|
|
1906
|
+
let t = z(e);
|
|
1907
|
+
return t.current !== e && !Tn(t.current, e) && (t.current = e), t.current;
|
|
1888
1908
|
}, $ = (e) => {
|
|
1889
1909
|
if (!e) return null;
|
|
1890
1910
|
let t = new Date(e);
|
|
1891
1911
|
return t instanceof Date && !Number.isNaN(t.getTime()) ? t : null;
|
|
1892
|
-
},
|
|
1912
|
+
}, ia = (e) => ie(e || {}) ? {
|
|
1893
1913
|
startTime: e?.startTime,
|
|
1894
1914
|
endTime: e?.endTime,
|
|
1895
1915
|
isTimeFilter: !0
|
|
1896
|
-
} : {},
|
|
1916
|
+
} : {}, aa = ({ option: e, value: t }) => ({
|
|
1897
1917
|
startDate: $(e?.fromDate) ?? $(e?.startDate) ?? void 0,
|
|
1898
1918
|
endDate: $(e?.toDate) ?? $(e?.endDate) ?? void 0,
|
|
1899
|
-
...
|
|
1919
|
+
...ia(e),
|
|
1900
1920
|
value: t,
|
|
1901
1921
|
label: t
|
|
1902
|
-
}),
|
|
1922
|
+
}), oa = (e, t) => {
|
|
1903
1923
|
if (typeof e == "object" && e) return Reflect.get(e, t);
|
|
1904
|
-
},
|
|
1924
|
+
}, sa = [], ca = [], la = [], ua = (e, t) => {
|
|
1905
1925
|
let n = t?.configV2?.levels?.find((e) => e?.isEnable)?.chartSettings;
|
|
1906
1926
|
return n ? {
|
|
1907
1927
|
...e,
|
|
1908
1928
|
...n
|
|
1909
1929
|
} : e;
|
|
1910
|
-
},
|
|
1911
|
-
let s =
|
|
1912
|
-
if (!s.rows.length) return
|
|
1913
|
-
let c =
|
|
1930
|
+
}, da = ({ raw: e, selectedDims: t, selectedMetrics: n, datasetSettings: r, integrationName: i, isPythonMode: a, stableOrder: o }) => {
|
|
1931
|
+
let s = Tr({ data: e });
|
|
1932
|
+
if (!s.rows.length) return sa;
|
|
1933
|
+
let c = ue(s.rows, t || [], n || []), l = c;
|
|
1914
1934
|
if (i?.toLowerCase() === "redshift" && !a) {
|
|
1915
|
-
let e = r?.selectedMetrics || [], t = [...((r?.selectedDims)?.filter((e) => !
|
|
1916
|
-
l =
|
|
1935
|
+
let e = r?.selectedMetrics || [], t = [...((r?.selectedDims)?.filter((e) => !it(e?.alias)) || [])?.map((e) => e.alias), ...e?.map((e) => e.alias)];
|
|
1936
|
+
l = De(t, c);
|
|
1917
1937
|
}
|
|
1918
|
-
let u =
|
|
1919
|
-
return !Array.isArray(u) || !u.length ?
|
|
1920
|
-
},
|
|
1938
|
+
let u = ot(l);
|
|
1939
|
+
return !Array.isArray(u) || !u.length ? sa : o ? xr(u, o) : u;
|
|
1940
|
+
}, fa = ({ externalDashboardClientId: e, metric: t, globalFilters: n = {
|
|
1921
1941
|
tableName: "",
|
|
1922
1942
|
filters: []
|
|
1923
|
-
}, rlsFilters: r, clientId: i, tenancyLevel: o, isInternalApp: s, appFilters: c, setCrossDashboardFilters: l, crossDashboardFilters: u, enableCrossFilter: d, enableCrossFilterBeforeDrill: f = !1, metricFilterOptions: p, isAllClient: g, isFrontendApp: _, guestToken: v, encryptedClientId: y, clientCacheScope: b, dashboardId: x, workspaceId:
|
|
1924
|
-
let [
|
|
1943
|
+
}, rlsFilters: r, clientId: i, tenancyLevel: o, isInternalApp: s, appFilters: c, setCrossDashboardFilters: l, crossDashboardFilters: u, enableCrossFilter: d, enableCrossFilterBeforeDrill: f = !1, metricFilterOptions: p, isAllClient: g, isFrontendApp: _, guestToken: v, encryptedClientId: y, clientCacheScope: b, dashboardId: x, workspaceId: T, metricStore: E, setMetricStore: O, summaryReferencedMetricIds: k, onServerEvent: ie, clientColumnType: le, datasourceId: j, appliedCardMetricFilters: fe, onMetricFiltersChange: _e, language: be, translationDictionary: Se, calendarType: P, setLoadedCardMetadata: Te, isRulePending: Ee = !1, setSettledCardIds: De, drillUrlState: ke, isFullScreen: Me, setMetricMetadata: Ie, viewMetricData: F, generatingPdf: Ve, dataMartTables: qe, isDisableQuery: Ye = !1, token: Xe, drilledLevel: et, drillFilters: nt, drillType: it, underlyingDataDrillFilters: lt }) => {
|
|
1944
|
+
let [pt, vt] = B(!1), xt = w(), [St, wt] = B(null), { state: Tt, start: Et, stop: kt, reset: At } = na(), jt = Tt.summary, Mt = Tt.error, Nt = Tt.empty, Pt = Tt.status === "running", Ft = z(null), It = z(null), [Lt, Rt] = B({
|
|
1925
1945
|
limit: parseInt(t?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
|
|
1926
1946
|
offset: 0
|
|
1927
|
-
}), [
|
|
1947
|
+
}), [zt, Bt] = B(0), [Vt, Ht] = B(0), [V, Ut] = B(t?.rlsConditions || []), [Wt, Gt] = B([]), [Kt, qt] = B(!1), [H, Jt] = B(), [Yt, Xt] = B(""), [Zt, Qt] = B([]), [$t, en] = B({
|
|
1928
1948
|
isOpen: !1,
|
|
1929
1949
|
report: "",
|
|
1930
1950
|
isLoading: !1
|
|
1931
|
-
}), [tn, nn] =
|
|
1951
|
+
}), [tn, nn] = B(!1), { drilldownCols: rn, setDrillDownCols: an, initialDrillFiltersRef: on, initialUnderlyingDataDrillFiltersRef: sn, drillFilters: U, setDrillFilters: cn, drillDownSettings: W, setDrillDownSettings: G, adhocDrillDims: ln, setAdhocDrillDims: un } = Hi({
|
|
1932
1952
|
savedDrillDownSettings: t?.drillDownSettings,
|
|
1933
1953
|
initialDrillState: {
|
|
1934
|
-
drilledLevel:
|
|
1935
|
-
drillFilters:
|
|
1936
|
-
drillType:
|
|
1937
|
-
underlyingDataDrillFilters:
|
|
1954
|
+
drilledLevel: et,
|
|
1955
|
+
drillFilters: nt,
|
|
1956
|
+
drillType: it,
|
|
1957
|
+
underlyingDataDrillFilters: lt
|
|
1938
1958
|
}
|
|
1939
|
-
}),
|
|
1959
|
+
}), dn = !s && f === !0, fn = Br({
|
|
1940
1960
|
runtimeEnabled: d,
|
|
1941
1961
|
metricEnabled: t?.drillDownSettings?.isEnableCrossFilter
|
|
1942
|
-
}), [
|
|
1943
|
-
|
|
1944
|
-
let
|
|
1945
|
-
|
|
1962
|
+
}), [pn, mn] = B([]), [hn, gn] = B(!1), [_n, vn] = B(!1), [K, yn] = B([]), bn = z(_e);
|
|
1963
|
+
bn.current = _e;
|
|
1964
|
+
let xn = I((e) => {
|
|
1965
|
+
yn((n) => {
|
|
1946
1966
|
let r = typeof e == "function" ? e(n) : e;
|
|
1947
|
-
return
|
|
1967
|
+
return ni({
|
|
1948
1968
|
metricId: t?.id,
|
|
1949
1969
|
filters: r,
|
|
1950
|
-
onChange:
|
|
1970
|
+
onChange: bn.current
|
|
1951
1971
|
}), r;
|
|
1952
1972
|
});
|
|
1953
|
-
}, [t?.id]), [
|
|
1973
|
+
}, [t?.id]), [Sn, Cn] = B({}), [wn, Tn] = B(!1), [En, Dn] = B([]), [q, J] = B(ua(t?.chartOptions, t?.drillDownSettings)), On = z(""), [kn, An] = B({
|
|
1954
1974
|
data: [],
|
|
1955
1975
|
error: "",
|
|
1956
1976
|
isLoading: !1,
|
|
1957
1977
|
currentValue: ""
|
|
1958
|
-
}),
|
|
1978
|
+
}), Y = R(() => !!t?.datasetMetricSettings?.newDatasetSettings?.isPythonMode, [t?.datasetMetricSettings?.newDatasetSettings?.isPythonMode]), jn = R(() => Qr(t?.datasetMetricSettings), [t?.datasetMetricSettings]), Mn = I((e) => se(e) ? !0 : e?.isAddOnMetrics && e?.datatype === "date" ? !1 : !!(e?.isAddOnMetrics && e?.client?.isEnable && e?.client?.columnName && e?.client?.as && !g && i), [i, g]), Pn = R(() => t?.externalDashboardMetrics?.[0]?.externalDashboard?.companyWorkspace?.datamart?.datamartRelationships || [], [t]), Fn = R(() => {
|
|
1959
1979
|
let e = {};
|
|
1960
1980
|
if (r?.values) for (let t in r.values) {
|
|
1961
1981
|
let n = `${t}_variable`;
|
|
1962
1982
|
e[n] = r.values[t];
|
|
1963
1983
|
}
|
|
1964
1984
|
return e;
|
|
1965
|
-
}, [r?.values]),
|
|
1985
|
+
}, [r?.values]), In = R(() => {
|
|
1966
1986
|
let e = t?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable;
|
|
1967
|
-
return (
|
|
1987
|
+
return (qe?.find((t) => t.tableName === e?.tableName))?.customColumnFields?.map((n) => ({
|
|
1968
1988
|
value: n?.columnName,
|
|
1969
1989
|
label: n?.columnName,
|
|
1970
1990
|
isCustomField: !0,
|
|
1971
1991
|
column: {
|
|
1972
|
-
uniqueId:
|
|
1992
|
+
uniqueId: we(10),
|
|
1973
1993
|
alias: n?.columnName,
|
|
1974
1994
|
configType: "DIMENSION",
|
|
1975
1995
|
datatype: n?.datatype,
|
|
1976
1996
|
dropType: "DIMENSION",
|
|
1977
1997
|
index: 1e3,
|
|
1978
1998
|
name: n?.columnName,
|
|
1979
|
-
parentAlias: `${
|
|
1999
|
+
parentAlias: `${je(e?.schemaName, t?.companyIntegration?.name || "")}_${e?.tableName?.replaceAll(" ", "_")?.replace("*", "_")}`,
|
|
1980
2000
|
table: t?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable,
|
|
1981
2001
|
type: "DEFAULT",
|
|
1982
2002
|
draggableItemData: {
|
|
@@ -1994,141 +2014,141 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
1994
2014
|
}, [
|
|
1995
2015
|
t?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable,
|
|
1996
2016
|
t?.companyIntegration?.name,
|
|
1997
|
-
|
|
1998
|
-
]),
|
|
2017
|
+
qe
|
|
2018
|
+
]), Ln = R(() => {
|
|
1999
2019
|
let e = t?.drillDownSettings?.isEnableGroupBy;
|
|
2000
|
-
return (
|
|
2020
|
+
return (dn ? [...V?.length ? V : [], ...kr({
|
|
2001
2021
|
filters: u,
|
|
2002
2022
|
metricId: t?.id,
|
|
2003
2023
|
isGroupByEnabled: e,
|
|
2004
2024
|
enableCrossFilterBeforeDrill: !0
|
|
2005
2025
|
})] : e ? V || [] : [...V?.length ? V : [], ...u || []]).filter((e) => e.isAddOnMetrics).map((e) => s ? {
|
|
2006
2026
|
...e,
|
|
2007
|
-
dimensionColumn:
|
|
2008
|
-
measureColumn:
|
|
2027
|
+
dimensionColumn: q?.xAxis || "",
|
|
2028
|
+
measureColumn: q?.yAxisList?.[0] || "",
|
|
2009
2029
|
options: e.datatype === "date" ? e.options : [],
|
|
2010
2030
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2011
2031
|
} : {
|
|
2012
2032
|
...e,
|
|
2013
|
-
dimensionColumn:
|
|
2014
|
-
measureColumn:
|
|
2015
|
-
value: e.isAppFilter ? e.datatype === "date" ?
|
|
2016
|
-
options: e.datatype === "date" ? e?.options?.map((t) =>
|
|
2033
|
+
dimensionColumn: q?.xAxis || "",
|
|
2034
|
+
measureColumn: q?.yAxisList?.[0] || "",
|
|
2035
|
+
value: e.isAppFilter ? e.datatype === "date" ? ze(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,
|
|
2036
|
+
options: e.datatype === "date" ? e?.options?.map((t) => P === "ind" && e.datatype === "date" ? {
|
|
2017
2037
|
...t,
|
|
2018
2038
|
isFiscal: !0
|
|
2019
2039
|
} : t) : [],
|
|
2020
2040
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2021
|
-
}).filter((e) =>
|
|
2041
|
+
}).filter((e) => Mn(e));
|
|
2022
2042
|
}, [
|
|
2023
2043
|
c?.values,
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2044
|
+
P,
|
|
2045
|
+
q?.xAxis,
|
|
2046
|
+
q?.yAxisList,
|
|
2027
2047
|
u,
|
|
2028
2048
|
t?.id,
|
|
2029
|
-
|
|
2049
|
+
dn,
|
|
2030
2050
|
s,
|
|
2031
2051
|
t?.drillDownSettings?.isEnableGroupBy,
|
|
2032
2052
|
V,
|
|
2033
|
-
|
|
2034
|
-
]),
|
|
2035
|
-
...
|
|
2053
|
+
Mn
|
|
2054
|
+
]), Rn = R(() => JSON.stringify(Wt), [Wt]), X = ra(R(() => ({
|
|
2055
|
+
..._i({
|
|
2036
2056
|
metric: t,
|
|
2037
2057
|
isAllClient: g,
|
|
2038
2058
|
tenancyLevel: o,
|
|
2039
|
-
appliedMetricFilters:
|
|
2040
|
-
firstLoadAppliedMetricFilters:
|
|
2059
|
+
appliedMetricFilters: K,
|
|
2060
|
+
firstLoadAppliedMetricFilters: Ln,
|
|
2041
2061
|
tableColumnFilters: Wt,
|
|
2042
|
-
chartSettings:
|
|
2043
|
-
isPythonMode:
|
|
2062
|
+
chartSettings: q,
|
|
2063
|
+
isPythonMode: Y,
|
|
2044
2064
|
globalFilters: n,
|
|
2045
|
-
filterValues:
|
|
2046
|
-
tableLimit:
|
|
2047
|
-
calendarType:
|
|
2048
|
-
comparisonCount:
|
|
2049
|
-
datasourceId:
|
|
2065
|
+
filterValues: Fn,
|
|
2066
|
+
tableLimit: Lt,
|
|
2067
|
+
calendarType: P,
|
|
2068
|
+
comparisonCount: Vt,
|
|
2069
|
+
datasourceId: j,
|
|
2050
2070
|
drillConfig: W?.configV2,
|
|
2051
2071
|
isFrontendApp: _,
|
|
2052
2072
|
guestToken: v
|
|
2053
2073
|
}),
|
|
2054
2074
|
dashboardId: x
|
|
2055
2075
|
}), [
|
|
2056
|
-
|
|
2076
|
+
q,
|
|
2057
2077
|
g,
|
|
2058
2078
|
t,
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2079
|
+
K,
|
|
2080
|
+
Ln,
|
|
2081
|
+
Y,
|
|
2082
|
+
Fn,
|
|
2063
2083
|
U,
|
|
2064
2084
|
o,
|
|
2065
2085
|
n,
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2086
|
+
Lt,
|
|
2087
|
+
Vt,
|
|
2088
|
+
Ue,
|
|
2089
|
+
j,
|
|
2090
|
+
P,
|
|
2071
2091
|
W?.configV2,
|
|
2072
2092
|
v,
|
|
2073
2093
|
_,
|
|
2074
2094
|
x,
|
|
2075
|
-
|
|
2076
|
-
])),
|
|
2077
|
-
query:
|
|
2078
|
-
clientId:
|
|
2095
|
+
Rn
|
|
2096
|
+
])), zn = R(() => JSON.stringify(X), [X]), Bn = ii(q, t?.datasetMetricSettings), Vn = t?.datasetMetricSettings, Hn = re(Vn), Un = Ye || Bn.renderEmpty || !!Hn, Gn = _ ? y || "" : i || "", qn = R(() => fi({
|
|
2097
|
+
query: X,
|
|
2098
|
+
clientId: Gn,
|
|
2079
2099
|
isFrontendApp: _
|
|
2080
2100
|
}), [
|
|
2081
|
-
|
|
2101
|
+
Gn,
|
|
2082
2102
|
_,
|
|
2083
|
-
|
|
2084
|
-
]),
|
|
2085
|
-
clientId:
|
|
2103
|
+
X
|
|
2104
|
+
]), Jn = R(() => di({
|
|
2105
|
+
clientId: Gn,
|
|
2086
2106
|
guestToken: v,
|
|
2087
2107
|
isFrontendApp: _
|
|
2088
2108
|
}), [
|
|
2089
|
-
|
|
2109
|
+
Gn,
|
|
2090
2110
|
v,
|
|
2091
2111
|
_
|
|
2092
2112
|
]);
|
|
2093
|
-
|
|
2113
|
+
L(() => {
|
|
2094
2114
|
m("metric-query-payload-prepared", {
|
|
2095
2115
|
metricId: t?.id,
|
|
2096
2116
|
metricName: t?.name,
|
|
2097
|
-
chartType:
|
|
2098
|
-
payload:
|
|
2117
|
+
chartType: q?.chartType,
|
|
2118
|
+
payload: ne(X)
|
|
2099
2119
|
});
|
|
2100
2120
|
}, [
|
|
2101
|
-
|
|
2121
|
+
X,
|
|
2102
2122
|
t?.id,
|
|
2103
2123
|
t?.name,
|
|
2104
|
-
|
|
2124
|
+
q?.chartType
|
|
2105
2125
|
]);
|
|
2106
|
-
let
|
|
2107
|
-
data:
|
|
2126
|
+
let Yn = R(() => Nn(t), [t]), { data: Z, dataUpdatedAt: Xn, isFetching: Zn, isLoading: Qn, error: $n, refetch: er } = Wn({
|
|
2127
|
+
data: X,
|
|
2108
2128
|
clientId: _ ? y || "" : i,
|
|
2109
2129
|
clientCacheScope: _ ? b : void 0,
|
|
2110
|
-
metricRevision:
|
|
2130
|
+
metricRevision: Yn,
|
|
2111
2131
|
token: v,
|
|
2112
2132
|
isFrontendApp: _,
|
|
2113
|
-
isFullScreen:
|
|
2114
|
-
savedMetricQuery: t?.isMetric === !1 || !t?.query ? void 0 :
|
|
2115
|
-
savedMetricIdentifiers:
|
|
2133
|
+
isFullScreen: Me,
|
|
2134
|
+
savedMetricQuery: t?.isMetric === !1 || !t?.query ? void 0 : Be(t?.query, t?.companyId),
|
|
2135
|
+
savedMetricIdentifiers: Vn,
|
|
2116
2136
|
dbName: t?.companyIntegration?.name || t?.integrationName,
|
|
2117
2137
|
batchHints: {
|
|
2118
|
-
chartType:
|
|
2119
|
-
isEnableComparisonFilter: !!
|
|
2120
|
-
isMultiDimension: !!
|
|
2121
|
-
isDynamicSeries: !!
|
|
2122
|
-
seriesField:
|
|
2138
|
+
chartType: q?.chartType,
|
|
2139
|
+
isEnableComparisonFilter: !!q?.isEnableComparisonFilter,
|
|
2140
|
+
isMultiDimension: !!q?.isMultiDimension,
|
|
2141
|
+
isDynamicSeries: !!q?.isDynamicSeries,
|
|
2142
|
+
seriesField: q?.seriesField,
|
|
2123
2143
|
isDataMartQuery: !!(t?.datasetMetricSettings)?.newDatasetSettings?.isDataMartQuery
|
|
2124
2144
|
}
|
|
2125
2145
|
}, {
|
|
2126
|
-
isDisableQuery:
|
|
2146
|
+
isDisableQuery: Un,
|
|
2127
2147
|
onSuccess: (e) => {
|
|
2128
|
-
let t =
|
|
2129
|
-
if (
|
|
2130
|
-
let e =
|
|
2131
|
-
|
|
2148
|
+
let t = Tr(e), n = ot(t.rows), r = oa(oa(t.error, "details"), "legacyCode");
|
|
2149
|
+
if (Te && oa(t.error, "code") !== "E1001" && r !== "E1001") {
|
|
2150
|
+
let e = X?.id, t = !!n?.length && (q?.chartType !== N.singleValue || n?.[0]?.[q?.singleValue || ""] != null);
|
|
2151
|
+
Te?.((n) => {
|
|
2132
2152
|
let r = n?.find((t) => t?.id === e);
|
|
2133
2153
|
return r && r.isDataFound === t ? n : [...n?.filter((t) => t?.id !== e) || [], {
|
|
2134
2154
|
id: e,
|
|
@@ -2138,86 +2158,86 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2138
2158
|
}
|
|
2139
2159
|
},
|
|
2140
2160
|
onSettled: () => {
|
|
2141
|
-
let e =
|
|
2142
|
-
|
|
2161
|
+
let e = X?.id;
|
|
2162
|
+
De && e && De((t) => pi(t, e));
|
|
2143
2163
|
}
|
|
2144
|
-
}),
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
}, [
|
|
2148
|
-
let
|
|
2149
|
-
query: t?.isMetric === !1 || !t?.query ? void 0 :
|
|
2150
|
-
chartType:
|
|
2164
|
+
}), tr = li(Qn), nr = Zn && !Qn && Xn > 0, rr = R(() => Tr(Z), [Z]), ir = !Un && !Zn && !$n && rr.isFilterNotApplied ? "A filter could not be applied to this chart." : void 0, ar = z(void 0);
|
|
2165
|
+
L(() => {
|
|
2166
|
+
ir && ar.current !== Z && (ar.current = Z, h("metric.filter_not_applied", { error_code: "FILTER_NOT_APPLIED" }));
|
|
2167
|
+
}, [ir, Z]);
|
|
2168
|
+
let or = R(() => _r({
|
|
2169
|
+
query: t?.isMetric === !1 || !t?.query ? void 0 : Be(t?.query, t?.companyId),
|
|
2170
|
+
chartType: q?.chartType,
|
|
2151
2171
|
isDrilled: U.length > 0,
|
|
2152
|
-
isPythonMode:
|
|
2172
|
+
isPythonMode: Y
|
|
2153
2173
|
}), [
|
|
2154
2174
|
t?.isMetric,
|
|
2155
2175
|
t?.query,
|
|
2156
2176
|
t?.companyId,
|
|
2157
|
-
|
|
2177
|
+
q?.chartType,
|
|
2158
2178
|
U.length,
|
|
2159
|
-
|
|
2160
|
-
]),
|
|
2161
|
-
raw:
|
|
2179
|
+
Y
|
|
2180
|
+
]), Q = R(() => da({
|
|
2181
|
+
raw: rr.rows,
|
|
2162
2182
|
selectedDims: (t?.datasetMetricSettings)?.newDatasetSettings?.selectedDims,
|
|
2163
2183
|
selectedMetrics: (t?.datasetMetricSettings)?.newDatasetSettings?.selectedMetrics,
|
|
2164
2184
|
datasetSettings: t?.datasetMetricSettings?.newDatasetSettings,
|
|
2165
2185
|
integrationName: t?.companyIntegration?.name,
|
|
2166
|
-
isPythonMode:
|
|
2167
|
-
stableOrder:
|
|
2186
|
+
isPythonMode: Y,
|
|
2187
|
+
stableOrder: or
|
|
2168
2188
|
}), [
|
|
2169
|
-
|
|
2189
|
+
rr.rows,
|
|
2170
2190
|
t?.datasetMetricSettings,
|
|
2171
2191
|
t?.companyIntegration?.name,
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
]),
|
|
2175
|
-
|
|
2176
|
-
if (!
|
|
2177
|
-
let e =
|
|
2192
|
+
Y,
|
|
2193
|
+
or
|
|
2194
|
+
]), sr = R(() => ft(Z?.metaData?.truncation, Q.length), [Z, Q]), cr = R(() => st(sr), [sr]), ur = Hn || $n || rr.error;
|
|
2195
|
+
L(() => {
|
|
2196
|
+
if (!ur) return;
|
|
2197
|
+
let e = ur instanceof Error ? ur.message : oa(ur, "message"), n = oa(ur, "context");
|
|
2178
2198
|
m("metric-query-error-observed", {
|
|
2179
2199
|
metricId: t?.id,
|
|
2180
2200
|
metricName: t?.name,
|
|
2181
|
-
chartType:
|
|
2201
|
+
chartType: q?.chartType,
|
|
2182
2202
|
message: e,
|
|
2183
2203
|
context: n,
|
|
2184
|
-
payload:
|
|
2204
|
+
payload: ne(X)
|
|
2185
2205
|
});
|
|
2186
2206
|
}, [
|
|
2187
|
-
|
|
2207
|
+
ur,
|
|
2188
2208
|
t?.id,
|
|
2189
2209
|
t?.name,
|
|
2190
|
-
|
|
2191
|
-
]),
|
|
2192
|
-
let e =
|
|
2193
|
-
|
|
2210
|
+
q?.chartType
|
|
2211
|
+
]), L(() => {
|
|
2212
|
+
let e = X?.id;
|
|
2213
|
+
Un && De && e && De((t) => pi(t, e));
|
|
2194
2214
|
}, [
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
]),
|
|
2199
|
-
let e =
|
|
2200
|
-
!
|
|
2215
|
+
Un,
|
|
2216
|
+
X?.id,
|
|
2217
|
+
De
|
|
2218
|
+
]), L(() => {
|
|
2219
|
+
let e = X?.id;
|
|
2220
|
+
!Un && De && e && De((t) => mi(t, e));
|
|
2201
2221
|
}, [
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2222
|
+
Un,
|
|
2223
|
+
zn,
|
|
2224
|
+
De
|
|
2205
2225
|
]);
|
|
2206
|
-
let { data:
|
|
2207
|
-
metricViewFilters:
|
|
2208
|
-
xAxisSettings:
|
|
2209
|
-
yAxisSettings:
|
|
2226
|
+
let { data: dr } = Kn(T, void 0, _, y), fr = R(() => dr?.weekStartDay === "sunday" ? "sunday" : "monday", [dr]), { mutate: pr } = te(), { mutateAsync: mr } = S(), hr = R(() => JSON.stringify({
|
|
2227
|
+
metricViewFilters: F?.metricViewFilters || [],
|
|
2228
|
+
xAxisSettings: F?.xAxisSettings || [],
|
|
2229
|
+
yAxisSettings: F?.yAxisSettings || []
|
|
2210
2230
|
}), [
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
]),
|
|
2215
|
-
|
|
2216
|
-
let
|
|
2217
|
-
|
|
2218
|
-
let
|
|
2219
|
-
|
|
2220
|
-
let e =
|
|
2231
|
+
F?.metricViewFilters,
|
|
2232
|
+
F?.xAxisSettings,
|
|
2233
|
+
F?.yAxisSettings
|
|
2234
|
+
]), gr = R(() => JSON.stringify(fe || []), [fe]), vr = z(F);
|
|
2235
|
+
vr.current = F;
|
|
2236
|
+
let yr = z(fe);
|
|
2237
|
+
yr.current = fe;
|
|
2238
|
+
let br = z(t?.id);
|
|
2239
|
+
br.current = t?.id, L(() => {
|
|
2240
|
+
let e = vr.current, n = yr.current, r = br.current, a = On.current !== hr, s = [...e?.metricViewFilters?.find((e) => e.id === r)?.filters?.filter((e) => !n?.find((t) => e?.name === t?.name)) || [], ...n || []];
|
|
2221
2241
|
Ut((e) => {
|
|
2222
2242
|
let n = t?.rlsConditions?.map((t) => {
|
|
2223
2243
|
let n = e?.find((e) => e.name === t.name && e.datatype === t.datatype && e.tableName === t.tableName && e.columnName === t.columnName), r = t;
|
|
@@ -2237,7 +2257,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2237
2257
|
maxDate: $(e.maxDate) ?? void 0,
|
|
2238
2258
|
fromDate: $(e.fromDate) ?? void 0,
|
|
2239
2259
|
toDate: $(e.toDate) ?? void 0,
|
|
2240
|
-
...
|
|
2260
|
+
...ia(e)
|
|
2241
2261
|
})) : e.options,
|
|
2242
2262
|
variableOptions: r.datatype === "date" ? e.options?.map((e) => ({
|
|
2243
2263
|
range: e.range,
|
|
@@ -2247,7 +2267,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2247
2267
|
maxDate: $(e.maxDate) ?? void 0,
|
|
2248
2268
|
fromDate: $(e.fromDate) ?? void 0,
|
|
2249
2269
|
toDate: $(e.toDate) ?? void 0,
|
|
2250
|
-
...
|
|
2270
|
+
...ia(e),
|
|
2251
2271
|
value: e.name,
|
|
2252
2272
|
label: e.name
|
|
2253
2273
|
})) : e.options?.map((e) => ({
|
|
@@ -2257,7 +2277,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2257
2277
|
selectedVariableValue: e.value ? r.datatype === "string" ? {
|
|
2258
2278
|
value: e.value,
|
|
2259
2279
|
label: e.value
|
|
2260
|
-
} :
|
|
2280
|
+
} : aa({
|
|
2261
2281
|
option: t,
|
|
2262
2282
|
value: e.value
|
|
2263
2283
|
}) : r.selectedVariableValue
|
|
@@ -2278,7 +2298,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2278
2298
|
...r?.selectedDropdownValue === void 0 && n?.selectedDropdownValue !== void 0 ? { selectedDropdownValue: n.selectedDropdownValue } : {},
|
|
2279
2299
|
...r?.selectedVariableValue === void 0 && n?.selectedVariableValue !== void 0 ? { selectedVariableValue: n.selectedVariableValue } : {}
|
|
2280
2300
|
}), r?.datatype === "date" && r?.options?.find((e) => e.range === "Custom Date") && r?.isEnableDynamicDate && r?.dynamicDate?.value) {
|
|
2281
|
-
let e =
|
|
2301
|
+
let e = A($e?.find((e) => e.value === r?.dynamicDate?.value)?.count || 0), t = Ge(e), n = Ge(e);
|
|
2282
2302
|
r = {
|
|
2283
2303
|
...r,
|
|
2284
2304
|
options: r?.options?.map((r) => r.range === "Custom Date" ? {
|
|
@@ -2294,108 +2314,108 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2294
2314
|
tableName: `${i}.${t.tableName.split(".").slice(1).join(".")}`
|
|
2295
2315
|
} : r;
|
|
2296
2316
|
}) || [];
|
|
2297
|
-
return
|
|
2317
|
+
return xe(e || [], n || []) ? e : n || [];
|
|
2298
2318
|
});
|
|
2299
2319
|
}, [
|
|
2300
2320
|
t?.rlsConditions,
|
|
2301
2321
|
p,
|
|
2302
2322
|
o,
|
|
2303
2323
|
i,
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
]),
|
|
2307
|
-
|
|
2308
|
-
}, [
|
|
2309
|
-
t?.id &&
|
|
2324
|
+
gr,
|
|
2325
|
+
hr
|
|
2326
|
+
]), L(() => {
|
|
2327
|
+
On.current = hr;
|
|
2328
|
+
}, [hr]), L(() => {
|
|
2329
|
+
t?.id && Ie && !Y && t?.isMetric && Ie?.((e) => {
|
|
2310
2330
|
let n = {
|
|
2311
|
-
filters: [...
|
|
2331
|
+
filters: [...K || [], ...q?.tableSettings?.isServerSidePagination && q?.chartType === N.table ? Wt?.map((e) => e.condition)?.filter((e) => se(e)) : []],
|
|
2312
2332
|
xAxisSettings: {
|
|
2313
|
-
isEnable: !!(
|
|
2314
|
-
xaxis:
|
|
2333
|
+
isEnable: !!(q?.dynamicXAxis?.isEnabled || q?.enduserMeasureAndDimensions?.isEnabled) && Ue.includes(q?.chartType || ""),
|
|
2334
|
+
xaxis: q?.xAxis || ""
|
|
2315
2335
|
},
|
|
2316
2336
|
yAxisSettings: {
|
|
2317
|
-
isEnable: !(
|
|
2318
|
-
yAxis:
|
|
2337
|
+
isEnable: !(q?.dynamicYAxis?.isEnabled && q?.dynamicYAxis?.selectedOption && !Array.isArray(q?.dynamicYAxis?.selectedOption)),
|
|
2338
|
+
yAxis: q?.dynamicYAxis?.selectedOption || ""
|
|
2319
2339
|
},
|
|
2320
2340
|
id: t?.id,
|
|
2321
2341
|
metricRequestData: {
|
|
2322
2342
|
isAllClient: g,
|
|
2323
|
-
timeseriesSettings:
|
|
2324
|
-
format:
|
|
2325
|
-
seriesField:
|
|
2326
|
-
isFiscal:
|
|
2343
|
+
timeseriesSettings: Y ? void 0 : {
|
|
2344
|
+
format: q?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase() || "monthly",
|
|
2345
|
+
seriesField: q?.seriesField || "",
|
|
2346
|
+
isFiscal: P === "ind"
|
|
2327
2347
|
}
|
|
2328
2348
|
}
|
|
2329
2349
|
}, r = e?.find((e) => e.id === t?.id);
|
|
2330
|
-
return r &&
|
|
2350
|
+
return r && xe(r, n) ? e : [...e?.filter((e) => e.id !== t?.id) || [], n];
|
|
2331
2351
|
});
|
|
2332
2352
|
}, [
|
|
2333
2353
|
t?.id,
|
|
2334
2354
|
t?.isMetric,
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2355
|
+
K,
|
|
2356
|
+
q?.timeSeriesSettings,
|
|
2357
|
+
q?.seriesField,
|
|
2358
|
+
Y,
|
|
2359
|
+
P,
|
|
2340
2360
|
g,
|
|
2341
2361
|
Wt,
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
]),
|
|
2362
|
+
q?.tableSettings?.isServerSidePagination,
|
|
2363
|
+
q?.chartType,
|
|
2364
|
+
q?.dynamicYAxis,
|
|
2365
|
+
q?.dynamicXAxis
|
|
2366
|
+
]), Ui({
|
|
2347
2367
|
metric: t,
|
|
2348
|
-
chartSettings:
|
|
2368
|
+
chartSettings: q,
|
|
2349
2369
|
drillDownSettings: W,
|
|
2350
|
-
setDrillDownSettings:
|
|
2351
|
-
initialDrilledLevel:
|
|
2352
|
-
initialDrillFiltersProp:
|
|
2353
|
-
initialDrillType:
|
|
2354
|
-
initialUnderlyingDataDrillFilters:
|
|
2355
|
-
}),
|
|
2356
|
-
drillUrlState:
|
|
2370
|
+
setDrillDownSettings: G,
|
|
2371
|
+
initialDrilledLevel: et,
|
|
2372
|
+
initialDrillFiltersProp: nt,
|
|
2373
|
+
initialDrillType: it,
|
|
2374
|
+
initialUnderlyingDataDrillFilters: lt
|
|
2375
|
+
}), Wi({
|
|
2376
|
+
drillUrlState: ke,
|
|
2357
2377
|
metric: t,
|
|
2358
2378
|
drillDownSettings: W,
|
|
2359
|
-
setDrillDownSettings:
|
|
2360
|
-
setChartSettings:
|
|
2379
|
+
setDrillDownSettings: G,
|
|
2380
|
+
setChartSettings: J
|
|
2361
2381
|
});
|
|
2362
|
-
let { mutateAsync:
|
|
2382
|
+
let { mutateAsync: xr } = D(), Sr = R(() => JSON.stringify(n?.filters), [n?.filters]), Cr = R(() => {
|
|
2363
2383
|
let e = t?.datasetMetricSettings?.metricVariables || [];
|
|
2364
2384
|
if (!e || !Array.isArray(e) || !e?.length) return [];
|
|
2365
2385
|
let r = [];
|
|
2366
2386
|
for (let a = 0; a < e?.length; a++) {
|
|
2367
2387
|
let s = e[a], c = s.type.value === "custom" && s.customQuery && s.customColumnName, l = c ? {
|
|
2368
|
-
query:
|
|
2388
|
+
query: ge({
|
|
2369
2389
|
query: s?.customQuery || "",
|
|
2370
2390
|
tenancyLevel: o,
|
|
2371
2391
|
clientId: i,
|
|
2372
2392
|
isAllClient: g,
|
|
2373
|
-
clientColumnType:
|
|
2393
|
+
clientColumnType: le || "STRING",
|
|
2374
2394
|
dbName: t?.companyIntegration?.name,
|
|
2375
|
-
rlsConditions:
|
|
2395
|
+
rlsConditions: K?.filter((e) => e.isVariableFilter),
|
|
2376
2396
|
globalFilters: {
|
|
2377
2397
|
...n,
|
|
2378
2398
|
filters: n?.filters?.filter((e) => e?.isVariableFilter && !!(Array.isArray(e?.value) ? e?.value?.length : e))
|
|
2379
2399
|
},
|
|
2380
|
-
weekStartDay:
|
|
2400
|
+
weekStartDay: fr
|
|
2381
2401
|
}),
|
|
2382
|
-
alias:
|
|
2383
|
-
} : void 0, u = s.dependOnOptions?.length ?
|
|
2384
|
-
let t =
|
|
2402
|
+
alias: ae
|
|
2403
|
+
} : void 0, u = s.dependOnOptions?.length ? K?.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) => {
|
|
2404
|
+
let t = We(e);
|
|
2385
2405
|
return e.datatype === "date" && t === void 0 ? null : {
|
|
2386
2406
|
columnName: s.dependOnOptions.find((t) => e.name === t.filter?.value)?.column || "",
|
|
2387
2407
|
value: t,
|
|
2388
2408
|
as: e.datatype
|
|
2389
2409
|
};
|
|
2390
2410
|
}).filter(Boolean), p = d?.map((e) => {
|
|
2391
|
-
let t = e.as === "date" ?
|
|
2411
|
+
let t = e.as === "date" ? Re(e) : de(e?.value);
|
|
2392
2412
|
return e.as === "date" && t === void 0 ? null : {
|
|
2393
2413
|
columnName: s.dependOnOptions.find((t) => e.label === t.filter?.value)?.column || "",
|
|
2394
2414
|
value: t,
|
|
2395
2415
|
as: e.as
|
|
2396
2416
|
};
|
|
2397
2417
|
}).filter(Boolean);
|
|
2398
|
-
s.isClientScoped && i &&
|
|
2418
|
+
s.isClientScoped && i && le && !g && o === "TABLE" && s.clientColumn?.name?.value && s.clientColumn?.datatype?.value && f.push({
|
|
2399
2419
|
columnName: s.clientColumn?.name?.value,
|
|
2400
2420
|
value: i,
|
|
2401
2421
|
as: s.clientColumn?.datatype?.value
|
|
@@ -2403,14 +2423,14 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2403
2423
|
let m = [...f, ...p];
|
|
2404
2424
|
r.push({
|
|
2405
2425
|
object: {
|
|
2406
|
-
wId:
|
|
2426
|
+
wId: T,
|
|
2407
2427
|
tableName: c ? "" : s?.table?.value,
|
|
2408
2428
|
columnName: c ? s?.customColumnName || "" : s?.column?.value || "",
|
|
2409
2429
|
filter: m,
|
|
2410
2430
|
customTable: l,
|
|
2411
2431
|
aggregate: c ? "" : s?.column?.aggregate || "",
|
|
2412
2432
|
limit: "1",
|
|
2413
|
-
datasourceId:
|
|
2433
|
+
datasourceId: j,
|
|
2414
2434
|
databaseName: o === "MULTI_DATABASE" && i || ""
|
|
2415
2435
|
},
|
|
2416
2436
|
element: s
|
|
@@ -2419,59 +2439,59 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2419
2439
|
return r;
|
|
2420
2440
|
}, [
|
|
2421
2441
|
t?.datasetMetricSettings?.metricVariables,
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2442
|
+
Sr,
|
|
2443
|
+
K,
|
|
2444
|
+
le,
|
|
2445
|
+
T,
|
|
2426
2446
|
o,
|
|
2427
2447
|
i,
|
|
2428
2448
|
g,
|
|
2429
|
-
|
|
2430
|
-
]),
|
|
2449
|
+
j
|
|
2450
|
+
]), wr = R(() => JSON.stringify(Cr), [Cr]), Dr = z(null), Or = z(0), Ar = z({
|
|
2431
2451
|
clientId: i,
|
|
2432
2452
|
encryptedClientId: y,
|
|
2433
2453
|
isFrontendApp: _,
|
|
2434
|
-
token:
|
|
2454
|
+
token: Xe
|
|
2435
2455
|
});
|
|
2436
|
-
|
|
2437
|
-
let
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
let e =
|
|
2441
|
-
if (
|
|
2442
|
-
let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } =
|
|
2443
|
-
|
|
2444
|
-
entries:
|
|
2445
|
-
fetchColumnValues:
|
|
2456
|
+
Ar.current.clientId = i, Ar.current.encryptedClientId = y, Ar.current.isFrontendApp = _, Ar.current.token = Xe;
|
|
2457
|
+
let jr = z(xr);
|
|
2458
|
+
jr.current = xr, L(() => {
|
|
2459
|
+
Or.current += 1;
|
|
2460
|
+
let e = Or.current, t = () => Or.current !== e;
|
|
2461
|
+
if (Cr?.length) {
|
|
2462
|
+
let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } = Ar.current;
|
|
2463
|
+
Ci({
|
|
2464
|
+
entries: Cr,
|
|
2465
|
+
fetchColumnValues: jr.current,
|
|
2446
2466
|
ctx: {
|
|
2447
2467
|
clientId: e,
|
|
2448
2468
|
encryptedClientId: n,
|
|
2449
2469
|
isFrontendApp: r,
|
|
2450
2470
|
token: i
|
|
2451
2471
|
},
|
|
2452
|
-
onSeed: (e) =>
|
|
2453
|
-
onResolved: (e, t) =>
|
|
2472
|
+
onSeed: (e) => Cn(e),
|
|
2473
|
+
onResolved: (e, t) => Cn((n) => ({
|
|
2454
2474
|
...n,
|
|
2455
2475
|
[e]: t
|
|
2456
2476
|
})),
|
|
2457
|
-
onLoading: (e) =>
|
|
2477
|
+
onLoading: (e) => vt(e),
|
|
2458
2478
|
onSettle: () => {
|
|
2459
|
-
|
|
2460
|
-
|
|
2479
|
+
Dr.current && clearTimeout(Dr.current), Dr.current = setTimeout(() => {
|
|
2480
|
+
Dr.current = null, vt(!1);
|
|
2461
2481
|
}, 200);
|
|
2462
2482
|
},
|
|
2463
2483
|
isCancelled: t
|
|
2464
2484
|
}).catch(() => {});
|
|
2465
2485
|
}
|
|
2466
2486
|
return () => {
|
|
2467
|
-
|
|
2487
|
+
Or.current += 1, Dr.current &&= (clearTimeout(Dr.current), null);
|
|
2468
2488
|
};
|
|
2469
|
-
}, [
|
|
2470
|
-
let
|
|
2471
|
-
|
|
2472
|
-
let
|
|
2489
|
+
}, [wr]);
|
|
2490
|
+
let Mr = R(() => (t?.datasetMetricSettings)?.newDatasetSettings?.selectedDims?.[0]?.name, [t]);
|
|
2491
|
+
R(() => Fe(t?.datasetMetricSettings?.selectedDimensions?.[U.length < t?.datasetMetricSettings?.selectedDimensions?.length ? U.length : 0] || ""), [t?.datasetMetricSettings, U]);
|
|
2492
|
+
let Nr = R(() => {
|
|
2473
2493
|
let e = t?.drillDownSettings?.isEnableGroupBy;
|
|
2474
|
-
return
|
|
2494
|
+
return dn ? [...V?.length ? V : [], ...kr({
|
|
2475
2495
|
filters: u,
|
|
2476
2496
|
metricId: t?.id,
|
|
2477
2497
|
isGroupByEnabled: e,
|
|
@@ -2480,108 +2500,108 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2480
2500
|
}, [
|
|
2481
2501
|
u,
|
|
2482
2502
|
t?.id,
|
|
2483
|
-
|
|
2503
|
+
dn,
|
|
2484
2504
|
t?.drillDownSettings?.isEnableGroupBy,
|
|
2485
2505
|
V
|
|
2486
|
-
]),
|
|
2506
|
+
]), Pr = I((e = []) => e.filter((e) => e.isAddOnMetrics).map((e) => s ? {
|
|
2487
2507
|
...e,
|
|
2488
|
-
dimensionColumn:
|
|
2489
|
-
measureColumn:
|
|
2508
|
+
dimensionColumn: q?.xAxis || "",
|
|
2509
|
+
measureColumn: q?.yAxisList?.[0] || "",
|
|
2490
2510
|
options: e.datatype === "date" ? e.options : [],
|
|
2491
2511
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2492
2512
|
} : {
|
|
2493
2513
|
...e,
|
|
2494
|
-
dimensionColumn:
|
|
2495
|
-
measureColumn:
|
|
2496
|
-
value: e.isAppFilter ? e.datatype === "date" ?
|
|
2497
|
-
options: e.datatype === "date" ? e?.options?.map((t) =>
|
|
2514
|
+
dimensionColumn: q?.xAxis || "",
|
|
2515
|
+
measureColumn: q?.yAxisList?.[0] || "",
|
|
2516
|
+
value: e.isAppFilter ? e.datatype === "date" ? ze(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,
|
|
2517
|
+
options: e.datatype === "date" ? e?.options?.map((t) => P === "ind" && e.datatype === "date" ? {
|
|
2498
2518
|
...t,
|
|
2499
2519
|
isFiscal: !0
|
|
2500
2520
|
} : t) : [],
|
|
2501
2521
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2502
|
-
}).filter((e) =>
|
|
2522
|
+
}).filter((e) => Mn(e)), [
|
|
2503
2523
|
c?.values,
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2524
|
+
P,
|
|
2525
|
+
q?.xAxis,
|
|
2526
|
+
q?.yAxisList,
|
|
2507
2527
|
s,
|
|
2508
|
-
|
|
2528
|
+
Mn
|
|
2509
2529
|
]);
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
}, [
|
|
2513
|
-
let
|
|
2514
|
-
|
|
2515
|
-
let e =
|
|
2516
|
-
if (
|
|
2530
|
+
R(() => Pr(Nr), [Pr, Nr]), L(() => {
|
|
2531
|
+
Nr?.some((e) => e.isAddOnMetrics) ? xn(Pr(Nr)) : xn([]);
|
|
2532
|
+
}, [Pr, Nr]);
|
|
2533
|
+
let Fr = R(() => q?.chartType === N.singleValue && !!q?.customSettings?.comparisonValueShow && !!q?.customSettings?.comparisonTimeGrain && !!q?.customSettings?.comparisonTimePeriod && !!q?.singleValue, [q]);
|
|
2534
|
+
L(() => {
|
|
2535
|
+
let e = Z;
|
|
2536
|
+
if (An({
|
|
2517
2537
|
data: [],
|
|
2518
2538
|
error: "",
|
|
2519
2539
|
isLoading: !1,
|
|
2520
2540
|
currentValue: ""
|
|
2521
|
-
}),
|
|
2541
|
+
}), q?.chartType === N.table) {
|
|
2522
2542
|
let t = e?.totalRecords;
|
|
2523
|
-
typeof t == "number" &&
|
|
2543
|
+
typeof t == "number" && Bt(t);
|
|
2524
2544
|
}
|
|
2525
2545
|
m("metric-query-response-applied", {
|
|
2526
2546
|
metricId: t?.id,
|
|
2527
2547
|
metricName: t?.name,
|
|
2528
|
-
chartType:
|
|
2529
|
-
rowCount:
|
|
2530
|
-
columns: Object.keys(
|
|
2548
|
+
chartType: q?.chartType,
|
|
2549
|
+
rowCount: Q?.length || 0,
|
|
2550
|
+
columns: Object.keys(Q?.[0] || {}),
|
|
2531
2551
|
totalRecords: e?.totalRecords,
|
|
2532
|
-
truncation:
|
|
2552
|
+
truncation: sr,
|
|
2533
2553
|
drillConfig: C(W?.configV2)
|
|
2534
2554
|
});
|
|
2535
2555
|
let n = !!W?.isEnableGroupBy && !!W?.configV2?.isEnable && !!W?.configV2?.levels?.some((e) => e?.isEnable);
|
|
2536
|
-
if (t?.datasetMetricSettings?.isUseRawSQL && !(
|
|
2537
|
-
let e = Object.keys(
|
|
2538
|
-
|
|
2556
|
+
if (t?.datasetMetricSettings?.isUseRawSQL && !(jn && n)) {
|
|
2557
|
+
let e = Object.keys(Q?.[0] || {});
|
|
2558
|
+
J((t) => ({
|
|
2539
2559
|
...t,
|
|
2540
2560
|
yAxisList: e.length ? e : t?.yAxisList || []
|
|
2541
2561
|
}));
|
|
2542
2562
|
}
|
|
2543
2563
|
let r = e?.metaData;
|
|
2544
|
-
|
|
2564
|
+
mn(Oe(r?.groupbyColumnList)), en((e) => ({
|
|
2545
2565
|
...e,
|
|
2546
2566
|
report: "",
|
|
2547
2567
|
isLoading: e?.isLoading,
|
|
2548
2568
|
isOpen: e?.isOpen
|
|
2549
2569
|
}));
|
|
2550
2570
|
}, [
|
|
2551
|
-
X,
|
|
2552
|
-
t?.datasetMetricSettings,
|
|
2553
2571
|
Z,
|
|
2554
|
-
|
|
2555
|
-
|
|
2572
|
+
t?.datasetMetricSettings,
|
|
2573
|
+
Q,
|
|
2574
|
+
sr,
|
|
2575
|
+
jn,
|
|
2556
2576
|
W?.isEnableGroupBy,
|
|
2557
2577
|
W?.configV2
|
|
2558
|
-
]),
|
|
2559
|
-
t?.datasetMetricSettings?.createdSorts?.length ?
|
|
2560
|
-
}, [t?.datasetMetricSettings?.createdSorts?.length]),
|
|
2561
|
-
|
|
2578
|
+
]), L(() => {
|
|
2579
|
+
t?.datasetMetricSettings?.createdSorts?.length ? Tn(!0) : Tn(!1);
|
|
2580
|
+
}, [t?.datasetMetricSettings?.createdSorts?.length]), L(() => {
|
|
2581
|
+
q?.chartType === N.timeSeries && q?.timeSeriesSettings?.groupBySettings?.value && !Y && J((e) => ({
|
|
2562
2582
|
...e,
|
|
2563
|
-
xAxis: `${
|
|
2583
|
+
xAxis: `${q?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase()} of ${Mr}`
|
|
2564
2584
|
}));
|
|
2565
2585
|
}, [
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
]),
|
|
2571
|
-
if (
|
|
2572
|
-
let e = t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics || [], n = Object?.keys(
|
|
2573
|
-
|
|
2586
|
+
Q,
|
|
2587
|
+
q?.chartType,
|
|
2588
|
+
q?.timeSeriesSettings,
|
|
2589
|
+
Y
|
|
2590
|
+
]), L(() => {
|
|
2591
|
+
if (q?.isEnableComparisonFilter && [N.line].includes(q?.chartType)) {
|
|
2592
|
+
let e = t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics || [], n = Object?.keys(Q?.[0] || {});
|
|
2593
|
+
J((t) => ({
|
|
2574
2594
|
...t,
|
|
2575
2595
|
yAxisList: [...n.filter((t) => e?.some((e) => t.startsWith(e.alias)))]
|
|
2576
2596
|
}));
|
|
2577
2597
|
}
|
|
2578
2598
|
}, [
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2599
|
+
Q,
|
|
2600
|
+
q?.isEnableComparisonFilter,
|
|
2601
|
+
Vt,
|
|
2602
|
+
q?.chartType
|
|
2583
2603
|
]);
|
|
2584
|
-
let
|
|
2604
|
+
let Lr = I((e, n, r, i, o, s) => {
|
|
2585
2605
|
ee("metric-filter-applied", {
|
|
2586
2606
|
metricId: t?.id,
|
|
2587
2607
|
hasCustomValue: !!i,
|
|
@@ -2589,7 +2609,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2589
2609
|
stringValueCount: o?.length || 0,
|
|
2590
2610
|
hasTimeGrain: !!s,
|
|
2591
2611
|
rlsConditionCount: V?.length || 0
|
|
2592
|
-
}),
|
|
2612
|
+
}), ie?.(a, t?.id), Ut(i ? (t) => t?.map((t) => t.name === e ? {
|
|
2593
2613
|
...t,
|
|
2594
2614
|
value: n,
|
|
2595
2615
|
options: t.options?.map((e) => n === e.name ? {
|
|
@@ -2607,7 +2627,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2607
2627
|
label: n,
|
|
2608
2628
|
endDate: i.endDate,
|
|
2609
2629
|
startDate: i.startDate,
|
|
2610
|
-
...
|
|
2630
|
+
...ia(i),
|
|
2611
2631
|
timeGrainValue: s
|
|
2612
2632
|
}
|
|
2613
2633
|
} : t) : o ? (t) => t?.map((t) => t.name === e ? {
|
|
@@ -2626,11 +2646,11 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2626
2646
|
label: r || n
|
|
2627
2647
|
}
|
|
2628
2648
|
} : t));
|
|
2629
|
-
}, []),
|
|
2649
|
+
}, []), zr = I((e) => {
|
|
2630
2650
|
e?.event && e?.event?.event?.preventDefault(), m("chart-click-params-captured", {
|
|
2631
2651
|
metricId: t?.id,
|
|
2632
2652
|
metricName: t?.name,
|
|
2633
|
-
chartType:
|
|
2653
|
+
chartType: q?.chartType,
|
|
2634
2654
|
name: e?.name,
|
|
2635
2655
|
value: e?.value,
|
|
2636
2656
|
seriesName: e?.seriesName,
|
|
@@ -2640,82 +2660,82 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2640
2660
|
}, [
|
|
2641
2661
|
t?.id,
|
|
2642
2662
|
t?.name,
|
|
2643
|
-
|
|
2663
|
+
q?.chartType,
|
|
2644
2664
|
W?.configV2
|
|
2645
|
-
]),
|
|
2646
|
-
let e = Array.isArray(
|
|
2665
|
+
]), Vr = R(() => {
|
|
2666
|
+
let e = Array.isArray(Q) && Q.length && H?.name != null ? Q?.map((e) => Object.entries(e).find(([, e]) => (typeof e == "number" && typeof H?.name == "string" ? e?.toString() : e) === H.name)?.[0]).filter((e) => e)[0] : "";
|
|
2647
2667
|
if (!e) return e;
|
|
2648
2668
|
let n = t?.datasetMetricSettings?.newDatasetSettings, r = [...n?.selectedDims || [], ...n?.selectedMetrics || []], i = W?.configV2?.levels?.flatMap((e) => e?.dimensions || []) || [];
|
|
2649
|
-
return
|
|
2669
|
+
return Qe(e, {
|
|
2650
2670
|
selectedColumns: r,
|
|
2651
2671
|
levelColumns: i,
|
|
2652
2672
|
dbName: t?.companyIntegration?.name
|
|
2653
2673
|
});
|
|
2654
2674
|
}, [
|
|
2655
|
-
|
|
2675
|
+
Q,
|
|
2656
2676
|
H?.name,
|
|
2657
2677
|
t?.datasetMetricSettings,
|
|
2658
2678
|
t?.companyIntegration?.name,
|
|
2659
2679
|
W?.configV2?.levels
|
|
2660
|
-
]),
|
|
2680
|
+
]), Hr = R(() => {
|
|
2661
2681
|
if (!H) return;
|
|
2662
|
-
let e =
|
|
2663
|
-
return
|
|
2682
|
+
let e = q?.isMultiDimension || q?.isDynamicSeries ? q?.seriesField : void 0, t = e === "ungrouped" ? void 0 : e, n = !t && typeof H.seriesName == "string" ? H.seriesName : q?.yAxisList?.[0] || q?.singleValue, r = tt(q);
|
|
2683
|
+
return at({
|
|
2664
2684
|
params: H,
|
|
2665
|
-
axisDimension:
|
|
2685
|
+
axisDimension: Vr ? { columnName: Vr } : void 0,
|
|
2666
2686
|
seriesDimension: t ? { columnName: t } : void 0,
|
|
2667
2687
|
measure: n ? { columnName: n } : void 0,
|
|
2668
2688
|
formatMeasure: r ? (e) => r(e, n) : void 0
|
|
2669
2689
|
});
|
|
2670
2690
|
}, [
|
|
2671
2691
|
H,
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
]),
|
|
2692
|
+
Vr,
|
|
2693
|
+
q
|
|
2694
|
+
]), Ur = R(() => {
|
|
2675
2695
|
let e = t?.datasetMetricSettings?.newDatasetSettings;
|
|
2676
2696
|
return {
|
|
2677
2697
|
selectedDims: e?.selectedDims,
|
|
2678
2698
|
selectedMetrics: e?.selectedMetrics,
|
|
2679
2699
|
levelDimensions: W?.configV2?.levels?.flatMap((e) => e?.dimensions || []) || []
|
|
2680
2700
|
};
|
|
2681
|
-
}, [W?.configV2?.levels, t?.datasetMetricSettings]),
|
|
2701
|
+
}, [W?.configV2?.levels, t?.datasetMetricSettings]), Gr = I((e) => ce({
|
|
2682
2702
|
filter: e,
|
|
2683
|
-
...
|
|
2684
|
-
}), [
|
|
2703
|
+
...Ur
|
|
2704
|
+
}), [Ur]), Kr = R(() => {
|
|
2685
2705
|
if (sn.current !== void 0 && U === on.current) return sn.current;
|
|
2686
2706
|
let e = W?.configV2?.levels?.find((e) => e?.isEnable)?.filters || [];
|
|
2687
|
-
return (e.length ? e : U).map(
|
|
2707
|
+
return (e.length ? e : U).map(Gr);
|
|
2688
2708
|
}, [
|
|
2689
2709
|
W?.configV2?.levels,
|
|
2690
2710
|
U,
|
|
2691
|
-
|
|
2711
|
+
Gr,
|
|
2692
2712
|
on,
|
|
2693
2713
|
sn
|
|
2694
|
-
]),
|
|
2695
|
-
columnName:
|
|
2696
|
-
...
|
|
2697
|
-
}), [
|
|
2714
|
+
]), qr = R(() => ye({
|
|
2715
|
+
columnName: Vr,
|
|
2716
|
+
...Ur
|
|
2717
|
+
}), [Vr, Ur]), { getUnderlyingData: Jr } = lr({
|
|
2698
2718
|
clientName: i,
|
|
2699
2719
|
dbName: t?.companyIntegration?.name,
|
|
2700
2720
|
tenancyType: o,
|
|
2701
|
-
values:
|
|
2721
|
+
values: Fn,
|
|
2702
2722
|
companyId: t?.companyId,
|
|
2703
|
-
query:
|
|
2704
|
-
workspaceId:
|
|
2723
|
+
query: Be(t?.query, t?.companyId),
|
|
2724
|
+
workspaceId: T,
|
|
2705
2725
|
metricId: t?.id,
|
|
2706
2726
|
dashboardId: x,
|
|
2707
|
-
rlsConditions:
|
|
2727
|
+
rlsConditions: K,
|
|
2708
2728
|
globalFilters: n,
|
|
2709
2729
|
isAllClient: !!g,
|
|
2710
|
-
dataMartRelationships:
|
|
2730
|
+
dataMartRelationships: Pn,
|
|
2711
2731
|
customSql: t?.clickActions?.underlyingData?.sql,
|
|
2712
|
-
isEnableCustomSQL:
|
|
2713
|
-
datasourceId:
|
|
2714
|
-
drillFilters:
|
|
2715
|
-
token:
|
|
2732
|
+
isEnableCustomSQL: q?.chartType === N.singleValue && t?.clickActions?.underlyingData?.isEnable && t?.clickActions?.underlyingData?.sql,
|
|
2733
|
+
datasourceId: j,
|
|
2734
|
+
drillFilters: Kr,
|
|
2735
|
+
token: Xe || "",
|
|
2716
2736
|
isFrontendApp: _,
|
|
2717
2737
|
encryptedClientId: _ ? y || "" : i || ""
|
|
2718
|
-
}),
|
|
2738
|
+
}), Xr = async (e, n, r, a, s, c) => {
|
|
2719
2739
|
m("drill-config-change-start", {
|
|
2720
2740
|
metricId: t?.id,
|
|
2721
2741
|
metricName: t?.name,
|
|
@@ -2728,7 +2748,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2728
2748
|
stateConfig: C(W?.configV2)
|
|
2729
2749
|
});
|
|
2730
2750
|
let d = t?.datasetMetricSettings;
|
|
2731
|
-
if (!e || !
|
|
2751
|
+
if (!e || !jn && !d?.newDatasetSettings?.configuration || !t?.companyIntegration?.name) {
|
|
2732
2752
|
m("drill-config-change-skipped", {
|
|
2733
2753
|
metricId: t?.id,
|
|
2734
2754
|
hasStateConfig: !!W?.configV2,
|
|
@@ -2741,14 +2761,14 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2741
2761
|
});
|
|
2742
2762
|
return;
|
|
2743
2763
|
}
|
|
2744
|
-
let f = n?.name, p = (e?.levels || []).find((e) => r ? e?.index === r : e?.isEnable), g = p?.dimensions?.[0]?.alias, _ = n?.rowFilters || [], { config: v, outcome: y } =
|
|
2745
|
-
config:
|
|
2764
|
+
let f = n?.name, p = (e?.levels || []).find((e) => r ? e?.index === r : e?.isEnable), g = p?.dimensions?.[0]?.alias, _ = n?.rowFilters || [], { config: v, outcome: y } = dt({
|
|
2765
|
+
config: jn && ei(e) || e,
|
|
2746
2766
|
clickedLevelIndex: r,
|
|
2747
2767
|
isReset: a,
|
|
2748
2768
|
clickedValue: f,
|
|
2749
2769
|
rowFilters: n?.rowFilters,
|
|
2750
2770
|
adhocDescent: c,
|
|
2751
|
-
enrichFilter:
|
|
2771
|
+
enrichFilter: Gr
|
|
2752
2772
|
});
|
|
2753
2773
|
if (m("drill-config-level-change-resolved", {
|
|
2754
2774
|
metricId: t?.id,
|
|
@@ -2758,7 +2778,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2758
2778
|
rowFilters: n?.rowFilters,
|
|
2759
2779
|
resolvedConfig: C(v)
|
|
2760
2780
|
}), y === "unrepresentable") {
|
|
2761
|
-
|
|
2781
|
+
wt(Yr({
|
|
2762
2782
|
kind: "none",
|
|
2763
2783
|
reason: "blank-value"
|
|
2764
2784
|
})), h("metric.drill_blocked", {
|
|
@@ -2767,15 +2787,15 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2767
2787
|
});
|
|
2768
2788
|
return;
|
|
2769
2789
|
}
|
|
2770
|
-
let b = v, x = [...s || [], ...
|
|
2771
|
-
if (b =
|
|
2790
|
+
let b = v, x = [...s || [], ...ln], S = x.length ? [...d?.newDatasetSettings?.selectedDims || [], ...x] : d?.newDatasetSettings?.selectedDims;
|
|
2791
|
+
if (b = jn ? b : Ae({
|
|
2772
2792
|
config: b,
|
|
2773
2793
|
selectedDims: S,
|
|
2774
2794
|
selectedMetrics: d?.newDatasetSettings?.selectedMetrics,
|
|
2775
2795
|
previousSelectedDims: S,
|
|
2776
2796
|
previousSelectedMetrics: d?.newDatasetSettings?.selectedMetrics
|
|
2777
|
-
}) || b, y === "descend" &&
|
|
2778
|
-
|
|
2797
|
+
}) || b, y === "descend" && _t(b?.levels?.find((e) => e?.isEnable))) {
|
|
2798
|
+
wt(Yr({
|
|
2779
2799
|
kind: "none",
|
|
2780
2800
|
reason: "level-without-measure"
|
|
2781
2801
|
})), h("metric.drill_blocked", {
|
|
@@ -2784,17 +2804,17 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2784
2804
|
});
|
|
2785
2805
|
return;
|
|
2786
2806
|
}
|
|
2787
|
-
|
|
2788
|
-
let w = b?.levels?.find((e) => e?.isEnable), ee = !!b?.levels?.[b?.levels?.length - 1]?.isEnable,
|
|
2789
|
-
parentSettings:
|
|
2807
|
+
wt(null);
|
|
2808
|
+
let w = b?.levels?.find((e) => e?.isEnable), ee = !!b?.levels?.[b?.levels?.length - 1]?.isEnable, te = b?.levels?.[0]?.isEnable, T = gt({
|
|
2809
|
+
parentSettings: q,
|
|
2790
2810
|
levelSettings: w?.chartSettings,
|
|
2791
2811
|
measures: w?.measures
|
|
2792
|
-
}) ||
|
|
2793
|
-
...
|
|
2812
|
+
}) || q, ne = T?.chartType === N.table, E = [...w?.dimensions?.map((e) => e.alias) || [], ...w?.measures?.map((e) => e.alias) || []], D = {
|
|
2813
|
+
...T,
|
|
2794
2814
|
xAxis: w?.dimensions?.[0]?.alias || "",
|
|
2795
|
-
yAxisList: ee && !
|
|
2796
|
-
chartType: ee && !
|
|
2797
|
-
},
|
|
2815
|
+
yAxisList: ee && !T?.chartType || ne ? E : w?.measures?.map((e) => e.alias) || [],
|
|
2816
|
+
chartType: ee && !T?.chartType ? N.table : T?.chartType
|
|
2817
|
+
}, O = `${w?.dimensions?.[0]?.table?.schemaName}.${w?.dimensions?.[0]?.table?.tableName}`;
|
|
2798
2818
|
if (m("drill-config-next-state-ready", {
|
|
2799
2819
|
metricId: t?.id,
|
|
2800
2820
|
activeLevel: {
|
|
@@ -2803,23 +2823,23 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2803
2823
|
filters: w?.filters
|
|
2804
2824
|
},
|
|
2805
2825
|
isLastLevel: ee,
|
|
2806
|
-
isFirstLevelActive:
|
|
2807
|
-
chartType:
|
|
2808
|
-
xAxis:
|
|
2809
|
-
yAxisList:
|
|
2810
|
-
tableColumns:
|
|
2826
|
+
isFirstLevelActive: te,
|
|
2827
|
+
chartType: D?.chartType,
|
|
2828
|
+
xAxis: D?.xAxis,
|
|
2829
|
+
yAxisList: D?.yAxisList,
|
|
2830
|
+
tableColumns: E,
|
|
2811
2831
|
updatedConfig: C(b)
|
|
2812
|
-
}),
|
|
2832
|
+
}), G((e) => ({
|
|
2813
2833
|
...e,
|
|
2814
2834
|
configV2: {
|
|
2815
2835
|
...b || {},
|
|
2816
2836
|
levels: b?.levels?.map((e) => e.index === w?.index ? {
|
|
2817
2837
|
...e,
|
|
2818
|
-
chartSettings:
|
|
2838
|
+
chartSettings: D
|
|
2819
2839
|
} : e) || []
|
|
2820
2840
|
}
|
|
2821
|
-
})),
|
|
2822
|
-
let e =
|
|
2841
|
+
})), J((e) => D), y === "descend" || y === "adhoc-descend") {
|
|
2842
|
+
let e = It.current, t = e ? e.querySelector("[data-chart-engine=\"v2\"]") ? "v2" : "v1" : void 0;
|
|
2823
2843
|
h("metric.drilled", {
|
|
2824
2844
|
level: b.levels?.findIndex((e) => e.isEnable) ?? -1,
|
|
2825
2845
|
...t ? { engine: t } : {}
|
|
@@ -2827,11 +2847,11 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2827
2847
|
}
|
|
2828
2848
|
if (m("drill-config-state-committed", {
|
|
2829
2849
|
metricId: t?.id,
|
|
2830
|
-
chartType:
|
|
2850
|
+
chartType: D?.chartType,
|
|
2831
2851
|
activeLevelIndex: w?.index,
|
|
2832
2852
|
drillConfig: C(b)
|
|
2833
|
-
}),
|
|
2834
|
-
let e =
|
|
2853
|
+
}), fn && !jn) {
|
|
2854
|
+
let e = Rr({
|
|
2835
2855
|
existing: u,
|
|
2836
2856
|
isReset: a,
|
|
2837
2857
|
levelIndex: r,
|
|
@@ -2840,11 +2860,11 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2840
2860
|
columnName: g,
|
|
2841
2861
|
rowFilters: _,
|
|
2842
2862
|
selectedDims: d?.newDatasetSettings?.selectedDims,
|
|
2843
|
-
activeLevelTableName:
|
|
2863
|
+
activeLevelTableName: O,
|
|
2844
2864
|
tenancyLevel: o,
|
|
2845
2865
|
clientId: i,
|
|
2846
|
-
sourceMetricId:
|
|
2847
|
-
}), n = !a && !r ?
|
|
2866
|
+
sourceMetricId: dn ? t?.id : void 0
|
|
2867
|
+
}), n = !a && !r ? Ir({
|
|
2848
2868
|
columnName: g,
|
|
2849
2869
|
rowFilters: _,
|
|
2850
2870
|
selectedDims: d?.newDatasetSettings?.selectedDims
|
|
@@ -2853,7 +2873,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2853
2873
|
metricId: t?.id,
|
|
2854
2874
|
crossFilterCount: e?.length || 0,
|
|
2855
2875
|
drillCrossFilters: e
|
|
2856
|
-
}), n ? (
|
|
2876
|
+
}), n ? (wt({
|
|
2857
2877
|
title: "Filter unavailable",
|
|
2858
2878
|
body: n
|
|
2859
2879
|
}), h("metric.drill_blocked", {
|
|
@@ -2862,15 +2882,15 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2862
2882
|
error_code: "DRILL_COLUMN_UNAVAILABLE"
|
|
2863
2883
|
})) : l?.(e);
|
|
2864
2884
|
}
|
|
2865
|
-
},
|
|
2866
|
-
if (!
|
|
2867
|
-
let a = t?.datasetMetricSettings, s =
|
|
2885
|
+
}, Zr = ({ columnName: e, value: n, mode: r = "only" }) => {
|
|
2886
|
+
if (!fn) return;
|
|
2887
|
+
let a = t?.datasetMetricSettings, s = Ir({
|
|
2868
2888
|
columnName: e,
|
|
2869
2889
|
selectedDims: a?.newDatasetSettings?.selectedDims,
|
|
2870
2890
|
requiresSchemaMetadata: !0
|
|
2871
2891
|
});
|
|
2872
2892
|
if (s) {
|
|
2873
|
-
|
|
2893
|
+
wt({
|
|
2874
2894
|
title: "Filter unavailable",
|
|
2875
2895
|
body: s
|
|
2876
2896
|
}), h("metric.drill_blocked", {
|
|
@@ -2880,7 +2900,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2880
2900
|
});
|
|
2881
2901
|
return;
|
|
2882
2902
|
}
|
|
2883
|
-
let c =
|
|
2903
|
+
let c = Wr({
|
|
2884
2904
|
existing: u,
|
|
2885
2905
|
columnName: e,
|
|
2886
2906
|
value: n,
|
|
@@ -2888,7 +2908,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2888
2908
|
selectedDims: a?.newDatasetSettings?.selectedDims,
|
|
2889
2909
|
tenancyLevel: o,
|
|
2890
2910
|
clientId: i,
|
|
2891
|
-
sourceMetricId:
|
|
2911
|
+
sourceMetricId: dn ? t?.id : void 0
|
|
2892
2912
|
});
|
|
2893
2913
|
m("point-cross-filter-committed", {
|
|
2894
2914
|
metricId: t?.id,
|
|
@@ -2896,15 +2916,15 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2896
2916
|
mode: r,
|
|
2897
2917
|
crossFilterCount: c?.length || 0
|
|
2898
2918
|
}), l?.(c);
|
|
2899
|
-
},
|
|
2919
|
+
}, $r = ({ columnName: e, value: n, mode: r = "only" }) => {
|
|
2900
2920
|
if (!t?.id) return;
|
|
2901
|
-
let a = t?.datasetMetricSettings, s =
|
|
2921
|
+
let a = t?.datasetMetricSettings, s = Ir({
|
|
2902
2922
|
columnName: e,
|
|
2903
2923
|
selectedDims: a?.newDatasetSettings?.selectedDims,
|
|
2904
2924
|
requiresSchemaMetadata: !0
|
|
2905
2925
|
});
|
|
2906
2926
|
if (s) {
|
|
2907
|
-
|
|
2927
|
+
wt({
|
|
2908
2928
|
title: "Filter unavailable",
|
|
2909
2929
|
body: s
|
|
2910
2930
|
}), h("metric.drill_blocked", {
|
|
@@ -2914,8 +2934,8 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2914
2934
|
});
|
|
2915
2935
|
return;
|
|
2916
2936
|
}
|
|
2917
|
-
let c =
|
|
2918
|
-
existing:
|
|
2937
|
+
let c = Wr({
|
|
2938
|
+
existing: fe,
|
|
2919
2939
|
columnName: e,
|
|
2920
2940
|
value: n,
|
|
2921
2941
|
mode: r,
|
|
@@ -2928,8 +2948,8 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2928
2948
|
columnName: e,
|
|
2929
2949
|
mode: r,
|
|
2930
2950
|
filterCount: c?.length || 0
|
|
2931
|
-
}),
|
|
2932
|
-
},
|
|
2951
|
+
}), _e?.(t.id, c);
|
|
2952
|
+
}, ti = async (e, n) => {
|
|
2933
2953
|
m("drill-down-handler-start", {
|
|
2934
2954
|
metricId: t?.id,
|
|
2935
2955
|
metricName: t?.name,
|
|
@@ -2938,20 +2958,20 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2938
2958
|
paramsSeriesName: e?.seriesName,
|
|
2939
2959
|
rowFilters: e?.rowFilters || n,
|
|
2940
2960
|
drillConfig: C(W?.configV2)
|
|
2941
|
-
}), await
|
|
2961
|
+
}), await Xr(W?.configV2, e), m("drill-down-handler-complete", {
|
|
2942
2962
|
metricId: t?.id,
|
|
2943
2963
|
metricName: t?.name
|
|
2944
2964
|
});
|
|
2945
|
-
},
|
|
2965
|
+
}, ri = async ({ dimension: e, params: n, point: r }) => {
|
|
2946
2966
|
if (!e?.alias) return;
|
|
2947
2967
|
let i = t?.datasetMetricSettings, a = W?.configV2, o = a?.levels || [], s = o.findIndex((e) => e?.isEnable), c = (s >= 0 ? o.slice(0, s + 1) : []).map((e) => ({
|
|
2948
2968
|
...e,
|
|
2949
2969
|
isEnable: !1
|
|
2950
|
-
})), l =
|
|
2970
|
+
})), l = mt({
|
|
2951
2971
|
dimension: e,
|
|
2952
2972
|
measures: i?.newDatasetSettings?.selectedMetrics || [],
|
|
2953
|
-
index:
|
|
2954
|
-
chartSettings:
|
|
2973
|
+
index: we(4),
|
|
2974
|
+
chartSettings: q
|
|
2955
2975
|
}), u = {
|
|
2956
2976
|
...a || {},
|
|
2957
2977
|
isEnable: !0,
|
|
@@ -2959,7 +2979,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2959
2979
|
}, d = c[c.length - 1], f = {
|
|
2960
2980
|
columnName: d?.dimensions?.[0]?.alias || i?.newDatasetSettings?.selectedDims?.[0]?.alias,
|
|
2961
2981
|
parentFilters: d?.filters || [],
|
|
2962
|
-
pointFilters:
|
|
2982
|
+
pointFilters: ct(r, Gr).filters
|
|
2963
2983
|
};
|
|
2964
2984
|
m("adhoc-drill-start", {
|
|
2965
2985
|
metricId: t?.id,
|
|
@@ -2967,17 +2987,17 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2967
2987
|
clickedValue: n?.name,
|
|
2968
2988
|
seededConfig: !a,
|
|
2969
2989
|
drillConfig: C(u)
|
|
2970
|
-
}),
|
|
2990
|
+
}), un((t) => t.some((t) => t?.alias === e?.alias) ? t : [...t, e]), G((e) => ({
|
|
2971
2991
|
...e,
|
|
2972
2992
|
isEnableGroupBy: !0,
|
|
2973
2993
|
configV2: u
|
|
2974
|
-
})), await
|
|
2975
|
-
},
|
|
2976
|
-
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) => (
|
|
2994
|
+
})), await Xr(u, n, void 0, !1, [e], f);
|
|
2995
|
+
}, ai = ({ filters: e, nextLevel: r, currentValue: a }) => {
|
|
2996
|
+
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) => (q?.pivotTableSettings2?.headers?.includes(t.alias) ? e.headerColumns.push(t) : e.nonHeaderColumns.push(t), e), {
|
|
2977
2997
|
headerColumns: [],
|
|
2978
2998
|
nonHeaderColumns: []
|
|
2979
2999
|
}), p = e?.map((e) => `${e.columnName};;${e.value}`).join(";;");
|
|
2980
|
-
|
|
3000
|
+
An((e) => ({
|
|
2981
3001
|
...e,
|
|
2982
3002
|
data: e.data.filter((e) => e.key !== p),
|
|
2983
3003
|
error: "",
|
|
@@ -2985,7 +3005,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
2985
3005
|
currentValue: a
|
|
2986
3006
|
}));
|
|
2987
3007
|
let m = f.slice(0, r), h = e?.map((e) => {
|
|
2988
|
-
let t = c.find((t) => t.alias === e.columnName ||
|
|
3008
|
+
let t = c.find((t) => t.alias === e.columnName || Le(t) === e.columnName);
|
|
2989
3009
|
if (t) return {
|
|
2990
3010
|
alias: t.alias || "",
|
|
2991
3011
|
columnName: t.name,
|
|
@@ -3000,7 +3020,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3000
3020
|
...m,
|
|
3001
3021
|
...l,
|
|
3002
3022
|
...d
|
|
3003
|
-
], { aggregates: b, dimensions: x } =
|
|
3023
|
+
], { aggregates: b, dimensions: x } = Ke(g), S = He(u), C = ut(S, g), w = {
|
|
3004
3024
|
...s,
|
|
3005
3025
|
dimensions: x,
|
|
3006
3026
|
aggregates: b,
|
|
@@ -3009,13 +3029,13 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3009
3029
|
isApplyGlobalFilter: !0,
|
|
3010
3030
|
isApplyMetricFilter: !0,
|
|
3011
3031
|
globalFilters: n,
|
|
3012
|
-
rlsConditions:
|
|
3032
|
+
rlsConditions: K
|
|
3013
3033
|
};
|
|
3014
|
-
|
|
3034
|
+
pr({
|
|
3015
3035
|
data: {
|
|
3016
3036
|
configuration: w,
|
|
3017
|
-
id:
|
|
3018
|
-
datasourceId:
|
|
3037
|
+
id: T,
|
|
3038
|
+
datasourceId: j,
|
|
3019
3039
|
dashboardId: "",
|
|
3020
3040
|
isCreateMetric: !0
|
|
3021
3041
|
},
|
|
@@ -3024,15 +3044,15 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3024
3044
|
isFrontendApp: _
|
|
3025
3045
|
}, { onSuccess(e) {
|
|
3026
3046
|
let n = e?.error, r = e?.data;
|
|
3027
|
-
if (n?.message)
|
|
3047
|
+
if (n?.message) An((e) => ({
|
|
3028
3048
|
...e,
|
|
3029
3049
|
error: n?.message,
|
|
3030
3050
|
isLoading: !1,
|
|
3031
3051
|
currentValue: ""
|
|
3032
3052
|
}));
|
|
3033
3053
|
else {
|
|
3034
|
-
let e =
|
|
3035
|
-
|
|
3054
|
+
let e = ue(Array.isArray(r) ? r : [], c, l), n = ot(e);
|
|
3055
|
+
An((e) => ({
|
|
3036
3056
|
data: [...e.data, {
|
|
3037
3057
|
key: p,
|
|
3038
3058
|
data: n
|
|
@@ -3040,24 +3060,24 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3040
3060
|
error: "",
|
|
3041
3061
|
isLoading: !1,
|
|
3042
3062
|
currentValue: ""
|
|
3043
|
-
})),
|
|
3063
|
+
})), J((e) => ({
|
|
3044
3064
|
...e,
|
|
3045
3065
|
pivotTableSettings2: {
|
|
3046
|
-
...
|
|
3047
|
-
dimensions:
|
|
3048
|
-
headers:
|
|
3066
|
+
...q?.pivotTableSettings2,
|
|
3067
|
+
dimensions: Ce(f, t?.companyIntegration?.name || ""),
|
|
3068
|
+
headers: Ce(d, t?.companyIntegration?.name || "")
|
|
3049
3069
|
}
|
|
3050
3070
|
}));
|
|
3051
3071
|
}
|
|
3052
3072
|
} });
|
|
3053
|
-
},
|
|
3073
|
+
}, ci = I(async (e, n) => {
|
|
3054
3074
|
m("drill-level-click-handler-start", {
|
|
3055
3075
|
metricId: t?.id,
|
|
3056
3076
|
metricName: t?.name,
|
|
3057
3077
|
clickedLevelIndex: e,
|
|
3058
3078
|
isReset: !!n,
|
|
3059
3079
|
drillConfig: C(W?.configV2)
|
|
3060
|
-
}), n &&
|
|
3080
|
+
}), n && un([]), wt(null), await Xr(W?.configV2, void 0, e, n), m("drill-level-click-handler-complete", {
|
|
3061
3081
|
metricId: t?.id,
|
|
3062
3082
|
metricName: t?.name,
|
|
3063
3083
|
clickedLevelIndex: e,
|
|
@@ -3067,28 +3087,28 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3067
3087
|
W?.configV2,
|
|
3068
3088
|
t?.id,
|
|
3069
3089
|
t?.name,
|
|
3070
|
-
|
|
3071
|
-
]),
|
|
3072
|
-
if (e) Ut((e) => [...e?.filter((e) => e.group !== `${
|
|
3090
|
+
un
|
|
3091
|
+
]), vi = I((e) => {
|
|
3092
|
+
if (e) Ut((e) => [...e?.filter((e) => e.group !== `${Vt}`)]), Ht((e) => e - 1);
|
|
3073
3093
|
else {
|
|
3074
3094
|
let e = V.filter((e) => !e?.group)?.map((e) => ({
|
|
3075
3095
|
...e,
|
|
3076
|
-
name: `${e?.name}_${
|
|
3077
|
-
group: `${
|
|
3096
|
+
name: `${e?.name}_${Vt + 1}`,
|
|
3097
|
+
group: `${Vt + 1}`,
|
|
3078
3098
|
dependOn: e.dependOn ? {
|
|
3079
|
-
value: `${e.dependOn?.value}_${
|
|
3080
|
-
label: `${e.dependOn?.label}_${
|
|
3099
|
+
value: `${e.dependOn?.value}_${Vt + 1}`,
|
|
3100
|
+
label: `${e.dependOn?.label}_${Vt + 1}`,
|
|
3081
3101
|
customColumnName: e.dependOn?.customColumnName
|
|
3082
3102
|
} : void 0,
|
|
3083
3103
|
dependOns: e?.dependOns?.map((e) => ({
|
|
3084
|
-
value: `${e?.value}_${
|
|
3085
|
-
label: `${e?.label}_${
|
|
3104
|
+
value: `${e?.value}_${Vt + 1}`,
|
|
3105
|
+
label: `${e?.label}_${Vt + 1}`,
|
|
3086
3106
|
customColumnName: e?.customColumnName
|
|
3087
3107
|
})) || []
|
|
3088
3108
|
}));
|
|
3089
3109
|
e.length && (Ut((t) => [...t, ...e]), Ht((e) => e + 1));
|
|
3090
3110
|
}
|
|
3091
|
-
}, [V]),
|
|
3111
|
+
}, [V]), yi = I(async () => {
|
|
3092
3112
|
$t.report ? en((e) => ({
|
|
3093
3113
|
...e,
|
|
3094
3114
|
isOpen: !0
|
|
@@ -3096,10 +3116,10 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3096
3116
|
report: "",
|
|
3097
3117
|
isLoading: !0,
|
|
3098
3118
|
isOpen: !0
|
|
3099
|
-
}), await
|
|
3119
|
+
}), await mr({
|
|
3100
3120
|
data: {
|
|
3101
|
-
data:
|
|
3102
|
-
wId:
|
|
3121
|
+
data: Q,
|
|
3122
|
+
wId: T
|
|
3103
3123
|
},
|
|
3104
3124
|
clientId: _ ? y || "" : i,
|
|
3105
3125
|
token: v || "",
|
|
@@ -3122,74 +3142,74 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3122
3142
|
}
|
|
3123
3143
|
}));
|
|
3124
3144
|
}, [
|
|
3125
|
-
|
|
3145
|
+
Q,
|
|
3126
3146
|
i,
|
|
3127
3147
|
_,
|
|
3128
3148
|
v,
|
|
3129
3149
|
y,
|
|
3130
3150
|
i,
|
|
3131
3151
|
$t
|
|
3132
|
-
]),
|
|
3133
|
-
let e = t?.datasetMetricSettings?.newDatasetSettings, n = e?.configuration, r =
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3152
|
+
]), bi = R(() => {
|
|
3153
|
+
let e = t?.datasetMetricSettings?.newDatasetSettings, n = e?.configuration, r = M(Q || []), i = r, a = e?.selectedDims?.some((e) => Ne(e?.datatype)) || Pe(Q?.[0] || ""), o = e?.selectedDims?.length > 1 && e?.selectedMetrics?.length > 0, s = [
|
|
3154
|
+
N.pivot,
|
|
3155
|
+
N.pivotV2,
|
|
3156
|
+
N.pivotV3,
|
|
3157
|
+
N.timeSeries,
|
|
3158
|
+
N.treeMap,
|
|
3159
|
+
N.indianMap,
|
|
3160
|
+
N.geoBarMap,
|
|
3161
|
+
N.geoMap,
|
|
3162
|
+
N.geoScatterMap,
|
|
3163
|
+
N.worldMap
|
|
3144
3164
|
], c = !!n?.aggregates?.length && !!n?.dimensions?.length;
|
|
3145
|
-
return c && a && (i = [...r?.filter((e) => !s?.includes(e)), ...s]), c && !a && (i = [...r?.filter((e) => !s?.includes(e)), ...s?.filter((e) => e !==
|
|
3165
|
+
return c && a && (i = [...r?.filter((e) => !s?.includes(e)), ...s]), c && !a && (i = [...r?.filter((e) => !s?.includes(e)), ...s?.filter((e) => e !== N.timeSeries)]), !c && a && (i = [...r?.filter((e) => !s?.includes(e)), N.timeSeries]), !c && !a && (i = r?.filter((e) => !s?.includes(e))), W?.isEnableGroupBy && W?.configV2 && (i = i?.filter((e) => me?.includes(e))), o || (i = i?.filter((e) => e !== N.bubbleV2)), i;
|
|
3146
3166
|
}, [
|
|
3147
|
-
|
|
3148
|
-
|
|
3167
|
+
Q,
|
|
3168
|
+
q?.xAxis,
|
|
3149
3169
|
W?.isEnableGroupBy,
|
|
3150
3170
|
W?.configV2,
|
|
3151
3171
|
t?.datasetMetricSettings?.newDatasetSettings?.configuration?.aggregates,
|
|
3152
3172
|
t?.datasetMetricSettings?.newDatasetSettings?.configuration?.dimensions
|
|
3153
|
-
]),
|
|
3154
|
-
let n = t?.datasetMetricSettings?.newDatasetSettings, r = n?.configuration, i = n?.selectedDims || [], a = n?.selectedMetrics || [], o = t?.companyIntegration?.name, s =
|
|
3155
|
-
|
|
3156
|
-
chartAggregateColumns:
|
|
3157
|
-
chartDimensions:
|
|
3158
|
-
chartMetrics:
|
|
3159
|
-
chartSettings:
|
|
3160
|
-
chartTimeColumns:
|
|
3173
|
+
]), xi = (e) => {
|
|
3174
|
+
let n = t?.datasetMetricSettings?.newDatasetSettings, r = n?.configuration, i = n?.selectedDims || [], a = n?.selectedMetrics || [], o = t?.companyIntegration?.name, s = q?.enduserMeasureAndDimensions?.isEnabled;
|
|
3175
|
+
oe({
|
|
3176
|
+
chartAggregateColumns: Je(Ce(a?.filter((e) => !e || typeof e != "object" ? !1 : Er(e) && s ? q?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias) : !0) || [], o), Q || []),
|
|
3177
|
+
chartDimensions: Je(Ce(i?.filter((e) => !s || q?.enduserMeasureAndDimensions?.dimensions?.some((t) => t.value === e.alias)) || [], o), Q || []),
|
|
3178
|
+
chartMetrics: Je(Ce(a?.filter((e) => !s || q?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias)) || [], o), Q || []),
|
|
3179
|
+
chartSettings: q,
|
|
3180
|
+
chartTimeColumns: Ce(i?.filter((e) => Ne(e.datatype)), o),
|
|
3161
3181
|
chartType: e,
|
|
3162
3182
|
configAggregates: r?.aggregates,
|
|
3163
3183
|
configuration: n?.configuration,
|
|
3164
3184
|
dbName: o,
|
|
3165
3185
|
pivotHeaderColumns: [],
|
|
3166
|
-
resultData:
|
|
3167
|
-
setChartSettings:
|
|
3186
|
+
resultData: Q || [],
|
|
3187
|
+
setChartSettings: J
|
|
3168
3188
|
});
|
|
3169
|
-
},
|
|
3170
|
-
|
|
3171
|
-
|
|
3189
|
+
}, Si = R(() => pe(V.filter((e) => e.group && e.isAddOnMetrics && !e.isHiddenInUi && !e.isAppFilter), "group"), [V]), wi = R(() => q?.customSettings?.comparisonValueShow && q?.chartType === N.singleValue ? n?.filters?.find((e) => e?.as === "date") : void 0, [
|
|
3190
|
+
q?.customSettings?.comparisonValueShow,
|
|
3191
|
+
q?.chartType,
|
|
3172
3192
|
n?.filters?.find((e) => e?.as === "date")
|
|
3173
3193
|
]);
|
|
3174
|
-
|
|
3175
|
-
|
|
3194
|
+
L(() => {
|
|
3195
|
+
Q?.length && pn.length ? gn(!0) : gn(!1);
|
|
3176
3196
|
}, [
|
|
3177
|
-
|
|
3178
|
-
|
|
3197
|
+
Q,
|
|
3198
|
+
pn.length,
|
|
3179
3199
|
t?.integrationName,
|
|
3180
3200
|
t?.query
|
|
3181
3201
|
]);
|
|
3182
|
-
let Ti =
|
|
3202
|
+
let Ti = R(() => t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.some(Er) && t?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.map((e) => ({
|
|
3183
3203
|
value: e.alias,
|
|
3184
3204
|
label: e.alias
|
|
3185
|
-
})) || [], [t?.datasetMetricSettings?.newDatasetSettings]), Ei =
|
|
3205
|
+
})) || [], [t?.datasetMetricSettings?.newDatasetSettings]), Ei = R(() => t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.map((e) => ({
|
|
3186
3206
|
value: e?.alias || e?.name,
|
|
3187
3207
|
label: e?.alias || e?.name
|
|
3188
|
-
})) || [], [t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), Di =
|
|
3208
|
+
})) || [], [t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), Di = oi(), { metricFilters: Oi, leftPositionedMetricFilters: ki, rightPositionedMetricFilters: Ai } = R(() => {
|
|
3189
3209
|
let r = Ot({
|
|
3190
3210
|
rlsConditions: V,
|
|
3191
3211
|
isFrontendApp: _
|
|
3192
|
-
}), a =
|
|
3212
|
+
}), a = yt({
|
|
3193
3213
|
metric: {
|
|
3194
3214
|
clientId: t?.clientId,
|
|
3195
3215
|
isCreatedByClient: t?.isCreatedByClient
|
|
@@ -3201,12 +3221,12 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3201
3221
|
},
|
|
3202
3222
|
tenancyLevel: o,
|
|
3203
3223
|
rlsConditions: r,
|
|
3204
|
-
clientColumnType:
|
|
3205
|
-
dataMartTables:
|
|
3224
|
+
clientColumnType: le,
|
|
3225
|
+
dataMartTables: qe
|
|
3206
3226
|
}).rls, s = a.filter((e) => e.isAddOnMetrics);
|
|
3207
|
-
|
|
3227
|
+
Ve && (s = s.filter((e) => se(e, !0)));
|
|
3208
3228
|
let c = [], l = [];
|
|
3209
|
-
return s =
|
|
3229
|
+
return s = si(s, Di, n?.filters), s.forEach((e) => {
|
|
3210
3230
|
e.position === "top-right" ? l.push(e) : c.push(e);
|
|
3211
3231
|
}), {
|
|
3212
3232
|
metricFilters: [...a.filter((e) => !e.isAddOnMetrics), ...s],
|
|
@@ -3216,68 +3236,68 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3216
3236
|
}, [
|
|
3217
3237
|
V,
|
|
3218
3238
|
_,
|
|
3219
|
-
|
|
3239
|
+
Ve,
|
|
3220
3240
|
t?.isCreatedByClient,
|
|
3221
3241
|
t?.clientId,
|
|
3222
3242
|
e,
|
|
3223
3243
|
o,
|
|
3224
3244
|
i,
|
|
3225
3245
|
g,
|
|
3226
|
-
|
|
3227
|
-
|
|
3246
|
+
le,
|
|
3247
|
+
qe,
|
|
3228
3248
|
Di,
|
|
3229
3249
|
n?.filters
|
|
3230
3250
|
]), ji = [
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
].includes(
|
|
3251
|
+
N.pie,
|
|
3252
|
+
N.doughnut,
|
|
3253
|
+
N.rose,
|
|
3254
|
+
N.funnel,
|
|
3255
|
+
N.singleValue,
|
|
3256
|
+
N.table,
|
|
3257
|
+
N.pivot,
|
|
3258
|
+
N.horizontalStackTable,
|
|
3259
|
+
N.geoBarMap,
|
|
3260
|
+
N.geoMap,
|
|
3261
|
+
N.geoScatterMap,
|
|
3262
|
+
N.sankey,
|
|
3263
|
+
N.timeSeries,
|
|
3264
|
+
N.geoBarMap,
|
|
3265
|
+
N.geoMap,
|
|
3266
|
+
N.geoScatterMap,
|
|
3267
|
+
N.worldMap,
|
|
3268
|
+
N.boxplot,
|
|
3269
|
+
N.timeSeries,
|
|
3270
|
+
N.gantt
|
|
3271
|
+
].includes(q?.chartType) || (q?.isMultiDimension || q?.isDynamicSeries) && q?.seriesField !== "ungrouped", Mi = I((e) => {
|
|
3252
3272
|
let n = t?.dataSecuritySettings?.csvColumns || [];
|
|
3253
3273
|
return e?.length ? e?.map((e) => {
|
|
3254
3274
|
let t = {};
|
|
3255
3275
|
for (let r in e) n?.includes(r) || (t[r] = e[r]);
|
|
3256
3276
|
return t;
|
|
3257
3277
|
}) : [];
|
|
3258
|
-
}, [t?.dataSecuritySettings]), Ni =
|
|
3259
|
-
|
|
3260
|
-
|
|
3278
|
+
}, [t?.dataSecuritySettings]), Ni = R(() => Mi(Q), [Q, Mi]);
|
|
3279
|
+
L(() => {
|
|
3280
|
+
q || (J(t?.chartOptions), Rt({
|
|
3261
3281
|
limit: parseInt(t?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
|
|
3262
3282
|
offset: 0
|
|
3263
3283
|
}));
|
|
3264
|
-
}, [t?.chartOptions,
|
|
3265
|
-
|
|
3266
|
-
limit: parseInt(
|
|
3284
|
+
}, [t?.chartOptions, q]), L(() => {
|
|
3285
|
+
q?.tableSettings?.isServerSidePagination && q?.chartType === N.table && Rt({
|
|
3286
|
+
limit: parseInt(q?.tableSettings?.defaultRowSize || "100", 10),
|
|
3267
3287
|
offset: 0
|
|
3268
3288
|
});
|
|
3269
3289
|
}, [
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3290
|
+
q?.tableSettings?.isServerSidePagination,
|
|
3291
|
+
q?.chartType,
|
|
3292
|
+
q?.tableSettings?.defaultRowSize
|
|
3273
3293
|
]);
|
|
3274
|
-
let
|
|
3275
|
-
|
|
3276
|
-
if (
|
|
3277
|
-
let e =
|
|
3294
|
+
let Pi = z(n);
|
|
3295
|
+
Pi.current = n, L(() => {
|
|
3296
|
+
if (q?.chartType === N.timeSeries && q?.timeSeriesSettings?.groupBySettings?.isGlobalFilter && Mr) {
|
|
3297
|
+
let e = Pi.current?.filters?.find((e) => e.label === q?.timeSeriesSettings?.groupBySettings?.globalFilterOption?.value)?.value;
|
|
3278
3298
|
if ((typeof e == "string" || typeof e == "object" && e?.value) && e) {
|
|
3279
|
-
let t = typeof e == "string" ?
|
|
3280
|
-
|
|
3299
|
+
let t = typeof e == "string" ? de(e)?.toLowerCase() : q?.timeSeriesSettings?.groupBySettings?.formatWithValue?.find((t) => t.value === de(e?.value))?.format?.toLowerCase() || "";
|
|
3300
|
+
bt?.find((e) => e?.value?.toLowerCase() === t) && J((e) => ({
|
|
3281
3301
|
...e,
|
|
3282
3302
|
timeSeriesSettings: {
|
|
3283
3303
|
...e?.timeSeriesSettings,
|
|
@@ -3286,109 +3306,109 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3286
3306
|
value: t
|
|
3287
3307
|
}
|
|
3288
3308
|
},
|
|
3289
|
-
xAxis:
|
|
3309
|
+
xAxis: Y ? e.xAxis : `${t} of ${Mr}`
|
|
3290
3310
|
}));
|
|
3291
3311
|
}
|
|
3292
3312
|
}
|
|
3293
3313
|
}, [
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
]),
|
|
3300
|
-
|
|
3314
|
+
Sr,
|
|
3315
|
+
q?.chartType,
|
|
3316
|
+
q?.timeSeriesSettings?.groupBySettings?.isGlobalFilter,
|
|
3317
|
+
q?.timeSeriesSettings?.groupBySettings?.globalFilterOption,
|
|
3318
|
+
Mr
|
|
3319
|
+
]), L(() => {
|
|
3320
|
+
q?.isDynamicSeries && (q?.seriesOptions?.includes("ungrouped") ? q?.ungroupedAlias ? Dn(q?.seriesOptions?.map((e) => e === "ungrouped" ? {
|
|
3301
3321
|
value: e,
|
|
3302
|
-
label:
|
|
3322
|
+
label: q?.ungroupedAlias
|
|
3303
3323
|
} : {
|
|
3304
3324
|
value: e,
|
|
3305
3325
|
label: e
|
|
3306
|
-
})) :
|
|
3326
|
+
})) : Dn(q?.seriesOptions?.map((e) => ({
|
|
3307
3327
|
value: e,
|
|
3308
3328
|
label: e
|
|
3309
|
-
}))) :
|
|
3329
|
+
}))) : Dn([...q?.seriesOptions?.map((e) => ({
|
|
3310
3330
|
value: e,
|
|
3311
3331
|
label: e
|
|
3312
3332
|
})) ?? []]));
|
|
3313
3333
|
}, [
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3334
|
+
q?.seriesOptions,
|
|
3335
|
+
q?.isDynamicSeries,
|
|
3336
|
+
q?.ungroupedAlias
|
|
3317
3337
|
]);
|
|
3318
|
-
let [
|
|
3319
|
-
e.key === "Control" &&
|
|
3320
|
-
},
|
|
3321
|
-
e.key === "Control" &&
|
|
3338
|
+
let [Fi, Ii] = B(!1), Li = (e) => {
|
|
3339
|
+
e.key === "Control" && Ii(!0);
|
|
3340
|
+
}, Ri = (e) => {
|
|
3341
|
+
e.key === "Control" && Ii(!1);
|
|
3322
3342
|
};
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
}, [
|
|
3326
|
-
window.removeEventListener("keydown",
|
|
3343
|
+
L(() => {
|
|
3344
|
+
Q?.length && Qt(Object.keys(Q?.[0] || {}));
|
|
3345
|
+
}, [Q?.length]), L(() => (q?.customSettings?.chartZoom?.isZoomEnabled && (window.addEventListener("keydown", Li), window.addEventListener("keyup", Ri)), () => {
|
|
3346
|
+
window.removeEventListener("keydown", Li), window.removeEventListener("keyup", Ri);
|
|
3327
3347
|
}), []);
|
|
3328
|
-
let
|
|
3348
|
+
let zi = R(() => {
|
|
3329
3349
|
let e = !1;
|
|
3330
|
-
if (
|
|
3331
|
-
let t =
|
|
3332
|
-
e =
|
|
3350
|
+
if (Q?.length) {
|
|
3351
|
+
let t = q?.singleValue;
|
|
3352
|
+
e = Q[0][t] === null && q?.chartType === N.singleValue;
|
|
3333
3353
|
}
|
|
3334
3354
|
return e;
|
|
3335
3355
|
}, [
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
]),
|
|
3340
|
-
chartOptions:
|
|
3341
|
-
data:
|
|
3356
|
+
Q?.length,
|
|
3357
|
+
q?.singleValue,
|
|
3358
|
+
q?.chartType === N.singleValue
|
|
3359
|
+
]), Bi = R(() => rt({
|
|
3360
|
+
chartOptions: q,
|
|
3361
|
+
data: Q || []
|
|
3342
3362
|
}), [
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
]),
|
|
3354
|
-
text:
|
|
3355
|
-
selectedLanguage:
|
|
3356
|
-
translationDictionary:
|
|
3363
|
+
Q,
|
|
3364
|
+
q?.xAxis,
|
|
3365
|
+
q?.yAxisList,
|
|
3366
|
+
q?.dynamicXAxis?.isEnabled,
|
|
3367
|
+
q?.chartType,
|
|
3368
|
+
q?.seriesField,
|
|
3369
|
+
q?.customSettings?.cumulativeBar,
|
|
3370
|
+
q?.isGroupXAxis,
|
|
3371
|
+
q?.timeSeriesSettings?.seriesType[0],
|
|
3372
|
+
q?.timeSeriesSettings?.groupBySettings?.fillXAxis
|
|
3373
|
+
]), Vi = R(() => he({
|
|
3374
|
+
text: ve(t?.name || "", Sn) || "",
|
|
3375
|
+
selectedLanguage: be,
|
|
3376
|
+
translationDictionary: Se
|
|
3357
3377
|
}), [
|
|
3358
3378
|
t?.name,
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
]), qi =
|
|
3363
|
-
text:
|
|
3364
|
-
selectedLanguage:
|
|
3365
|
-
translationDictionary:
|
|
3379
|
+
Sn,
|
|
3380
|
+
Se,
|
|
3381
|
+
be
|
|
3382
|
+
]), qi = R(() => he({
|
|
3383
|
+
text: ve(t?.longDescription || "", Sn) || "",
|
|
3384
|
+
selectedLanguage: be,
|
|
3385
|
+
translationDictionary: Se
|
|
3366
3386
|
}), [
|
|
3367
3387
|
t?.longDescription,
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
]),
|
|
3372
|
-
text:
|
|
3373
|
-
selectedLanguage:
|
|
3374
|
-
translationDictionary:
|
|
3388
|
+
Sn,
|
|
3389
|
+
be,
|
|
3390
|
+
Se
|
|
3391
|
+
]), Ji = R(() => he({
|
|
3392
|
+
text: ve(t?.description || "", Sn) || "",
|
|
3393
|
+
selectedLanguage: be,
|
|
3394
|
+
translationDictionary: Se
|
|
3375
3395
|
}), [
|
|
3376
3396
|
t?.description,
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
]),
|
|
3381
|
-
text:
|
|
3382
|
-
selectedLanguage:
|
|
3383
|
-
translationDictionary:
|
|
3397
|
+
Sn,
|
|
3398
|
+
be,
|
|
3399
|
+
Se
|
|
3400
|
+
]), Yi = R(() => he({
|
|
3401
|
+
text: ve(t?.footNote || "", Sn) || "",
|
|
3402
|
+
selectedLanguage: be,
|
|
3403
|
+
translationDictionary: Se
|
|
3384
3404
|
}), [
|
|
3385
3405
|
t?.footNote,
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
]),
|
|
3406
|
+
Sn,
|
|
3407
|
+
be,
|
|
3408
|
+
Se
|
|
3409
|
+
]), Xi = R(() => `${Q?.[0]?.dbn_metric_expression_data || "No Data Found"}`, [Q]), Zi = R(() => t?.rlsConditions?.map((e) => {
|
|
3390
3410
|
if (e?.datatype === "date" && e?.options?.find((e) => e.range === "Custom Date") && e?.isEnableDynamicDate && e?.dynamicDate?.value) {
|
|
3391
|
-
let t =
|
|
3411
|
+
let t = A($e?.find((t) => t.value === e?.dynamicDate?.value)?.count || 0), n = Ge(t), r = Ge(t);
|
|
3392
3412
|
return {
|
|
3393
3413
|
...e,
|
|
3394
3414
|
options: e?.options?.map((e) => e.range === "Custom Date" ? {
|
|
@@ -3401,9 +3421,9 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3401
3421
|
}
|
|
3402
3422
|
return e;
|
|
3403
3423
|
}), [t?.rlsConditions]);
|
|
3404
|
-
|
|
3405
|
-
if (
|
|
3406
|
-
if (
|
|
3424
|
+
Ct(() => {
|
|
3425
|
+
if (Qn && O?.((e) => {
|
|
3426
|
+
if (ui(e?.get(t?.id), qn)) return e;
|
|
3407
3427
|
let n = new Map(e);
|
|
3408
3428
|
return n.set(t?.id, {
|
|
3409
3429
|
data: {
|
|
@@ -3411,18 +3431,18 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3411
3431
|
name: "",
|
|
3412
3432
|
description: ""
|
|
3413
3433
|
},
|
|
3414
|
-
isLoading:
|
|
3415
|
-
key:
|
|
3434
|
+
isLoading: Qn,
|
|
3435
|
+
key: qn
|
|
3416
3436
|
}), n;
|
|
3417
|
-
}),
|
|
3418
|
-
let e =
|
|
3419
|
-
|
|
3420
|
-
if (
|
|
3437
|
+
}), Z?.data && E) {
|
|
3438
|
+
let e = pa(t?.id, k) ? Z?.data : void 0;
|
|
3439
|
+
O?.((n) => {
|
|
3440
|
+
if (hi(n?.get(t?.id), {
|
|
3421
3441
|
data: e,
|
|
3422
3442
|
name: t?.name || "",
|
|
3423
3443
|
description: t?.description || "",
|
|
3424
|
-
isLoading:
|
|
3425
|
-
key:
|
|
3444
|
+
isLoading: Qn,
|
|
3445
|
+
key: qn
|
|
3426
3446
|
})) return n;
|
|
3427
3447
|
let r = new Map(n);
|
|
3428
3448
|
return r.set(t?.id, {
|
|
@@ -3431,16 +3451,16 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3431
3451
|
name: t?.name || "",
|
|
3432
3452
|
description: t?.description || ""
|
|
3433
3453
|
},
|
|
3434
|
-
isLoading:
|
|
3435
|
-
key:
|
|
3454
|
+
isLoading: Qn,
|
|
3455
|
+
key: qn
|
|
3436
3456
|
}), r;
|
|
3437
3457
|
});
|
|
3438
3458
|
}
|
|
3439
|
-
if (
|
|
3440
|
-
let e =
|
|
3441
|
-
|
|
3459
|
+
if (!Qn && ur) {
|
|
3460
|
+
let e = gi(t);
|
|
3461
|
+
O?.((n) => {
|
|
3442
3462
|
let r = n?.get(t?.id);
|
|
3443
|
-
if (r && !r.isLoading && !!r.error === e && r.key ===
|
|
3463
|
+
if (r && !r.isLoading && !!r.error === e && r.key === qn) return n;
|
|
3444
3464
|
let i = new Map(n);
|
|
3445
3465
|
return i.set(t?.id, {
|
|
3446
3466
|
data: r?.data ?? {
|
|
@@ -3449,45 +3469,45 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3449
3469
|
description: ""
|
|
3450
3470
|
},
|
|
3451
3471
|
isLoading: !1,
|
|
3452
|
-
key:
|
|
3472
|
+
key: qn,
|
|
3453
3473
|
...e ? { error: "failed" } : {}
|
|
3454
3474
|
}), i;
|
|
3455
3475
|
});
|
|
3456
3476
|
}
|
|
3457
3477
|
}, [
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
]),
|
|
3478
|
+
Z?.data,
|
|
3479
|
+
Qn,
|
|
3480
|
+
qn,
|
|
3481
|
+
ur
|
|
3482
|
+
]), Gi({
|
|
3463
3483
|
metric: t,
|
|
3464
|
-
metricStore:
|
|
3465
|
-
setMetricStore:
|
|
3484
|
+
metricStore: E,
|
|
3485
|
+
setMetricStore: O
|
|
3466
3486
|
});
|
|
3467
|
-
let
|
|
3487
|
+
let Qi = Ki({
|
|
3468
3488
|
metric: t,
|
|
3469
|
-
metricStore:
|
|
3489
|
+
metricStore: E
|
|
3470
3490
|
});
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
}, [
|
|
3474
|
-
let
|
|
3475
|
-
|
|
3491
|
+
Ct(() => {
|
|
3492
|
+
Ft.current !== Jn && (Ft.current = Jn, At());
|
|
3493
|
+
}, [Jn, At]);
|
|
3494
|
+
let $i = () => !!t?.elementSettings?.summary?.metricList?.some((e) => E?.get(e.value)?.isLoading === !0);
|
|
3495
|
+
Ct(() => {
|
|
3476
3496
|
let e = t?.elementSettings?.summary;
|
|
3477
|
-
if (!e?.metricList?.length || !
|
|
3478
|
-
let n = e.metricList.map((e) =>
|
|
3497
|
+
if (!e?.metricList?.length || !E?.get(t?.id)) return;
|
|
3498
|
+
let n = e.metricList.map((e) => E.get(e.value));
|
|
3479
3499
|
if (n.some((e) => e?.isLoading)) return;
|
|
3480
3500
|
let r = JSON.stringify({
|
|
3481
3501
|
keys: n.map((e) => [e?.key, !!e?.data?.data?.length]),
|
|
3482
3502
|
prompt: e.summaryPrompt,
|
|
3483
3503
|
id: t?.id,
|
|
3484
|
-
identity:
|
|
3504
|
+
identity: Jn
|
|
3485
3505
|
}), a = n.map((e) => ({
|
|
3486
3506
|
data: e?.data?.data || [],
|
|
3487
3507
|
metricName: e?.data?.name,
|
|
3488
3508
|
metricDescription: e?.data?.description
|
|
3489
3509
|
})), o = a.every((e) => e.data.length > 0);
|
|
3490
|
-
|
|
3510
|
+
Et(r, o ? (r) => xt.mutateAsync({
|
|
3491
3511
|
signal: r,
|
|
3492
3512
|
data: {
|
|
3493
3513
|
metricData: a,
|
|
@@ -3496,7 +3516,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3496
3516
|
filters: n.map((e) => e?.key).join("###"),
|
|
3497
3517
|
name: t?.name,
|
|
3498
3518
|
description: t?.description,
|
|
3499
|
-
workspaceId:
|
|
3519
|
+
workspaceId: T
|
|
3500
3520
|
},
|
|
3501
3521
|
token: v || "",
|
|
3502
3522
|
clientId: _ ? y || "" : i,
|
|
@@ -3507,32 +3527,32 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3507
3527
|
t?.id,
|
|
3508
3528
|
t?.name,
|
|
3509
3529
|
t?.description,
|
|
3510
|
-
D,
|
|
3511
|
-
ca,
|
|
3512
|
-
Yn,
|
|
3513
|
-
kt,
|
|
3514
|
-
St,
|
|
3515
3530
|
E,
|
|
3531
|
+
Qi,
|
|
3532
|
+
Jn,
|
|
3533
|
+
Et,
|
|
3534
|
+
xt,
|
|
3535
|
+
T,
|
|
3516
3536
|
v,
|
|
3517
3537
|
_,
|
|
3518
3538
|
y,
|
|
3519
3539
|
i
|
|
3520
|
-
]),
|
|
3521
|
-
let e =
|
|
3522
|
-
if (
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
].includes(
|
|
3527
|
-
let e =
|
|
3528
|
-
|
|
3540
|
+
]), L(() => {
|
|
3541
|
+
let e = ht(q?.customSettings?.comboAxisSettings || []), t = e?.flatMap((e) => e?.measures), n = q?.yAxisList?.every((e) => t?.includes(e));
|
|
3542
|
+
if (q?.yAxisList?.length && q?.yAxisList?.length !== t?.length && !t?.length && [
|
|
3543
|
+
N.combo,
|
|
3544
|
+
N.timeSeries,
|
|
3545
|
+
N.horizontalCombo
|
|
3546
|
+
].includes(q?.chartType || "")) {
|
|
3547
|
+
let e = q?.yAxisList?.filter((e) => !q?.comboBarList?.includes(e))?.filter((e) => !t?.includes(e)), n = q?.customSettings?.comboStackAxisSymbols?.name || "", r = q?.customSettings?.comboLabelFormatter?.find((e) => e.axis === (n || "stack"))?.formatter, i = q?.comboBarList?.join(" and "), a = q?.customSettings?.comboLabelFormatter?.find((e) => e.axis === i)?.formatter;
|
|
3548
|
+
J((t) => ({
|
|
3529
3549
|
...t,
|
|
3530
3550
|
customSettings: {
|
|
3531
3551
|
...t.customSettings,
|
|
3532
|
-
comboAxisSettings:
|
|
3552
|
+
comboAxisSettings: ht([
|
|
3533
3553
|
...t.customSettings?.comboAxisSettings || [],
|
|
3534
3554
|
...e?.map((e) => {
|
|
3535
|
-
let t =
|
|
3555
|
+
let t = q?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = q?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
|
|
3536
3556
|
return {
|
|
3537
3557
|
axis: e,
|
|
3538
3558
|
measures: [e],
|
|
@@ -3540,36 +3560,36 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3540
3560
|
axis: e,
|
|
3541
3561
|
type: "line"
|
|
3542
3562
|
}],
|
|
3543
|
-
numberFormatter:
|
|
3563
|
+
numberFormatter: q?.customSettings?.numberFormatter,
|
|
3544
3564
|
labelFormatter: t,
|
|
3545
3565
|
prefix: n?.prefix || "",
|
|
3546
3566
|
suffix: n?.suffix || "",
|
|
3547
3567
|
isEnableLabelFormatter: !!t?.length
|
|
3548
3568
|
};
|
|
3549
3569
|
}),
|
|
3550
|
-
...
|
|
3551
|
-
axis:
|
|
3552
|
-
measures:
|
|
3553
|
-
chartTypes:
|
|
3570
|
+
...q?.comboBarList?.length && (q?.customSettings?.isCombineBarAxis || q?.customSettings?.isStackBar) ? [{
|
|
3571
|
+
axis: q?.customSettings?.isStackBar && n || i,
|
|
3572
|
+
measures: q?.comboBarList,
|
|
3573
|
+
chartTypes: q?.comboBarList?.map((e) => ({
|
|
3554
3574
|
axis: e,
|
|
3555
3575
|
type: "bar"
|
|
3556
3576
|
})),
|
|
3557
|
-
isEnableStackBar:
|
|
3558
|
-
numberFormatter:
|
|
3559
|
-
...
|
|
3560
|
-
prefix:
|
|
3561
|
-
suffix:
|
|
3577
|
+
isEnableStackBar: q?.customSettings?.isStackBar,
|
|
3578
|
+
numberFormatter: q?.customSettings?.numberFormatter,
|
|
3579
|
+
...q?.customSettings?.isStackBar ? {
|
|
3580
|
+
prefix: q?.customSettings?.comboStackAxisSymbols?.prefix || "",
|
|
3581
|
+
suffix: q?.customSettings?.comboStackAxisSymbols?.suffix || "",
|
|
3562
3582
|
labelFormatter: r,
|
|
3563
3583
|
isEnableLabelFormatter: !!r?.length
|
|
3564
3584
|
} : {
|
|
3565
|
-
prefix:
|
|
3566
|
-
suffix:
|
|
3585
|
+
prefix: q?.customSettings?.combinedAxisPrefix || "",
|
|
3586
|
+
suffix: q?.customSettings?.combinedAxisSuffix || "",
|
|
3567
3587
|
labelFormatter: a,
|
|
3568
3588
|
isEnableLabelFormatter: !!a?.length
|
|
3569
3589
|
}
|
|
3570
3590
|
}] : [],
|
|
3571
|
-
...
|
|
3572
|
-
let t =
|
|
3591
|
+
...q?.comboBarList?.length && !q?.customSettings?.isCombineBarAxis && !q?.customSettings?.isStackBar ? q?.comboBarList?.map((e) => {
|
|
3592
|
+
let t = q?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = q?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
|
|
3573
3593
|
return {
|
|
3574
3594
|
axis: e,
|
|
3575
3595
|
measures: [e],
|
|
@@ -3577,7 +3597,7 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3577
3597
|
axis: e,
|
|
3578
3598
|
type: "bar"
|
|
3579
3599
|
}],
|
|
3580
|
-
numberFormatter:
|
|
3600
|
+
numberFormatter: q?.customSettings?.numberFormatter,
|
|
3581
3601
|
labelFormatter: t,
|
|
3582
3602
|
prefix: n?.prefix || "",
|
|
3583
3603
|
suffix: n?.suffix || "",
|
|
@@ -3596,29 +3616,29 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3596
3616
|
comboBarList: []
|
|
3597
3617
|
}));
|
|
3598
3618
|
}
|
|
3599
|
-
if (t?.length &&
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
].includes(
|
|
3604
|
-
let e =
|
|
3605
|
-
(t?.filter((e) => !
|
|
3606
|
-
let t =
|
|
3607
|
-
|
|
3619
|
+
if (t?.length && q?.yAxisList?.length && (q?.yAxisList?.length !== t?.length || q?.yAxisList?.length === t?.length && !n) && [
|
|
3620
|
+
N.combo,
|
|
3621
|
+
N.timeSeries,
|
|
3622
|
+
N.horizontalCombo
|
|
3623
|
+
].includes(q?.chartType || "")) {
|
|
3624
|
+
let e = q?.yAxisList?.filter((e) => !t?.includes(e));
|
|
3625
|
+
(t?.filter((e) => !q?.yAxisList?.includes(e)))?.forEach((e) => {
|
|
3626
|
+
let t = q?.customSettings?.comboAxisSettings?.find((t) => t.measures?.includes(e)), n = t?.axis, r = (t?.measures?.length || 0) > 1;
|
|
3627
|
+
J((t) => ({
|
|
3608
3628
|
...t,
|
|
3609
3629
|
customSettings: {
|
|
3610
3630
|
...t.customSettings,
|
|
3611
|
-
comboAxisSettings:
|
|
3631
|
+
comboAxisSettings: ht(r ? t.customSettings?.comboAxisSettings?.map((t) => t.axis === n ? {
|
|
3612
3632
|
...t,
|
|
3613
3633
|
measures: t?.measures?.filter((t) => t !== e)
|
|
3614
3634
|
} : t)?.filter((e) => e?.measures?.length) || [] : t.customSettings?.comboAxisSettings?.filter((e) => e.axis !== n && e?.measures?.length) || [])
|
|
3615
3635
|
}
|
|
3616
3636
|
}));
|
|
3617
|
-
}), e?.length &&
|
|
3637
|
+
}), e?.length && J((t) => ({
|
|
3618
3638
|
...t,
|
|
3619
3639
|
customSettings: {
|
|
3620
3640
|
...t.customSettings,
|
|
3621
|
-
comboAxisSettings:
|
|
3641
|
+
comboAxisSettings: ht([...t.customSettings?.comboAxisSettings || [], ...e?.map((e) => ({
|
|
3622
3642
|
axis: e,
|
|
3623
3643
|
measures: [e],
|
|
3624
3644
|
chartTypes: [{
|
|
@@ -3629,11 +3649,11 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3629
3649
|
}
|
|
3630
3650
|
}));
|
|
3631
3651
|
}
|
|
3632
|
-
t?.length &&
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
].includes(
|
|
3652
|
+
t?.length && q?.yAxisList?.length && q?.yAxisList?.length === t?.length && n && [
|
|
3653
|
+
N.combo,
|
|
3654
|
+
N.timeSeries,
|
|
3655
|
+
N.horizontalCombo
|
|
3656
|
+
].includes(q?.chartType || "") && q?.customSettings?.comboAxisSettings?.length !== e?.length && J((t) => ({
|
|
3637
3657
|
...t,
|
|
3638
3658
|
customSettings: {
|
|
3639
3659
|
...t?.customSettings,
|
|
@@ -3641,32 +3661,32 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3641
3661
|
}
|
|
3642
3662
|
}));
|
|
3643
3663
|
}, [
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
]),
|
|
3659
|
-
|
|
3664
|
+
q?.yAxisList,
|
|
3665
|
+
q?.customSettings?.comboAxisSettings,
|
|
3666
|
+
q?.comboBarList,
|
|
3667
|
+
q?.customSettings?.isCombineBarAxis,
|
|
3668
|
+
q?.customSettings?.isStackBar,
|
|
3669
|
+
q?.customSettings?.comboStackAxisSymbols?.name,
|
|
3670
|
+
q?.customSettings?.comboStackAxisSymbols?.prefix,
|
|
3671
|
+
q?.customSettings?.comboStackAxisSymbols?.suffix,
|
|
3672
|
+
q?.customSettings?.comboLabelFormatter,
|
|
3673
|
+
q?.customSettings?.comboAxisSymbols,
|
|
3674
|
+
q?.customSettings?.numberFormatter,
|
|
3675
|
+
q?.customSettings?.combinedAxisPrefix,
|
|
3676
|
+
q?.customSettings?.combinedAxisSuffix,
|
|
3677
|
+
q?.chartType
|
|
3678
|
+
]), L(() => {
|
|
3679
|
+
q?.yAxisList?.length && q?.yAxisList?.length < 5 && q?.chartType === N.boxplot && J((e) => ({
|
|
3660
3680
|
...e,
|
|
3661
|
-
chartType:
|
|
3662
|
-
})), !
|
|
3681
|
+
chartType: N.line
|
|
3682
|
+
})), !q?.yAxisList?.length && q?.chartType === N.funnelV2 && J((e) => ({
|
|
3663
3683
|
...e,
|
|
3664
|
-
chartType:
|
|
3684
|
+
chartType: N.singleValue
|
|
3665
3685
|
}));
|
|
3666
|
-
}, [
|
|
3667
|
-
let
|
|
3686
|
+
}, [q?.chartType, q?.yAxisList?.length]);
|
|
3687
|
+
let ea = ({ columnAlias: e, value: n, isClear: r = !1 }) => {
|
|
3668
3688
|
let i = t?.datasetMetricSettings;
|
|
3669
|
-
i &&
|
|
3689
|
+
i && Ze({
|
|
3670
3690
|
columnAlias: e,
|
|
3671
3691
|
datasetSettings: i,
|
|
3672
3692
|
setTableColumnFilters: Gt,
|
|
@@ -3674,10 +3694,10 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3674
3694
|
isClear: r
|
|
3675
3695
|
});
|
|
3676
3696
|
};
|
|
3677
|
-
|
|
3678
|
-
if (!
|
|
3679
|
-
let e =
|
|
3680
|
-
|
|
3697
|
+
L(() => {
|
|
3698
|
+
if (!q?.dynamicYAxis?.isEnabled || !q?.dynamicYAxis?.selectedOption || Array.isArray(q?.dynamicYAxis?.selectedOption)) return;
|
|
3699
|
+
let e = q?.dynamicYAxis?.selectedOption;
|
|
3700
|
+
J((t) => ({
|
|
3681
3701
|
...t,
|
|
3682
3702
|
dynamicYAxis: {
|
|
3683
3703
|
...t?.dynamicYAxis,
|
|
@@ -3685,14 +3705,14 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3685
3705
|
},
|
|
3686
3706
|
yAxisList: [e?.value]
|
|
3687
3707
|
}));
|
|
3688
|
-
}, [
|
|
3689
|
-
let e =
|
|
3690
|
-
if (!
|
|
3691
|
-
|
|
3708
|
+
}, [q?.dynamicYAxis?.selectedOption, q?.dynamicYAxis?.isEnabled]), L(() => {
|
|
3709
|
+
let e = F?.yAxisSettings?.find((e) => e?.yAxisSettings?.isEnable && e?.id === t?.id && e?.yAxisSettings?.yAxis && Array.isArray(e?.yAxisSettings?.yAxis) && e?.yAxisSettings?.yAxis?.length > 0), n = F?.xAxisSettings?.find((e) => e?.xAxisSettings?.isEnable && e?.id === t?.id && e?.xAxisSettings?.xaxis), r = W?.configV2?.levels?.length ? W : t?.drillDownSettings, i = ua(t?.chartOptions, r), a = i !== t?.chartOptions;
|
|
3710
|
+
if (!q?.dynamicYAxis?.isEnabled && !q?.dynamicXAxis?.isEnabled && !a || !e && !n && !a) {
|
|
3711
|
+
J((e) => t?.chartOptions || e);
|
|
3692
3712
|
return;
|
|
3693
3713
|
}
|
|
3694
3714
|
let o = e?.yAxisSettings?.yAxis?.[0];
|
|
3695
|
-
|
|
3715
|
+
J((e) => {
|
|
3696
3716
|
let t = a ? {
|
|
3697
3717
|
...e,
|
|
3698
3718
|
...i
|
|
@@ -3715,18 +3735,18 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3715
3735
|
};
|
|
3716
3736
|
});
|
|
3717
3737
|
}, [
|
|
3718
|
-
|
|
3738
|
+
F?.yAxisSettings,
|
|
3719
3739
|
t?.id,
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3740
|
+
F?.xAxisSettings,
|
|
3741
|
+
q?.dynamicYAxis?.isEnabled,
|
|
3742
|
+
q?.dynamicXAxis?.isEnabled,
|
|
3723
3743
|
W,
|
|
3724
3744
|
W?.configV2?.isEnable,
|
|
3725
3745
|
W?.configV2?.levels,
|
|
3726
3746
|
t?.chartOptions,
|
|
3727
3747
|
t?.drillDownSettings
|
|
3728
|
-
]),
|
|
3729
|
-
|
|
3748
|
+
]), L(() => {
|
|
3749
|
+
q?.customSettings?.isShowDuration && q?.chartType === N.gantt && !q?.customSettings?.ganttTooltipKeys?.includes("Duration") && J((e) => ({
|
|
3730
3750
|
...e,
|
|
3731
3751
|
customSettings: {
|
|
3732
3752
|
...e?.customSettings,
|
|
@@ -3734,59 +3754,59 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3734
3754
|
}
|
|
3735
3755
|
}));
|
|
3736
3756
|
}, [
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3757
|
+
q?.customSettings?.isShowDuration,
|
|
3758
|
+
q?.chartType,
|
|
3759
|
+
q?.customSettings?.ganttTooltipKeys
|
|
3740
3760
|
]);
|
|
3741
|
-
let
|
|
3761
|
+
let ta = R(() => t?.datasetMetricSettings?.selectedDimensions?.map((e) => Fe(e || "none")) || la, [t?.datasetMetricSettings?.selectedDimensions]);
|
|
3742
3762
|
return {
|
|
3743
|
-
drillBlockedNotice:
|
|
3744
|
-
filterNotAppliedNotice:
|
|
3745
|
-
dismissDrillBlockedNotice: () =>
|
|
3746
|
-
elementSummary:
|
|
3747
|
-
elementSummaryError:
|
|
3748
|
-
elementSummaryEmpty:
|
|
3749
|
-
isLoadingSummary:
|
|
3750
|
-
stopSummary:
|
|
3751
|
-
isMetricListLoading:
|
|
3752
|
-
onDrillLevelClick:
|
|
3753
|
-
onDrillDown:
|
|
3754
|
-
onFilterDashboardTo:
|
|
3755
|
-
onFilterMetricTo:
|
|
3756
|
-
handleChartClick:
|
|
3757
|
-
dataDb:
|
|
3758
|
-
truncation:
|
|
3759
|
-
truncationNotice:
|
|
3760
|
-
getUnderlyingData:
|
|
3761
|
-
onChangeFilterValue:
|
|
3763
|
+
drillBlockedNotice: St,
|
|
3764
|
+
filterNotAppliedNotice: ir,
|
|
3765
|
+
dismissDrillBlockedNotice: () => wt(null),
|
|
3766
|
+
elementSummary: jt,
|
|
3767
|
+
elementSummaryError: Mt,
|
|
3768
|
+
elementSummaryEmpty: Nt,
|
|
3769
|
+
isLoadingSummary: Pt,
|
|
3770
|
+
stopSummary: kt,
|
|
3771
|
+
isMetricListLoading: $i,
|
|
3772
|
+
onDrillLevelClick: ci,
|
|
3773
|
+
onDrillDown: ti,
|
|
3774
|
+
onFilterDashboardTo: Zr,
|
|
3775
|
+
onFilterMetricTo: $r,
|
|
3776
|
+
handleChartClick: zr,
|
|
3777
|
+
dataDb: Q,
|
|
3778
|
+
truncation: sr,
|
|
3779
|
+
truncationNotice: cr,
|
|
3780
|
+
getUnderlyingData: Jr,
|
|
3781
|
+
onChangeFilterValue: Lr,
|
|
3762
3782
|
isShowChartPopup: Kt,
|
|
3763
3783
|
setShowChartPopup: qt,
|
|
3764
|
-
columnName:
|
|
3765
|
-
underlyingDataPoint:
|
|
3784
|
+
columnName: Vr,
|
|
3785
|
+
underlyingDataPoint: Hr,
|
|
3766
3786
|
chartParams: H,
|
|
3767
|
-
isQueryLoading: !
|
|
3768
|
-
isMetricUpdating:
|
|
3769
|
-
isSingleValueNull:
|
|
3770
|
-
dynamicOptions:
|
|
3771
|
-
chartSettings:
|
|
3772
|
-
setChartSettings:
|
|
3773
|
-
isEnableZoom:
|
|
3774
|
-
filterValues:
|
|
3775
|
-
containerRef:
|
|
3787
|
+
isQueryLoading: !Hn && (Qn || pt || tr || Ee && (!Q?.length || zi)),
|
|
3788
|
+
isMetricUpdating: nr,
|
|
3789
|
+
isSingleValueNull: zi,
|
|
3790
|
+
dynamicOptions: En,
|
|
3791
|
+
chartSettings: q,
|
|
3792
|
+
setChartSettings: J,
|
|
3793
|
+
isEnableZoom: Fi,
|
|
3794
|
+
filterValues: Fn,
|
|
3795
|
+
containerRef: It,
|
|
3776
3796
|
drilledLevel: U.length,
|
|
3777
|
-
dimensions:
|
|
3797
|
+
dimensions: ta,
|
|
3778
3798
|
rlsConditions: V,
|
|
3779
3799
|
setRlsConditions: Ut,
|
|
3780
|
-
setTableLimit:
|
|
3781
|
-
isEnableNextBtn:
|
|
3782
|
-
isEnablePrevBtn:
|
|
3800
|
+
setTableLimit: Rt,
|
|
3801
|
+
isEnableNextBtn: zt > Lt?.limit + Lt?.offset,
|
|
3802
|
+
isEnablePrevBtn: Lt?.offset !== 0,
|
|
3783
3803
|
paginationInfo: {
|
|
3784
|
-
limit:
|
|
3785
|
-
offset:
|
|
3786
|
-
totalRecords:
|
|
3804
|
+
limit: Lt?.limit,
|
|
3805
|
+
offset: Lt?.offset,
|
|
3806
|
+
totalRecords: zt
|
|
3787
3807
|
},
|
|
3788
3808
|
onChangePage: (e, t, n) => {
|
|
3789
|
-
|
|
3809
|
+
Rt(t ? {
|
|
3790
3810
|
limit: t,
|
|
3791
3811
|
offset: 0
|
|
3792
3812
|
} : (t) => {
|
|
@@ -3797,9 +3817,9 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3797
3817
|
};
|
|
3798
3818
|
});
|
|
3799
3819
|
},
|
|
3800
|
-
isExternalChart:
|
|
3801
|
-
isEnablePivotTable:
|
|
3802
|
-
groupByList:
|
|
3820
|
+
isExternalChart: q?.tableSettings?.isServerSidePagination && q?.chartType === N.table,
|
|
3821
|
+
isEnablePivotTable: hn,
|
|
3822
|
+
groupByList: pn,
|
|
3803
3823
|
hasNumberKeys: !0,
|
|
3804
3824
|
isEnableGauge: !0,
|
|
3805
3825
|
updateFilter: (e) => {
|
|
@@ -3812,113 +3832,113 @@ var Hr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ur = (e) => ty
|
|
|
3812
3832
|
leftPositionedMetricFilters: ki,
|
|
3813
3833
|
rightPositionedMetricFilters: Ai,
|
|
3814
3834
|
drillFilters: U,
|
|
3815
|
-
underlyingDataColumnMetadata:
|
|
3816
|
-
underlyingDataDrillFilters:
|
|
3835
|
+
underlyingDataColumnMetadata: qr,
|
|
3836
|
+
underlyingDataDrillFilters: Kr,
|
|
3817
3837
|
drillType: W?.drillType,
|
|
3818
3838
|
tableResultsDownloadData: Ni,
|
|
3819
3839
|
filterCsvColumns: Mi,
|
|
3820
|
-
appliedMetricFilters:
|
|
3840
|
+
appliedMetricFilters: K,
|
|
3821
3841
|
pivotHeaderOptions: Ti,
|
|
3822
|
-
pivotDrillState:
|
|
3823
|
-
onDrillPivotTable:
|
|
3824
|
-
legendData:
|
|
3825
|
-
timeseriesDimension:
|
|
3826
|
-
isPythonMode:
|
|
3842
|
+
pivotDrillState: kn,
|
|
3843
|
+
onDrillPivotTable: ai,
|
|
3844
|
+
legendData: Bi,
|
|
3845
|
+
timeseriesDimension: Mr,
|
|
3846
|
+
isPythonMode: Y,
|
|
3827
3847
|
sortOrder: Yt,
|
|
3828
3848
|
setSortOrder: Xt,
|
|
3829
3849
|
isNotFirstRender: tn,
|
|
3830
3850
|
setNotFirstRender: nn,
|
|
3831
|
-
isSorted:
|
|
3851
|
+
isSorted: wn,
|
|
3832
3852
|
isInavlidForSort: ji,
|
|
3833
|
-
onAddComparison:
|
|
3834
|
-
groupedRlsConditions:
|
|
3835
|
-
onGenerateMetricSummary:
|
|
3853
|
+
onAddComparison: vi,
|
|
3854
|
+
groupedRlsConditions: Si,
|
|
3855
|
+
onGenerateMetricSummary: yi,
|
|
3836
3856
|
summary: $t,
|
|
3837
3857
|
setSummary: en,
|
|
3838
|
-
dataMartRelationships:
|
|
3839
|
-
onChartChange:
|
|
3840
|
-
isCompareValue:
|
|
3841
|
-
isShowChartPropertyPanel:
|
|
3842
|
-
setShowChartPropertyPanel:
|
|
3858
|
+
dataMartRelationships: Pn,
|
|
3859
|
+
onChartChange: xi,
|
|
3860
|
+
isCompareValue: Fr,
|
|
3861
|
+
isShowChartPropertyPanel: _n,
|
|
3862
|
+
setShowChartPropertyPanel: vn,
|
|
3843
3863
|
columnList: Zt,
|
|
3844
|
-
variables:
|
|
3845
|
-
metricName:
|
|
3864
|
+
variables: Sn,
|
|
3865
|
+
metricName: Vi,
|
|
3846
3866
|
longDescription: qi,
|
|
3847
|
-
footNote:
|
|
3848
|
-
description:
|
|
3867
|
+
footNote: Yi,
|
|
3868
|
+
description: Ji,
|
|
3849
3869
|
drilldownCols: rn,
|
|
3850
3870
|
switchMeasureOptions: Ei,
|
|
3851
|
-
metricExpressionResult:
|
|
3871
|
+
metricExpressionResult: Xi,
|
|
3852
3872
|
dateFilter: wi,
|
|
3853
3873
|
drillDownSettings: W,
|
|
3854
|
-
onDrillIntoDimension:
|
|
3855
|
-
adhocDrillDims:
|
|
3856
|
-
enabledCharts:
|
|
3874
|
+
onDrillIntoDimension: ri,
|
|
3875
|
+
adhocDrillDims: ln,
|
|
3876
|
+
enabledCharts: bi,
|
|
3857
3877
|
tableColumnFilters: Wt,
|
|
3858
|
-
onChangePaginationColumnFilters:
|
|
3859
|
-
queryError:
|
|
3860
|
-
queryPermissionDenied:
|
|
3861
|
-
refetchMetricData:
|
|
3862
|
-
customSwitchXAxis:
|
|
3863
|
-
savedMetricFilters:
|
|
3878
|
+
onChangePaginationColumnFilters: ea,
|
|
3879
|
+
queryError: ur,
|
|
3880
|
+
queryPermissionDenied: !!$n?.isBatchAuth,
|
|
3881
|
+
refetchMetricData: er,
|
|
3882
|
+
customSwitchXAxis: In,
|
|
3883
|
+
savedMetricFilters: Zi || ca
|
|
3864
3884
|
};
|
|
3865
3885
|
};
|
|
3866
|
-
function
|
|
3886
|
+
function pa(e, t) {
|
|
3867
3887
|
return t === void 0 || t.has(e);
|
|
3868
3888
|
}
|
|
3869
|
-
var
|
|
3889
|
+
var ma = {
|
|
3870
3890
|
notice: "_notice_vwpz7_1",
|
|
3871
3891
|
icon: "_icon_vwpz7_15"
|
|
3872
|
-
},
|
|
3873
|
-
className:
|
|
3892
|
+
}, ha = ({ text: e }) => e ? /* @__PURE__ */ Et("div", {
|
|
3893
|
+
className: ma.notice,
|
|
3874
3894
|
role: "status",
|
|
3875
3895
|
"data-testid": "custom-sql-filter-notice",
|
|
3876
|
-
children: [/* @__PURE__ */ Tt(
|
|
3877
|
-
className:
|
|
3896
|
+
children: [/* @__PURE__ */ Tt(lt, {
|
|
3897
|
+
className: ma.icon,
|
|
3878
3898
|
"aria-hidden": "true"
|
|
3879
3899
|
}), /* @__PURE__ */ Tt("span", { children: e })]
|
|
3880
|
-
}) : null,
|
|
3900
|
+
}) : null, ga = (e) => {
|
|
3881
3901
|
let t = e.value ?? e.selectedVariableValue?.value;
|
|
3882
3902
|
return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim().length > 0 : t != null;
|
|
3883
|
-
},
|
|
3903
|
+
}, _a = (e) => {
|
|
3884
3904
|
let t = e.label ?? e.name ?? e.column;
|
|
3885
3905
|
return typeof t == "string" && t.trim() ? t.trim() : "Filter";
|
|
3886
|
-
},
|
|
3906
|
+
}, va = ({ isCustomSqlMetric: e, query: t, metricId: n, filters: r }) => {
|
|
3887
3907
|
if (!e) return [];
|
|
3888
|
-
let i =
|
|
3908
|
+
let i = Ve(t || "");
|
|
3889
3909
|
return (r || []).flatMap((e) => {
|
|
3890
3910
|
let t = e.restrictedMetrics?.some((e) => e.value === n);
|
|
3891
|
-
if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !
|
|
3911
|
+
if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !ga(e)) return [];
|
|
3892
3912
|
let r = (e.variableStrings || []).filter(Boolean), a = r.filter((e) => !i.includes(e));
|
|
3893
3913
|
return r.length > 0 && a.length === 0 ? [] : [{
|
|
3894
|
-
label:
|
|
3914
|
+
label: _a(e),
|
|
3895
3915
|
missingVariables: a
|
|
3896
3916
|
}];
|
|
3897
3917
|
});
|
|
3898
|
-
},
|
|
3899
|
-
let t =
|
|
3918
|
+
}, ya = (e) => e.length === 1 ? e[0] : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e.at(-1)}`, ba = (e) => {
|
|
3919
|
+
let t = va(e);
|
|
3900
3920
|
if (!t.length) return null;
|
|
3901
3921
|
let n = [...new Set(t.flatMap((e) => e.missingVariables))], r = t.length === 1 ? `${t[0].label} is not applied to this custom SQL metric.` : `${t.length} filters are not applied to this custom SQL metric.`;
|
|
3902
|
-
return n.length ? `${r} Add ${
|
|
3903
|
-
},
|
|
3922
|
+
return n.length ? `${r} Add ${ya(n)} to the metric SQL.` : `${r} Configure matching filter variables in the metric SQL.`;
|
|
3923
|
+
}, xa = ({ chart: e, valueColumn: t, isDrillEnabled: n, drilledLevel: r, dimensionCount: i, params: a, passAllData: o }) => {
|
|
3904
3924
|
let s = e?.chartType;
|
|
3905
|
-
return s ===
|
|
3925
|
+
return s === N.table || s === N.singleValue || n && r === i ? o ? a?.reduce((e, t) => (e[t.columnName] = t.value, e), {}) : a?.find((e) => e.columnName === t)?.value : [N.sankey, N.treeMap].includes(s) ? o ? {
|
|
3906
3926
|
name: a?.name,
|
|
3907
3927
|
value: a?.value
|
|
3908
3928
|
} : a?.value : o ? {
|
|
3909
3929
|
name: a?.name,
|
|
3910
3930
|
value: a?.value,
|
|
3911
3931
|
columnName: a?.seriesName
|
|
3912
|
-
} : t === e?.xAxis || s ===
|
|
3913
|
-
},
|
|
3914
|
-
let c =
|
|
3932
|
+
} : t === e?.xAxis || s === N.gauge && t === e?.gaugeSettings?.dimensions?.join(", ") ? a?.name : a?.seriesName === t || s === N.gauge && t === e?.gaugeSettings?.metric || [N.funnel].includes(s) ? a?.value : null;
|
|
3933
|
+
}, Sa = (e, t, n) => !e || t === n, Ca = ({ chart: e, chartWithMetric: t, chartWithDashboard: n, isDrillEnabled: r, drilledLevel: i, dimensionCount: a, isLastConfiguredDrillLevel: o, isTableRedirectAllowed: s = !0 }) => {
|
|
3934
|
+
let c = Sa(r, i, a), l = c || !!o, u = !!e?.isEnable && l && s, d = e?.routeType === "user";
|
|
3915
3935
|
return {
|
|
3916
3936
|
navigate: u && !d,
|
|
3917
3937
|
host: u && d,
|
|
3918
3938
|
openNestedMetric: !!t?.isEnable && c,
|
|
3919
3939
|
openDashboard: !!n?.isEnable && l
|
|
3920
3940
|
};
|
|
3921
|
-
},
|
|
3941
|
+
}, wa = (e) => e === "column" ? {
|
|
3922
3942
|
code: "JOIN_COLUMN_HIDDEN",
|
|
3923
3943
|
message: "A column this metric uses is hidden or no longer in the datamart.",
|
|
3924
3944
|
hint: "Ask an editor to unhide it in the datamart or update the metric."
|
|
@@ -3926,9 +3946,9 @@ var oa = {
|
|
|
3926
3946
|
code: "JOIN_PATH_MISSING",
|
|
3927
3947
|
message: "A join this metric uses is no longer in the datamart.",
|
|
3928
3948
|
hint: "Ask an editor to add the relationship back or update the metric."
|
|
3929
|
-
},
|
|
3949
|
+
}, Ta = (e) => {
|
|
3930
3950
|
let t = r(e, { fallback: "The query couldn't run." });
|
|
3931
|
-
return t.code === "JOIN_COLUMN_HIDDEN" ? r(
|
|
3951
|
+
return t.code === "JOIN_COLUMN_HIDDEN" ? r(wa("column")) : t.code === "JOIN_PATH_MISSING" ? r(wa("join")) : t;
|
|
3932
3952
|
};
|
|
3933
3953
|
//#endregion
|
|
3934
|
-
export {
|
|
3954
|
+
export { Xn as A, Br as C, $n as D, Jn as E, At as F, Ot as I, Zn as M, Kn as N, ar as O, kt as P, Ur as S, Qn as T, Di as _, ba as a, Yr as b, qi as c, Pi as d, Vi as f, ki as g, Oi as h, xa as i, Z as j, Yn as k, Fi as l, Mi as m, Ta as n, ha as o, Ri as p, Ca as r, fa as s, wa as t, zi as u, ti as v, Vr as w, Hr as x, qr as y };
|