@databrainhq/plugin 0.17.9-beta.16 → 0.17.9-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Accordion-Bb74CQ-z.mjs → Accordion-DsORmK4r.mjs} +1 -1
- package/dist/{ChartCardOverlay-7PjIkbse.mjs → ChartCardOverlay-CyLHFHJa.mjs} +15 -12
- package/dist/{ChartNavigationProvider-CtSvd6kl.mjs → ChartNavigationProvider-I67YIHce.mjs} +1401 -1401
- package/dist/{CreateGlobalFilter-BqFhZ5_I.mjs → CreateGlobalFilter-Da6S3dnu.mjs} +2 -2
- package/dist/{CreateMetricV2-Bb5xNRY7.mjs → CreateMetricV2-RNLSJMxN.mjs} +21 -21
- package/dist/{HorizontalStackTable-Ci6XWwf-.mjs → HorizontalStackTable-Bg3wERrZ.mjs} +4 -4
- package/dist/{Loader-fiz_o6YC.mjs → Loader-BOT4ofJi.mjs} +1 -1
- package/dist/{ManageMetricsV2-qyk-SCcL.mjs → ManageMetricsV2-B0mbiFlY.mjs} +4 -4
- package/dist/{MetricCardV2-YINjQ5xk.mjs → MetricCardV2-A3PVcIkw.mjs} +10 -10
- package/dist/{NoDataFound-CVyRVkzK.mjs → NoDataFound-CEBF6MOr.mjs} +1 -1
- package/dist/{NoDataState-Dgm3tkCe.mjs → NoDataState-CmQQi1kw.mjs} +4 -4
- package/dist/{Panel-BpByQBce.mjs → Panel-DD-9FoTg.mjs} +1 -1
- package/dist/{PivotTableV2-DzIDJiSY.mjs → PivotTableV2-pWrTxupk.mjs} +2 -2
- package/dist/{PivotTableV3-B4UiH33n.mjs → PivotTableV3-B6QG_LCW.mjs} +4 -4
- package/dist/{Portal-CLz2zya_.mjs → Portal-B4Kj0rIP.mjs} +38 -38
- package/dist/{RadioButton-Dz-MsEbj.mjs → RadioButton-DpB36vSj.mjs} +44 -44
- package/dist/{ScheduleEmail-D85TAzI5.mjs → ScheduleEmail-gqxwqtp3.mjs} +7 -7
- package/dist/{TagInputField-CFrkMoTw.mjs → TagInputField-BbP-qWl4.mjs} +119 -110
- package/dist/{TextAreaField-B5Gxdaat.mjs → TextAreaField-C9qNJtxa.mjs} +10 -10
- package/dist/{charts-B3jV6aAX.mjs → charts-B2lwO2wF.mjs} +2 -2
- package/dist/{chevron-down-jFldnWcP.mjs → chevron-down-DYt-7zTT.mjs} +0 -0
- package/dist/{conditionalFormatting-ClTTstDV.mjs → conditionalFormatting-CrVixZL6.mjs} +1 -1
- package/dist/{createGlobalFilter.module-C1gmnqpy.mjs → createGlobalFilter.module-D9y4fUa6.mjs} +1 -1
- package/dist/{echarts-BwNzdyVe.mjs → echarts-CNq_XyLZ.mjs} +1 -1
- package/dist/{loading-state-CWZlWaOv.mjs → loading-state-CF_6fTCn.mjs} +3 -3
- package/dist/{metric.mutation-rX2iD9gk.mjs → metric.mutation-Bw7qZhLi.mjs} +37 -37
- package/dist/{pluginV3Request-CTFUezaJ.mjs → pluginV3Request-Ctr47kPo.mjs} +14 -14
- package/dist/{renderer-BQ-2Ksj0.mjs → renderer-BTvVu5ie.mjs} +6 -6
- package/dist/{timeseries-BeWDRXFD.mjs → timeseries-1uk9rCLq.mjs} +1 -1
- package/dist/{toTasteAppearance-xPVajb_2.mjs → toTasteAppearance-DyYAwtBW.mjs} +1 -1
- package/dist/{useGuesTokenUsageLog-R2_v2Wnd.mjs → useGuesTokenUsageLog-C98YQ6dU.mjs} +1 -1
- package/dist/{usePublishArchivedMetrics-C19AAeOY.mjs → usePublishArchivedMetrics-C3suEAda.mjs} +2 -2
- package/dist/{useQuery-xw_-DpE2.mjs → useQuery-BlfQIaBR.mjs} +1 -1
- package/dist/webcomponents.css +1 -1
- package/dist/webcomponents.es.js +1989 -1986
- package/dist/webcomponents.umd.js +146 -146
- package/package.json +1 -1
|
@@ -2,21 +2,21 @@ import "react";
|
|
|
2
2
|
import "react-dom";
|
|
3
3
|
import "react-dom/client";
|
|
4
4
|
import { o as e } from "./rolldown-runtime-C1JUX4Ur.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import { A as
|
|
8
|
-
import { t as
|
|
9
|
-
import { $ as
|
|
10
|
-
import { n as
|
|
11
|
-
import { i as
|
|
12
|
-
import { i as
|
|
13
|
-
import { r as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import * as
|
|
17
|
-
import { useCallback as
|
|
5
|
+
import { It as t, Jt as n, Lt as r, Nt as i, Rt as a, d as o, o as s, r as c, s as l } from "./pluginV3Request-Ctr47kPo.mjs";
|
|
6
|
+
import { t as u } from "./jsx-runtime-B0EUnyJj.mjs";
|
|
7
|
+
import { A as d, E as f, S as p, _ as m, a as ee, b as h, ct as g, d as te, h as _, i as ne, l as v, s as y, v as b, x, y as S } from "./metric.mutation-Bw7qZhLi.mjs";
|
|
8
|
+
import { t as C } from "./useQuery-BlfQIaBR.mjs";
|
|
9
|
+
import { $ as re, Aa as w, Ai as ie, At as T, B as ae, Bi as oe, Bt as se, Ca as E, D as ce, Dt as le, E as ue, H as de, Ht as fe, J as pe, Jt as me, L as he, Ma as ge, Mt as _e, N as ve, Ot as ye, P as D, Pa as O, T as k, U as be, Ut as A, W as xe, Xt as Se, Y as Ce, _n as we, _t as Te, ba as Ee, bt as De, ct as Oe, dt as ke, ei as Ae, et as je, h as j, hn as Me, hr as Ne, ht as Pe, it as Fe, j as Ie, ja as M, jn as Le, k as Re, ka as ze, lt as Be, na as Ve, ni as He, nt as Ue, ot as We, qt as Ge, s as Ke, tt as qe, u as Je, vn as Ye, vt as Xe, wr as Ze, xa as Qe, xn as $e, yn as et, yt as tt, z as nt } from "./Portal-B4Kj0rIP.mjs";
|
|
10
|
+
import { n as rt } from "./timeseries-1uk9rCLq.mjs";
|
|
11
|
+
import { i as it } from "./text-CtrvkDIo.mjs";
|
|
12
|
+
import { i as at, l as ot, p as st, r as ct, s as lt, t as ut } from "./RadioButton-DpB36vSj.mjs";
|
|
13
|
+
import { r as dt } from "./cardActions-BLBLsjcd.mjs";
|
|
14
|
+
import { t as ft } from "./createLucideIcon-C-N26TaJ.mjs";
|
|
15
|
+
import { t as pt } from "./Switch-Bjta4jTW.mjs";
|
|
16
|
+
import * as mt from "react";
|
|
17
|
+
import { useCallback as N, useEffect as P, useLayoutEffect as ht, useMemo as F, useRef as I, useState as L } from "react";
|
|
18
18
|
//#region src/helpers/sqlUtils/queryWrapping.ts
|
|
19
|
-
var
|
|
19
|
+
var R = u(), gt = /* @__PURE__ */ e(ge()), _t = /;\s*$/, vt = (e) => e.replace(_t, ""), yt = (e) => `${e?.token || ""}|${+!!e?.isFrontendApp}|${e?.clientId || ""}`, bt = (e, t = {}) => e?.id ? e.drillConfig?.levels?.some((e) => !!e?.filters?.length) ? {
|
|
20
20
|
eligible: !1,
|
|
21
21
|
reason: "drill-filtered"
|
|
22
22
|
} : e.isEncrypted && !t.isGuestTokenSession ? {
|
|
@@ -25,14 +25,14 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
25
25
|
} : { eligible: !0 } : {
|
|
26
26
|
eligible: !1,
|
|
27
27
|
reason: "no-metric-id"
|
|
28
|
-
},
|
|
28
|
+
}, xt = (e, t, n, r = "embed", i) => ({
|
|
29
29
|
key: e,
|
|
30
30
|
externalMetricId: t.id,
|
|
31
31
|
...r === "platform" && n ? { clientId: n } : {},
|
|
32
32
|
...r === "platform" && t.timezone ? { timezone: t.timezone } : {},
|
|
33
33
|
...t.isEncrypted && i ? {
|
|
34
|
-
rlsConditions: t.rlsConditions?.length ?
|
|
35
|
-
globalFilters: t.globalFilters?.filters?.length ?
|
|
34
|
+
rlsConditions: t.rlsConditions?.length ? w(t.rlsConditions, i) : [],
|
|
35
|
+
globalFilters: t.globalFilters?.filters?.length ? w(t.globalFilters, i) : {
|
|
36
36
|
tableName: "",
|
|
37
37
|
filters: []
|
|
38
38
|
}
|
|
@@ -54,7 +54,7 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
54
54
|
comparisonCount: t.comparisonCount,
|
|
55
55
|
drillConfig: t.drillConfig,
|
|
56
56
|
...t.isEncrypted && i ? { isEncrypted: !0 } : {}
|
|
57
|
-
}),
|
|
57
|
+
}), St = (e) => {
|
|
58
58
|
let t = [];
|
|
59
59
|
if (typeof e.data == "string") try {
|
|
60
60
|
t = JSON.parse(e.data);
|
|
@@ -74,7 +74,7 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
74
74
|
metaData: e.metaData,
|
|
75
75
|
...e.error ? { error: e.error } : {}
|
|
76
76
|
};
|
|
77
|
-
},
|
|
77
|
+
}, Ct = 45e3, wt = 1e3, Tt = 1500, Et = class {
|
|
78
78
|
options;
|
|
79
79
|
queue = [];
|
|
80
80
|
flushScheduled = !1;
|
|
@@ -154,7 +154,7 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
154
154
|
}
|
|
155
155
|
let t = /* @__PURE__ */ new Map();
|
|
156
156
|
e.forEach((e) => {
|
|
157
|
-
let n =
|
|
157
|
+
let n = yt(e.session), r = t.get(n);
|
|
158
158
|
r ? r.push(e) : t.set(n, [e]);
|
|
159
159
|
});
|
|
160
160
|
let n = [];
|
|
@@ -183,7 +183,7 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
183
183
|
o = await this.options.transport(e.map((e) => e.request), t.signal, e[0]?.session || {}), r = !0, a();
|
|
184
184
|
} catch (t) {
|
|
185
185
|
if (r = !0, a(), n) {
|
|
186
|
-
let t = new
|
|
186
|
+
let t = new S(this.options.timeoutMs);
|
|
187
187
|
e.forEach((e) => {
|
|
188
188
|
e.reject(t);
|
|
189
189
|
});
|
|
@@ -221,51 +221,51 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
221
221
|
this.settleWithFallback(e);
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
let r =
|
|
224
|
+
let r = St(n);
|
|
225
225
|
e.resolve(r);
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
settleWithFallback(e) {
|
|
229
229
|
e.fallback().then(e.resolve, e.reject);
|
|
230
230
|
}
|
|
231
|
-
},
|
|
231
|
+
}, Dt = "dbnMetricBatch", Ot = "@dbn:metricQueryBatch", kt = () => {
|
|
232
232
|
try {
|
|
233
|
-
let e = window.localStorage.getItem(
|
|
233
|
+
let e = window.localStorage.getItem(Ot);
|
|
234
234
|
if (e === "on" || e === "off") return e;
|
|
235
235
|
} catch {}
|
|
236
236
|
return null;
|
|
237
|
-
},
|
|
237
|
+
}, z = (e) => {
|
|
238
238
|
try {
|
|
239
|
-
e === null ? window.localStorage.removeItem(
|
|
239
|
+
e === null ? window.localStorage.removeItem(Ot) : window.localStorage.setItem(Ot, e);
|
|
240
240
|
} catch {}
|
|
241
|
-
},
|
|
241
|
+
}, At = () => {
|
|
242
242
|
try {
|
|
243
|
-
let e = new URLSearchParams(window.location.search).get(
|
|
244
|
-
(e === "on" || e === "off") &&
|
|
243
|
+
let e = new URLSearchParams(window.location.search).get(Dt);
|
|
244
|
+
(e === "on" || e === "off") && z(e);
|
|
245
245
|
} catch {}
|
|
246
|
-
},
|
|
246
|
+
}, B = () => typeof window > "u" || window.dbn?.disableMetricQueryBatch ? "off" : (At(), kt() ?? "auto"), jt = () => B() !== "off", Mt = /* @__PURE__ */ new Set(), Nt = () => {
|
|
247
247
|
let e;
|
|
248
|
-
return
|
|
248
|
+
return Mt.forEach((t) => {
|
|
249
249
|
if (!e) try {
|
|
250
250
|
let n = t();
|
|
251
251
|
n && Object.keys(n).length && (e = n);
|
|
252
252
|
} catch {}
|
|
253
253
|
}), e;
|
|
254
|
-
},
|
|
254
|
+
}, Pt = "/hasuraActions/externalMetricQueryBatch", Ft = "/api/v3/metric/queryBatch", It = [
|
|
255
255
|
404,
|
|
256
256
|
405,
|
|
257
257
|
501
|
|
258
|
-
],
|
|
258
|
+
], Lt = [
|
|
259
259
|
200,
|
|
260
260
|
400,
|
|
261
261
|
401,
|
|
262
262
|
403
|
|
263
|
-
],
|
|
264
|
-
let r =
|
|
265
|
-
if (!r) throw new
|
|
263
|
+
], Rt = (e) => !!e.token || !!(e.isFrontendApp && e.clientId), zt = (e = {}) => typeof window > "u" || typeof fetch != "function" || window.dbn?.isEnableProxyAuth ? null : Rt(e) ? "embed" : Nt() ? "platform" : null, Bt = (e = "platform") => `${window.dbn?.baseUrl || o}${e === "embed" ? Ft : Pt}`, Vt = async (e, t, n = {}) => {
|
|
264
|
+
let r = zt(n);
|
|
265
|
+
if (!r) throw new m("No credentials available for batched queries");
|
|
266
266
|
let i;
|
|
267
|
-
if (r === "embed") i = await
|
|
268
|
-
path:
|
|
267
|
+
if (r === "embed") i = await s({
|
|
268
|
+
path: Ft,
|
|
269
269
|
method: "POST",
|
|
270
270
|
signal: t,
|
|
271
271
|
token: n.token,
|
|
@@ -275,9 +275,9 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
275
275
|
throwOnHttpError: !1
|
|
276
276
|
});
|
|
277
277
|
else {
|
|
278
|
-
let n =
|
|
279
|
-
if (!n) throw new
|
|
280
|
-
i = await fetch(
|
|
278
|
+
let n = Nt();
|
|
279
|
+
if (!n) throw new m("No access token available for batched queries");
|
|
280
|
+
i = await fetch(Bt(r), {
|
|
281
281
|
method: "POST",
|
|
282
282
|
signal: t,
|
|
283
283
|
headers: {
|
|
@@ -288,57 +288,57 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
288
288
|
body: JSON.stringify({ input: { input: { requests: e } } })
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
-
if (
|
|
292
|
-
let
|
|
291
|
+
if (It.includes(i.status)) throw new b(`Batch endpoint responded ${i.status}`);
|
|
292
|
+
let a;
|
|
293
293
|
try {
|
|
294
|
-
|
|
294
|
+
a = await i.json();
|
|
295
295
|
} catch {
|
|
296
|
-
throw new
|
|
296
|
+
throw new b("Batch endpoint returned a non-JSON body");
|
|
297
297
|
}
|
|
298
|
-
let
|
|
299
|
-
if (
|
|
300
|
-
if (i.status === 401 || i.status === 403) throw new
|
|
301
|
-
if (!i.ok) throw Error(
|
|
302
|
-
if (!Array.isArray(
|
|
303
|
-
return
|
|
304
|
-
},
|
|
305
|
-
transport:
|
|
298
|
+
let o = a?.error && typeof a.error == "object" ? a.error : void 0;
|
|
299
|
+
if (o && Lt.includes(i.status)) throw new m(o.message || "Unauthorized request!");
|
|
300
|
+
if (i.status === 401 || i.status === 403) throw new m(`Batch endpoint responded ${i.status}`);
|
|
301
|
+
if (!i.ok) throw Error(a?.message || `Batch request failed with status ${i.status}`);
|
|
302
|
+
if (!Array.isArray(a?.results) && typeof a?.error != "string") throw new b("Batch endpoint response did not match the expected shape");
|
|
303
|
+
return a;
|
|
304
|
+
}, Ht = null, Ut = () => (Ht ||= new Et({
|
|
305
|
+
transport: Vt,
|
|
306
306
|
coalesceWindowMs: 500,
|
|
307
|
-
coalesceIdleMs:
|
|
308
|
-
coalesceMaxWaitMs:
|
|
309
|
-
}),
|
|
310
|
-
t !== void 0 &&
|
|
311
|
-
let l =
|
|
312
|
-
if (!
|
|
313
|
-
let u =
|
|
314
|
-
if (!u || !
|
|
307
|
+
coalesceIdleMs: wt,
|
|
308
|
+
coalesceMaxWaitMs: Tt
|
|
309
|
+
}), Ht), Wt = async ({ payload: e, savedMetricQuery: t, dbName: n, savedMetricIdentifiers: r, clientId: i, key: a, hints: o, session: s, single: c }) => {
|
|
310
|
+
t !== void 0 && we(t, "metric.query", n), Ye(r);
|
|
311
|
+
let l = $e(e);
|
|
312
|
+
if (!jt()) return c(l);
|
|
313
|
+
let u = zt(s);
|
|
314
|
+
if (!u || !bt(l, o).eligible) return c(l);
|
|
315
315
|
let d = {
|
|
316
|
-
request:
|
|
316
|
+
request: xt(a, l, i, u, s?.token),
|
|
317
317
|
fallback: () => c(l),
|
|
318
318
|
session: s
|
|
319
319
|
};
|
|
320
|
-
return
|
|
321
|
-
},
|
|
320
|
+
return Ut().enqueue(d);
|
|
321
|
+
}, Gt = 134217728, Kt = /* @__PURE__ */ new WeakMap(), qt = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
322
322
|
if (e == null) return 0;
|
|
323
323
|
if (typeof e == "string") return e.length * 2;
|
|
324
324
|
if (typeof e == "number" || typeof e == "bigint") return 8;
|
|
325
325
|
if (typeof e == "boolean") return 4;
|
|
326
326
|
if (typeof e != "object") return 0;
|
|
327
|
-
let n = e, r =
|
|
327
|
+
let n = e, r = Kt.get(n);
|
|
328
328
|
if (r !== void 0) return r;
|
|
329
329
|
if (t.has(n)) return 0;
|
|
330
330
|
t.add(n);
|
|
331
331
|
let i = 32;
|
|
332
|
-
if (Array.isArray(e)) for (let n of e) i += 8 +
|
|
333
|
-
else for (let [n, r] of Object.entries(e)) i += n.length * 2 + 8 +
|
|
334
|
-
return
|
|
335
|
-
},
|
|
332
|
+
if (Array.isArray(e)) for (let n of e) i += 8 + qt(n, t);
|
|
333
|
+
else for (let [n, r] of Object.entries(e)) i += n.length * 2 + 8 + qt(r, t);
|
|
334
|
+
return Kt.set(n, i), i;
|
|
335
|
+
}, Jt = (e, { maxEntries: n = 128, maxBytes: r = Gt } = {}) => {
|
|
336
336
|
let i = e.getQueryCache().findAll({
|
|
337
337
|
queryKey: [t],
|
|
338
338
|
type: "inactive"
|
|
339
339
|
}).map((e) => ({
|
|
340
340
|
query: e,
|
|
341
|
-
bytes:
|
|
341
|
+
bytes: qt(e.state.data)
|
|
342
342
|
})).sort((e, t) => e.query.state.dataUpdatedAt - t.query.state.dataUpdatedAt), a = i.reduce((e, t) => e + t.bytes, 0);
|
|
343
343
|
for (; i.length > n || a > r && i.length > 1;) {
|
|
344
344
|
let t = i.shift();
|
|
@@ -349,11 +349,11 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
349
349
|
type: "inactive"
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
|
-
},
|
|
353
|
-
if (
|
|
354
|
-
|
|
352
|
+
}, Yt = /* @__PURE__ */ new WeakSet(), Xt = (e) => {
|
|
353
|
+
if (Yt.has(e)) return;
|
|
354
|
+
Yt.add(e);
|
|
355
355
|
let t = () => {
|
|
356
|
-
|
|
356
|
+
Yt.delete(e), Jt(e);
|
|
357
357
|
}, n = globalThis.scheduler;
|
|
358
358
|
if (typeof n?.postTask == "function") {
|
|
359
359
|
n.postTask(t, { priority: "background" });
|
|
@@ -364,165 +364,165 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
364
364
|
return;
|
|
365
365
|
}
|
|
366
366
|
setTimeout(t, 0);
|
|
367
|
-
},
|
|
367
|
+
}, Zt = "dbn:metric-query:guest-principal:v1", Qt = (e) => e ? gt.default.HmacSHA256(e, Zt).toString(gt.default.enc.Hex) : void 0, $t = ({ queryName: e, data: t, clientId: n, isFrontendApp: r, token: i, isFullScreen: a }) => [
|
|
368
368
|
e,
|
|
369
369
|
t,
|
|
370
370
|
n,
|
|
371
371
|
r,
|
|
372
|
-
i ? { guestPrincipal:
|
|
372
|
+
i ? { guestPrincipal: Qt(i) } : void 0,
|
|
373
373
|
a
|
|
374
|
-
],
|
|
375
|
-
let m = g(),
|
|
374
|
+
], en = ({ clientId: e, data: r, token: i, isFrontendApp: a, isFullScreen: o = "", batchHints: s, savedMetricQuery: c, savedMetricIdentifiers: l, dbName: u, timeoutMs: f = Ct }, p) => {
|
|
375
|
+
let m = g(), ee = !!r.id && !p?.isDisableQuery && (!a || !!e), te = $t({
|
|
376
376
|
queryName: t,
|
|
377
|
-
data:
|
|
377
|
+
data: r,
|
|
378
378
|
clientId: e,
|
|
379
|
-
isFrontendApp:
|
|
380
|
-
token:
|
|
381
|
-
isFullScreen:
|
|
379
|
+
isFrontendApp: a,
|
|
380
|
+
token: i,
|
|
381
|
+
isFullScreen: o
|
|
382
382
|
});
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
isQueryEnabled:
|
|
386
|
-
hasMetricId: !!
|
|
383
|
+
P(() => {
|
|
384
|
+
x("metric-query-enabled-state", {
|
|
385
|
+
isQueryEnabled: ee,
|
|
386
|
+
hasMetricId: !!r.id,
|
|
387
387
|
isDisableQuery: !!p?.isDisableQuery,
|
|
388
|
-
isFrontendApp:
|
|
388
|
+
isFrontendApp: a,
|
|
389
389
|
hasClientId: !!e,
|
|
390
|
-
hasToken: !!
|
|
391
|
-
isFullScreen:
|
|
392
|
-
payload:
|
|
390
|
+
hasToken: !!i,
|
|
391
|
+
isFullScreen: o,
|
|
392
|
+
payload: d(r)
|
|
393
393
|
});
|
|
394
394
|
}, [
|
|
395
|
-
|
|
396
|
-
|
|
395
|
+
ee,
|
|
396
|
+
r,
|
|
397
397
|
p?.isDisableQuery,
|
|
398
|
-
|
|
398
|
+
a,
|
|
399
399
|
e,
|
|
400
|
-
|
|
401
|
-
|
|
400
|
+
i,
|
|
401
|
+
o
|
|
402
402
|
]);
|
|
403
|
-
let
|
|
404
|
-
let s = t ||
|
|
405
|
-
return
|
|
406
|
-
path:
|
|
403
|
+
let ne = (t) => {
|
|
404
|
+
let s = t || r;
|
|
405
|
+
return x("metric-query-fetch-start", {
|
|
406
|
+
path: n,
|
|
407
407
|
clientId: e,
|
|
408
|
-
isFrontendApp:
|
|
409
|
-
hasToken: !!
|
|
410
|
-
isFullScreen:
|
|
411
|
-
payload:
|
|
412
|
-
}),
|
|
408
|
+
isFrontendApp: a,
|
|
409
|
+
hasToken: !!i,
|
|
410
|
+
isFullScreen: o,
|
|
411
|
+
payload: d(s)
|
|
412
|
+
}), _(n, {
|
|
413
413
|
method: "POST",
|
|
414
414
|
data: {
|
|
415
415
|
...s || {},
|
|
416
|
-
...!
|
|
417
|
-
...Array.isArray(s?.rlsConditions) && s.rlsConditions.length ? { rlsConditions:
|
|
418
|
-
...typeof s?.globalFilters == "object" && s.globalFilters !== null && "filters" in s.globalFilters && Array.isArray(s.globalFilters.filters) && s.globalFilters.filters.length ? { globalFilters:
|
|
416
|
+
...!a && i ? {
|
|
417
|
+
...Array.isArray(s?.rlsConditions) && s.rlsConditions.length ? { rlsConditions: w(s.rlsConditions, i) } : { rlsConditions: [] },
|
|
418
|
+
...typeof s?.globalFilters == "object" && s.globalFilters !== null && "filters" in s.globalFilters && Array.isArray(s.globalFilters.filters) && s.globalFilters.filters.length ? { globalFilters: w(s.globalFilters, i) } : { globalFilters: {
|
|
419
419
|
tableName: "",
|
|
420
420
|
filters: []
|
|
421
421
|
} }
|
|
422
422
|
} : {}
|
|
423
423
|
},
|
|
424
|
-
isFrontend:
|
|
424
|
+
isFrontend: a,
|
|
425
425
|
clientId: e,
|
|
426
|
-
token:
|
|
426
|
+
token: i,
|
|
427
427
|
timeoutMs: f
|
|
428
428
|
});
|
|
429
|
-
},
|
|
430
|
-
queryKey:
|
|
431
|
-
queryFn: () => (
|
|
432
|
-
metricId:
|
|
433
|
-
payload:
|
|
434
|
-
}),
|
|
435
|
-
payload:
|
|
429
|
+
}, v = C({
|
|
430
|
+
queryKey: te,
|
|
431
|
+
queryFn: () => (x("metric-query-dispatch", {
|
|
432
|
+
metricId: r?.id,
|
|
433
|
+
payload: d(r)
|
|
434
|
+
}), Wt({
|
|
435
|
+
payload: r,
|
|
436
436
|
savedMetricQuery: c,
|
|
437
437
|
savedMetricIdentifiers: l,
|
|
438
|
-
dbName:
|
|
438
|
+
dbName: u,
|
|
439
439
|
clientId: e,
|
|
440
|
-
key: `${
|
|
440
|
+
key: `${r?.id || "metric"}::${JSON.stringify(r)}::${e || ""}`,
|
|
441
441
|
hints: {
|
|
442
442
|
...s || {},
|
|
443
|
-
isGuestTokenSession: !
|
|
443
|
+
isGuestTokenSession: !a && !!i
|
|
444
444
|
},
|
|
445
445
|
session: {
|
|
446
|
-
token:
|
|
447
|
-
isFrontendApp:
|
|
446
|
+
token: i,
|
|
447
|
+
isFrontendApp: a,
|
|
448
448
|
clientId: e
|
|
449
449
|
},
|
|
450
|
-
single:
|
|
450
|
+
single: ne
|
|
451
451
|
})),
|
|
452
|
-
enabled:
|
|
453
|
-
meta:
|
|
452
|
+
enabled: ee,
|
|
453
|
+
meta: i ? { persist: !1 } : void 0,
|
|
454
454
|
retry: (e, t) => !h(t) && e < 2,
|
|
455
455
|
staleTime: 3e5,
|
|
456
456
|
gcTime: 3e5
|
|
457
|
-
}),
|
|
458
|
-
|
|
459
|
-
let
|
|
460
|
-
return
|
|
461
|
-
if (!
|
|
462
|
-
let e =
|
|
463
|
-
|
|
464
|
-
payload:
|
|
457
|
+
}), y = I(r);
|
|
458
|
+
y.current = r;
|
|
459
|
+
let b = I(p);
|
|
460
|
+
return b.current = p, P(() => {
|
|
461
|
+
if (!v.isSuccess) return;
|
|
462
|
+
let e = v.data;
|
|
463
|
+
x("metric-query-success", {
|
|
464
|
+
payload: d(y.current),
|
|
465
465
|
responseDataType: typeof e?.data,
|
|
466
466
|
responseRowCount: Array.isArray(e?.data) ? e?.data?.length : void 0,
|
|
467
467
|
totalRecords: e?.totalRecords
|
|
468
|
-
}),
|
|
468
|
+
}), b.current?.onSuccess?.(e), Xt(m);
|
|
469
469
|
}, [
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
v.isSuccess,
|
|
471
|
+
v.data,
|
|
472
472
|
m
|
|
473
|
-
]),
|
|
474
|
-
if (!
|
|
475
|
-
let e =
|
|
476
|
-
|
|
477
|
-
payload:
|
|
473
|
+
]), P(() => () => Xt(m), [m]), P(() => {
|
|
474
|
+
if (!v.isSuccess && !v.isError) return;
|
|
475
|
+
let e = v.data, t = v.error;
|
|
476
|
+
x("metric-query-settled", {
|
|
477
|
+
payload: d(y.current),
|
|
478
478
|
hasError: !!t,
|
|
479
479
|
errorMessage: t instanceof Error ? t.message : t?.message,
|
|
480
480
|
responseDataType: typeof e?.data,
|
|
481
481
|
responseRowCount: Array.isArray(e?.data) ? e?.data?.length : void 0
|
|
482
|
-
}),
|
|
482
|
+
}), b.current?.onSettled?.(e, t);
|
|
483
483
|
}, [
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
]),
|
|
489
|
-
},
|
|
484
|
+
v.isSuccess,
|
|
485
|
+
v.isError,
|
|
486
|
+
v.data,
|
|
487
|
+
v.error
|
|
488
|
+
]), v;
|
|
489
|
+
}, V = async ({ workspaceId: e, token: t, isFrontend: n, encryptedClientId: i }) => (n && await l(), _(`${r}?id=${e}`, {
|
|
490
490
|
method: "GET",
|
|
491
|
-
token: t || "",
|
|
492
|
-
isFrontend:
|
|
491
|
+
token: n ? "" : t || "",
|
|
492
|
+
isFrontend: n,
|
|
493
493
|
clientId: i
|
|
494
|
-
}),
|
|
495
|
-
let { token:
|
|
496
|
-
return
|
|
494
|
+
})), tn = (e, t, n, r) => {
|
|
495
|
+
let { token: i } = O(), o = n ? "" : t || i || "";
|
|
496
|
+
return C({
|
|
497
497
|
queryKey: [
|
|
498
|
-
|
|
498
|
+
a,
|
|
499
499
|
e,
|
|
500
500
|
{
|
|
501
501
|
token: o,
|
|
502
502
|
isFrontendApp: !!n,
|
|
503
|
-
encryptedClientId:
|
|
503
|
+
encryptedClientId: r
|
|
504
504
|
}
|
|
505
505
|
],
|
|
506
506
|
meta: { persist: !1 },
|
|
507
|
-
queryFn: () =>
|
|
507
|
+
queryFn: () => V({
|
|
508
508
|
workspaceId: e,
|
|
509
509
|
token: o,
|
|
510
510
|
isFrontend: n,
|
|
511
|
-
encryptedClientId:
|
|
511
|
+
encryptedClientId: r
|
|
512
512
|
}),
|
|
513
513
|
enabled: !!e
|
|
514
514
|
});
|
|
515
|
-
},
|
|
515
|
+
}, nn = ({ language: e, translationDictionary: t }) => !e || !t ? !1 : Object.values(t).some((t) => !!t?.[e]), rn = ({ language: e, translationDictionary: t }) => !nn({
|
|
516
516
|
language: e,
|
|
517
517
|
translationDictionary: t
|
|
518
|
-
}),
|
|
518
|
+
}), an = ({ language: e, tableLimit: t, translationDictionary: n }) => rn({
|
|
519
519
|
language: e,
|
|
520
520
|
translationDictionary: n
|
|
521
521
|
}) ? {
|
|
522
522
|
limit: String(t.limit),
|
|
523
523
|
offset: String(t.offset)
|
|
524
|
-
} : {},
|
|
525
|
-
if (!
|
|
524
|
+
} : {}, on = ({ language: e, search: t, searchColumns: n, translationDictionary: r }) => {
|
|
525
|
+
if (!rn({
|
|
526
526
|
language: e,
|
|
527
527
|
translationDictionary: r
|
|
528
528
|
})) return {};
|
|
@@ -531,13 +531,13 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
531
531
|
search: i && a ? i : void 0,
|
|
532
532
|
searchColumns: i && a ? n : void 0
|
|
533
533
|
};
|
|
534
|
-
},
|
|
534
|
+
}, sn = ({ currentSearchValue: e, nextValue: t, shouldUseServerSideSearch: n, tableLimit: r }) => {
|
|
535
535
|
let i = String(t).trim() !== (e || "").trim(), a = r.offset !== 0;
|
|
536
536
|
return {
|
|
537
537
|
shouldResetPageOffset: a,
|
|
538
538
|
shouldSetTablePending: a || n && i
|
|
539
539
|
};
|
|
540
|
-
},
|
|
540
|
+
}, cn = ({ isPythonMode: e, search: t, shouldUseServerSideSearch: n }) => e ? !0 : !n, ln = ({ columnName: e, disableDownloadUnderlyingDataNoFilters: t, isLoading: n, isSingleValueChart: r }) => !n && !t && !!(e || r), un = ({ isPrev: e, nextOffset: t, prev: n, resetValue: r }) => r === void 0 ? t === void 0 ? {
|
|
541
541
|
limit: n.limit,
|
|
542
542
|
offset: e ? Math.max(n.offset - n.limit, 0) : n.offset + n.limit
|
|
543
543
|
} : {
|
|
@@ -546,15 +546,15 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
546
546
|
} : {
|
|
547
547
|
limit: r,
|
|
548
548
|
offset: 0
|
|
549
|
-
},
|
|
550
|
-
let o =
|
|
549
|
+
}, dn = (e) => e == null ? e : A(e.toString()), fn = (e, t) => [...e ?? [], ...t ?? []].some((e) => !!e?.columnName && e.value !== void 0), H = (e = []) => e.filter((e) => e?.columnName && e.value !== void 0), pn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => {
|
|
550
|
+
let o = H(n);
|
|
551
551
|
return i || !e || a === void 0 ? o : [...o.filter((t) => t.columnName !== e || String(t.value) !== String(a)), {
|
|
552
552
|
columnName: e,
|
|
553
553
|
dataType: t,
|
|
554
554
|
expressionSql: r,
|
|
555
555
|
value: a
|
|
556
556
|
}];
|
|
557
|
-
},
|
|
557
|
+
}, mn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => pn({
|
|
558
558
|
columnName: e,
|
|
559
559
|
dataType: t,
|
|
560
560
|
drillFilters: n,
|
|
@@ -565,179 +565,179 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
565
565
|
columnName: e.columnName,
|
|
566
566
|
dataType: e.dataType,
|
|
567
567
|
expressionSql: e.expressionSql,
|
|
568
|
-
value:
|
|
569
|
-
})),
|
|
568
|
+
value: dn(e.value)
|
|
569
|
+
})), hn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => pn({
|
|
570
570
|
columnName: e,
|
|
571
571
|
dataType: t,
|
|
572
572
|
drillFilters: n,
|
|
573
573
|
expressionSql: r,
|
|
574
574
|
isSingleValueChart: i,
|
|
575
575
|
value: a
|
|
576
|
-
}),
|
|
577
|
-
let i =
|
|
576
|
+
}), gn = ({ query: e, limit: t, offset: n, dbName: r }) => {
|
|
577
|
+
let i = Ne === r?.toLowerCase(), a = [He, Ae].includes(r?.toLowerCase() || ""), o = ie === r?.toLowerCase(), s = (e) => n ? `OFFSET ${n} LIMIT ${e}` : `LIMIT ${e}`, c = vt(e), l = (c?.toLowerCase() ?? "").includes("order"), u = parseInt(t, 10);
|
|
578
578
|
if (c?.toLowerCase().includes("limit")) {
|
|
579
579
|
let e = parseInt(c?.toLowerCase().split("limit")?.[1]?.trim() ?? "0", 10), r = n ? t : Math.min(e, u);
|
|
580
580
|
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}` : ""}`));
|
|
581
581
|
} 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}` : ""}`);
|
|
582
582
|
return c;
|
|
583
|
-
},
|
|
583
|
+
}, _n = (e) => {
|
|
584
584
|
try {
|
|
585
585
|
return JSON.stringify(e);
|
|
586
586
|
} catch {
|
|
587
587
|
return String(Date.now()) + ":" + Math.random().toString(36).slice(2);
|
|
588
588
|
}
|
|
589
|
-
},
|
|
589
|
+
}, vn = (e, t) => {
|
|
590
590
|
let n = t?.data, r = typeof t?.totalRecords == "number" ? t.totalRecords : 0, i = n && Array.isArray(n) && n.length ? n : [];
|
|
591
591
|
e.forEach((e) => {
|
|
592
592
|
e.setTotalRecords?.(r), e.setData(i), e.setLoading(!1);
|
|
593
593
|
});
|
|
594
|
-
},
|
|
594
|
+
}, yn = (e) => {
|
|
595
595
|
e.forEach((e) => {
|
|
596
596
|
e.onError?.(), e.setData([]), e.setLoading(!1), e.setTotalRecords?.(0);
|
|
597
597
|
});
|
|
598
|
-
},
|
|
599
|
-
let { mutateAsync:
|
|
598
|
+
}, bn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i, query: a, companyId: o, workspaceId: s, metricId: c, dashboardId: l, token: u, isFrontendApp: d, encryptedClientId: f, globalFilters: p, isAllClient: m, rlsConditions: ee, dataMartRelationships: h, customSql: g, isEnableCustomSQL: te, drillFilters: _ }) => {
|
|
599
|
+
let { mutateAsync: ne } = v(), { data: y } = tn(s, void 0, d, f), b = y?.weekStartDay === "sunday" ? "sunday" : "monday", x = I(/* @__PURE__ */ new Map()), S = I({
|
|
600
600
|
token: u,
|
|
601
601
|
epoch: 0
|
|
602
602
|
});
|
|
603
|
-
|
|
603
|
+
S.current.token !== u && (S.current = {
|
|
604
604
|
token: u,
|
|
605
|
-
epoch:
|
|
605
|
+
epoch: S.current.epoch + 1
|
|
606
606
|
});
|
|
607
|
-
let
|
|
608
|
-
return
|
|
609
|
-
let e =
|
|
607
|
+
let C = S.current.epoch;
|
|
608
|
+
return P(() => {
|
|
609
|
+
let e = x.current;
|
|
610
610
|
return () => {
|
|
611
611
|
e.clear();
|
|
612
612
|
};
|
|
613
|
-
}, []), { getUnderlyingData:
|
|
614
|
-
let
|
|
613
|
+
}, []), { getUnderlyingData: N(({ columnName: v, dataType: y, expressionSql: S, value: re, setData: w, setLoading: ie, isSingleValueChart: T, clientColumnType: ae, limit: oe, offset: se, search: E, searchColumns: ce, setTotalRecords: le, pointFilters: ue, onError: de, withoutFilters: fe }) => {
|
|
614
|
+
let pe = r === "MULTI_DATABASE" && t || "", me = te && g ? g : oe !== void 0 || se !== void 0 ? a : gn({
|
|
615
615
|
query: a,
|
|
616
616
|
limit: "5000",
|
|
617
617
|
dbName: n
|
|
618
|
-
}),
|
|
618
|
+
}), he = fe ? {
|
|
619
619
|
...p,
|
|
620
620
|
filters: p.filters.filter((e) => e.isVariableFilter)
|
|
621
|
-
} : p,
|
|
622
|
-
clientColumnType:
|
|
623
|
-
query:
|
|
621
|
+
} : p, ge = ee, _e = Xe({
|
|
622
|
+
clientColumnType: ae,
|
|
623
|
+
query: me || "",
|
|
624
624
|
dbName: n,
|
|
625
|
-
rlsConditions:
|
|
625
|
+
rlsConditions: ge,
|
|
626
626
|
tenancyLevel: r || "TABLE",
|
|
627
627
|
clientId: t,
|
|
628
|
-
globalFilters:
|
|
628
|
+
globalFilters: he,
|
|
629
629
|
values: i,
|
|
630
630
|
isAllClient: m,
|
|
631
|
-
dataMartRelationships:
|
|
632
|
-
weekStartDay:
|
|
633
|
-
}),
|
|
634
|
-
columnName:
|
|
635
|
-
dataType:
|
|
636
|
-
drillFilters:
|
|
637
|
-
expressionSql:
|
|
638
|
-
isSingleValueChart:
|
|
639
|
-
value:
|
|
640
|
-
}) : [],
|
|
641
|
-
columnName:
|
|
631
|
+
dataMartRelationships: h,
|
|
632
|
+
weekStartDay: b
|
|
633
|
+
}), ve = T && !te ? st(_e) : _e, ye = fn(_, ue) ? mn({
|
|
634
|
+
columnName: v,
|
|
635
|
+
dataType: y,
|
|
636
|
+
drillFilters: ue?.length ? [..._ ?? [], ...ue] : _,
|
|
637
|
+
expressionSql: S,
|
|
638
|
+
isSingleValueChart: T,
|
|
639
|
+
value: re
|
|
640
|
+
}) : [], D = {
|
|
641
|
+
columnName: T ? void 0 : v,
|
|
642
642
|
companyId: o,
|
|
643
|
-
query:
|
|
644
|
-
dataType:
|
|
645
|
-
expressionSql:
|
|
646
|
-
value:
|
|
647
|
-
drillFilters:
|
|
643
|
+
query: M(ve, o),
|
|
644
|
+
dataType: T ? void 0 : y,
|
|
645
|
+
expressionSql: T ? void 0 : S,
|
|
646
|
+
value: T ? void 0 : dn(re),
|
|
647
|
+
drillFilters: ye.length ? ye : void 0,
|
|
648
648
|
workspaceId: s,
|
|
649
649
|
metricId: c,
|
|
650
650
|
dashboardId: l,
|
|
651
|
-
isCustomSql:
|
|
652
|
-
databaseName:
|
|
651
|
+
isCustomSql: te && !!g,
|
|
652
|
+
databaseName: pe,
|
|
653
653
|
datasourceId: e,
|
|
654
|
-
limit:
|
|
655
|
-
offset:
|
|
656
|
-
search:
|
|
657
|
-
searchColumns:
|
|
658
|
-
globalFilters:
|
|
659
|
-
rlsConditions:
|
|
654
|
+
limit: oe,
|
|
655
|
+
offset: se,
|
|
656
|
+
search: E,
|
|
657
|
+
searchColumns: ce,
|
|
658
|
+
globalFilters: he,
|
|
659
|
+
rlsConditions: ge,
|
|
660
660
|
filterValues: i,
|
|
661
|
-
isSingleValueChart:
|
|
661
|
+
isSingleValueChart: T && !te
|
|
662
662
|
};
|
|
663
|
-
|
|
664
|
-
let
|
|
665
|
-
columnName:
|
|
666
|
-
value:
|
|
667
|
-
dataType:
|
|
668
|
-
expressionSql:
|
|
669
|
-
drillFilters:
|
|
670
|
-
limit:
|
|
671
|
-
offset:
|
|
672
|
-
search:
|
|
673
|
-
searchColumns:
|
|
674
|
-
finalQuery:
|
|
675
|
-
companyId:
|
|
676
|
-
workspaceId:
|
|
677
|
-
metricId:
|
|
678
|
-
dashboardId:
|
|
679
|
-
datasourceId:
|
|
680
|
-
databaseName:
|
|
681
|
-
isCustomSql:
|
|
682
|
-
isSingleValueChart:
|
|
683
|
-
principal: `${+!!d}|${f || ""}|${
|
|
684
|
-
}),
|
|
685
|
-
setData:
|
|
686
|
-
setLoading:
|
|
687
|
-
setTotalRecords:
|
|
688
|
-
onError:
|
|
689
|
-
},
|
|
690
|
-
if (
|
|
691
|
-
|
|
663
|
+
w([]), ie(!0);
|
|
664
|
+
let O = _n({
|
|
665
|
+
columnName: D.columnName,
|
|
666
|
+
value: D.value,
|
|
667
|
+
dataType: D.dataType,
|
|
668
|
+
expressionSql: D.expressionSql,
|
|
669
|
+
drillFilters: D.drillFilters,
|
|
670
|
+
limit: D.limit,
|
|
671
|
+
offset: D.offset,
|
|
672
|
+
search: D.search,
|
|
673
|
+
searchColumns: D.searchColumns,
|
|
674
|
+
finalQuery: ve,
|
|
675
|
+
companyId: D.companyId,
|
|
676
|
+
workspaceId: D.workspaceId,
|
|
677
|
+
metricId: D.metricId,
|
|
678
|
+
dashboardId: D.dashboardId,
|
|
679
|
+
datasourceId: D.datasourceId,
|
|
680
|
+
databaseName: D.databaseName,
|
|
681
|
+
isCustomSql: D.isCustomSql,
|
|
682
|
+
isSingleValueChart: T,
|
|
683
|
+
principal: `${+!!d}|${f || ""}|${C}`
|
|
684
|
+
}), k = {
|
|
685
|
+
setData: w,
|
|
686
|
+
setLoading: ie,
|
|
687
|
+
setTotalRecords: le,
|
|
688
|
+
onError: de
|
|
689
|
+
}, be = x.current.get(O);
|
|
690
|
+
if (be) {
|
|
691
|
+
be.subscribers.add(k);
|
|
692
692
|
return;
|
|
693
693
|
}
|
|
694
|
-
let
|
|
695
|
-
|
|
696
|
-
data:
|
|
694
|
+
let A = /* @__PURE__ */ new Set([k]);
|
|
695
|
+
x.current.set(O, { subscribers: A }), ne({
|
|
696
|
+
data: D,
|
|
697
697
|
token: u || "",
|
|
698
698
|
isFrontendApp: d,
|
|
699
699
|
encryptedClientId: d && f || ""
|
|
700
700
|
}).then((e) => {
|
|
701
|
-
let t =
|
|
702
|
-
|
|
701
|
+
let t = x.current.get(O);
|
|
702
|
+
x.current.delete(O), vn(t?.subscribers ?? A, e);
|
|
703
703
|
}).catch(() => {
|
|
704
|
-
let e =
|
|
705
|
-
|
|
704
|
+
let e = x.current.get(O);
|
|
705
|
+
x.current.delete(O), yn(e?.subscribers ?? A);
|
|
706
706
|
});
|
|
707
707
|
}, [
|
|
708
708
|
t,
|
|
709
709
|
o,
|
|
710
|
-
_,
|
|
711
710
|
g,
|
|
711
|
+
h,
|
|
712
712
|
e,
|
|
713
713
|
n,
|
|
714
|
-
|
|
714
|
+
_,
|
|
715
715
|
p,
|
|
716
716
|
m,
|
|
717
|
-
|
|
717
|
+
te,
|
|
718
718
|
c,
|
|
719
719
|
l,
|
|
720
720
|
u,
|
|
721
721
|
d,
|
|
722
722
|
f,
|
|
723
|
-
|
|
723
|
+
C,
|
|
724
724
|
a,
|
|
725
|
-
|
|
725
|
+
ee,
|
|
726
726
|
r,
|
|
727
|
-
|
|
727
|
+
ne,
|
|
728
728
|
i,
|
|
729
|
-
|
|
729
|
+
b,
|
|
730
730
|
s
|
|
731
731
|
]) };
|
|
732
|
-
},
|
|
732
|
+
}, xn = [
|
|
733
733
|
"backend-cap",
|
|
734
734
|
"metric-limit",
|
|
735
735
|
"client-window",
|
|
736
736
|
"chart-coverage"
|
|
737
|
-
],
|
|
738
|
-
let t = e[0], n =
|
|
737
|
+
], Sn = (e) => typeof e == "string" && xn.includes(e), U = (e) => typeof e == "number" && Number.isFinite(e) && e >= 0, W = (e) => e.of === null ? Infinity : Math.max(0, e.of - e.at), Cn = (e) => {
|
|
738
|
+
let t = e[0], n = W(t);
|
|
739
739
|
for (let r = 1; r < e.length; r += 1) {
|
|
740
|
-
let i =
|
|
740
|
+
let i = W(e[r]);
|
|
741
741
|
i > n && (t = e[r], n = i);
|
|
742
742
|
}
|
|
743
743
|
return {
|
|
@@ -746,11 +746,11 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
|
|
|
746
746
|
by: t.by,
|
|
747
747
|
stages: e
|
|
748
748
|
};
|
|
749
|
-
},
|
|
749
|
+
}, wn = (e) => ({
|
|
750
750
|
rows: e,
|
|
751
751
|
truncated: null
|
|
752
752
|
});
|
|
753
|
-
function
|
|
753
|
+
function Tn(e, t, n) {
|
|
754
754
|
let r = e.rows.length, i = n.length;
|
|
755
755
|
if (i >= r) return e;
|
|
756
756
|
let a = {
|
|
@@ -760,42 +760,42 @@ function Sn(e, t, n) {
|
|
|
760
760
|
};
|
|
761
761
|
return {
|
|
762
762
|
rows: n,
|
|
763
|
-
truncated:
|
|
763
|
+
truncated: Cn(e.truncated ? [...e.truncated.stages, a] : [a])
|
|
764
764
|
};
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function En(e, t) {
|
|
767
767
|
if (!e || typeof e != "object") return null;
|
|
768
768
|
let n = e, r = Array.isArray(n.stages) ? n.stages : [], i = [];
|
|
769
769
|
for (let e of r) {
|
|
770
770
|
if (!e || typeof e != "object") continue;
|
|
771
771
|
let { by: t, at: n, of: r } = e;
|
|
772
|
-
|
|
772
|
+
Sn(t) && U(n) && i.push({
|
|
773
773
|
by: t,
|
|
774
774
|
at: n,
|
|
775
|
-
of:
|
|
775
|
+
of: U(r) ? r : null
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
778
|
if (!i.length) {
|
|
779
|
-
if (!
|
|
779
|
+
if (!Sn(n.by) || !U(n.at)) return null;
|
|
780
780
|
i.push({
|
|
781
781
|
by: n.by,
|
|
782
782
|
at: n.at,
|
|
783
|
-
of:
|
|
783
|
+
of: U(n.of) ? n.of : null
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
|
-
if (
|
|
786
|
+
if (U(t)) {
|
|
787
787
|
let e = i[i.length - 1];
|
|
788
788
|
e.at !== t && (i[i.length - 1] = {
|
|
789
789
|
...e,
|
|
790
790
|
at: t
|
|
791
791
|
});
|
|
792
792
|
}
|
|
793
|
-
return
|
|
793
|
+
return Cn(i);
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function Dn(e, t = (e) => e.toLocaleString()) {
|
|
796
796
|
return e ? e.of === null ? `Displaying the first ${t(e.at)} rows` : `Displaying ${t(e.at)} of ${t(e.of)}` : null;
|
|
797
797
|
}
|
|
798
|
-
var
|
|
798
|
+
var G = {
|
|
799
799
|
timeSeriesSettingsContainer: "_timeSeriesSettingsContainer_dnv9l_8",
|
|
800
800
|
timeSeriesSettingsType: "_timeSeriesSettingsType_dnv9l_12",
|
|
801
801
|
featToggle: "_featToggle_dnv9l_16",
|
|
@@ -803,7 +803,7 @@ var Tn = {
|
|
|
803
803
|
dynamicFormat: "_dynamicFormat_dnv9l_24",
|
|
804
804
|
wrapper: "_wrapper_dnv9l_27",
|
|
805
805
|
inputWrapper: "_inputWrapper_dnv9l_30"
|
|
806
|
-
},
|
|
806
|
+
}, On = [
|
|
807
807
|
{
|
|
808
808
|
value: "line",
|
|
809
809
|
label: "line"
|
|
@@ -824,7 +824,7 @@ var Tn = {
|
|
|
824
824
|
value: "combo",
|
|
825
825
|
label: "combo"
|
|
826
826
|
}
|
|
827
|
-
],
|
|
827
|
+
], K = [
|
|
828
828
|
{
|
|
829
829
|
value: "Daily",
|
|
830
830
|
label: "Daily"
|
|
@@ -845,7 +845,7 @@ var Tn = {
|
|
|
845
845
|
value: "Yearly",
|
|
846
846
|
label: "Yearly"
|
|
847
847
|
}
|
|
848
|
-
],
|
|
848
|
+
], kn = ({ onChange: e, settings: { groupBySettings: t, seriesType: n }, yAxisList: r, onChangeTimeseriesFormat: i, globalFilterOptions: a }) => {
|
|
849
849
|
let o = (n, r) => {
|
|
850
850
|
if (t?.options?.[n]?.split("____").length) {
|
|
851
851
|
let i = `${t?.options?.[n]?.split("____")?.[0]}____${r}`, a = `${t?.options?.[n]?.split("____")?.[0]}`;
|
|
@@ -869,16 +869,16 @@ var Tn = {
|
|
|
869
869
|
}));
|
|
870
870
|
}
|
|
871
871
|
};
|
|
872
|
-
return /* @__PURE__ */ (0,
|
|
873
|
-
className:
|
|
872
|
+
return /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
873
|
+
className: G.timeSeriesSettingsContainer,
|
|
874
874
|
children: [
|
|
875
|
-
/* @__PURE__ */ (0,
|
|
875
|
+
/* @__PURE__ */ (0, R.jsx)(fe, {
|
|
876
876
|
variant: "heading-5",
|
|
877
877
|
children: "Time Series Settings"
|
|
878
878
|
}),
|
|
879
|
-
/* @__PURE__ */ (0,
|
|
879
|
+
/* @__PURE__ */ (0, R.jsx)(k, {
|
|
880
880
|
label: "Series Type",
|
|
881
|
-
options:
|
|
881
|
+
options: On,
|
|
882
882
|
selectedOption: {
|
|
883
883
|
value: n?.[0]?.type || "bar",
|
|
884
884
|
label: n?.[0]?.type || "bar"
|
|
@@ -895,14 +895,14 @@ var Tn = {
|
|
|
895
895
|
menuWidth: "100%",
|
|
896
896
|
buttonWidth: "100%"
|
|
897
897
|
}),
|
|
898
|
-
/* @__PURE__ */ (0,
|
|
898
|
+
/* @__PURE__ */ (0, R.jsx)(fe, {
|
|
899
899
|
variant: "body-text-2",
|
|
900
900
|
children: "Group format"
|
|
901
901
|
}),
|
|
902
|
-
/* @__PURE__ */ (0,
|
|
903
|
-
className:
|
|
902
|
+
/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
903
|
+
className: G.timeSeriesSettingsType,
|
|
904
904
|
children: [
|
|
905
|
-
/* @__PURE__ */ (0,
|
|
905
|
+
/* @__PURE__ */ (0, R.jsx)(ut, {
|
|
906
906
|
"data-testid": "group-default",
|
|
907
907
|
id: "group-default",
|
|
908
908
|
type: "radio",
|
|
@@ -914,21 +914,21 @@ var Tn = {
|
|
|
914
914
|
...e.groupBySettings,
|
|
915
915
|
value: "monthly",
|
|
916
916
|
isDynamic: !1,
|
|
917
|
-
options:
|
|
917
|
+
options: K?.map((e) => e.value),
|
|
918
918
|
isGlobalFilter: !1,
|
|
919
919
|
globalFilterOption: {
|
|
920
920
|
label: "",
|
|
921
921
|
value: ""
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
|
-
})), i?.(
|
|
924
|
+
})), i?.(K?.[2]));
|
|
925
925
|
},
|
|
926
926
|
name: "isDynamic",
|
|
927
927
|
label: "Default",
|
|
928
928
|
defaultChecked: !t.isDynamic && !t.isGlobalFilter,
|
|
929
929
|
checked: !t.isDynamic && !t.isGlobalFilter
|
|
930
930
|
}),
|
|
931
|
-
/* @__PURE__ */ (0,
|
|
931
|
+
/* @__PURE__ */ (0, R.jsx)(ut, {
|
|
932
932
|
"data-testid": "group-dynamic",
|
|
933
933
|
id: "group-dynamic",
|
|
934
934
|
type: "radio",
|
|
@@ -944,7 +944,7 @@ var Tn = {
|
|
|
944
944
|
...e.groupBySettings,
|
|
945
945
|
value: "monthly",
|
|
946
946
|
isDynamic: !0,
|
|
947
|
-
options:
|
|
947
|
+
options: K?.map((e) => e.value),
|
|
948
948
|
fillXAxis: !1,
|
|
949
949
|
isGlobalFilter: !1,
|
|
950
950
|
globalFilterOption: {
|
|
@@ -952,10 +952,10 @@ var Tn = {
|
|
|
952
952
|
value: ""
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
|
-
})), i?.(
|
|
955
|
+
})), i?.(K?.[2]));
|
|
956
956
|
}
|
|
957
957
|
}),
|
|
958
|
-
/* @__PURE__ */ (0,
|
|
958
|
+
/* @__PURE__ */ (0, R.jsx)(ut, {
|
|
959
959
|
"data-testid": "group-global-filters",
|
|
960
960
|
id: "group-global-filters",
|
|
961
961
|
type: "radio",
|
|
@@ -971,7 +971,7 @@ var Tn = {
|
|
|
971
971
|
...e.groupBySettings,
|
|
972
972
|
value: "daily",
|
|
973
973
|
isDynamic: !1,
|
|
974
|
-
options:
|
|
974
|
+
options: K?.map((e) => e.value),
|
|
975
975
|
fillXAxis: !1,
|
|
976
976
|
isGlobalFilter: !0,
|
|
977
977
|
globalFilterOption: {
|
|
@@ -979,17 +979,17 @@ var Tn = {
|
|
|
979
979
|
value: ""
|
|
980
980
|
}
|
|
981
981
|
}
|
|
982
|
-
})), i?.(
|
|
982
|
+
})), i?.(K?.[0]));
|
|
983
983
|
}
|
|
984
984
|
})
|
|
985
985
|
]
|
|
986
986
|
}),
|
|
987
|
-
t.isDynamic ? /* @__PURE__ */ (0,
|
|
988
|
-
className:
|
|
989
|
-
children: [/* @__PURE__ */ (0,
|
|
987
|
+
t.isDynamic ? /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
988
|
+
className: G.dynamicFormat,
|
|
989
|
+
children: [/* @__PURE__ */ (0, R.jsx)(T, {
|
|
990
990
|
buttonWidth: "100%",
|
|
991
991
|
menuWidth: "100%",
|
|
992
|
-
options:
|
|
992
|
+
options: K,
|
|
993
993
|
selectedOption: t.options?.map((e) => e.split("____").length ? {
|
|
994
994
|
value: e.split("____")[0],
|
|
995
995
|
label: e.split("____")[0]
|
|
@@ -1006,15 +1006,15 @@ var Tn = {
|
|
|
1006
1006
|
value: Array.isArray(t) && t.length ? t[0].value : "monthly",
|
|
1007
1007
|
options: t?.map((e) => e.value) || ["monthly"],
|
|
1008
1008
|
fillXAxis: ![
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1009
|
+
Qe.daily,
|
|
1010
|
+
Qe.weekly,
|
|
1011
|
+
Qe.yearly
|
|
1012
1012
|
].includes(Array.isArray(t) && t.length ? t[0].value : "monthly") && e.groupBySettings.fillXAxis
|
|
1013
1013
|
}
|
|
1014
|
-
})), i?.(t?.[0] ||
|
|
1014
|
+
})), i?.(t?.[0] || K?.[2]);
|
|
1015
1015
|
},
|
|
1016
1016
|
isShowSelectedOptions: !0
|
|
1017
|
-
}), t.options?.map((e, t) => /* @__PURE__ */ (0,
|
|
1017
|
+
}), t.options?.map((e, t) => /* @__PURE__ */ (0, R.jsx)(se, {
|
|
1018
1018
|
label: e.split("____").length > 1 ? e.split("____")[0] : e,
|
|
1019
1019
|
type: "text",
|
|
1020
1020
|
value: e.split("____").length > 1 ? e.split("____")[1] : e,
|
|
@@ -1023,8 +1023,8 @@ var Tn = {
|
|
|
1023
1023
|
o(t, e.target.value);
|
|
1024
1024
|
}
|
|
1025
1025
|
}))]
|
|
1026
|
-
}) : /* @__PURE__ */ (0,
|
|
1027
|
-
t?.isGlobalFilter && /* @__PURE__ */ (0,
|
|
1026
|
+
}) : /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [
|
|
1027
|
+
t?.isGlobalFilter && /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(k, {
|
|
1028
1028
|
label: "Dashboard Filter",
|
|
1029
1029
|
menuWidth: "100%",
|
|
1030
1030
|
buttonWidth: "100%",
|
|
@@ -1043,14 +1043,14 @@ var Tn = {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
}));
|
|
1045
1045
|
}
|
|
1046
|
-
}), !!t?.globalFilterOption?.presetDateOptions?.length && /* @__PURE__ */ (0,
|
|
1046
|
+
}), !!t?.globalFilterOption?.presetDateOptions?.length && /* @__PURE__ */ (0, R.jsx)(j, {
|
|
1047
1047
|
direction: "col",
|
|
1048
1048
|
className: "dbn:gap-3",
|
|
1049
|
-
children:
|
|
1049
|
+
children: K?.map((n) => /* @__PURE__ */ (0, R.jsxs)(j, {
|
|
1050
1050
|
className: "dbn:w-full dbn:gap-2",
|
|
1051
1051
|
alignItems: "center",
|
|
1052
1052
|
justify: "between",
|
|
1053
|
-
children: [/* @__PURE__ */ (0,
|
|
1053
|
+
children: [/* @__PURE__ */ (0, R.jsx)(Je, {
|
|
1054
1054
|
checked: !!t?.formatWithValue?.find((e) => e.format === n.value && e.isEnable),
|
|
1055
1055
|
onChange: ({ target: { checked: t } }) => {
|
|
1056
1056
|
e((e) => ({
|
|
@@ -1066,9 +1066,9 @@ var Tn = {
|
|
|
1066
1066
|
}));
|
|
1067
1067
|
},
|
|
1068
1068
|
label: n.value
|
|
1069
|
-
}), /* @__PURE__ */ (0,
|
|
1069
|
+
}), /* @__PURE__ */ (0, R.jsx)("div", {
|
|
1070
1070
|
className: "dbn:w-full",
|
|
1071
|
-
children: /* @__PURE__ */ (0,
|
|
1071
|
+
children: /* @__PURE__ */ (0, R.jsx)(k, {
|
|
1072
1072
|
placeholder: "Select a Filter Value",
|
|
1073
1073
|
menuWidth: "100%",
|
|
1074
1074
|
buttonWidth: "100%",
|
|
@@ -1095,12 +1095,12 @@ var Tn = {
|
|
|
1095
1095
|
})]
|
|
1096
1096
|
}))
|
|
1097
1097
|
})] }),
|
|
1098
|
-
/* @__PURE__ */ (0,
|
|
1098
|
+
/* @__PURE__ */ (0, R.jsx)(k, {
|
|
1099
1099
|
label: "Format Type",
|
|
1100
1100
|
menuWidth: "100%",
|
|
1101
1101
|
buttonWidth: "100%",
|
|
1102
|
-
options:
|
|
1103
|
-
selectedOption:
|
|
1102
|
+
options: K,
|
|
1103
|
+
selectedOption: K?.find((e) => e.value?.toLowerCase() === t?.value?.toLowerCase()) || K?.[2],
|
|
1104
1104
|
onChange: (t) => {
|
|
1105
1105
|
e((e) => ({
|
|
1106
1106
|
...e,
|
|
@@ -1111,9 +1111,9 @@ var Tn = {
|
|
|
1111
1111
|
})), i?.(t);
|
|
1112
1112
|
}
|
|
1113
1113
|
}),
|
|
1114
|
-
[
|
|
1115
|
-
className:
|
|
1116
|
-
children: [/* @__PURE__ */ (0,
|
|
1114
|
+
[Qe.month, Qe.quarter].includes(t?.value?.toLowerCase()) && /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
1115
|
+
className: G.featToggle,
|
|
1116
|
+
children: [/* @__PURE__ */ (0, R.jsx)(pt, {
|
|
1117
1117
|
name: "fill axis",
|
|
1118
1118
|
enabled: t.fillXAxis,
|
|
1119
1119
|
onChange: () => e((e) => ({
|
|
@@ -1123,12 +1123,12 @@ var Tn = {
|
|
|
1123
1123
|
fillXAxis: !e.groupBySettings.fillXAxis
|
|
1124
1124
|
}
|
|
1125
1125
|
}))
|
|
1126
|
-
}), /* @__PURE__ */ (0,
|
|
1126
|
+
}), /* @__PURE__ */ (0, R.jsxs)("span", {
|
|
1127
1127
|
className: "dbn:flex dbn:gap-2 dbn:items-center",
|
|
1128
|
-
children: [/* @__PURE__ */ (0,
|
|
1128
|
+
children: [/* @__PURE__ */ (0, R.jsx)(fe, {
|
|
1129
1129
|
variant: "body-text-2",
|
|
1130
1130
|
children: "Fill X-axis"
|
|
1131
|
-
}), /* @__PURE__ */ (0,
|
|
1131
|
+
}), /* @__PURE__ */ (0, R.jsx)(_e, {
|
|
1132
1132
|
position: "top",
|
|
1133
1133
|
iconConfig: {
|
|
1134
1134
|
size: "xs",
|
|
@@ -1142,15 +1142,15 @@ var Tn = {
|
|
|
1142
1142
|
] })
|
|
1143
1143
|
]
|
|
1144
1144
|
});
|
|
1145
|
-
},
|
|
1145
|
+
}, An = [
|
|
1146
1146
|
"dashboardId",
|
|
1147
1147
|
"configId",
|
|
1148
1148
|
"embed",
|
|
1149
1149
|
"isDbn"
|
|
1150
|
-
],
|
|
1150
|
+
], jn = (e) => `dbn.${e}.`, Mn = "drill.", Nn = (e) => {
|
|
1151
1151
|
let t = encodeURIComponent(e.levelIndex);
|
|
1152
1152
|
return e.filters?.length ? `${t}~${e.filters.map((e) => `${encodeURIComponent(e.columnName)}:${encodeURIComponent(String(e.value ?? ""))}`).join("|")}` : t;
|
|
1153
|
-
},
|
|
1153
|
+
}, Pn = (e) => {
|
|
1154
1154
|
if (!e) return null;
|
|
1155
1155
|
let t = e.indexOf("~"), n = t === -1 ? e : e.slice(0, t), r = decodeURIComponent(n);
|
|
1156
1156
|
return r ? t === -1 ? {
|
|
@@ -1168,18 +1168,18 @@ var Tn = {
|
|
|
1168
1168
|
} : null;
|
|
1169
1169
|
}).filter((e) => e !== null)
|
|
1170
1170
|
} : null;
|
|
1171
|
-
},
|
|
1171
|
+
}, q = (e, t) => {
|
|
1172
1172
|
if (!t) return {};
|
|
1173
|
-
let n = `${
|
|
1173
|
+
let n = `${jn(t)}${Mn}`, r = {};
|
|
1174
1174
|
return new URLSearchParams(e).forEach((e, t) => {
|
|
1175
1175
|
if (!t.startsWith(n)) return;
|
|
1176
|
-
let i = t.slice(n.length), a =
|
|
1176
|
+
let i = t.slice(n.length), a = Pn(e);
|
|
1177
1177
|
i && a && (r[i] = a);
|
|
1178
1178
|
}), r;
|
|
1179
|
-
},
|
|
1179
|
+
}, Fn = ({ currentSearch: e, dashboardId: t, entries: n, legacyGlobals: r = {}, namespaced: i = !0 }) => {
|
|
1180
1180
|
if (!i) {
|
|
1181
1181
|
let e = new URLSearchParams();
|
|
1182
|
-
return
|
|
1182
|
+
return An.forEach((n) => {
|
|
1183
1183
|
let i = r[n];
|
|
1184
1184
|
if (n === "dashboardId") {
|
|
1185
1185
|
e.set(n, t ?? "");
|
|
@@ -1192,7 +1192,7 @@ var Tn = {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
let a = new URLSearchParams(e);
|
|
1194
1194
|
if (!t) return a;
|
|
1195
|
-
let o =
|
|
1195
|
+
let o = jn(t), s = [];
|
|
1196
1196
|
return a.forEach((e, t) => {
|
|
1197
1197
|
t.startsWith(o) && s.push(t);
|
|
1198
1198
|
}), s.forEach((e) => {
|
|
@@ -1200,7 +1200,7 @@ var Tn = {
|
|
|
1200
1200
|
}), n.forEach(({ key: e, value: t }) => {
|
|
1201
1201
|
a.set(`${o}${e}`, t);
|
|
1202
1202
|
}), a;
|
|
1203
|
-
},
|
|
1203
|
+
}, In = (e, t) => {
|
|
1204
1204
|
let n = e?.levels;
|
|
1205
1205
|
if (!e || !n?.length) return null;
|
|
1206
1206
|
let r = n.findIndex((e) => e?.index === t.levelIndex);
|
|
@@ -1216,8 +1216,8 @@ var Tn = {
|
|
|
1216
1216
|
filters: n > r ? [] : e?.filters
|
|
1217
1217
|
})
|
|
1218
1218
|
};
|
|
1219
|
-
},
|
|
1220
|
-
let n = new URLSearchParams(e), r = {}, i = {}, a = t ?
|
|
1219
|
+
}, Ln = (e, t) => {
|
|
1220
|
+
let n = new URLSearchParams(e), r = {}, i = {}, a = t ? jn(t) : null, o = (e, t, n) => {
|
|
1221
1221
|
let r = n.includes(";;") ? n.split(";;") : n, i = e[t];
|
|
1222
1222
|
if (i === void 0) {
|
|
1223
1223
|
e[t] = r;
|
|
@@ -1240,25 +1240,25 @@ var Tn = {
|
|
|
1240
1240
|
};
|
|
1241
1241
|
//#endregion
|
|
1242
1242
|
//#region src/core/metric-builder/crossFilter.ts
|
|
1243
|
-
function
|
|
1243
|
+
function Rn(e, t, n) {
|
|
1244
1244
|
return t === "DATABASE" ? `${n}.${e?.split(".").slice(1).join(".")}` : e;
|
|
1245
1245
|
}
|
|
1246
|
-
var
|
|
1246
|
+
var zn = (e) => {
|
|
1247
1247
|
let t = e?.table?.schemaName, n = e?.table?.tableName;
|
|
1248
1248
|
if (t && n) return `${t}.${n}`;
|
|
1249
|
-
},
|
|
1250
|
-
if (!
|
|
1249
|
+
}, J = (e) => typeof e == "string" && !!e.trim(), Bn = (e, t) => t?.find((t) => t?.alias === e || t?.name === e), Vn = ({ columnName: e, selectedDims: t }) => {
|
|
1250
|
+
if (!J(e)) return;
|
|
1251
1251
|
if (!t?.length) return e;
|
|
1252
|
-
let n =
|
|
1253
|
-
if (n &&
|
|
1254
|
-
},
|
|
1252
|
+
let n = Bn(e, t);
|
|
1253
|
+
if (n && zn(n)) return J(n.name) ? n.name : e;
|
|
1254
|
+
}, Hn = "This filter column is no longer available. Refresh the metric and select a column before filtering.", Un = ({ columnName: e, rowFilters: t, selectedDims: n, requiresSchemaMetadata: r = !1 }) => {
|
|
1255
1255
|
let i = t?.length ? t.map((e) => e.columnName) : e === void 0 ? [] : [e];
|
|
1256
|
-
return i.some((e) => !
|
|
1256
|
+
return i.some((e) => !J(e)) || (t?.length || r) && !n?.length || i.some((e) => !!n?.length && !Vn({
|
|
1257
1257
|
columnName: e,
|
|
1258
1258
|
selectedDims: n
|
|
1259
|
-
})) ?
|
|
1259
|
+
})) ? Hn : void 0;
|
|
1260
1260
|
};
|
|
1261
|
-
function
|
|
1261
|
+
function Y(e) {
|
|
1262
1262
|
let t = e.value === null || e.value === void 0, n = t ? "null" : e.value;
|
|
1263
1263
|
return {
|
|
1264
1264
|
columnName: e.columnName,
|
|
@@ -1266,7 +1266,7 @@ function Vn(e) {
|
|
|
1266
1266
|
isAddOnMetrics: !0,
|
|
1267
1267
|
name: "cross-filter",
|
|
1268
1268
|
options: [n],
|
|
1269
|
-
tableName:
|
|
1269
|
+
tableName: Rn(e.tableName, e.tenancyLevel, e.clientId),
|
|
1270
1270
|
value: [n],
|
|
1271
1271
|
...t ? { filterVariant: {
|
|
1272
1272
|
label: "IN",
|
|
@@ -1274,17 +1274,17 @@ function Vn(e) {
|
|
|
1274
1274
|
} } : {}
|
|
1275
1275
|
};
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1277
|
+
function Wn({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filterValue: i, columnName: a, rowFilters: o, selectedDims: s, activeLevelTableName: c, tenancyLevel: l, clientId: u }) {
|
|
1278
1278
|
if (t || n) return [];
|
|
1279
|
-
let d = i != null &&
|
|
1279
|
+
let d = i != null && J(a);
|
|
1280
1280
|
if (!((d || o?.length) && r)) return [];
|
|
1281
1281
|
if (o?.length) {
|
|
1282
1282
|
let t = o.map((e) => {
|
|
1283
|
-
let t =
|
|
1283
|
+
let t = Vn({
|
|
1284
1284
|
columnName: e?.columnName,
|
|
1285
1285
|
selectedDims: s
|
|
1286
|
-
}), n =
|
|
1287
|
-
if (n && t) return
|
|
1286
|
+
}), n = zn(t ? Bn(e.columnName, s) : void 0);
|
|
1287
|
+
if (n && t) return Y({
|
|
1288
1288
|
columnName: t,
|
|
1289
1289
|
value: e?.value,
|
|
1290
1290
|
tableName: n,
|
|
@@ -1295,11 +1295,11 @@ function Hn({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
|
|
|
1295
1295
|
return [...e || [], ...t];
|
|
1296
1296
|
}
|
|
1297
1297
|
if (d) {
|
|
1298
|
-
let t =
|
|
1298
|
+
let t = Vn({
|
|
1299
1299
|
columnName: a,
|
|
1300
1300
|
selectedDims: s
|
|
1301
1301
|
});
|
|
1302
|
-
return t ? [...e || [],
|
|
1302
|
+
return t ? [...e || [], Y({
|
|
1303
1303
|
columnName: t,
|
|
1304
1304
|
value: i,
|
|
1305
1305
|
tableName: c,
|
|
@@ -1309,42 +1309,42 @@ function Hn({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
|
|
|
1309
1309
|
}
|
|
1310
1310
|
return [];
|
|
1311
1311
|
}
|
|
1312
|
-
var
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1312
|
+
var Gn = /* @__PURE__ */ new Set([
|
|
1313
|
+
E.progressBar,
|
|
1314
|
+
E.progressBarV2,
|
|
1315
|
+
E.linearGauge,
|
|
1316
|
+
E.linearGaugeV2,
|
|
1317
|
+
E.gauge,
|
|
1318
|
+
E.gaugeV2
|
|
1319
1319
|
]);
|
|
1320
|
-
function
|
|
1320
|
+
function Kn({ runtimeEnabled: e, metricEnabled: t }) {
|
|
1321
1321
|
return !!e || !!t;
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1324
|
-
if (e &&
|
|
1323
|
+
function qn({ chartType: e, isDrillEnabled: t, dimensions: n, drilledLevel: r, drillLevels: i }) {
|
|
1324
|
+
if (e && Gn.has(e)) return "terminal";
|
|
1325
1325
|
if (!t || (n?.length ?? 0) === r) return "none";
|
|
1326
1326
|
let a = i || [];
|
|
1327
1327
|
return a[a.length - 1]?.isEnable ? "none" : "drill";
|
|
1328
1328
|
}
|
|
1329
|
-
function
|
|
1330
|
-
return e ===
|
|
1329
|
+
function Jn({ chartType: e, params: t, rowFilters: n, dimensions: r }) {
|
|
1330
|
+
return e === E.table ? {
|
|
1331
1331
|
name: n?.find((e) => r?.some((t) => e?.columnName === t))?.value,
|
|
1332
1332
|
rowFilters: n
|
|
1333
1333
|
} : t;
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1336
|
-
if (!
|
|
1337
|
-
let n =
|
|
1338
|
-
return !!n && !!
|
|
1335
|
+
function X(e, t) {
|
|
1336
|
+
if (!J(e)) return !1;
|
|
1337
|
+
let n = Bn(e, t);
|
|
1338
|
+
return !!n && !!zn(n);
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1341
|
-
if (!
|
|
1342
|
-
let s =
|
|
1340
|
+
function Yn({ existing: e, columnName: t, value: n, mode: r = "only", selectedDims: i, tenancyLevel: a, clientId: o }) {
|
|
1341
|
+
if (!J(t) || n === void 0) return e || [];
|
|
1342
|
+
let s = Bn(t, i), c = Vn({
|
|
1343
1343
|
columnName: t,
|
|
1344
1344
|
selectedDims: i
|
|
1345
|
-
}), l =
|
|
1345
|
+
}), l = zn(s);
|
|
1346
1346
|
if (!l || !c) return e || [];
|
|
1347
|
-
let u =
|
|
1347
|
+
let u = Y({
|
|
1348
1348
|
columnName: c,
|
|
1349
1349
|
value: n,
|
|
1350
1350
|
tableName: l,
|
|
@@ -1361,50 +1361,50 @@ function qn({ existing: e, columnName: t, value: n, mode: r = "only", selectedDi
|
|
|
1361
1361
|
}
|
|
1362
1362
|
//#endregion
|
|
1363
1363
|
//#region src/core/metric-builder/drillPoint.ts
|
|
1364
|
-
var
|
|
1364
|
+
var Xn = "Empty", Zn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !== ""), Qn = (e) => !!e.columnName && Zn(e.value), $n = (e, t) => ({
|
|
1365
1365
|
columnName: e,
|
|
1366
1366
|
value: t,
|
|
1367
1367
|
...t === null ? { operator: "isNull" } : {}
|
|
1368
|
-
}),
|
|
1368
|
+
}), er = (e, t = (e) => e) => {
|
|
1369
1369
|
let n = e?.dimensions || [], r = [], i = [];
|
|
1370
1370
|
return n.forEach((e) => {
|
|
1371
|
-
if (!
|
|
1371
|
+
if (!Qn(e)) {
|
|
1372
1372
|
e.columnName && i.push(e);
|
|
1373
1373
|
return;
|
|
1374
1374
|
}
|
|
1375
|
-
r.push(t(
|
|
1375
|
+
r.push(t($n(e.columnName, e.value)));
|
|
1376
1376
|
}), {
|
|
1377
1377
|
filters: r,
|
|
1378
1378
|
skipped: i
|
|
1379
1379
|
};
|
|
1380
|
-
},
|
|
1380
|
+
}, tr = (e) => (e?.dimensions || []).filter((e) => e.value !== void 0).map((e) => ({
|
|
1381
1381
|
label: e.label || e.columnName,
|
|
1382
1382
|
value: e.formatted ?? (e.value === null ? "Empty" : String(e.value)),
|
|
1383
1383
|
role: e.role
|
|
1384
|
-
})),
|
|
1384
|
+
})), nr = (e) => {
|
|
1385
1385
|
let t = e?.measure;
|
|
1386
1386
|
if (t && t.value !== void 0) return t.formatted ?? String(t.value ?? "Empty");
|
|
1387
1387
|
let n = (e?.dimensions || []).find((e) => e.value !== void 0);
|
|
1388
1388
|
if (n) return n.formatted ?? String(n.value ?? "Empty");
|
|
1389
|
-
},
|
|
1389
|
+
}, rr = (e) => {
|
|
1390
1390
|
if (e !== void 0) return e === null ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : String(e);
|
|
1391
|
-
},
|
|
1392
|
-
let n =
|
|
1391
|
+
}, ir = (e) => e === void 0 ? void 0 : e === null ? Xn : String(e), ar = (e, t) => {
|
|
1392
|
+
let n = ir(e);
|
|
1393
1393
|
if (!t || typeof e != "number") return n;
|
|
1394
1394
|
try {
|
|
1395
1395
|
return t(e) || n;
|
|
1396
1396
|
} catch {
|
|
1397
1397
|
return n;
|
|
1398
1398
|
}
|
|
1399
|
-
},
|
|
1399
|
+
}, or = ({ params: e, axisDimension: t, seriesDimension: n, measure: r, formatMeasure: i }) => {
|
|
1400
1400
|
let a = e?.rowFilters;
|
|
1401
1401
|
if (a?.length) return {
|
|
1402
1402
|
dimensions: a.filter((e) => !!e?.columnName).map((e) => {
|
|
1403
|
-
let t =
|
|
1403
|
+
let t = rr(e.value);
|
|
1404
1404
|
return {
|
|
1405
1405
|
columnName: e.columnName,
|
|
1406
1406
|
value: t,
|
|
1407
|
-
formatted:
|
|
1407
|
+
formatted: ir(t),
|
|
1408
1408
|
role: "row"
|
|
1409
1409
|
};
|
|
1410
1410
|
}),
|
|
@@ -1412,33 +1412,33 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1412
1412
|
};
|
|
1413
1413
|
let o = [];
|
|
1414
1414
|
if (t?.columnName) {
|
|
1415
|
-
let n =
|
|
1415
|
+
let n = rr(e?.name);
|
|
1416
1416
|
o.push({
|
|
1417
1417
|
columnName: t.columnName,
|
|
1418
1418
|
label: t.label,
|
|
1419
1419
|
value: n,
|
|
1420
|
-
formatted:
|
|
1420
|
+
formatted: ir(n),
|
|
1421
1421
|
role: "axis"
|
|
1422
1422
|
});
|
|
1423
1423
|
}
|
|
1424
1424
|
if (n?.columnName) {
|
|
1425
|
-
let t =
|
|
1425
|
+
let t = rr(e?.seriesName);
|
|
1426
1426
|
o.push({
|
|
1427
1427
|
columnName: n.columnName,
|
|
1428
1428
|
label: n.label,
|
|
1429
1429
|
value: t,
|
|
1430
|
-
formatted:
|
|
1430
|
+
formatted: ir(t),
|
|
1431
1431
|
role: "series"
|
|
1432
1432
|
});
|
|
1433
1433
|
}
|
|
1434
|
-
let s =
|
|
1434
|
+
let s = rr(e?.value), c = { dimensions: o }, l = n?.columnName ? r?.columnName : r?.columnName ?? rr(e?.seriesName);
|
|
1435
1435
|
return (s !== void 0 || l) && (c.measure = {
|
|
1436
1436
|
columnName: typeof l == "string" ? l : void 0,
|
|
1437
1437
|
label: r?.label,
|
|
1438
1438
|
value: s,
|
|
1439
|
-
formatted:
|
|
1439
|
+
formatted: ar(s, i)
|
|
1440
1440
|
}), c;
|
|
1441
|
-
},
|
|
1441
|
+
}, sr = [
|
|
1442
1442
|
{
|
|
1443
1443
|
value: "day",
|
|
1444
1444
|
label: "Day"
|
|
@@ -1459,22 +1459,22 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1459
1459
|
value: "year",
|
|
1460
1460
|
label: "Year"
|
|
1461
1461
|
}
|
|
1462
|
-
],
|
|
1462
|
+
], cr = (e, t) => `${t} of ${e}`, lr = (e, t) => {
|
|
1463
1463
|
let n = e?.alias || e?.name || "", r = {
|
|
1464
1464
|
...e,
|
|
1465
1465
|
timeGrain: t,
|
|
1466
|
-
alias:
|
|
1466
|
+
alias: cr(n, t),
|
|
1467
1467
|
label: `${e?.label || n} (by ${t})`,
|
|
1468
1468
|
type: e?.type === "HELPER_FUNCTION" ? "DEFAULT" : e?.type
|
|
1469
1469
|
};
|
|
1470
1470
|
return delete r.helperFunction, delete r.functionConfiguration, r;
|
|
1471
|
-
},
|
|
1471
|
+
}, ur = /* @__PURE__ */ new Set([
|
|
1472
1472
|
"date",
|
|
1473
1473
|
"datetime",
|
|
1474
1474
|
"timestamp",
|
|
1475
1475
|
"timestamptz",
|
|
1476
1476
|
"time"
|
|
1477
|
-
]),
|
|
1477
|
+
]), dr = /* @__PURE__ */ new Set([
|
|
1478
1478
|
"number",
|
|
1479
1479
|
"int",
|
|
1480
1480
|
"integer",
|
|
@@ -1485,24 +1485,24 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1485
1485
|
"decimal",
|
|
1486
1486
|
"numeric",
|
|
1487
1487
|
"real"
|
|
1488
|
-
]),
|
|
1488
|
+
]), fr = /* @__PURE__ */ new Set([
|
|
1489
1489
|
"nullable",
|
|
1490
1490
|
"lowcardinality",
|
|
1491
1491
|
"array"
|
|
1492
|
-
]),
|
|
1492
|
+
]), pr = (e) => {
|
|
1493
1493
|
let t = e;
|
|
1494
1494
|
for (let e = 0; e < 4; e += 1) {
|
|
1495
1495
|
let e = /^([a-z_]+)\((.*)\)$/.exec(t);
|
|
1496
|
-
if (!e || !
|
|
1496
|
+
if (!e || !fr.has(e[1])) break;
|
|
1497
1497
|
t = e[2].trim();
|
|
1498
1498
|
}
|
|
1499
1499
|
return t = t.split("(")[0].trim(), t.split(/\s+/)[0] || "";
|
|
1500
|
-
},
|
|
1500
|
+
}, Z = (e) => {
|
|
1501
1501
|
let t = (e || "").toLowerCase().trim();
|
|
1502
1502
|
if (!t) return "text";
|
|
1503
|
-
let n =
|
|
1504
|
-
return n ?
|
|
1505
|
-
},
|
|
1503
|
+
let n = pr(t);
|
|
1504
|
+
return n ? ur.has(n) ? "date" : dr.has(n) ? "number" : n === "boolean" || n === "bool" ? "boolean" : /^(timestamp|datetime)([_a-z0-9]*)$/.test(n) ? "date" : /^u?int(eger)?[0-9]*$/.test(n) || /^(float|double|real)[0-9]*$/.test(n) || /^(decimal|numeric)[0-9]*$/.test(n) || /^u?(big|small|tiny|medium)int[0-9]*$/.test(n) ? "number" : "text" : "text";
|
|
1505
|
+
}, mr = (e) => {
|
|
1506
1506
|
let t = (e || "").trim(), n = t.lastIndexOf(".");
|
|
1507
1507
|
return n < 0 ? {
|
|
1508
1508
|
schema: "",
|
|
@@ -1511,7 +1511,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1511
1511
|
schema: t.slice(0, n),
|
|
1512
1512
|
name: t.slice(n + 1)
|
|
1513
1513
|
};
|
|
1514
|
-
},
|
|
1514
|
+
}, Q = (e) => (e || "").trim().toLowerCase().replace(/\s+/g, "_"), hr = (e) => {
|
|
1515
1515
|
let t = e?.table;
|
|
1516
1516
|
if (!t?.name) return [];
|
|
1517
1517
|
let n = [{
|
|
@@ -1519,10 +1519,10 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1519
1519
|
alias: t.alias || t.name,
|
|
1520
1520
|
schema: t.schema || "",
|
|
1521
1521
|
isBaseTable: !0
|
|
1522
|
-
}], r = /* @__PURE__ */ new Set([
|
|
1522
|
+
}], r = /* @__PURE__ */ new Set([Q(t.name)]);
|
|
1523
1523
|
return (t.joins || []).forEach((e) => {
|
|
1524
1524
|
if (!e?.name) return;
|
|
1525
|
-
let t =
|
|
1525
|
+
let t = Q(e.name);
|
|
1526
1526
|
r.has(t) || (r.add(t), n.push({
|
|
1527
1527
|
name: e.name,
|
|
1528
1528
|
alias: e.alias || e.name,
|
|
@@ -1530,7 +1530,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1530
1530
|
isBaseTable: !1
|
|
1531
1531
|
}));
|
|
1532
1532
|
}), n;
|
|
1533
|
-
},
|
|
1533
|
+
}, gr = (e, t) => ({
|
|
1534
1534
|
id: "",
|
|
1535
1535
|
columns: (t?.columns || []).map((e) => e?.name || e?.as || "").filter(Boolean),
|
|
1536
1536
|
columnsWithDataType: [],
|
|
@@ -1541,7 +1541,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1541
1541
|
label: t?.label,
|
|
1542
1542
|
clientColumn: t?.clientColumn,
|
|
1543
1543
|
wildcard: t?.wildcard
|
|
1544
|
-
}),
|
|
1544
|
+
}), _r = ({ column: e, reachable: t, subsetTable: n, index: r = 0 }) => {
|
|
1545
1545
|
let i = e?.name || e?.as || "", a = e?.as || e?.name || "";
|
|
1546
1546
|
return {
|
|
1547
1547
|
alias: a,
|
|
@@ -1551,21 +1551,21 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1551
1551
|
datatype: e?.datatype || "",
|
|
1552
1552
|
draggableItemData: {
|
|
1553
1553
|
column: e,
|
|
1554
|
-
table:
|
|
1554
|
+
table: gr(t, n)
|
|
1555
1555
|
},
|
|
1556
1556
|
index: r,
|
|
1557
1557
|
isApplyTimezone: e?.isApplyTimezone,
|
|
1558
1558
|
name: i,
|
|
1559
1559
|
parentAlias: t.alias,
|
|
1560
1560
|
sql: e?.sql || "",
|
|
1561
|
-
table:
|
|
1561
|
+
table: gr(t, n),
|
|
1562
1562
|
transform: e?.transform || "original",
|
|
1563
1563
|
type: e?.isCustomColumn ? "CUSTOM" : "DEFAULT",
|
|
1564
1564
|
allowAggregate: e?.allowAggregate,
|
|
1565
1565
|
defaultAggregation: e?.defaultAggregation,
|
|
1566
1566
|
defaultSort: e?.defaultSort
|
|
1567
1567
|
};
|
|
1568
|
-
},
|
|
1568
|
+
}, vr = ({ subset: e, configuration: t, usedAliases: n = [], currentDepth: r = 0, hasDateLevel: i = !1, isCustomSql: a = !1 }) => {
|
|
1569
1569
|
if (a) return {
|
|
1570
1570
|
groups: [],
|
|
1571
1571
|
unavailableReason: "custom-sql"
|
|
@@ -1579,19 +1579,19 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1579
1579
|
groups: [],
|
|
1580
1580
|
unavailableReason: "no-subset"
|
|
1581
1581
|
};
|
|
1582
|
-
let s =
|
|
1582
|
+
let s = hr(t);
|
|
1583
1583
|
if (!s.length) return {
|
|
1584
1584
|
groups: [],
|
|
1585
1585
|
unavailableReason: "no-reachable-columns"
|
|
1586
1586
|
};
|
|
1587
1587
|
let c = /* @__PURE__ */ new Map();
|
|
1588
1588
|
o.forEach((e) => {
|
|
1589
|
-
let { name: t } =
|
|
1590
|
-
t && c.set(
|
|
1589
|
+
let { name: t } = mr(e?.tableName);
|
|
1590
|
+
t && c.set(Q(t), e), e?.wildcard && c.set(Q(e.wildcard), e);
|
|
1591
1591
|
});
|
|
1592
1592
|
let l = new Set(n.filter(Boolean).map((e) => e.trim().toLowerCase())), u = !1, d = [];
|
|
1593
1593
|
return s.forEach((e) => {
|
|
1594
|
-
let t = c.get(
|
|
1594
|
+
let t = c.get(Q(e.name)), n = t?.columns || [];
|
|
1595
1595
|
if (!n.length) return;
|
|
1596
1596
|
let r = [], a = /* @__PURE__ */ new Set();
|
|
1597
1597
|
n.forEach((n, o) => {
|
|
@@ -1600,13 +1600,13 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1600
1600
|
u = !0;
|
|
1601
1601
|
let c = s.trim().toLowerCase();
|
|
1602
1602
|
if (a.has(c) || (a.add(c), l.has(c))) return;
|
|
1603
|
-
let d =
|
|
1603
|
+
let d = Z(n?.datatype) === "date";
|
|
1604
1604
|
d && i || r.push({
|
|
1605
|
-
key: `${
|
|
1605
|
+
key: `${Q(e.name)}.${c}`,
|
|
1606
1606
|
label: n?.label || s,
|
|
1607
|
-
datatype:
|
|
1607
|
+
datatype: Z(n?.datatype),
|
|
1608
1608
|
isDate: d,
|
|
1609
|
-
column:
|
|
1609
|
+
column: _r({
|
|
1610
1610
|
column: n,
|
|
1611
1611
|
reachable: e,
|
|
1612
1612
|
subsetTable: t,
|
|
@@ -1623,7 +1623,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1623
1623
|
groups: [],
|
|
1624
1624
|
unavailableReason: u ? "all-dimensions-used" : "no-reachable-columns"
|
|
1625
1625
|
};
|
|
1626
|
-
},
|
|
1626
|
+
}, yr = ({ selectedDims: e, usedAliases: t = [] }) => {
|
|
1627
1627
|
let n = new Set(t.filter(Boolean).map((e) => e.trim().toLowerCase())), r = [], i = /* @__PURE__ */ new Set();
|
|
1628
1628
|
return (e || []).forEach((e) => {
|
|
1629
1629
|
let t = e?.alias;
|
|
@@ -1632,8 +1632,8 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1632
1632
|
i.has(a) || (i.add(a), !n.has(a) && r.push({
|
|
1633
1633
|
key: `metric.${a}`,
|
|
1634
1634
|
label: e?.label || t,
|
|
1635
|
-
datatype:
|
|
1636
|
-
isDate:
|
|
1635
|
+
datatype: Z(e?.datatype),
|
|
1636
|
+
isDate: Z(e?.datatype) === "date",
|
|
1637
1637
|
column: e
|
|
1638
1638
|
}));
|
|
1639
1639
|
}), r.length ? { groups: [{
|
|
@@ -1645,7 +1645,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1645
1645
|
groups: [],
|
|
1646
1646
|
unavailableReason: e?.length ? "all-dimensions-used" : "no-reachable-columns"
|
|
1647
1647
|
};
|
|
1648
|
-
},
|
|
1648
|
+
}, br = ({ dimension: e, measures: t, index: n, chartSettings: r, parentFilters: i = [] }) => ({
|
|
1649
1649
|
name: e?.alias || "",
|
|
1650
1650
|
index: n,
|
|
1651
1651
|
isEnable: !0,
|
|
@@ -1656,7 +1656,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1656
1656
|
dimensions: [e],
|
|
1657
1657
|
measures: t || [],
|
|
1658
1658
|
filters: i
|
|
1659
|
-
}),
|
|
1659
|
+
}), xr = ({ selectedDims: e, selectedMetrics: t, chartSettings: n, drilldownChartSettings: r, makeIndex: i }) => (e || []).map((e, a) => {
|
|
1660
1660
|
let o = r?.find((t) => t?.name === e?.alias)?.chartSettings;
|
|
1661
1661
|
return {
|
|
1662
1662
|
name: e?.alias || `Drill Level ${a + 1}`,
|
|
@@ -1667,10 +1667,10 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1667
1667
|
measures: t || [],
|
|
1668
1668
|
filters: []
|
|
1669
1669
|
};
|
|
1670
|
-
}),
|
|
1670
|
+
}), Sr = (e) => (e || []).map((e) => e?.alias || "").filter((e) => !!e), Cr = (e) => e?.value === null ? {
|
|
1671
1671
|
...e,
|
|
1672
1672
|
operator: "isNull"
|
|
1673
|
-
} : e,
|
|
1673
|
+
} : e, wr = ({ config: e, clickedLevelIndex: t, isReset: n, clickedValue: r, rowFilters: i, adhocDescent: a, enrichFilter: o = (e) => e }) => {
|
|
1674
1674
|
let s = e?.levels || [], c = s.find((e) => t ? e?.index === t : e?.isEnable), l = s.findIndex((e) => t ? e?.index === t : e?.isEnable), u = l >= 0 && l < s.length - 1, d = u ? s[l + 1] : s[0], f = c?.dimensions?.[0]?.alias, p = i || [];
|
|
1675
1675
|
if (!c || n) return {
|
|
1676
1676
|
config: {
|
|
@@ -1702,7 +1702,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1702
1702
|
outcome: "jump"
|
|
1703
1703
|
};
|
|
1704
1704
|
if (a) {
|
|
1705
|
-
let t = a.parentFilters || [], n = typeof r == "string" && r.trim() === "", i = r != null && !n && !!a.columnName, l = (e) => e.filter((e) =>
|
|
1705
|
+
let t = a.parentFilters || [], n = typeof r == "string" && r.trim() === "", i = r != null && !n && !!a.columnName, l = (e) => e.filter((e) => Zn(e.value)), u = l(a.pointFilters ?? []), d = l(p.map(Cr).map(o)), f = u.length ? [...t, ...u] : d.length ? [...t, ...d] : i ? [...t, o({
|
|
1706
1706
|
columnName: a.columnName,
|
|
1707
1707
|
value: r
|
|
1708
1708
|
})] : t;
|
|
@@ -1726,7 +1726,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1726
1726
|
...e,
|
|
1727
1727
|
levels: s.map((e) => e?.index === d?.index ? {
|
|
1728
1728
|
...e,
|
|
1729
|
-
filters: u ? [...c?.filters || [], ...p.length ? p.map(
|
|
1729
|
+
filters: u ? [...c?.filters || [], ...p.length ? p.map(Cr).map(o) : [o({
|
|
1730
1730
|
columnName: f,
|
|
1731
1731
|
value: r
|
|
1732
1732
|
})]] : [],
|
|
@@ -1754,22 +1754,22 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
|
|
|
1754
1754
|
},
|
|
1755
1755
|
outcome: "stay"
|
|
1756
1756
|
};
|
|
1757
|
-
},
|
|
1757
|
+
}, Tr = {
|
|
1758
1758
|
"no-subset": "no-subset",
|
|
1759
1759
|
"no-reachable-columns": "no-reachable-columns",
|
|
1760
1760
|
"all-dimensions-used": "all-dimensions-used",
|
|
1761
1761
|
"max-depth-reached": "max-depth-reached",
|
|
1762
1762
|
"custom-sql": "custom-sql"
|
|
1763
|
-
},
|
|
1763
|
+
}, Er = ({ position: e, hasAuthoredNextLevel: t, pool: n, canDrillIntoAnyDimension: r }) => {
|
|
1764
1764
|
if (t) return "underlying-data-not-permitted";
|
|
1765
1765
|
if (r) {
|
|
1766
1766
|
if (n?.groups?.length) return "underlying-data-not-permitted";
|
|
1767
|
-
if (n?.unavailableReason) return
|
|
1767
|
+
if (n?.unavailableReason) return Tr[n.unavailableReason];
|
|
1768
1768
|
if (e.currentDepth >= 3) return "max-depth-reached";
|
|
1769
1769
|
}
|
|
1770
1770
|
return "hierarchy-exhausted";
|
|
1771
1771
|
};
|
|
1772
|
-
function
|
|
1772
|
+
function Dr(e) {
|
|
1773
1773
|
if (e.resultState === "failed") return {
|
|
1774
1774
|
kind: "none",
|
|
1775
1775
|
reason: "query-failed"
|
|
@@ -1788,10 +1788,10 @@ function Er(e) {
|
|
|
1788
1788
|
isOpenInNewTab: t.isOpenInNewTab
|
|
1789
1789
|
} : e.canViewUnderlyingData ? { kind: "viewRecords" } : {
|
|
1790
1790
|
kind: "none",
|
|
1791
|
-
reason:
|
|
1791
|
+
reason: Er(e)
|
|
1792
1792
|
};
|
|
1793
1793
|
}
|
|
1794
|
-
var
|
|
1794
|
+
var Or = {
|
|
1795
1795
|
"hierarchy-exhausted": {
|
|
1796
1796
|
title: "There is nothing further to break this down by",
|
|
1797
1797
|
body: "This is the whole breakdown this chart is set up for."
|
|
@@ -1833,7 +1833,7 @@ var Dr = {
|
|
|
1833
1833
|
body: "Try again, or go back a step."
|
|
1834
1834
|
}
|
|
1835
1835
|
};
|
|
1836
|
-
function
|
|
1836
|
+
function kr(e) {
|
|
1837
1837
|
switch (e.kind) {
|
|
1838
1838
|
case "viewRecords": return {
|
|
1839
1839
|
title: "Look at the rows behind this",
|
|
@@ -1850,27 +1850,27 @@ function Or(e) {
|
|
|
1850
1850
|
body: "Another chart is set up to pick up from what you picked here.",
|
|
1851
1851
|
cta: "Open chart"
|
|
1852
1852
|
};
|
|
1853
|
-
default: return
|
|
1853
|
+
default: return Or[e.reason];
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
1856
|
//#endregion
|
|
1857
1857
|
//#region src/components/MetricList/components/FullScreenView/fullscreenDrillState.ts
|
|
1858
|
-
var
|
|
1858
|
+
var Ar = "__dbnFullscreenDrillState", jr = (e) => typeof e == "object" && !!e, Mr = (e) => Array.isArray(e), Nr = (e, t) => ({
|
|
1859
1859
|
...e,
|
|
1860
1860
|
...t,
|
|
1861
1861
|
metric: {
|
|
1862
1862
|
...e.metric,
|
|
1863
|
-
[
|
|
1863
|
+
[Ar]: t
|
|
1864
1864
|
}
|
|
1865
|
-
}),
|
|
1866
|
-
let n =
|
|
1865
|
+
}), Pr = (e, t = {}) => {
|
|
1866
|
+
let n = jr(e) && jr(e.__dbnFullscreenDrillState) ? e[Ar] : {};
|
|
1867
1867
|
return {
|
|
1868
1868
|
drilledLevel: t.drilledLevel ?? (typeof n.drilledLevel == "number" ? n.drilledLevel : void 0),
|
|
1869
|
-
drillFilters: t.drillFilters ?? (
|
|
1869
|
+
drillFilters: t.drillFilters ?? (Mr(n.drillFilters) ? n.drillFilters : void 0),
|
|
1870
1870
|
drillType: t.drillType ?? (typeof n.drillType == "string" ? n.drillType : void 0),
|
|
1871
|
-
underlyingDataDrillFilters: t.underlyingDataDrillFilters ?? (
|
|
1871
|
+
underlyingDataDrillFilters: t.underlyingDataDrillFilters ?? (Mr(n.underlyingDataDrillFilters) ? n.underlyingDataDrillFilters : void 0)
|
|
1872
1872
|
};
|
|
1873
|
-
},
|
|
1873
|
+
}, Fr = (e, t) => {
|
|
1874
1874
|
if (!e || e.isEnableGroupBy === !1 || t.drilledLevel === void 0 && t.drillFilters === void 0 && t.drillType === void 0 && t.underlyingDataDrillFilters === void 0) return e;
|
|
1875
1875
|
let n = e.configV2?.levels;
|
|
1876
1876
|
if (!n?.length) return t.drillType === void 0 ? e : {
|
|
@@ -1892,15 +1892,15 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
1892
1892
|
}))
|
|
1893
1893
|
}
|
|
1894
1894
|
};
|
|
1895
|
-
},
|
|
1895
|
+
}, Ir = (e, t, n) => n?.length ? {
|
|
1896
1896
|
...e,
|
|
1897
1897
|
[t]: n
|
|
1898
|
-
} : Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)),
|
|
1898
|
+
} : Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)), Lr = ({ metricId: e, filters: t, onChange: n }) => {
|
|
1899
1899
|
e && n?.(e, t);
|
|
1900
|
-
},
|
|
1900
|
+
}, Rr = (e) => e.find(([, e, t]) => !Array.isArray(e) || !t && e.length === 0)?.[0], zr = (e, t) => {
|
|
1901
1901
|
let n = e?.chartType, r = n === "pivotV2" || n === "pivot table 2";
|
|
1902
1902
|
if (!r && n !== "pivotV3" && n !== "pivot table 3") return { renderEmpty: !1 };
|
|
1903
|
-
let i =
|
|
1903
|
+
let i = Rr(r ? [
|
|
1904
1904
|
["chartOptions.pivotTableSettings2.dimensions", e?.pivotTableSettings2?.dimensions],
|
|
1905
1905
|
[
|
|
1906
1906
|
"chartOptions.pivotTableSettings2.headers",
|
|
@@ -1918,7 +1918,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
1918
1918
|
renderEmpty: !0,
|
|
1919
1919
|
missingField: i
|
|
1920
1920
|
};
|
|
1921
|
-
let a = t?.newDatasetSettings, o =
|
|
1921
|
+
let a = t?.newDatasetSettings, o = Rr([
|
|
1922
1922
|
["datasetMetricSettings.newDatasetSettings.selectedDims", a?.selectedDims],
|
|
1923
1923
|
["datasetMetricSettings.newDatasetSettings.selectedMetrics", a?.selectedMetrics],
|
|
1924
1924
|
[
|
|
@@ -1931,28 +1931,28 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
1931
1931
|
renderEmpty: !0,
|
|
1932
1932
|
missingField: o
|
|
1933
1933
|
} : { renderEmpty: !1 };
|
|
1934
|
-
},
|
|
1934
|
+
}, Br = (e, t) => !(!e || e.isLoading !== !0 || e.key !== t || e.data?.data?.length), Vr = ({ clientId: e, guestToken: t, isFrontendApp: n }) => JSON.stringify({
|
|
1935
1935
|
clientId: e,
|
|
1936
1936
|
guestToken: t || "",
|
|
1937
1937
|
isFrontendApp: n
|
|
1938
|
-
}),
|
|
1938
|
+
}), Hr = ({ query: e, clientId: t, isFrontendApp: n }) => JSON.stringify({
|
|
1939
1939
|
query: e,
|
|
1940
1940
|
tenant: {
|
|
1941
1941
|
clientId: t,
|
|
1942
1942
|
isFrontendApp: n
|
|
1943
1943
|
}
|
|
1944
|
-
}),
|
|
1944
|
+
}), Ur = (e, t) => e?.includes(t) ? e : [...e || [], t], Wr = (e, t) => e?.includes(t) ? e.filter((e) => e !== t) : e, Gr = (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), Kr = ({ 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: ee, guestToken: h }) => ({
|
|
1945
1945
|
isAllClient: t,
|
|
1946
1946
|
id: e?.id,
|
|
1947
1947
|
tenancyLevel: n,
|
|
1948
|
-
rlsConditions: [...(r?.length ? r : i) || [], ...o?.tableSettings?.isServerSidePagination && o?.chartType ===
|
|
1948
|
+
rlsConditions: [...(r?.length ? r : i) || [], ...o?.tableSettings?.isServerSidePagination && o?.chartType === E.table ? a.map((e) => e.condition).filter((e) => tt(e)) : []],
|
|
1949
1949
|
globalFilters: s ? void 0 : {
|
|
1950
1950
|
...c,
|
|
1951
1951
|
filters: c?.filters?.filter((e) => Array.isArray(e?.value) ? e?.value?.length : e)
|
|
1952
1952
|
},
|
|
1953
1953
|
filterValues: s ? void 0 : l,
|
|
1954
|
-
limit: o?.tableSettings?.isServerSidePagination && o?.chartType ===
|
|
1955
|
-
offset: o?.tableSettings?.isServerSidePagination && o?.chartType ===
|
|
1954
|
+
limit: o?.tableSettings?.isServerSidePagination && o?.chartType === E.table ? Math.min(u.limit, 1e3) : void 0,
|
|
1955
|
+
offset: o?.tableSettings?.isServerSidePagination && o?.chartType === E.table ? u.offset : void 0,
|
|
1956
1956
|
disableStringify: !0,
|
|
1957
1957
|
pivotHeaders: o?.pivotTableSettings2?.headers || [],
|
|
1958
1958
|
timeseriesSettings: s ? void 0 : {
|
|
@@ -1963,35 +1963,35 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
1963
1963
|
chartSeriesField: o?.seriesField !== "ungrouped" && o?.seriesField && o?.isDynamicSeries ? o?.seriesField : void 0,
|
|
1964
1964
|
comparisonCount: f,
|
|
1965
1965
|
dynamicXAxis: {
|
|
1966
|
-
isEnable: !!(o?.dynamicXAxis?.isEnabled || o?.enduserMeasureAndDimensions?.isEnabled) &&
|
|
1966
|
+
isEnable: !!(o?.dynamicXAxis?.isEnabled || o?.enduserMeasureAndDimensions?.isEnabled) && oe.includes(o?.chartType || ""),
|
|
1967
1967
|
xaxis: o?.xAxis || "",
|
|
1968
1968
|
customField: o?.dynamicXAxis?.selectedOption?.column
|
|
1969
1969
|
},
|
|
1970
1970
|
dbId: p,
|
|
1971
1971
|
elementSettings: e?.elementSettings?.metricExpression,
|
|
1972
1972
|
drillConfig: m,
|
|
1973
|
-
isEncrypted: !(
|
|
1974
|
-
}),
|
|
1973
|
+
isEncrypted: !(ee || !h)
|
|
1974
|
+
}), qr = (e) => {
|
|
1975
1975
|
let t = e.object.customTable?.query;
|
|
1976
1976
|
return e.object.wId ? !t || !t.includes("{{") : !1;
|
|
1977
|
-
},
|
|
1978
|
-
if (!e.customColumnSql) return e.columnName ?
|
|
1979
|
-
},
|
|
1977
|
+
}, Jr = (e, t) => e.customTable ? "" : e.tableName ? M(e.tableName, t) : e.tableName, Yr = (e, t) => {
|
|
1978
|
+
if (!e.customColumnSql) return e.columnName ? M(e.columnName, t) : e.columnName;
|
|
1979
|
+
}, Xr = (e) => {
|
|
1980
1980
|
let { object: t } = e, n = t.wId;
|
|
1981
1981
|
return {
|
|
1982
1982
|
...t,
|
|
1983
|
-
tableName:
|
|
1984
|
-
columnName:
|
|
1985
|
-
filter: t.filter?.length ?
|
|
1983
|
+
tableName: Jr(t, n),
|
|
1984
|
+
columnName: Yr(t, n),
|
|
1985
|
+
filter: t.filter?.length ? w(t.filter, n) : [],
|
|
1986
1986
|
customTable: t.customTable?.query ? {
|
|
1987
|
-
query:
|
|
1988
|
-
alias:
|
|
1987
|
+
query: M(t.customTable.query, n),
|
|
1988
|
+
alias: M(t.customTable.alias, n)
|
|
1989
1989
|
} : t.customTable
|
|
1990
1990
|
};
|
|
1991
|
-
},
|
|
1992
|
-
if (
|
|
1991
|
+
}, Zr = async (e, t, n) => {
|
|
1992
|
+
if (qr(e)) try {
|
|
1993
1993
|
let r = await t({
|
|
1994
|
-
data:
|
|
1994
|
+
data: Xr(e),
|
|
1995
1995
|
encryptedClientId: n.isFrontendApp ? n.encryptedClientId || "" : n.clientId || "",
|
|
1996
1996
|
isFrontendApp: !!n.isFrontendApp,
|
|
1997
1997
|
token: n.token || ""
|
|
@@ -2000,7 +2000,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2000
2000
|
} catch {
|
|
2001
2001
|
return;
|
|
2002
2002
|
}
|
|
2003
|
-
},
|
|
2003
|
+
}, Qr = async ({ entries: e, fetchColumnValues: t, ctx: n, onSeed: r, onResolved: i, onLoading: a, onSettle: o, isCancelled: s }) => {
|
|
2004
2004
|
a(!0);
|
|
2005
2005
|
let c = {};
|
|
2006
2006
|
e?.forEach((e) => {
|
|
@@ -2011,24 +2011,24 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2011
2011
|
if (s()) return;
|
|
2012
2012
|
let o = e[r];
|
|
2013
2013
|
a(!0);
|
|
2014
|
-
let c = await
|
|
2014
|
+
let c = await Zr(o, t, n);
|
|
2015
2015
|
if (s()) return;
|
|
2016
2016
|
c !== void 0 && i(o.element.name, c);
|
|
2017
2017
|
}
|
|
2018
2018
|
} finally {
|
|
2019
2019
|
o();
|
|
2020
2020
|
}
|
|
2021
|
-
},
|
|
2022
|
-
|
|
2023
|
-
},
|
|
2024
|
-
|
|
2025
|
-
t.settledAt !== void 0 && e - t.settledAt >= 3e4 &&
|
|
2026
|
-
}), !(
|
|
2027
|
-
|
|
2021
|
+
}, $r = "Could not generate this metric summary. Try again.", ei = 1500, ti = /* @__PURE__ */ new Map(), ni = (e, t) => {
|
|
2022
|
+
ti.get(e) === t && ti.delete(e), t.abandonTimer && clearTimeout(t.abandonTimer), t.abandonTimer = void 0;
|
|
2023
|
+
}, ri = (e) => {
|
|
2024
|
+
ti.forEach((t, n) => {
|
|
2025
|
+
t.settledAt !== void 0 && e - t.settledAt >= 3e4 && ni(n, t);
|
|
2026
|
+
}), !(ti.size <= 24) && [...ti.entries()].filter(([, e]) => e.settledAt !== void 0).sort(([, e], [, t]) => (e.settledAt ?? 0) - (t.settledAt ?? 0)).slice(0, Math.max(0, ti.size - 24)).forEach(([e, t]) => {
|
|
2027
|
+
ni(e, t);
|
|
2028
2028
|
});
|
|
2029
|
-
},
|
|
2030
|
-
|
|
2031
|
-
let r =
|
|
2029
|
+
}, ii = (e, t, n = Date.now) => {
|
|
2030
|
+
ri(n());
|
|
2031
|
+
let r = ti.get(e);
|
|
2032
2032
|
if (r) r.abandonTimer && (clearTimeout(r.abandonTimer), r.abandonTimer = void 0);
|
|
2033
2033
|
else {
|
|
2034
2034
|
let i = new AbortController(), a = {
|
|
@@ -2037,74 +2037,74 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2037
2037
|
promise: Promise.resolve()
|
|
2038
2038
|
};
|
|
2039
2039
|
a.promise = t(i.signal).then((e) => (a.settledAt = n(), e), (t) => {
|
|
2040
|
-
throw
|
|
2041
|
-
}), a.promise.catch(() => void 0),
|
|
2040
|
+
throw ni(e, a), t;
|
|
2041
|
+
}), a.promise.catch(() => void 0), ti.set(e, a), r = a;
|
|
2042
2042
|
}
|
|
2043
2043
|
let i = r;
|
|
2044
2044
|
i.holders += 1;
|
|
2045
2045
|
let a = !1, o = () => {
|
|
2046
2046
|
a || (a = !0, --i.holders, !(i.holders > 0 || i.settledAt !== void 0) && (i.abandonTimer ||= setTimeout(() => {
|
|
2047
|
-
i.abandonTimer = void 0, !(i.holders > 0) && (i.controller.abort(),
|
|
2048
|
-
},
|
|
2047
|
+
i.abandonTimer = void 0, !(i.holders > 0) && (i.controller.abort(), ni(e, i));
|
|
2048
|
+
}, ei)));
|
|
2049
2049
|
};
|
|
2050
2050
|
return {
|
|
2051
2051
|
promise: i.promise,
|
|
2052
2052
|
release: o,
|
|
2053
2053
|
abort: () => {
|
|
2054
|
-
o(), i.controller.abort(),
|
|
2054
|
+
o(), i.controller.abort(), ni(e, i);
|
|
2055
2055
|
}
|
|
2056
2056
|
};
|
|
2057
|
-
},
|
|
2057
|
+
}, ai = {
|
|
2058
2058
|
status: "idle",
|
|
2059
2059
|
summary: "",
|
|
2060
2060
|
error: "",
|
|
2061
2061
|
empty: !1
|
|
2062
|
-
}, ai = {
|
|
2063
|
-
...ii,
|
|
2064
|
-
status: "failed",
|
|
2065
|
-
error: Qr
|
|
2066
2062
|
}, oi = {
|
|
2063
|
+
...ai,
|
|
2064
|
+
status: "failed",
|
|
2065
|
+
error: $r
|
|
2066
|
+
}, si = {
|
|
2067
2067
|
status: "done",
|
|
2068
2068
|
summary: "",
|
|
2069
2069
|
error: "There is no data to summarize.",
|
|
2070
2070
|
empty: !0
|
|
2071
|
-
},
|
|
2072
|
-
let [e, t] =
|
|
2071
|
+
}, ci = () => {
|
|
2072
|
+
let [e, t] = L(ai), n = I(null), r = I(null), i = N(() => {
|
|
2073
2073
|
let e = r.current;
|
|
2074
|
-
r.current = null, n.current = null, e?.abort(), t(
|
|
2075
|
-
}, []), a =
|
|
2074
|
+
r.current = null, n.current = null, e?.abort(), t(ai);
|
|
2075
|
+
}, []), a = N(() => {
|
|
2076
2076
|
let e = r.current;
|
|
2077
|
-
r.current = null, e?.abort(), t(
|
|
2078
|
-
}, []), o =
|
|
2077
|
+
r.current = null, e?.abort(), t(ai);
|
|
2078
|
+
}, []), o = N((e, i) => {
|
|
2079
2079
|
if (n.current === e) return;
|
|
2080
2080
|
if (n.current = e, r.current?.release(), r.current = null, !i) {
|
|
2081
|
-
t(
|
|
2081
|
+
t(si);
|
|
2082
2082
|
return;
|
|
2083
2083
|
}
|
|
2084
2084
|
t({
|
|
2085
|
-
...
|
|
2085
|
+
...ai,
|
|
2086
2086
|
status: "running"
|
|
2087
2087
|
});
|
|
2088
|
-
let a =
|
|
2088
|
+
let a = ii(e, async (e) => {
|
|
2089
2089
|
try {
|
|
2090
2090
|
let t = await i(e), n = t && typeof t == "object" && "summary" in t && typeof t.summary == "string" ? t.summary.trim() : "";
|
|
2091
2091
|
return n ? {
|
|
2092
|
-
...
|
|
2092
|
+
...ai,
|
|
2093
2093
|
status: "done",
|
|
2094
2094
|
summary: n
|
|
2095
|
-
} :
|
|
2095
|
+
} : si;
|
|
2096
2096
|
} catch (e) {
|
|
2097
|
-
if (
|
|
2098
|
-
return
|
|
2097
|
+
if (c(e)) throw e;
|
|
2098
|
+
return oi;
|
|
2099
2099
|
}
|
|
2100
2100
|
});
|
|
2101
2101
|
r.current = a, a.promise.then((e) => {
|
|
2102
2102
|
r.current === a && t(e);
|
|
2103
2103
|
}, (e) => {
|
|
2104
|
-
r.current === a && t(
|
|
2104
|
+
r.current === a && t(c(e) ? ai : oi);
|
|
2105
2105
|
});
|
|
2106
2106
|
}, []);
|
|
2107
|
-
return
|
|
2107
|
+
return P(() => () => {
|
|
2108
2108
|
r.current?.release(), r.current = null, n.current = null;
|
|
2109
2109
|
}, []), {
|
|
2110
2110
|
state: e,
|
|
@@ -2116,102 +2116,102 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2116
2116
|
if (!e) return null;
|
|
2117
2117
|
let t = new Date(e);
|
|
2118
2118
|
return t instanceof Date && !Number.isNaN(t.getTime()) ? t : null;
|
|
2119
|
-
},
|
|
2119
|
+
}, li = (e) => Le(e || {}) ? {
|
|
2120
2120
|
startTime: e?.startTime,
|
|
2121
2121
|
endTime: e?.endTime,
|
|
2122
2122
|
isTimeFilter: !0
|
|
2123
|
-
} : {},
|
|
2123
|
+
} : {}, ui = ({ option: e, value: t }) => ({
|
|
2124
2124
|
startDate: $(e?.fromDate) ?? $(e?.startDate) ?? void 0,
|
|
2125
2125
|
endDate: $(e?.toDate) ?? $(e?.endDate) ?? void 0,
|
|
2126
|
-
...
|
|
2126
|
+
...li(e),
|
|
2127
2127
|
value: t,
|
|
2128
2128
|
label: t
|
|
2129
|
-
}),
|
|
2129
|
+
}), di = (e, t) => {
|
|
2130
2130
|
if (typeof e == "object" && e) return Reflect.get(e, t);
|
|
2131
|
-
},
|
|
2131
|
+
}, fi = [], pi = [], mi = [], hi = (e, t) => {
|
|
2132
2132
|
let n = t?.configV2?.levels?.find((e) => e?.isEnable)?.chartSettings;
|
|
2133
2133
|
return n ? {
|
|
2134
2134
|
...e,
|
|
2135
2135
|
...n
|
|
2136
2136
|
} : e;
|
|
2137
|
-
},
|
|
2137
|
+
}, gi = ({ raw: e, selectedDims: t, selectedMetrics: n, datasetSettings: r, integrationName: i, isPythonMode: a }) => {
|
|
2138
2138
|
let o;
|
|
2139
2139
|
if (typeof e == "string") try {
|
|
2140
2140
|
o = JSON.parse(e);
|
|
2141
2141
|
} catch {
|
|
2142
|
-
return
|
|
2142
|
+
return fi;
|
|
2143
2143
|
}
|
|
2144
2144
|
else if (Array.isArray(e)) o = e;
|
|
2145
|
-
else return
|
|
2146
|
-
if (o =
|
|
2145
|
+
else return fi;
|
|
2146
|
+
if (o = ue(o || [], t || [], n || []), !Array.isArray(o)) return fi;
|
|
2147
2147
|
let s = o;
|
|
2148
2148
|
if (i?.toLowerCase() === "redshift" && !a) {
|
|
2149
|
-
let e = r?.selectedMetrics || [], t = [...((r?.selectedDims)?.filter((e) => !
|
|
2150
|
-
s =
|
|
2149
|
+
let e = r?.selectedMetrics || [], t = [...((r?.selectedDims)?.filter((e) => !it(e?.alias)) || [])?.map((e) => e.alias), ...e?.map((e) => e.alias)];
|
|
2150
|
+
s = qe(t, o);
|
|
2151
2151
|
}
|
|
2152
|
-
let c =
|
|
2153
|
-
return !Array.isArray(c) || !c.length ?
|
|
2154
|
-
},
|
|
2152
|
+
let c = ye(s);
|
|
2153
|
+
return !Array.isArray(c) || !c.length ? fi : c;
|
|
2154
|
+
}, _i = ({ metric: e, globalFilters: t = {
|
|
2155
2155
|
tableName: "",
|
|
2156
2156
|
filters: []
|
|
2157
|
-
}, rlsFilters: n, clientId: r, tenancyLevel: a, isInternalApp: o, appFilters: s, setCrossDashboardFilters: c, crossDashboardFilters: l, enableCrossFilter:
|
|
2158
|
-
let [
|
|
2157
|
+
}, rlsFilters: n, clientId: r, tenancyLevel: a, isInternalApp: o, appFilters: s, setCrossDashboardFilters: c, crossDashboardFilters: l, enableCrossFilter: u, metricFilterOptions: m, isAllClient: h, isFrontendApp: g, guestToken: _, encryptedClientId: v, dashboardId: b, workspaceId: S, metricStore: C, setMetricStore: w, summaryReferencedMetricIds: ie, onServerEvent: T, clientColumnType: se, datasourceId: fe, appliedCardMetricFilters: ge, onMetricFiltersChange: _e, language: O, translationDictionary: k, calendarType: A, setLoadedCardMetadata: Se, isRulePending: we = !1, setSettledCardIds: Ae, drillUrlState: j, isFullScreen: Me, setMetricMetadata: Ne, viewMetricData: M, generatingPdf: Le, dataMartTables: He, isDisableQuery: qe = !1, token: Je, drilledLevel: Ye, drillFilters: Qe, drillType: $e, underlyingDataDrillFilters: it }) => {
|
|
2158
|
+
let [st, ut] = L(!1), [dt, ft] = L(!0), pt = te(), [mt, R] = L(null), { state: gt, start: _t, stop: vt, reset: yt } = ci(), bt = gt.summary, xt = gt.error, St = gt.empty, Ct = gt.status === "running", wt = I(null), Tt = I(null), [Et, Dt] = L({
|
|
2159
2159
|
limit: parseInt(e?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
|
|
2160
2160
|
offset: 0
|
|
2161
|
-
}), [
|
|
2161
|
+
}), [Ot, kt] = L(0), [z, At] = L(0), [B, jt] = L(e?.rlsConditions || []), [Mt, Nt] = L([]), [Pt, Ft] = L(!1), [It, Lt] = L(), [Rt, zt] = L(""), [Bt, Vt] = L([]), [Ht, Ut] = L({
|
|
2162
2162
|
isOpen: !1,
|
|
2163
2163
|
report: "",
|
|
2164
2164
|
isLoading: !1
|
|
2165
|
-
}), [
|
|
2166
|
-
drilledLevel:
|
|
2167
|
-
drillFilters:
|
|
2168
|
-
drillType:
|
|
2169
|
-
underlyingDataDrillFilters:
|
|
2170
|
-
}), [
|
|
2165
|
+
}), [Wt, Gt] = L(!1), [Kt, qt] = L([]), Jt = Qe ?? [], Yt = I(Jt), Xt = I(it), Zt = Fr(e?.drillDownSettings, {
|
|
2166
|
+
drilledLevel: Ye,
|
|
2167
|
+
drillFilters: Qe,
|
|
2168
|
+
drillType: $e,
|
|
2169
|
+
underlyingDataDrillFilters: it
|
|
2170
|
+
}), [Qt, $t] = L(Jt), [V, nn] = L(Zt ?? {
|
|
2171
2171
|
isEnableGroupBy: !1,
|
|
2172
2172
|
isEnableCrossFilter: !1,
|
|
2173
2173
|
drillType: ""
|
|
2174
|
-
}),
|
|
2175
|
-
runtimeEnabled:
|
|
2174
|
+
}), rn = Kn({
|
|
2175
|
+
runtimeEnabled: u,
|
|
2176
2176
|
metricEnabled: e?.drillDownSettings?.isEnableCrossFilter
|
|
2177
|
-
}), [
|
|
2178
|
-
|
|
2179
|
-
let
|
|
2180
|
-
|
|
2177
|
+
}), [an, on] = L([]), [sn, cn] = L([]), [ln, un] = L(!1), [dn, fn] = L(!1), [H, pn] = L([]), mn = I(_e);
|
|
2178
|
+
mn.current = _e;
|
|
2179
|
+
let hn = N((t) => {
|
|
2180
|
+
pn((n) => {
|
|
2181
2181
|
let r = typeof t == "function" ? t(n) : t;
|
|
2182
|
-
return
|
|
2182
|
+
return Lr({
|
|
2183
2183
|
metricId: e?.id,
|
|
2184
2184
|
filters: r,
|
|
2185
|
-
onChange:
|
|
2185
|
+
onChange: mn.current
|
|
2186
2186
|
}), r;
|
|
2187
2187
|
});
|
|
2188
|
-
}, [e?.id]), [
|
|
2188
|
+
}, [e?.id]), [gn, _n] = L({}), [vn, yn] = L(!1), [xn, Sn] = L(null), [U, W] = L(hi(e?.chartOptions, e?.drillDownSettings)), Cn = I(""), [wn, Tn] = L({
|
|
2189
2189
|
data: [],
|
|
2190
2190
|
error: "",
|
|
2191
2191
|
isLoading: !1,
|
|
2192
2192
|
currentValue: ""
|
|
2193
|
-
}),
|
|
2193
|
+
}), G = F(() => !!e?.datasetMetricSettings?.newDatasetSettings?.isPythonMode, [e?.datasetMetricSettings?.newDatasetSettings?.isPythonMode]), On = N((e) => tt(e) ? !0 : e?.isAddOnMetrics && e?.datatype === "date" ? !1 : !!(e?.isAddOnMetrics && e?.client?.isEnable && e?.client?.columnName && e?.client?.as && !h && r), [r, h]), kn = F(() => e?.externalDashboardMetrics?.[0]?.externalDashboard?.companyWorkspace?.datamart?.datamartRelationships || [], [e]), An = F(() => {
|
|
2194
2194
|
let e = {};
|
|
2195
2195
|
if (n?.values) for (let t in n.values) {
|
|
2196
2196
|
let r = `${t}_variable`;
|
|
2197
2197
|
e[r] = n.values[t];
|
|
2198
2198
|
}
|
|
2199
2199
|
return e;
|
|
2200
|
-
}, [n?.values]),
|
|
2200
|
+
}, [n?.values]), jn = F(() => {
|
|
2201
2201
|
let t = e?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable;
|
|
2202
|
-
return (
|
|
2202
|
+
return (He?.find((e) => e.tableName === t?.tableName))?.customColumnFields?.map((n) => ({
|
|
2203
2203
|
value: n?.columnName,
|
|
2204
2204
|
label: n?.columnName,
|
|
2205
2205
|
isCustomField: !0,
|
|
2206
2206
|
column: {
|
|
2207
|
-
uniqueId:
|
|
2207
|
+
uniqueId: ve(10),
|
|
2208
2208
|
alias: n?.columnName,
|
|
2209
2209
|
configType: "DIMENSION",
|
|
2210
2210
|
datatype: n?.datatype,
|
|
2211
2211
|
dropType: "DIMENSION",
|
|
2212
2212
|
index: 1e3,
|
|
2213
2213
|
name: n?.columnName,
|
|
2214
|
-
parentAlias: `${
|
|
2214
|
+
parentAlias: `${Ce(t?.schemaName, e?.companyIntegration?.name || "")}_${t?.tableName?.replaceAll(" ", "_")?.replace("*", "_")}`,
|
|
2215
2215
|
table: e?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable,
|
|
2216
2216
|
type: "DEFAULT",
|
|
2217
2217
|
draggableItemData: {
|
|
@@ -2229,129 +2229,129 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2229
2229
|
}, [
|
|
2230
2230
|
e?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable,
|
|
2231
2231
|
e?.companyIntegration?.name,
|
|
2232
|
-
|
|
2233
|
-
]),
|
|
2232
|
+
He
|
|
2233
|
+
]), Mn = F(() => (e?.drillDownSettings?.isEnableGroupBy ? B || [] : [...B?.length ? B : [], ...l || []]).filter((e) => e.isAddOnMetrics).map((e) => o ? {
|
|
2234
2234
|
...e,
|
|
2235
|
-
dimensionColumn:
|
|
2236
|
-
measureColumn:
|
|
2235
|
+
dimensionColumn: U?.xAxis || "",
|
|
2236
|
+
measureColumn: U?.yAxisList?.[0] || "",
|
|
2237
2237
|
options: e.datatype === "date" ? e.options : [],
|
|
2238
2238
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2239
2239
|
} : {
|
|
2240
2240
|
...e,
|
|
2241
|
-
dimensionColumn:
|
|
2242
|
-
measureColumn:
|
|
2243
|
-
value: e.isAppFilter ? e.datatype === "date" ?
|
|
2244
|
-
options: e.datatype === "date" ? e?.options?.map((t) =>
|
|
2241
|
+
dimensionColumn: U?.xAxis || "",
|
|
2242
|
+
measureColumn: U?.yAxisList?.[0] || "",
|
|
2243
|
+
value: e.isAppFilter ? e.datatype === "date" ? xe(s?.values?.[e.name], e?.datePresetOptions || e?.presetDateOptions) || (e?.options)?.find((t) => t.name === (s?.values?.[e.name] ?? e.value)) : s?.values?.[e.name] ?? e.value : e.value,
|
|
2244
|
+
options: e.datatype === "date" ? e?.options?.map((t) => A === "ind" && e.datatype === "date" ? {
|
|
2245
2245
|
...t,
|
|
2246
2246
|
isFiscal: !0
|
|
2247
2247
|
} : t) : [],
|
|
2248
2248
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2249
|
-
}).filter((e) =>
|
|
2249
|
+
}).filter((e) => On(e)), [
|
|
2250
2250
|
s?.values,
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2251
|
+
A,
|
|
2252
|
+
U?.xAxis,
|
|
2253
|
+
U?.yAxisList,
|
|
2254
2254
|
l,
|
|
2255
2255
|
o,
|
|
2256
2256
|
e?.drillDownSettings?.isEnableGroupBy,
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
]),
|
|
2260
|
-
...
|
|
2257
|
+
B,
|
|
2258
|
+
On
|
|
2259
|
+
]), Pn = F(() => JSON.stringify(Mt), [Mt]), q = F(() => ({
|
|
2260
|
+
...Kr({
|
|
2261
2261
|
metric: e,
|
|
2262
|
-
isAllClient:
|
|
2262
|
+
isAllClient: h,
|
|
2263
2263
|
tenancyLevel: a,
|
|
2264
|
-
appliedMetricFilters:
|
|
2265
|
-
firstLoadAppliedMetricFilters:
|
|
2266
|
-
tableColumnFilters:
|
|
2267
|
-
chartSettings:
|
|
2268
|
-
isPythonMode:
|
|
2264
|
+
appliedMetricFilters: H,
|
|
2265
|
+
firstLoadAppliedMetricFilters: Mn,
|
|
2266
|
+
tableColumnFilters: Mt,
|
|
2267
|
+
chartSettings: U,
|
|
2268
|
+
isPythonMode: G,
|
|
2269
2269
|
globalFilters: t,
|
|
2270
|
-
filterValues:
|
|
2271
|
-
tableLimit:
|
|
2272
|
-
calendarType:
|
|
2273
|
-
comparisonCount:
|
|
2270
|
+
filterValues: An,
|
|
2271
|
+
tableLimit: Et,
|
|
2272
|
+
calendarType: A,
|
|
2273
|
+
comparisonCount: z,
|
|
2274
2274
|
datasourceId: fe,
|
|
2275
|
-
drillConfig:
|
|
2276
|
-
isFrontendApp:
|
|
2277
|
-
guestToken:
|
|
2275
|
+
drillConfig: V?.configV2,
|
|
2276
|
+
isFrontendApp: g,
|
|
2277
|
+
guestToken: _
|
|
2278
2278
|
}),
|
|
2279
|
-
dashboardId:
|
|
2279
|
+
dashboardId: b
|
|
2280
2280
|
}), [
|
|
2281
|
-
|
|
2282
|
-
|
|
2281
|
+
U,
|
|
2282
|
+
h,
|
|
2283
2283
|
e,
|
|
2284
|
-
W,
|
|
2285
|
-
jn,
|
|
2286
|
-
q,
|
|
2287
|
-
On,
|
|
2288
2284
|
H,
|
|
2285
|
+
Mn,
|
|
2286
|
+
G,
|
|
2287
|
+
An,
|
|
2288
|
+
Qt,
|
|
2289
2289
|
a,
|
|
2290
2290
|
t,
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2291
|
+
Et,
|
|
2292
|
+
z,
|
|
2293
|
+
oe,
|
|
2294
2294
|
fe,
|
|
2295
|
-
|
|
2296
|
-
|
|
2295
|
+
A,
|
|
2296
|
+
V?.configV2,
|
|
2297
|
+
_,
|
|
2298
|
+
g,
|
|
2297
2299
|
b,
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
clientId: Rn,
|
|
2304
|
-
isFrontendApp: v
|
|
2300
|
+
Pn
|
|
2301
|
+
]), Fn = F(() => JSON.stringify(q), [q]), Ln = zr(U, e?.datasetMetricSettings), Rn = e?.datasetMetricSettings, zn = et(Rn), J = qe || Ln.renderEmpty || !!zn, Bn = g ? v || "" : r || "", Vn = F(() => Hr({
|
|
2302
|
+
query: q,
|
|
2303
|
+
clientId: Bn,
|
|
2304
|
+
isFrontendApp: g
|
|
2305
2305
|
}), [
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
]),
|
|
2310
|
-
clientId:
|
|
2311
|
-
guestToken:
|
|
2312
|
-
isFrontendApp:
|
|
2306
|
+
Bn,
|
|
2307
|
+
g,
|
|
2308
|
+
q
|
|
2309
|
+
]), Hn = F(() => Vr({
|
|
2310
|
+
clientId: Bn,
|
|
2311
|
+
guestToken: _,
|
|
2312
|
+
isFrontendApp: g
|
|
2313
2313
|
}), [
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2314
|
+
Bn,
|
|
2315
|
+
_,
|
|
2316
|
+
g
|
|
2317
2317
|
]);
|
|
2318
|
-
|
|
2319
|
-
|
|
2318
|
+
P(() => {
|
|
2319
|
+
x("metric-query-payload-prepared", {
|
|
2320
2320
|
metricId: e?.id,
|
|
2321
2321
|
metricName: e?.name,
|
|
2322
|
-
chartType:
|
|
2323
|
-
payload:
|
|
2322
|
+
chartType: U?.chartType,
|
|
2323
|
+
payload: d(q)
|
|
2324
2324
|
});
|
|
2325
2325
|
}, [
|
|
2326
|
-
|
|
2326
|
+
q,
|
|
2327
2327
|
e?.id,
|
|
2328
2328
|
e?.name,
|
|
2329
|
-
|
|
2329
|
+
U?.chartType
|
|
2330
2330
|
]);
|
|
2331
|
-
let { data:
|
|
2332
|
-
data:
|
|
2333
|
-
clientId:
|
|
2334
|
-
token:
|
|
2335
|
-
isFrontendApp:
|
|
2336
|
-
isFullScreen:
|
|
2337
|
-
savedMetricQuery: e?.isMetric === !1 || !e?.query ? void 0 :
|
|
2338
|
-
savedMetricIdentifiers:
|
|
2331
|
+
let { data: Y, isLoading: Gn, error: qn, refetch: Jn } = en({
|
|
2332
|
+
data: q,
|
|
2333
|
+
clientId: g ? v || "" : r,
|
|
2334
|
+
token: _,
|
|
2335
|
+
isFrontendApp: g,
|
|
2336
|
+
isFullScreen: Me,
|
|
2337
|
+
savedMetricQuery: e?.isMetric === !1 || !e?.query ? void 0 : ze(e?.query, e?.companyId),
|
|
2338
|
+
savedMetricIdentifiers: Rn,
|
|
2339
2339
|
dbName: e?.companyIntegration?.name || e?.integrationName,
|
|
2340
2340
|
batchHints: {
|
|
2341
|
-
chartType:
|
|
2342
|
-
isEnableComparisonFilter: !!
|
|
2343
|
-
isMultiDimension: !!
|
|
2344
|
-
isDynamicSeries: !!
|
|
2345
|
-
seriesField:
|
|
2341
|
+
chartType: U?.chartType,
|
|
2342
|
+
isEnableComparisonFilter: !!U?.isEnableComparisonFilter,
|
|
2343
|
+
isMultiDimension: !!U?.isMultiDimension,
|
|
2344
|
+
isDynamicSeries: !!U?.isDynamicSeries,
|
|
2345
|
+
seriesField: U?.seriesField,
|
|
2346
2346
|
isDataMartQuery: !!(e?.datasetMetricSettings)?.newDatasetSettings?.isDataMartQuery
|
|
2347
2347
|
}
|
|
2348
2348
|
}, {
|
|
2349
|
-
isDisableQuery:
|
|
2349
|
+
isDisableQuery: J,
|
|
2350
2350
|
onSuccess: (e) => {
|
|
2351
|
-
let t =
|
|
2352
|
-
if (
|
|
2353
|
-
let e =
|
|
2354
|
-
|
|
2351
|
+
let t = Te(e);
|
|
2352
|
+
if (Se && t?.error?.code !== "E1001") {
|
|
2353
|
+
let e = q?.id, n = !!t?.length && (U?.chartType !== E.singleValue || t?.[0]?.[U?.singleValue || ""] != null);
|
|
2354
|
+
Se?.((t) => {
|
|
2355
2355
|
let r = t?.find((t) => t?.id === e);
|
|
2356
2356
|
return r && r.isDataFound === n ? t : [...t?.filter((t) => t?.id !== e) || [], {
|
|
2357
2357
|
id: e,
|
|
@@ -2361,75 +2361,75 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2361
2361
|
}
|
|
2362
2362
|
},
|
|
2363
2363
|
onSettled: () => {
|
|
2364
|
-
let e =
|
|
2365
|
-
|
|
2364
|
+
let e = q?.id;
|
|
2365
|
+
Ae && e && Ae((t) => Ur(t, e));
|
|
2366
2366
|
}
|
|
2367
|
-
}),
|
|
2368
|
-
raw:
|
|
2367
|
+
}), X = F(() => gi({
|
|
2368
|
+
raw: Y?.data,
|
|
2369
2369
|
selectedDims: (e?.datasetMetricSettings)?.newDatasetSettings?.selectedDims,
|
|
2370
2370
|
selectedMetrics: (e?.datasetMetricSettings)?.newDatasetSettings?.selectedMetrics,
|
|
2371
2371
|
datasetSettings: e?.datasetMetricSettings?.newDatasetSettings,
|
|
2372
2372
|
integrationName: e?.companyIntegration?.name,
|
|
2373
|
-
isPythonMode:
|
|
2373
|
+
isPythonMode: G
|
|
2374
2374
|
}), [
|
|
2375
|
-
|
|
2375
|
+
Y,
|
|
2376
2376
|
e?.datasetMetricSettings,
|
|
2377
2377
|
e?.companyIntegration?.name,
|
|
2378
|
-
|
|
2379
|
-
]),
|
|
2380
|
-
|
|
2381
|
-
let t =
|
|
2378
|
+
G
|
|
2379
|
+
]), Xn = F(() => En(Y?.metaData?.truncation, X.length), [Y, X]), Zn = F(() => Dn(Xn), [Xn]);
|
|
2380
|
+
P(() => {
|
|
2381
|
+
let t = zn || qn;
|
|
2382
2382
|
if (!t) return;
|
|
2383
|
-
let n = t instanceof Error ? t.message :
|
|
2384
|
-
|
|
2383
|
+
let n = t instanceof Error ? t.message : di(t, "message"), r = di(t, "context");
|
|
2384
|
+
x("metric-query-error-observed", {
|
|
2385
2385
|
metricId: e?.id,
|
|
2386
2386
|
metricName: e?.name,
|
|
2387
|
-
chartType:
|
|
2387
|
+
chartType: U?.chartType,
|
|
2388
2388
|
message: n,
|
|
2389
2389
|
context: r,
|
|
2390
|
-
payload:
|
|
2390
|
+
payload: d(q)
|
|
2391
2391
|
});
|
|
2392
2392
|
}, [
|
|
2393
|
-
|
|
2394
|
-
|
|
2393
|
+
zn,
|
|
2394
|
+
qn,
|
|
2395
2395
|
e?.id,
|
|
2396
2396
|
e?.name,
|
|
2397
|
-
|
|
2398
|
-
]),
|
|
2399
|
-
let e =
|
|
2400
|
-
|
|
2397
|
+
U?.chartType
|
|
2398
|
+
]), P(() => {
|
|
2399
|
+
let e = q?.id;
|
|
2400
|
+
J && Ae && e && Ae((t) => Ur(t, e));
|
|
2401
2401
|
}, [
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
]),
|
|
2406
|
-
let e =
|
|
2407
|
-
!
|
|
2402
|
+
J,
|
|
2403
|
+
q?.id,
|
|
2404
|
+
Ae
|
|
2405
|
+
]), P(() => {
|
|
2406
|
+
let e = q?.id;
|
|
2407
|
+
!J && Ae && e && Ae((t) => Wr(t, e));
|
|
2408
2408
|
}, [
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2409
|
+
J,
|
|
2410
|
+
Fn,
|
|
2411
|
+
Ae
|
|
2412
2412
|
]);
|
|
2413
|
-
let { data:
|
|
2414
|
-
metricViewFilters:
|
|
2415
|
-
xAxisSettings:
|
|
2416
|
-
yAxisSettings:
|
|
2413
|
+
let { data: Qn } = tn(S, void 0, g, v), $n = F(() => Qn?.weekStartDay === "sunday" ? "sunday" : "monday", [Qn]), { mutate: tr } = ne(), { mutateAsync: nr } = ee(), rr = F(() => JSON.stringify({
|
|
2414
|
+
metricViewFilters: M?.metricViewFilters || [],
|
|
2415
|
+
xAxisSettings: M?.xAxisSettings || [],
|
|
2416
|
+
yAxisSettings: M?.yAxisSettings || []
|
|
2417
2417
|
}), [
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
]),
|
|
2422
|
-
|
|
2423
|
-
let
|
|
2424
|
-
|
|
2425
|
-
let
|
|
2426
|
-
|
|
2427
|
-
let t =
|
|
2428
|
-
|
|
2418
|
+
M?.metricViewFilters,
|
|
2419
|
+
M?.xAxisSettings,
|
|
2420
|
+
M?.yAxisSettings
|
|
2421
|
+
]), ir = F(() => JSON.stringify(ge || []), [ge]), ar = I(M);
|
|
2422
|
+
ar.current = M;
|
|
2423
|
+
let or = I(ge);
|
|
2424
|
+
or.current = ge;
|
|
2425
|
+
let sr = I(e?.id);
|
|
2426
|
+
sr.current = e?.id, P(() => {
|
|
2427
|
+
let t = ar.current, n = or.current, i = sr.current, o = Cn.current !== rr, s = [...t?.metricViewFilters?.find((e) => e.id === i)?.filters?.filter((e) => !n?.find((t) => e?.name === t?.name)) || [], ...n || []];
|
|
2428
|
+
jt((t) => {
|
|
2429
2429
|
let n = e?.rlsConditions?.map((e) => {
|
|
2430
2430
|
let n = t?.find((t) => t.name === e.name && t.datatype === e.datatype && t.tableName === e.tableName && t.columnName === e.columnName), i = e;
|
|
2431
|
-
if (
|
|
2432
|
-
let e =
|
|
2431
|
+
if (m) {
|
|
2432
|
+
let e = yi(i, m);
|
|
2433
2433
|
if (e) {
|
|
2434
2434
|
let t = i.datatype === "date" ? e.options?.find((t) => t.name === e.value) : void 0;
|
|
2435
2435
|
i = {
|
|
@@ -2444,7 +2444,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2444
2444
|
maxDate: $(e.maxDate) ?? void 0,
|
|
2445
2445
|
fromDate: $(e.fromDate) ?? void 0,
|
|
2446
2446
|
toDate: $(e.toDate) ?? void 0,
|
|
2447
|
-
...
|
|
2447
|
+
...li(e)
|
|
2448
2448
|
})) : e.options,
|
|
2449
2449
|
variableOptions: i.datatype === "date" ? e.options?.map((e) => ({
|
|
2450
2450
|
range: e.range,
|
|
@@ -2454,7 +2454,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2454
2454
|
maxDate: $(e.maxDate) ?? void 0,
|
|
2455
2455
|
fromDate: $(e.fromDate) ?? void 0,
|
|
2456
2456
|
toDate: $(e.toDate) ?? void 0,
|
|
2457
|
-
...
|
|
2457
|
+
...li(e),
|
|
2458
2458
|
value: e.name,
|
|
2459
2459
|
label: e.name
|
|
2460
2460
|
})) : e.options?.map((e) => ({
|
|
@@ -2464,7 +2464,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2464
2464
|
selectedVariableValue: e.value ? i.datatype === "string" ? {
|
|
2465
2465
|
value: e.value,
|
|
2466
2466
|
label: e.value
|
|
2467
|
-
} :
|
|
2467
|
+
} : ui({
|
|
2468
2468
|
option: t,
|
|
2469
2469
|
value: e.value
|
|
2470
2470
|
}) : i.selectedVariableValue
|
|
@@ -2485,7 +2485,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2485
2485
|
...i?.selectedDropdownValue === void 0 && n?.selectedDropdownValue !== void 0 ? { selectedDropdownValue: n.selectedDropdownValue } : {},
|
|
2486
2486
|
...i?.selectedVariableValue === void 0 && n?.selectedVariableValue !== void 0 ? { selectedVariableValue: n.selectedVariableValue } : {}
|
|
2487
2487
|
}), i?.datatype === "date" && i?.options?.find((e) => e.range === "Custom Date") && i?.isEnableDynamicDate && i?.dynamicDate?.value) {
|
|
2488
|
-
let e =
|
|
2488
|
+
let e = he(Ve?.find((e) => e.value === i?.dynamicDate?.value)?.count || 0), t = Ke(e), n = Ke(e);
|
|
2489
2489
|
i = {
|
|
2490
2490
|
...i,
|
|
2491
2491
|
options: i?.options?.map((r) => r.range === "Custom Date" ? {
|
|
@@ -2501,178 +2501,178 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2501
2501
|
tableName: `${r}.${e.tableName.split(".").slice(1).join(".")}`
|
|
2502
2502
|
} : i;
|
|
2503
2503
|
}) || [];
|
|
2504
|
-
return
|
|
2504
|
+
return ce(t || [], n || []) ? t : n || [];
|
|
2505
2505
|
});
|
|
2506
2506
|
}, [
|
|
2507
2507
|
e?.rlsConditions,
|
|
2508
|
-
|
|
2508
|
+
m,
|
|
2509
2509
|
a,
|
|
2510
2510
|
r,
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
]),
|
|
2514
|
-
|
|
2515
|
-
}, [
|
|
2511
|
+
ir,
|
|
2512
|
+
rr
|
|
2513
|
+
]), P(() => {
|
|
2514
|
+
Cn.current = rr;
|
|
2515
|
+
}, [rr]), P(() => {
|
|
2516
2516
|
let e;
|
|
2517
|
-
return
|
|
2518
|
-
|
|
2517
|
+
return Gn ? ft(!0) : e = setTimeout(() => {
|
|
2518
|
+
ft(!1);
|
|
2519
2519
|
}, 300), () => clearTimeout(e);
|
|
2520
|
-
}, [
|
|
2521
|
-
e?.id &&
|
|
2520
|
+
}, [Gn]), P(() => {
|
|
2521
|
+
e?.id && Ne && !G && e?.isMetric && Ne?.((t) => {
|
|
2522
2522
|
let n = {
|
|
2523
|
-
filters: [...
|
|
2523
|
+
filters: [...H || [], ...U?.tableSettings?.isServerSidePagination && U?.chartType === E.table ? Mt?.map((e) => e.condition)?.filter((e) => tt(e)) : []],
|
|
2524
2524
|
xAxisSettings: {
|
|
2525
|
-
isEnable: !!(
|
|
2526
|
-
xaxis:
|
|
2525
|
+
isEnable: !!(U?.dynamicXAxis?.isEnabled || U?.enduserMeasureAndDimensions?.isEnabled) && oe.includes(U?.chartType || ""),
|
|
2526
|
+
xaxis: U?.xAxis || ""
|
|
2527
2527
|
},
|
|
2528
2528
|
yAxisSettings: {
|
|
2529
|
-
isEnable: !(
|
|
2530
|
-
yAxis:
|
|
2529
|
+
isEnable: !(U?.dynamicYAxis?.isEnabled && U?.dynamicYAxis?.selectedOption && !Array.isArray(U?.dynamicYAxis?.selectedOption)),
|
|
2530
|
+
yAxis: U?.dynamicYAxis?.selectedOption || ""
|
|
2531
2531
|
},
|
|
2532
2532
|
id: e?.id,
|
|
2533
2533
|
metricRequestData: {
|
|
2534
|
-
isAllClient:
|
|
2535
|
-
timeseriesSettings:
|
|
2536
|
-
format:
|
|
2537
|
-
seriesField:
|
|
2538
|
-
isFiscal:
|
|
2534
|
+
isAllClient: h,
|
|
2535
|
+
timeseriesSettings: G ? void 0 : {
|
|
2536
|
+
format: U?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase() || "monthly",
|
|
2537
|
+
seriesField: U?.seriesField || "",
|
|
2538
|
+
isFiscal: A === "ind"
|
|
2539
2539
|
}
|
|
2540
2540
|
}
|
|
2541
2541
|
}, r = t?.find((t) => t.id === e?.id);
|
|
2542
|
-
return r &&
|
|
2542
|
+
return r && ce(r, n) ? t : [...t?.filter((t) => t.id !== e?.id) || [], n];
|
|
2543
2543
|
});
|
|
2544
2544
|
}, [
|
|
2545
2545
|
e?.id,
|
|
2546
2546
|
e?.isMetric,
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
]),
|
|
2547
|
+
H,
|
|
2548
|
+
U?.timeSeriesSettings,
|
|
2549
|
+
U?.seriesField,
|
|
2550
|
+
G,
|
|
2551
|
+
A,
|
|
2552
|
+
h,
|
|
2553
|
+
Mt,
|
|
2554
|
+
U?.tableSettings?.isServerSidePagination,
|
|
2555
|
+
U?.chartType,
|
|
2556
|
+
U?.dynamicYAxis,
|
|
2557
|
+
U?.dynamicXAxis
|
|
2558
|
+
]), P(() => {
|
|
2559
2559
|
if (e?.drillDownSettings?.isEnableGroupBy) {
|
|
2560
2560
|
let t = e?.datasetMetricSettings;
|
|
2561
|
-
if (!e?.drillDownSettings?.configV2 && !
|
|
2561
|
+
if (!e?.drillDownSettings?.configV2 && !V?.configV2 && t?.newDatasetSettings?.selectedMetrics?.length && t?.newDatasetSettings?.selectedDims?.length) {
|
|
2562
2562
|
let n = {
|
|
2563
2563
|
...e?.drillDownSettings || {},
|
|
2564
2564
|
configV2: {
|
|
2565
2565
|
isEnable: !!e?.drillDownSettings?.isEnableGroupBy,
|
|
2566
|
-
levels:
|
|
2566
|
+
levels: xr({
|
|
2567
2567
|
selectedDims: t?.newDatasetSettings?.selectedDims,
|
|
2568
2568
|
selectedMetrics: t?.newDatasetSettings?.selectedMetrics,
|
|
2569
|
-
chartSettings:
|
|
2569
|
+
chartSettings: U,
|
|
2570
2570
|
drilldownChartSettings: e?.drillDownSettings?.drilldownChartSettings,
|
|
2571
|
-
makeIndex: () =>
|
|
2571
|
+
makeIndex: () => ve(4)
|
|
2572
2572
|
})
|
|
2573
2573
|
}
|
|
2574
2574
|
};
|
|
2575
|
-
|
|
2576
|
-
drilledLevel:
|
|
2577
|
-
drillFilters:
|
|
2578
|
-
drillType:
|
|
2579
|
-
underlyingDataDrillFilters:
|
|
2575
|
+
nn(() => Fr(n, {
|
|
2576
|
+
drilledLevel: Ye,
|
|
2577
|
+
drillFilters: Qe,
|
|
2578
|
+
drillType: $e,
|
|
2579
|
+
underlyingDataDrillFilters: it
|
|
2580
2580
|
}) ?? n);
|
|
2581
|
-
} else
|
|
2581
|
+
} else V?.isEnableGroupBy || nn(e?.drillDownSettings);
|
|
2582
2582
|
}
|
|
2583
2583
|
}, [
|
|
2584
2584
|
e?.drillDownSettings?.isEnableGroupBy,
|
|
2585
2585
|
e?.drillDownSettings?.configV2,
|
|
2586
2586
|
e?.datasetMetricSettings,
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2587
|
+
U,
|
|
2588
|
+
Qe,
|
|
2589
|
+
Ye,
|
|
2590
|
+
$e,
|
|
2591
|
+
it
|
|
2592
2592
|
]);
|
|
2593
|
-
let
|
|
2594
|
-
|
|
2595
|
-
if (
|
|
2596
|
-
let t =
|
|
2597
|
-
if (!
|
|
2598
|
-
let n =
|
|
2593
|
+
let cr = I(!1);
|
|
2594
|
+
P(() => {
|
|
2595
|
+
if (cr.current) return;
|
|
2596
|
+
let t = j?.position;
|
|
2597
|
+
if (!j?.enabled || !t || !e?.id) return;
|
|
2598
|
+
let n = V?.configV2;
|
|
2599
2599
|
if (!n?.levels?.length) return;
|
|
2600
|
-
|
|
2601
|
-
let r =
|
|
2600
|
+
cr.current = !0;
|
|
2601
|
+
let r = In(n, t);
|
|
2602
2602
|
if (!r) return;
|
|
2603
|
-
|
|
2603
|
+
nn((e) => ({
|
|
2604
2604
|
...e,
|
|
2605
2605
|
configV2: r
|
|
2606
2606
|
}));
|
|
2607
2607
|
let i = r.levels?.find((e) => e?.isEnable);
|
|
2608
|
-
i?.chartSettings &&
|
|
2608
|
+
i?.chartSettings && W((e) => ({
|
|
2609
2609
|
...e,
|
|
2610
2610
|
...i.chartSettings
|
|
2611
|
-
})),
|
|
2611
|
+
})), x("drill-restored-from-url", {
|
|
2612
2612
|
metricId: e?.id,
|
|
2613
2613
|
levelIndex: t.levelIndex,
|
|
2614
2614
|
filterCount: t.filters?.length || 0
|
|
2615
2615
|
});
|
|
2616
2616
|
}, [
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2617
|
+
j?.enabled,
|
|
2618
|
+
j?.position,
|
|
2619
|
+
V?.configV2,
|
|
2620
2620
|
e?.id
|
|
2621
2621
|
]);
|
|
2622
|
-
let
|
|
2623
|
-
|
|
2624
|
-
if (!
|
|
2625
|
-
let t =
|
|
2622
|
+
let lr = I(void 0);
|
|
2623
|
+
P(() => {
|
|
2624
|
+
if (!j?.enabled || !j.onChange || !e?.id) return;
|
|
2625
|
+
let t = V?.configV2?.levels || [], n = t.findIndex((e) => e?.isEnable), r = n >= 0 ? t[n] : void 0, i = n > 0 && r?.index ? Nn({
|
|
2626
2626
|
levelIndex: r.index,
|
|
2627
2627
|
filters: (r.filters || []).filter((e) => e?.columnName).map((e) => ({
|
|
2628
2628
|
columnName: String(e.columnName),
|
|
2629
2629
|
value: String(e.value ?? "")
|
|
2630
2630
|
}))
|
|
2631
2631
|
}) : null;
|
|
2632
|
-
|
|
2632
|
+
lr.current !== i && (lr.current = i, j.onChange(e.id, i));
|
|
2633
2633
|
}, [
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2634
|
+
j?.enabled,
|
|
2635
|
+
j?.onChange,
|
|
2636
|
+
V?.configV2,
|
|
2637
2637
|
e?.id
|
|
2638
2638
|
]);
|
|
2639
|
-
let { mutateAsync:
|
|
2639
|
+
let { mutateAsync: ur } = y(), dr = F(() => JSON.stringify(t?.filters), [t?.filters]), fr = F(() => {
|
|
2640
2640
|
let n = e?.datasetMetricSettings?.metricVariables || [];
|
|
2641
2641
|
if (!n || !Array.isArray(n) || !n?.length) return [];
|
|
2642
2642
|
let i = [];
|
|
2643
2643
|
for (let o = 0; o < n?.length; o++) {
|
|
2644
2644
|
let s = n[o], c = s.type.value === "custom" && s.customQuery && s.customColumnName, l = c ? {
|
|
2645
|
-
query:
|
|
2645
|
+
query: Xe({
|
|
2646
2646
|
query: s?.customQuery || "",
|
|
2647
2647
|
tenancyLevel: a,
|
|
2648
2648
|
clientId: r,
|
|
2649
|
-
isAllClient:
|
|
2650
|
-
clientColumnType:
|
|
2649
|
+
isAllClient: h,
|
|
2650
|
+
clientColumnType: se || "STRING",
|
|
2651
2651
|
dbName: e?.companyIntegration?.name,
|
|
2652
|
-
rlsConditions:
|
|
2652
|
+
rlsConditions: H?.filter((e) => e.isVariableFilter),
|
|
2653
2653
|
globalFilters: {
|
|
2654
2654
|
...t,
|
|
2655
2655
|
filters: t?.filters?.filter((e) => e?.isVariableFilter && !!(Array.isArray(e?.value) ? e?.value?.length : e))
|
|
2656
2656
|
},
|
|
2657
|
-
weekStartDay:
|
|
2657
|
+
weekStartDay: $n
|
|
2658
2658
|
}),
|
|
2659
|
-
alias:
|
|
2660
|
-
} : void 0, u = s.dependOnOptions?.length ?
|
|
2661
|
-
let t =
|
|
2659
|
+
alias: Ze
|
|
2660
|
+
} : void 0, u = s.dependOnOptions?.length ? H?.filter((e) => s.dependOnOptions.some((t) => t.type === "metric" && t.filter?.value === e.name && t.column)) : [], d = s.dependOnOptions?.length ? t?.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) => {
|
|
2661
|
+
let t = me(e);
|
|
2662
2662
|
return e.datatype === "date" && t === void 0 ? null : {
|
|
2663
2663
|
columnName: s.dependOnOptions.find((t) => e.name === t.filter?.value)?.column || "",
|
|
2664
2664
|
value: t,
|
|
2665
2665
|
as: e.datatype
|
|
2666
2666
|
};
|
|
2667
2667
|
}).filter(Boolean), p = d?.map((e) => {
|
|
2668
|
-
let t = e.as === "date" ?
|
|
2668
|
+
let t = e.as === "date" ? Ge(e) : De(e?.value);
|
|
2669
2669
|
return e.as === "date" && t === void 0 ? null : {
|
|
2670
2670
|
columnName: s.dependOnOptions.find((t) => e.label === t.filter?.value)?.column || "",
|
|
2671
2671
|
value: t,
|
|
2672
2672
|
as: e.as
|
|
2673
2673
|
};
|
|
2674
2674
|
}).filter(Boolean);
|
|
2675
|
-
s.isClientScoped && r &&
|
|
2675
|
+
s.isClientScoped && r && se && !h && a === "TABLE" && s.clientColumn?.name?.value && s.clientColumn?.datatype?.value && f.push({
|
|
2676
2676
|
columnName: s.clientColumn?.name?.value,
|
|
2677
2677
|
value: r,
|
|
2678
2678
|
as: s.clientColumn?.datatype?.value
|
|
@@ -2680,7 +2680,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2680
2680
|
let m = [...f, ...p];
|
|
2681
2681
|
i.push({
|
|
2682
2682
|
object: {
|
|
2683
|
-
wId:
|
|
2683
|
+
wId: S,
|
|
2684
2684
|
tableName: c ? "" : s?.table?.value,
|
|
2685
2685
|
columnName: c ? s?.customColumnName || "" : s?.column?.value || "",
|
|
2686
2686
|
filter: m,
|
|
@@ -2696,29 +2696,29 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2696
2696
|
return i;
|
|
2697
2697
|
}, [
|
|
2698
2698
|
e?.datasetMetricSettings?.metricVariables,
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2699
|
+
dr,
|
|
2700
|
+
H,
|
|
2701
|
+
se,
|
|
2702
|
+
S,
|
|
2703
2703
|
a,
|
|
2704
2704
|
r,
|
|
2705
|
-
|
|
2705
|
+
h,
|
|
2706
2706
|
fe
|
|
2707
|
-
]),
|
|
2707
|
+
]), pr = F(() => JSON.stringify(fr), [fr]), Z = I(null), mr = I(0), Q = I({
|
|
2708
2708
|
clientId: r,
|
|
2709
|
-
encryptedClientId:
|
|
2710
|
-
isFrontendApp:
|
|
2711
|
-
token:
|
|
2709
|
+
encryptedClientId: v,
|
|
2710
|
+
isFrontendApp: g,
|
|
2711
|
+
token: Je
|
|
2712
2712
|
});
|
|
2713
|
-
|
|
2714
|
-
let hr =
|
|
2715
|
-
hr.current =
|
|
2716
|
-
|
|
2717
|
-
let e =
|
|
2718
|
-
if (
|
|
2719
|
-
let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } =
|
|
2720
|
-
|
|
2721
|
-
entries:
|
|
2713
|
+
Q.current.clientId = r, Q.current.encryptedClientId = v, Q.current.isFrontendApp = g, Q.current.token = Je;
|
|
2714
|
+
let hr = I(ur);
|
|
2715
|
+
hr.current = ur, P(() => {
|
|
2716
|
+
mr.current += 1;
|
|
2717
|
+
let e = mr.current, t = () => mr.current !== e;
|
|
2718
|
+
if (fr?.length) {
|
|
2719
|
+
let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } = Q.current;
|
|
2720
|
+
Qr({
|
|
2721
|
+
entries: fr,
|
|
2722
2722
|
fetchColumnValues: hr.current,
|
|
2723
2723
|
ctx: {
|
|
2724
2724
|
clientId: e,
|
|
@@ -2726,132 +2726,132 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2726
2726
|
isFrontendApp: r,
|
|
2727
2727
|
token: i
|
|
2728
2728
|
},
|
|
2729
|
-
onSeed: (e) =>
|
|
2730
|
-
onResolved: (e, t) =>
|
|
2729
|
+
onSeed: (e) => _n(e),
|
|
2730
|
+
onResolved: (e, t) => _n((n) => ({
|
|
2731
2731
|
...n,
|
|
2732
2732
|
[e]: t
|
|
2733
2733
|
})),
|
|
2734
|
-
onLoading: (e) =>
|
|
2734
|
+
onLoading: (e) => ut(e),
|
|
2735
2735
|
onSettle: () => {
|
|
2736
|
-
|
|
2737
|
-
|
|
2736
|
+
Z.current && clearTimeout(Z.current), Z.current = setTimeout(() => {
|
|
2737
|
+
Z.current = null, ut(!1);
|
|
2738
2738
|
}, 200);
|
|
2739
2739
|
},
|
|
2740
2740
|
isCancelled: t
|
|
2741
2741
|
}).catch(() => {});
|
|
2742
2742
|
}
|
|
2743
2743
|
return () => {
|
|
2744
|
-
|
|
2744
|
+
mr.current += 1, Z.current &&= (clearTimeout(Z.current), null);
|
|
2745
2745
|
};
|
|
2746
|
-
}, [
|
|
2747
|
-
let gr =
|
|
2748
|
-
|
|
2749
|
-
let _r =
|
|
2746
|
+
}, [pr]);
|
|
2747
|
+
let gr = F(() => (e?.datasetMetricSettings)?.newDatasetSettings?.selectedDims?.[0]?.name, [e]);
|
|
2748
|
+
F(() => de(e?.datasetMetricSettings?.selectedDimensions?.[Qt.length < e?.datasetMetricSettings?.selectedDimensions?.length ? Qt.length : 0] || ""), [e?.datasetMetricSettings, Qt]);
|
|
2749
|
+
let _r = F(() => e?.drillDownSettings?.isEnableGroupBy ? B || [] : [...B?.length ? B : [], ...l || []], [
|
|
2750
2750
|
l,
|
|
2751
2751
|
e?.drillDownSettings?.isEnableGroupBy,
|
|
2752
|
-
|
|
2753
|
-
]), vr =
|
|
2752
|
+
B
|
|
2753
|
+
]), vr = N((e = []) => e.filter((e) => e.isAddOnMetrics).map((e) => o ? {
|
|
2754
2754
|
...e,
|
|
2755
|
-
dimensionColumn:
|
|
2756
|
-
measureColumn:
|
|
2755
|
+
dimensionColumn: U?.xAxis || "",
|
|
2756
|
+
measureColumn: U?.yAxisList?.[0] || "",
|
|
2757
2757
|
options: e.datatype === "date" ? e.options : [],
|
|
2758
2758
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2759
2759
|
} : {
|
|
2760
2760
|
...e,
|
|
2761
|
-
dimensionColumn:
|
|
2762
|
-
measureColumn:
|
|
2763
|
-
value: e.isAppFilter ? e.datatype === "date" ?
|
|
2764
|
-
options: e.datatype === "date" ? e?.options?.map((t) =>
|
|
2761
|
+
dimensionColumn: U?.xAxis || "",
|
|
2762
|
+
measureColumn: U?.yAxisList?.[0] || "",
|
|
2763
|
+
value: e.isAppFilter ? e.datatype === "date" ? xe(s?.values?.[e.name], e?.datePresetOptions || e?.presetDateOptions) || (e?.options)?.find((t) => t.name === (s?.values?.[e.name] ?? e.value)) : s?.values?.[e.name] ?? e.value : e.value,
|
|
2764
|
+
options: e.datatype === "date" ? e?.options?.map((t) => A === "ind" && e.datatype === "date" ? {
|
|
2765
2765
|
...t,
|
|
2766
2766
|
isFiscal: !0
|
|
2767
2767
|
} : t) : [],
|
|
2768
2768
|
variableOptions: e.datatype === "date" ? e.variableOptions : []
|
|
2769
|
-
}).filter((e) =>
|
|
2769
|
+
}).filter((e) => On(e)), [
|
|
2770
2770
|
s?.values,
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2771
|
+
A,
|
|
2772
|
+
U?.xAxis,
|
|
2773
|
+
U?.yAxisList,
|
|
2774
2774
|
o,
|
|
2775
|
-
|
|
2775
|
+
On
|
|
2776
2776
|
]);
|
|
2777
|
-
|
|
2778
|
-
_r?.some((e) => e.isAddOnMetrics) ?
|
|
2777
|
+
F(() => vr(_r), [vr, _r]), P(() => {
|
|
2778
|
+
_r?.some((e) => e.isAddOnMetrics) ? hn(vr(_r)) : hn([]);
|
|
2779
2779
|
}, [vr, _r]);
|
|
2780
|
-
let
|
|
2781
|
-
|
|
2782
|
-
let t =
|
|
2780
|
+
let yr = F(() => U?.chartType === E.singleValue && !!U?.customSettings?.comparisonValueShow && !!U?.customSettings?.comparisonTimeGrain && !!U?.customSettings?.comparisonTimePeriod && !!U?.singleValue, [U]);
|
|
2781
|
+
P(() => {
|
|
2782
|
+
let t = Y;
|
|
2783
2783
|
if (Tn({
|
|
2784
2784
|
data: [],
|
|
2785
2785
|
error: "",
|
|
2786
2786
|
isLoading: !1,
|
|
2787
2787
|
currentValue: ""
|
|
2788
|
-
}),
|
|
2788
|
+
}), U?.chartType === E.table) {
|
|
2789
2789
|
let e = t?.totalRecords;
|
|
2790
|
-
typeof e == "number" &&
|
|
2790
|
+
typeof e == "number" && kt(e);
|
|
2791
2791
|
}
|
|
2792
|
-
if (
|
|
2792
|
+
if (x("metric-query-response-applied", {
|
|
2793
2793
|
metricId: e?.id,
|
|
2794
2794
|
metricName: e?.name,
|
|
2795
|
-
chartType:
|
|
2796
|
-
rowCount:
|
|
2797
|
-
columns: Object.keys(
|
|
2795
|
+
chartType: U?.chartType,
|
|
2796
|
+
rowCount: X?.length || 0,
|
|
2797
|
+
columns: Object.keys(X?.[0] || {}),
|
|
2798
2798
|
totalRecords: t?.totalRecords,
|
|
2799
|
-
truncation:
|
|
2800
|
-
drillConfig:
|
|
2799
|
+
truncation: Xn,
|
|
2800
|
+
drillConfig: f(V?.configV2)
|
|
2801
2801
|
}), e?.datasetMetricSettings?.isUseRawSQL) {
|
|
2802
|
-
let e = Object.keys(
|
|
2803
|
-
|
|
2802
|
+
let e = Object.keys(X?.[0] || {});
|
|
2803
|
+
W((t) => ({
|
|
2804
2804
|
...t,
|
|
2805
2805
|
yAxisList: e.length ? e : t?.yAxisList || []
|
|
2806
2806
|
}));
|
|
2807
2807
|
}
|
|
2808
2808
|
let n = t?.metaData;
|
|
2809
|
-
|
|
2809
|
+
cn(be(n?.groupbyColumnList)), Ut((e) => ({
|
|
2810
2810
|
...e,
|
|
2811
2811
|
report: "",
|
|
2812
2812
|
isLoading: e?.isLoading,
|
|
2813
2813
|
isOpen: e?.isOpen
|
|
2814
2814
|
}));
|
|
2815
2815
|
}, [
|
|
2816
|
-
|
|
2816
|
+
Y,
|
|
2817
2817
|
e?.datasetMetricSettings,
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
]),
|
|
2821
|
-
e?.datasetMetricSettings?.createdSorts?.length ?
|
|
2822
|
-
}, [e?.datasetMetricSettings?.createdSorts?.length]),
|
|
2823
|
-
|
|
2818
|
+
X,
|
|
2819
|
+
Xn
|
|
2820
|
+
]), P(() => {
|
|
2821
|
+
e?.datasetMetricSettings?.createdSorts?.length ? yn(!0) : yn(!1);
|
|
2822
|
+
}, [e?.datasetMetricSettings?.createdSorts?.length]), P(() => {
|
|
2823
|
+
U?.chartType === E.timeSeries && U?.timeSeriesSettings?.groupBySettings?.value && !G && W((e) => ({
|
|
2824
2824
|
...e,
|
|
2825
|
-
xAxis: `${
|
|
2825
|
+
xAxis: `${U?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase()} of ${gr}`
|
|
2826
2826
|
}));
|
|
2827
2827
|
}, [
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
]),
|
|
2833
|
-
if (
|
|
2834
|
-
let t = e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics || [], n = Object?.keys(
|
|
2835
|
-
|
|
2828
|
+
X,
|
|
2829
|
+
U?.chartType,
|
|
2830
|
+
U?.timeSeriesSettings,
|
|
2831
|
+
G
|
|
2832
|
+
]), P(() => {
|
|
2833
|
+
if (U?.isEnableComparisonFilter && [E.line].includes(U?.chartType)) {
|
|
2834
|
+
let t = e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics || [], n = Object?.keys(X?.[0] || {});
|
|
2835
|
+
W((e) => ({
|
|
2836
2836
|
...e,
|
|
2837
2837
|
yAxisList: [...n.filter((e) => t?.some((t) => e.startsWith(t.alias)))]
|
|
2838
2838
|
}));
|
|
2839
2839
|
}
|
|
2840
2840
|
}, [
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2841
|
+
X,
|
|
2842
|
+
U?.isEnableComparisonFilter,
|
|
2843
|
+
z,
|
|
2844
|
+
U?.chartType
|
|
2845
2845
|
]);
|
|
2846
|
-
let Sr =
|
|
2847
|
-
|
|
2846
|
+
let Sr = N((t, n, r, a, o, s) => {
|
|
2847
|
+
p("metric-filter-applied", {
|
|
2848
2848
|
metricId: e?.id,
|
|
2849
2849
|
hasCustomValue: !!a,
|
|
2850
2850
|
hasStringValues: !!o?.length,
|
|
2851
2851
|
stringValueCount: o?.length || 0,
|
|
2852
2852
|
hasTimeGrain: !!s,
|
|
2853
|
-
rlsConditionCount:
|
|
2854
|
-
}),
|
|
2853
|
+
rlsConditionCount: B?.length || 0
|
|
2854
|
+
}), T?.(i, e?.id), jt(a ? (e) => e?.map((e) => e.name === t ? {
|
|
2855
2855
|
...e,
|
|
2856
2856
|
value: n,
|
|
2857
2857
|
options: e.options?.map((e) => n === e.name ? {
|
|
@@ -2869,7 +2869,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2869
2869
|
label: n,
|
|
2870
2870
|
endDate: a.endDate,
|
|
2871
2871
|
startDate: a.startDate,
|
|
2872
|
-
...
|
|
2872
|
+
...li(a),
|
|
2873
2873
|
timeGrainValue: s
|
|
2874
2874
|
}
|
|
2875
2875
|
} : e) : o ? (e) => e?.map((e) => e.name === t ? {
|
|
@@ -2888,68 +2888,68 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2888
2888
|
label: r || n
|
|
2889
2889
|
}
|
|
2890
2890
|
} : e));
|
|
2891
|
-
}, []),
|
|
2892
|
-
t?.event && t?.event?.event?.preventDefault(),
|
|
2891
|
+
}, []), Cr = N((t) => {
|
|
2892
|
+
t?.event && t?.event?.event?.preventDefault(), x("chart-click-params-captured", {
|
|
2893
2893
|
metricId: e?.id,
|
|
2894
2894
|
metricName: e?.name,
|
|
2895
|
-
chartType:
|
|
2895
|
+
chartType: U?.chartType,
|
|
2896
2896
|
name: t?.name,
|
|
2897
2897
|
value: t?.value,
|
|
2898
2898
|
seriesName: t?.seriesName,
|
|
2899
2899
|
dataIndex: t?.dataIndex,
|
|
2900
|
-
drillConfig:
|
|
2901
|
-
}),
|
|
2900
|
+
drillConfig: f(V?.configV2)
|
|
2901
|
+
}), Lt(t);
|
|
2902
2902
|
}, [
|
|
2903
2903
|
e?.id,
|
|
2904
2904
|
e?.name,
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
]), Tr =
|
|
2905
|
+
U?.chartType,
|
|
2906
|
+
V?.configV2
|
|
2907
|
+
]), Tr = F(() => Array.isArray(X) && X.length && It?.name ? X?.map((e) => Object.entries(e).find(([, e]) => (typeof e == "number" && typeof It?.name == "string" ? e?.toString() : e) === It.name)?.[0]).filter((e) => e)[0] : "", [X, It?.name]), Er = F(() => {
|
|
2908
2908
|
let t = e?.datasetMetricSettings?.newDatasetSettings;
|
|
2909
2909
|
return {
|
|
2910
2910
|
selectedDims: t?.selectedDims,
|
|
2911
2911
|
selectedMetrics: t?.selectedMetrics,
|
|
2912
|
-
levelDimensions:
|
|
2912
|
+
levelDimensions: V?.configV2?.levels?.flatMap((e) => e?.dimensions || []) || []
|
|
2913
2913
|
};
|
|
2914
|
-
}, [
|
|
2914
|
+
}, [V?.configV2?.levels, e?.datasetMetricSettings]), Dr = N((e) => Re({
|
|
2915
2915
|
filter: e,
|
|
2916
2916
|
...Er
|
|
2917
|
-
}), [Er]),
|
|
2918
|
-
if (
|
|
2919
|
-
let e =
|
|
2920
|
-
return (e.length ? e :
|
|
2917
|
+
}), [Er]), Or = F(() => {
|
|
2918
|
+
if (Xt.current !== void 0 && Qt === Yt.current) return Xt.current;
|
|
2919
|
+
let e = V?.configV2?.levels?.find((e) => e?.isEnable)?.filters || [];
|
|
2920
|
+
return (e.length ? e : Qt).map(Dr);
|
|
2921
2921
|
}, [
|
|
2922
|
-
|
|
2923
|
-
|
|
2922
|
+
V?.configV2?.levels,
|
|
2923
|
+
Qt,
|
|
2924
2924
|
Dr,
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
]), Ar =
|
|
2925
|
+
Yt,
|
|
2926
|
+
Xt
|
|
2927
|
+
]), Ar = F(() => Oe({
|
|
2928
2928
|
columnName: Tr,
|
|
2929
2929
|
...Er
|
|
2930
|
-
}), [Tr, Er]), { getUnderlyingData: jr } =
|
|
2930
|
+
}), [Tr, Er]), { getUnderlyingData: jr } = bn({
|
|
2931
2931
|
clientName: r,
|
|
2932
2932
|
dbName: e?.companyIntegration?.name,
|
|
2933
2933
|
tenancyType: a,
|
|
2934
|
-
values:
|
|
2934
|
+
values: An,
|
|
2935
2935
|
companyId: e?.companyId,
|
|
2936
|
-
query:
|
|
2937
|
-
workspaceId:
|
|
2936
|
+
query: ze(e?.query, e?.companyId),
|
|
2937
|
+
workspaceId: S,
|
|
2938
2938
|
metricId: e?.id,
|
|
2939
|
-
dashboardId:
|
|
2940
|
-
rlsConditions:
|
|
2939
|
+
dashboardId: b,
|
|
2940
|
+
rlsConditions: H,
|
|
2941
2941
|
globalFilters: t,
|
|
2942
|
-
isAllClient: !!
|
|
2943
|
-
dataMartRelationships:
|
|
2942
|
+
isAllClient: !!h,
|
|
2943
|
+
dataMartRelationships: kn,
|
|
2944
2944
|
customSql: e?.clickActions?.underlyingData?.sql,
|
|
2945
|
-
isEnableCustomSQL:
|
|
2945
|
+
isEnableCustomSQL: U?.chartType === E.singleValue && e?.clickActions?.underlyingData?.isEnable && e?.clickActions?.underlyingData?.sql,
|
|
2946
2946
|
datasourceId: fe,
|
|
2947
|
-
drillFilters:
|
|
2948
|
-
token:
|
|
2949
|
-
isFrontendApp:
|
|
2950
|
-
encryptedClientId:
|
|
2947
|
+
drillFilters: Or,
|
|
2948
|
+
token: Je || "",
|
|
2949
|
+
isFrontendApp: g,
|
|
2950
|
+
encryptedClientId: g ? v || "" : r || ""
|
|
2951
2951
|
}), Mr = async (t, n, i, o, s, u) => {
|
|
2952
|
-
|
|
2952
|
+
x("drill-config-change-start", {
|
|
2953
2953
|
metricId: e?.id,
|
|
2954
2954
|
metricName: e?.name,
|
|
2955
2955
|
clickedLevelIndex: i,
|
|
@@ -2957,21 +2957,21 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2957
2957
|
clickName: n?.name,
|
|
2958
2958
|
clickValue: n?.value,
|
|
2959
2959
|
rowFilters: n?.rowFilters,
|
|
2960
|
-
incomingConfig:
|
|
2961
|
-
stateConfig:
|
|
2960
|
+
incomingConfig: f(t),
|
|
2961
|
+
stateConfig: f(V?.configV2)
|
|
2962
2962
|
});
|
|
2963
|
-
let
|
|
2964
|
-
if (!t || !
|
|
2965
|
-
|
|
2963
|
+
let d = e?.datasetMetricSettings;
|
|
2964
|
+
if (!t || !d?.newDatasetSettings?.configuration || !e?.companyIntegration?.name) {
|
|
2965
|
+
x("drill-config-change-skipped", {
|
|
2966
2966
|
metricId: e?.id,
|
|
2967
|
-
hasStateConfig: !!
|
|
2967
|
+
hasStateConfig: !!V?.configV2,
|
|
2968
2968
|
hasIncomingConfig: !!t,
|
|
2969
|
-
hasDatasetConfiguration: !!
|
|
2969
|
+
hasDatasetConfiguration: !!d?.newDatasetSettings?.configuration,
|
|
2970
2970
|
integrationName: e?.companyIntegration?.name
|
|
2971
2971
|
});
|
|
2972
2972
|
return;
|
|
2973
2973
|
}
|
|
2974
|
-
let p = n?.name, m = (t?.levels || []).find((e) => i ? e?.index === i : e?.isEnable),
|
|
2974
|
+
let p = n?.name, m = (t?.levels || []).find((e) => i ? e?.index === i : e?.isEnable), ee = m?.dimensions?.[0]?.alias, h = n?.rowFilters || [], { config: g, outcome: te } = wr({
|
|
2975
2975
|
config: t,
|
|
2976
2976
|
clickedLevelIndex: i,
|
|
2977
2977
|
isReset: o,
|
|
@@ -2980,105 +2980,105 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
2980
2980
|
adhocDescent: u,
|
|
2981
2981
|
enrichFilter: Dr
|
|
2982
2982
|
});
|
|
2983
|
-
if (
|
|
2983
|
+
if (x("drill-config-level-change-resolved", {
|
|
2984
2984
|
metricId: e?.id,
|
|
2985
2985
|
clickedLevelIndex: i,
|
|
2986
|
-
outcome:
|
|
2986
|
+
outcome: te,
|
|
2987
2987
|
filterValue: p,
|
|
2988
2988
|
rowFilters: n?.rowFilters,
|
|
2989
|
-
resolvedConfig:
|
|
2990
|
-
}),
|
|
2991
|
-
|
|
2989
|
+
resolvedConfig: f(g)
|
|
2990
|
+
}), te === "unrepresentable") {
|
|
2991
|
+
R(kr({
|
|
2992
2992
|
kind: "none",
|
|
2993
2993
|
reason: "blank-value"
|
|
2994
2994
|
}));
|
|
2995
2995
|
return;
|
|
2996
2996
|
}
|
|
2997
|
-
|
|
2998
|
-
let
|
|
2999
|
-
|
|
3000
|
-
config:
|
|
3001
|
-
selectedDims:
|
|
3002
|
-
selectedMetrics:
|
|
3003
|
-
previousSelectedDims:
|
|
3004
|
-
previousSelectedMetrics:
|
|
3005
|
-
}) ||
|
|
3006
|
-
let
|
|
3007
|
-
...
|
|
3008
|
-
xAxis:
|
|
3009
|
-
yAxisList:
|
|
3010
|
-
chartType:
|
|
3011
|
-
},
|
|
3012
|
-
if (
|
|
2997
|
+
R(null);
|
|
2998
|
+
let _ = g, ne = [...s || [], ...an], v = ne.length ? [...d?.newDatasetSettings?.selectedDims || [], ...ne] : d?.newDatasetSettings?.selectedDims;
|
|
2999
|
+
_ = Fe({
|
|
3000
|
+
config: _,
|
|
3001
|
+
selectedDims: v,
|
|
3002
|
+
selectedMetrics: d?.newDatasetSettings?.selectedMetrics,
|
|
3003
|
+
previousSelectedDims: v,
|
|
3004
|
+
previousSelectedMetrics: d?.newDatasetSettings?.selectedMetrics
|
|
3005
|
+
}) || _;
|
|
3006
|
+
let y = _?.levels?.find((e) => e?.isEnable), b = !!_?.levels?.[_?.levels?.length - 1]?.isEnable, S = _?.levels?.[0]?.isEnable, C = y?.chartSettings || U, re = C?.chartType === E.table, w = [...y?.dimensions?.map((e) => e.alias) || [], ...y?.measures?.map((e) => e.alias) || []], ie = {
|
|
3007
|
+
...C,
|
|
3008
|
+
xAxis: y?.dimensions?.[0]?.alias || "",
|
|
3009
|
+
yAxisList: b && !C?.chartType || re ? w : y?.measures?.map((e) => e.alias) || [],
|
|
3010
|
+
chartType: b && !C?.chartType ? E.table : C?.chartType
|
|
3011
|
+
}, T = `${y?.dimensions?.[0]?.table?.schemaName}.${y?.dimensions?.[0]?.table?.tableName}`;
|
|
3012
|
+
if (x("drill-config-next-state-ready", {
|
|
3013
3013
|
metricId: e?.id,
|
|
3014
3014
|
activeLevel: {
|
|
3015
|
-
index:
|
|
3016
|
-
name:
|
|
3017
|
-
filters:
|
|
3015
|
+
index: y?.index,
|
|
3016
|
+
name: y?.name,
|
|
3017
|
+
filters: y?.filters
|
|
3018
3018
|
},
|
|
3019
|
-
isLastLevel:
|
|
3020
|
-
isFirstLevelActive:
|
|
3021
|
-
chartType:
|
|
3022
|
-
xAxis:
|
|
3023
|
-
yAxisList:
|
|
3024
|
-
tableColumns:
|
|
3025
|
-
updatedConfig:
|
|
3026
|
-
}),
|
|
3019
|
+
isLastLevel: b,
|
|
3020
|
+
isFirstLevelActive: S,
|
|
3021
|
+
chartType: ie?.chartType,
|
|
3022
|
+
xAxis: ie?.xAxis,
|
|
3023
|
+
yAxisList: ie?.yAxisList,
|
|
3024
|
+
tableColumns: w,
|
|
3025
|
+
updatedConfig: f(_)
|
|
3026
|
+
}), nn((e) => ({
|
|
3027
3027
|
...e,
|
|
3028
3028
|
configV2: {
|
|
3029
|
-
...
|
|
3030
|
-
levels:
|
|
3029
|
+
..._ || {},
|
|
3030
|
+
levels: _?.levels?.map((e) => e.index === y?.index ? {
|
|
3031
3031
|
...e,
|
|
3032
|
-
chartSettings:
|
|
3032
|
+
chartSettings: ie
|
|
3033
3033
|
} : e) || []
|
|
3034
3034
|
}
|
|
3035
|
-
})),
|
|
3035
|
+
})), W((e) => ie), x("drill-config-state-committed", {
|
|
3036
3036
|
metricId: e?.id,
|
|
3037
|
-
chartType:
|
|
3038
|
-
activeLevelIndex:
|
|
3039
|
-
drillConfig:
|
|
3040
|
-
}),
|
|
3041
|
-
let t =
|
|
3037
|
+
chartType: ie?.chartType,
|
|
3038
|
+
activeLevelIndex: y?.index,
|
|
3039
|
+
drillConfig: f(_)
|
|
3040
|
+
}), rn) {
|
|
3041
|
+
let t = Wn({
|
|
3042
3042
|
existing: l,
|
|
3043
3043
|
isReset: o,
|
|
3044
3044
|
levelIndex: i,
|
|
3045
3045
|
hasCurrentLevel: !!m,
|
|
3046
3046
|
filterValue: p,
|
|
3047
|
-
columnName:
|
|
3048
|
-
rowFilters:
|
|
3049
|
-
selectedDims:
|
|
3050
|
-
activeLevelTableName:
|
|
3047
|
+
columnName: ee,
|
|
3048
|
+
rowFilters: h,
|
|
3049
|
+
selectedDims: d?.newDatasetSettings?.selectedDims,
|
|
3050
|
+
activeLevelTableName: T,
|
|
3051
3051
|
tenancyLevel: a,
|
|
3052
3052
|
clientId: r
|
|
3053
|
-
}), n = !o && !i ?
|
|
3054
|
-
columnName:
|
|
3055
|
-
rowFilters:
|
|
3056
|
-
selectedDims:
|
|
3053
|
+
}), n = !o && !i ? Un({
|
|
3054
|
+
columnName: ee,
|
|
3055
|
+
rowFilters: h,
|
|
3056
|
+
selectedDims: d?.newDatasetSettings?.selectedDims
|
|
3057
3057
|
}) : void 0;
|
|
3058
|
-
|
|
3058
|
+
x("drill-cross-filter-state-committed", {
|
|
3059
3059
|
metricId: e?.id,
|
|
3060
3060
|
crossFilterCount: t?.length || 0,
|
|
3061
3061
|
drillCrossFilters: t
|
|
3062
|
-
}), n ?
|
|
3062
|
+
}), n ? R({
|
|
3063
3063
|
title: "Filter unavailable",
|
|
3064
3064
|
body: n
|
|
3065
3065
|
}) : c?.(t);
|
|
3066
3066
|
}
|
|
3067
3067
|
}, Nr = ({ columnName: t, value: n, mode: i = "only" }) => {
|
|
3068
|
-
if (!
|
|
3069
|
-
let o = e?.datasetMetricSettings, s =
|
|
3068
|
+
if (!rn) return;
|
|
3069
|
+
let o = e?.datasetMetricSettings, s = Un({
|
|
3070
3070
|
columnName: t,
|
|
3071
3071
|
selectedDims: o?.newDatasetSettings?.selectedDims,
|
|
3072
3072
|
requiresSchemaMetadata: !0
|
|
3073
3073
|
});
|
|
3074
3074
|
if (s) {
|
|
3075
|
-
|
|
3075
|
+
R({
|
|
3076
3076
|
title: "Filter unavailable",
|
|
3077
3077
|
body: s
|
|
3078
3078
|
});
|
|
3079
3079
|
return;
|
|
3080
3080
|
}
|
|
3081
|
-
let u =
|
|
3081
|
+
let u = Yn({
|
|
3082
3082
|
existing: l,
|
|
3083
3083
|
columnName: t,
|
|
3084
3084
|
value: n,
|
|
@@ -3087,28 +3087,28 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3087
3087
|
tenancyLevel: a,
|
|
3088
3088
|
clientId: r
|
|
3089
3089
|
});
|
|
3090
|
-
|
|
3090
|
+
x("point-cross-filter-committed", {
|
|
3091
3091
|
metricId: e?.id,
|
|
3092
3092
|
columnName: t,
|
|
3093
3093
|
mode: i,
|
|
3094
3094
|
crossFilterCount: u?.length || 0
|
|
3095
3095
|
}), c?.(u);
|
|
3096
|
-
},
|
|
3096
|
+
}, Pr = ({ columnName: t, value: n, mode: i = "only" }) => {
|
|
3097
3097
|
if (!e?.id) return;
|
|
3098
|
-
let o = e?.datasetMetricSettings, s =
|
|
3098
|
+
let o = e?.datasetMetricSettings, s = Un({
|
|
3099
3099
|
columnName: t,
|
|
3100
3100
|
selectedDims: o?.newDatasetSettings?.selectedDims,
|
|
3101
3101
|
requiresSchemaMetadata: !0
|
|
3102
3102
|
});
|
|
3103
3103
|
if (s) {
|
|
3104
|
-
|
|
3104
|
+
R({
|
|
3105
3105
|
title: "Filter unavailable",
|
|
3106
3106
|
body: s
|
|
3107
3107
|
});
|
|
3108
3108
|
return;
|
|
3109
3109
|
}
|
|
3110
|
-
let c =
|
|
3111
|
-
existing:
|
|
3110
|
+
let c = Yn({
|
|
3111
|
+
existing: ge,
|
|
3112
3112
|
columnName: t,
|
|
3113
3113
|
value: n,
|
|
3114
3114
|
mode: i,
|
|
@@ -3116,57 +3116,57 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3116
3116
|
tenancyLevel: a,
|
|
3117
3117
|
clientId: r
|
|
3118
3118
|
});
|
|
3119
|
-
|
|
3119
|
+
x("metric-filter-committed", {
|
|
3120
3120
|
metricId: e?.id,
|
|
3121
3121
|
columnName: t,
|
|
3122
3122
|
mode: i,
|
|
3123
3123
|
filterCount: c?.length || 0
|
|
3124
|
-
}),
|
|
3125
|
-
},
|
|
3126
|
-
|
|
3124
|
+
}), _e?.(e.id, c);
|
|
3125
|
+
}, Ir = async (t, n) => {
|
|
3126
|
+
x("drill-down-handler-start", {
|
|
3127
3127
|
metricId: e?.id,
|
|
3128
3128
|
metricName: e?.name,
|
|
3129
3129
|
paramsName: t?.name,
|
|
3130
3130
|
paramsValue: t?.value,
|
|
3131
3131
|
paramsSeriesName: t?.seriesName,
|
|
3132
3132
|
rowFilters: t?.rowFilters || n,
|
|
3133
|
-
drillConfig:
|
|
3134
|
-
}), await Mr(
|
|
3133
|
+
drillConfig: f(V?.configV2)
|
|
3134
|
+
}), await Mr(V?.configV2, t), x("drill-down-handler-complete", {
|
|
3135
3135
|
metricId: e?.id,
|
|
3136
3136
|
metricName: e?.name
|
|
3137
3137
|
});
|
|
3138
|
-
},
|
|
3138
|
+
}, Rr = async ({ dimension: t, params: n, point: r }) => {
|
|
3139
3139
|
if (!t?.alias) return;
|
|
3140
|
-
let i = e?.datasetMetricSettings, a =
|
|
3140
|
+
let i = e?.datasetMetricSettings, a = V?.configV2, o = a?.levels || [], s = o.findIndex((e) => e?.isEnable), c = (s >= 0 ? o.slice(0, s + 1) : []).map((e) => ({
|
|
3141
3141
|
...e,
|
|
3142
3142
|
isEnable: !1
|
|
3143
|
-
})), l =
|
|
3143
|
+
})), l = br({
|
|
3144
3144
|
dimension: t,
|
|
3145
3145
|
measures: i?.newDatasetSettings?.selectedMetrics || [],
|
|
3146
|
-
index:
|
|
3147
|
-
chartSettings:
|
|
3146
|
+
index: ve(4),
|
|
3147
|
+
chartSettings: U
|
|
3148
3148
|
}), u = {
|
|
3149
3149
|
...a || {},
|
|
3150
3150
|
isEnable: !0,
|
|
3151
3151
|
levels: [...c, l]
|
|
3152
|
-
},
|
|
3153
|
-
columnName:
|
|
3154
|
-
parentFilters:
|
|
3155
|
-
pointFilters:
|
|
3152
|
+
}, d = c[c.length - 1], p = {
|
|
3153
|
+
columnName: d?.dimensions?.[0]?.alias || i?.newDatasetSettings?.selectedDims?.[0]?.alias,
|
|
3154
|
+
parentFilters: d?.filters || [],
|
|
3155
|
+
pointFilters: er(r, Dr).filters
|
|
3156
3156
|
};
|
|
3157
|
-
|
|
3157
|
+
x("adhoc-drill-start", {
|
|
3158
3158
|
metricId: e?.id,
|
|
3159
3159
|
dimensionAlias: t?.alias,
|
|
3160
3160
|
clickedValue: n?.name,
|
|
3161
3161
|
seededConfig: !a,
|
|
3162
|
-
drillConfig:
|
|
3163
|
-
}),
|
|
3162
|
+
drillConfig: f(u)
|
|
3163
|
+
}), on((e) => e.some((e) => e?.alias === t?.alias) ? e : [...e, t]), nn((e) => ({
|
|
3164
3164
|
...e,
|
|
3165
3165
|
isEnableGroupBy: !0,
|
|
3166
3166
|
configV2: u
|
|
3167
3167
|
})), await Mr(u, n, void 0, !1, [t], p);
|
|
3168
3168
|
}, qr = ({ filters: n, nextLevel: i, currentValue: a }) => {
|
|
3169
|
-
let o = e?.datasetMetricSettings?.newDatasetSettings, s = o?.configuration, c = o?.selectedDims || [], l = o?.selectedMetrics || [], u = e?.datasetMetricSettings?.createdSorts || [], { headerColumns: d, nonHeaderColumns: f } = c.reduce((e, t) => (
|
|
3169
|
+
let o = e?.datasetMetricSettings?.newDatasetSettings, s = o?.configuration, c = o?.selectedDims || [], l = o?.selectedMetrics || [], u = e?.datasetMetricSettings?.createdSorts || [], { headerColumns: d, nonHeaderColumns: f } = c.reduce((e, t) => (U?.pivotTableSettings2?.headers?.includes(t.alias) ? e.headerColumns.push(t) : e.nonHeaderColumns.push(t), e), {
|
|
3170
3170
|
headerColumns: [],
|
|
3171
3171
|
nonHeaderColumns: []
|
|
3172
3172
|
}), p = n?.map((e) => `${e.columnName};;${e.value}`).join(";;");
|
|
@@ -3177,8 +3177,8 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3177
3177
|
isLoading: !0,
|
|
3178
3178
|
currentValue: a
|
|
3179
3179
|
}));
|
|
3180
|
-
let m = f.slice(0, i),
|
|
3181
|
-
let t = c.find((t) => t.alias === e.columnName ||
|
|
3180
|
+
let m = f.slice(0, i), ee = n?.map((e) => {
|
|
3181
|
+
let t = c.find((t) => t.alias === e.columnName || ae(t) === e.columnName);
|
|
3182
3182
|
if (t) return {
|
|
3183
3183
|
alias: t.alias || "",
|
|
3184
3184
|
columnName: t.name,
|
|
@@ -3189,32 +3189,32 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3189
3189
|
value: e.value,
|
|
3190
3190
|
relationOperator: "AND"
|
|
3191
3191
|
};
|
|
3192
|
-
}).filter((e) => e),
|
|
3192
|
+
}).filter((e) => e), h = [
|
|
3193
3193
|
...m,
|
|
3194
3194
|
...l,
|
|
3195
3195
|
...d
|
|
3196
|
-
], { aggregates:
|
|
3196
|
+
], { aggregates: te, dimensions: ne } = nt(h), y = Ie(u), b = lt(y, h), x = {
|
|
3197
3197
|
...s,
|
|
3198
|
-
dimensions:
|
|
3199
|
-
aggregates:
|
|
3200
|
-
filters: [...s.filters, ...
|
|
3201
|
-
orders:
|
|
3198
|
+
dimensions: ne,
|
|
3199
|
+
aggregates: te,
|
|
3200
|
+
filters: [...s.filters, ...ee],
|
|
3201
|
+
orders: b,
|
|
3202
3202
|
isApplyGlobalFilter: !0,
|
|
3203
3203
|
isApplyMetricFilter: !0,
|
|
3204
3204
|
globalFilters: t,
|
|
3205
|
-
rlsConditions:
|
|
3205
|
+
rlsConditions: H
|
|
3206
3206
|
};
|
|
3207
|
-
|
|
3207
|
+
tr({
|
|
3208
3208
|
data: {
|
|
3209
|
-
configuration:
|
|
3210
|
-
id:
|
|
3209
|
+
configuration: x,
|
|
3210
|
+
id: S,
|
|
3211
3211
|
datasourceId: fe,
|
|
3212
3212
|
dashboardId: "",
|
|
3213
3213
|
isCreateMetric: !0
|
|
3214
3214
|
},
|
|
3215
|
-
clientId:
|
|
3216
|
-
token:
|
|
3217
|
-
isFrontendApp:
|
|
3215
|
+
clientId: g ? v || "" : r,
|
|
3216
|
+
token: _ || "",
|
|
3217
|
+
isFrontendApp: g
|
|
3218
3218
|
}, { onSuccess(t) {
|
|
3219
3219
|
let n = t?.error, r = t?.data;
|
|
3220
3220
|
if (n?.message) Tn((e) => ({
|
|
@@ -3224,7 +3224,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3224
3224
|
currentValue: ""
|
|
3225
3225
|
}));
|
|
3226
3226
|
else {
|
|
3227
|
-
let t =
|
|
3227
|
+
let t = ue(Array.isArray(r) ? r : [], c, l), n = ye(t);
|
|
3228
3228
|
Tn((e) => ({
|
|
3229
3229
|
data: [...e.data, {
|
|
3230
3230
|
key: p,
|
|
@@ -3233,80 +3233,80 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3233
3233
|
error: "",
|
|
3234
3234
|
isLoading: !1,
|
|
3235
3235
|
currentValue: ""
|
|
3236
|
-
})),
|
|
3236
|
+
})), W((t) => ({
|
|
3237
3237
|
...t,
|
|
3238
3238
|
pivotTableSettings2: {
|
|
3239
|
-
...
|
|
3240
|
-
dimensions:
|
|
3241
|
-
headers:
|
|
3239
|
+
...U?.pivotTableSettings2,
|
|
3240
|
+
dimensions: D(f, e?.companyIntegration?.name || ""),
|
|
3241
|
+
headers: D(d, e?.companyIntegration?.name || "")
|
|
3242
3242
|
}
|
|
3243
3243
|
}));
|
|
3244
3244
|
}
|
|
3245
3245
|
} });
|
|
3246
|
-
}, Jr =
|
|
3247
|
-
|
|
3246
|
+
}, Jr = N(async (t, n) => {
|
|
3247
|
+
x("drill-level-click-handler-start", {
|
|
3248
3248
|
metricId: e?.id,
|
|
3249
3249
|
metricName: e?.name,
|
|
3250
3250
|
clickedLevelIndex: t,
|
|
3251
3251
|
isReset: !!n,
|
|
3252
|
-
drillConfig:
|
|
3253
|
-
}), n &&
|
|
3252
|
+
drillConfig: f(V?.configV2)
|
|
3253
|
+
}), n && on([]), R(null), await Mr(V?.configV2, void 0, t, n), x("drill-level-click-handler-complete", {
|
|
3254
3254
|
metricId: e?.id,
|
|
3255
3255
|
metricName: e?.name,
|
|
3256
3256
|
clickedLevelIndex: t,
|
|
3257
3257
|
isReset: !!n
|
|
3258
3258
|
});
|
|
3259
3259
|
}, [
|
|
3260
|
-
|
|
3260
|
+
V?.configV2,
|
|
3261
3261
|
e?.id,
|
|
3262
3262
|
e?.name
|
|
3263
|
-
]), Yr =
|
|
3264
|
-
if (e)
|
|
3263
|
+
]), Yr = N((e) => {
|
|
3264
|
+
if (e) jt((e) => [...e?.filter((e) => e.group !== `${z}`)]), At((e) => e - 1);
|
|
3265
3265
|
else {
|
|
3266
|
-
let e =
|
|
3266
|
+
let e = B.filter((e) => !e?.group)?.map((e) => ({
|
|
3267
3267
|
...e,
|
|
3268
|
-
name: `${e?.name}_${
|
|
3269
|
-
group: `${
|
|
3268
|
+
name: `${e?.name}_${z + 1}`,
|
|
3269
|
+
group: `${z + 1}`,
|
|
3270
3270
|
dependOn: e.dependOn ? {
|
|
3271
|
-
value: `${e.dependOn?.value}_${
|
|
3272
|
-
label: `${e.dependOn?.label}_${
|
|
3271
|
+
value: `${e.dependOn?.value}_${z + 1}`,
|
|
3272
|
+
label: `${e.dependOn?.label}_${z + 1}`,
|
|
3273
3273
|
customColumnName: e.dependOn?.customColumnName
|
|
3274
3274
|
} : void 0,
|
|
3275
3275
|
dependOns: e?.dependOns?.map((e) => ({
|
|
3276
|
-
value: `${e?.value}_${
|
|
3277
|
-
label: `${e?.label}_${
|
|
3276
|
+
value: `${e?.value}_${z + 1}`,
|
|
3277
|
+
label: `${e?.label}_${z + 1}`,
|
|
3278
3278
|
customColumnName: e?.customColumnName
|
|
3279
3279
|
})) || []
|
|
3280
3280
|
}));
|
|
3281
|
-
e.length && (
|
|
3281
|
+
e.length && (jt((t) => [...t, ...e]), At((e) => e + 1));
|
|
3282
3282
|
}
|
|
3283
|
-
}, [
|
|
3284
|
-
|
|
3283
|
+
}, [B]), Xr = N(async () => {
|
|
3284
|
+
Ht.report ? Ut((e) => ({
|
|
3285
3285
|
...e,
|
|
3286
3286
|
isOpen: !0
|
|
3287
|
-
})) : (
|
|
3287
|
+
})) : (Ut({
|
|
3288
3288
|
report: "",
|
|
3289
3289
|
isLoading: !0,
|
|
3290
3290
|
isOpen: !0
|
|
3291
|
-
}), await
|
|
3291
|
+
}), await nr({
|
|
3292
3292
|
data: {
|
|
3293
|
-
data:
|
|
3294
|
-
wId:
|
|
3293
|
+
data: X,
|
|
3294
|
+
wId: S
|
|
3295
3295
|
},
|
|
3296
|
-
clientId:
|
|
3297
|
-
token:
|
|
3298
|
-
isFrontendApp:
|
|
3296
|
+
clientId: g ? v || "" : r,
|
|
3297
|
+
token: _ || "",
|
|
3298
|
+
isFrontendApp: g
|
|
3299
3299
|
}, {
|
|
3300
3300
|
onSuccess(e) {
|
|
3301
3301
|
let t = e?.content;
|
|
3302
|
-
|
|
3302
|
+
Ut((e) => ({
|
|
3303
3303
|
...e,
|
|
3304
3304
|
report: t || "",
|
|
3305
3305
|
isLoading: !1
|
|
3306
3306
|
}));
|
|
3307
3307
|
},
|
|
3308
3308
|
onError() {
|
|
3309
|
-
|
|
3309
|
+
Ut((e) => ({
|
|
3310
3310
|
...e,
|
|
3311
3311
|
report: "",
|
|
3312
3312
|
isLoading: !1
|
|
@@ -3314,85 +3314,85 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3314
3314
|
}
|
|
3315
3315
|
}));
|
|
3316
3316
|
}, [
|
|
3317
|
-
|
|
3317
|
+
X,
|
|
3318
3318
|
r,
|
|
3319
|
+
g,
|
|
3320
|
+
_,
|
|
3319
3321
|
v,
|
|
3320
|
-
b,
|
|
3321
|
-
S,
|
|
3322
3322
|
r,
|
|
3323
|
-
|
|
3324
|
-
]),
|
|
3325
|
-
let t = e?.datasetMetricSettings?.newDatasetSettings, n = t?.configuration, r =
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3323
|
+
Ht
|
|
3324
|
+
]), Zr = F(() => {
|
|
3325
|
+
let t = e?.datasetMetricSettings?.newDatasetSettings, n = t?.configuration, r = Pe(X || []), i = r, a = t?.selectedDims?.some((e) => je(e?.datatype)) || re(X?.[0] || ""), o = t?.selectedDims?.length > 1 && t?.selectedMetrics?.length > 0, s = [
|
|
3326
|
+
E.pivot,
|
|
3327
|
+
E.pivotV2,
|
|
3328
|
+
E.pivotV3,
|
|
3329
|
+
E.timeSeries,
|
|
3330
|
+
E.treeMap,
|
|
3331
|
+
E.indianMap,
|
|
3332
|
+
E.geoBarMap,
|
|
3333
|
+
E.geoMap,
|
|
3334
|
+
E.geoScatterMap,
|
|
3335
|
+
E.worldMap
|
|
3336
3336
|
], c = !!n?.aggregates?.length && !!n?.dimensions?.length;
|
|
3337
|
-
return c && a && (i = [...r?.filter((e) => !s?.includes(e)), ...s]), c && !a && (i = [...r?.filter((e) => !s?.includes(e)), ...s?.filter((e) => e !==
|
|
3337
|
+
return c && a && (i = [...r?.filter((e) => !s?.includes(e)), ...s]), c && !a && (i = [...r?.filter((e) => !s?.includes(e)), ...s?.filter((e) => e !== E.timeSeries)]), !c && a && (i = [...r?.filter((e) => !s?.includes(e)), E.timeSeries]), !c && !a && (i = r?.filter((e) => !s?.includes(e))), V?.isEnableGroupBy && V?.configV2 && (i = i?.filter((e) => Ee?.includes(e))), o || (i = i?.filter((e) => e !== E.bubbleV2)), i;
|
|
3338
3338
|
}, [
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3339
|
+
X,
|
|
3340
|
+
U?.xAxis,
|
|
3341
|
+
V?.isEnableGroupBy,
|
|
3342
|
+
V?.configV2,
|
|
3343
3343
|
e?.datasetMetricSettings?.newDatasetSettings?.configuration?.aggregates,
|
|
3344
3344
|
e?.datasetMetricSettings?.newDatasetSettings?.configuration?.dimensions
|
|
3345
3345
|
]), $r = (t) => {
|
|
3346
|
-
let n = e?.datasetMetricSettings?.newDatasetSettings, r = n?.configuration, i = n?.selectedDims || [], a = n?.selectedMetrics || [], o = e?.companyIntegration?.name, s =
|
|
3347
|
-
|
|
3348
|
-
chartAggregateColumns:
|
|
3349
|
-
chartDimensions:
|
|
3350
|
-
chartMetrics:
|
|
3351
|
-
chartSettings:
|
|
3352
|
-
chartTimeColumns:
|
|
3346
|
+
let n = e?.datasetMetricSettings?.newDatasetSettings, r = n?.configuration, i = n?.selectedDims || [], a = n?.selectedMetrics || [], o = e?.companyIntegration?.name, s = U?.enduserMeasureAndDimensions?.isEnabled;
|
|
3347
|
+
Be({
|
|
3348
|
+
chartAggregateColumns: pe(D(a?.filter((e) => e.configType === "AGGREGATE" && s ? U?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias) : !0) || [], o), X || []),
|
|
3349
|
+
chartDimensions: pe(D(i?.filter((e) => !s || U?.enduserMeasureAndDimensions?.dimensions?.some((t) => t.value === e.alias)) || [], o), X || []),
|
|
3350
|
+
chartMetrics: pe(D(a?.filter((e) => !s || U?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias)) || [], o), X || []),
|
|
3351
|
+
chartSettings: U,
|
|
3352
|
+
chartTimeColumns: D(i?.filter((e) => je(e.datatype)), o),
|
|
3353
3353
|
chartType: t,
|
|
3354
3354
|
configAggregates: r?.aggregates,
|
|
3355
3355
|
configuration: n?.configuration,
|
|
3356
3356
|
dbName: o,
|
|
3357
3357
|
pivotHeaderColumns: [],
|
|
3358
|
-
resultData:
|
|
3359
|
-
setChartSettings:
|
|
3358
|
+
resultData: X || [],
|
|
3359
|
+
setChartSettings: W
|
|
3360
3360
|
});
|
|
3361
|
-
}, ei =
|
|
3362
|
-
|
|
3363
|
-
|
|
3361
|
+
}, ei = F(() => le(B.filter((e) => e.group && e.isAddOnMetrics && !e.isHiddenInUi && !e.isAppFilter), "group"), [B]), ti = F(() => U?.customSettings?.comparisonValueShow && U?.chartType === E.singleValue ? t?.filters?.find((e) => e?.as === "date") : void 0, [
|
|
3362
|
+
U?.customSettings?.comparisonValueShow,
|
|
3363
|
+
U?.chartType,
|
|
3364
3364
|
t?.filters?.find((e) => e?.as === "date")
|
|
3365
3365
|
]);
|
|
3366
|
-
|
|
3367
|
-
|
|
3366
|
+
P(() => {
|
|
3367
|
+
X?.length && sn.length ? un(!0) : un(!1);
|
|
3368
3368
|
}, [
|
|
3369
|
-
|
|
3370
|
-
|
|
3369
|
+
X,
|
|
3370
|
+
sn.length,
|
|
3371
3371
|
e?.integrationName,
|
|
3372
3372
|
e?.query
|
|
3373
3373
|
]);
|
|
3374
|
-
let ni =
|
|
3374
|
+
let ni = F(() => e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.some((e) => e.configType === "AGGREGATE") && e?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.map((e) => ({
|
|
3375
3375
|
value: e.alias,
|
|
3376
3376
|
label: e.alias
|
|
3377
|
-
})) || [], [e?.datasetMetricSettings?.newDatasetSettings]), ri =
|
|
3377
|
+
})) || [], [e?.datasetMetricSettings?.newDatasetSettings]), ri = F(() => e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.map((e) => ({
|
|
3378
3378
|
value: e?.alias || e?.name,
|
|
3379
3379
|
label: e?.alias || e?.name
|
|
3380
|
-
})) || [], [e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), { metricFilters: ii, leftPositionedMetricFilters: ai, rightPositionedMetricFilters: oi } =
|
|
3381
|
-
let t =
|
|
3382
|
-
rlsConditions:
|
|
3383
|
-
isFrontendApp:
|
|
3384
|
-
}), n =
|
|
3380
|
+
})) || [], [e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), { metricFilters: ii, leftPositionedMetricFilters: ai, rightPositionedMetricFilters: oi } = F(() => {
|
|
3381
|
+
let t = bi({
|
|
3382
|
+
rlsConditions: B,
|
|
3383
|
+
isFrontendApp: g
|
|
3384
|
+
}), n = at({
|
|
3385
3385
|
metric: e,
|
|
3386
|
-
isAllClient:
|
|
3386
|
+
isAllClient: h,
|
|
3387
3387
|
tenancyLevel: a
|
|
3388
|
-
}) || e?.isCreatedByClient && a !== "DATABASE" ?
|
|
3388
|
+
}) || e?.isCreatedByClient && a !== "DATABASE" ? ct({
|
|
3389
3389
|
filters: t,
|
|
3390
3390
|
clientId: r,
|
|
3391
|
-
isAllClient:
|
|
3392
|
-
clientColumnType:
|
|
3393
|
-
dataMartTables:
|
|
3391
|
+
isAllClient: h,
|
|
3392
|
+
clientColumnType: se,
|
|
3393
|
+
dataMartTables: He
|
|
3394
3394
|
}) : t, i = n.filter((e) => e.isAddOnMetrics);
|
|
3395
|
-
|
|
3395
|
+
Le && (i = i.filter((e) => tt(e, !0)));
|
|
3396
3396
|
let o = [], s = [];
|
|
3397
3397
|
return i.forEach((e) => {
|
|
3398
3398
|
e.position === "top-right" ? s.push(e) : o.push(e);
|
|
@@ -3402,67 +3402,67 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3402
3402
|
rightPositionedMetricFilters: s
|
|
3403
3403
|
};
|
|
3404
3404
|
}, [
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3405
|
+
B,
|
|
3406
|
+
g,
|
|
3407
|
+
Le,
|
|
3408
3408
|
e?.isCreatedByClient,
|
|
3409
3409
|
e?.isAutomaticClientScopeEnabled,
|
|
3410
3410
|
a,
|
|
3411
3411
|
r,
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
]),
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
].includes(
|
|
3412
|
+
h,
|
|
3413
|
+
se,
|
|
3414
|
+
He
|
|
3415
|
+
]), si = [
|
|
3416
|
+
E.pie,
|
|
3417
|
+
E.doughnut,
|
|
3418
|
+
E.rose,
|
|
3419
|
+
E.funnel,
|
|
3420
|
+
E.singleValue,
|
|
3421
|
+
E.table,
|
|
3422
|
+
E.pivot,
|
|
3423
|
+
E.horizontalStackTable,
|
|
3424
|
+
E.geoBarMap,
|
|
3425
|
+
E.geoMap,
|
|
3426
|
+
E.geoScatterMap,
|
|
3427
|
+
E.sankey,
|
|
3428
|
+
E.timeSeries,
|
|
3429
|
+
E.geoBarMap,
|
|
3430
|
+
E.geoMap,
|
|
3431
|
+
E.geoScatterMap,
|
|
3432
|
+
E.worldMap,
|
|
3433
|
+
E.boxplot,
|
|
3434
|
+
E.timeSeries,
|
|
3435
|
+
E.gantt
|
|
3436
|
+
].includes(U?.chartType) || (U?.isMultiDimension || U?.isDynamicSeries) && U?.seriesField !== "ungrouped", fi = N((t) => {
|
|
3437
3437
|
let n = e?.dataSecuritySettings?.csvColumns || [];
|
|
3438
3438
|
return t?.length ? t?.map((e) => {
|
|
3439
3439
|
let t = {};
|
|
3440
3440
|
for (let r in e) n?.includes(r) || (t[r] = e[r]);
|
|
3441
3441
|
return t;
|
|
3442
3442
|
}) : [];
|
|
3443
|
-
}, [e?.dataSecuritySettings]),
|
|
3444
|
-
|
|
3445
|
-
|
|
3443
|
+
}, [e?.dataSecuritySettings]), _i = F(() => fi(X), [X, fi]);
|
|
3444
|
+
P(() => {
|
|
3445
|
+
U || (W(e?.chartOptions), Dt({
|
|
3446
3446
|
limit: parseInt(e?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
|
|
3447
3447
|
offset: 0
|
|
3448
3448
|
}));
|
|
3449
|
-
}, [e?.chartOptions,
|
|
3450
|
-
|
|
3451
|
-
limit: parseInt(
|
|
3449
|
+
}, [e?.chartOptions, U]), P(() => {
|
|
3450
|
+
U?.tableSettings?.isServerSidePagination && U?.chartType === E.table && Dt({
|
|
3451
|
+
limit: parseInt(U?.tableSettings?.defaultRowSize || "100", 10),
|
|
3452
3452
|
offset: 0
|
|
3453
3453
|
});
|
|
3454
3454
|
}, [
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3455
|
+
U?.tableSettings?.isServerSidePagination,
|
|
3456
|
+
U?.chartType,
|
|
3457
|
+
U?.tableSettings?.defaultRowSize
|
|
3458
3458
|
]);
|
|
3459
|
-
let xi =
|
|
3460
|
-
xi.current = t,
|
|
3461
|
-
if (
|
|
3462
|
-
let e = xi.current?.filters?.find((e) => e.label ===
|
|
3459
|
+
let xi = I(t);
|
|
3460
|
+
xi.current = t, P(() => {
|
|
3461
|
+
if (U?.chartType === E.timeSeries && U?.timeSeriesSettings?.groupBySettings?.isGlobalFilter && gr) {
|
|
3462
|
+
let e = xi.current?.filters?.find((e) => e.label === U?.timeSeriesSettings?.groupBySettings?.globalFilterOption?.value)?.value;
|
|
3463
3463
|
if ((typeof e == "string" || typeof e == "object" && e?.value) && e) {
|
|
3464
|
-
let t = typeof e == "string" ?
|
|
3465
|
-
|
|
3464
|
+
let t = typeof e == "string" ? De(e)?.toLowerCase() : U?.timeSeriesSettings?.groupBySettings?.formatWithValue?.find((t) => t.value === De(e?.value))?.format?.toLowerCase() || "";
|
|
3465
|
+
K?.find((e) => e?.value?.toLowerCase() === t) && W((e) => ({
|
|
3466
3466
|
...e,
|
|
3467
3467
|
timeSeriesSettings: {
|
|
3468
3468
|
...e?.timeSeriesSettings,
|
|
@@ -3471,109 +3471,109 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3471
3471
|
value: t
|
|
3472
3472
|
}
|
|
3473
3473
|
},
|
|
3474
|
-
xAxis:
|
|
3474
|
+
xAxis: G ? e.xAxis : `${t} of ${gr}`
|
|
3475
3475
|
}));
|
|
3476
3476
|
}
|
|
3477
3477
|
}
|
|
3478
3478
|
}, [
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3479
|
+
dr,
|
|
3480
|
+
U?.chartType,
|
|
3481
|
+
U?.timeSeriesSettings?.groupBySettings?.isGlobalFilter,
|
|
3482
|
+
U?.timeSeriesSettings?.groupBySettings?.globalFilterOption,
|
|
3483
3483
|
gr
|
|
3484
|
-
]),
|
|
3485
|
-
|
|
3484
|
+
]), P(() => {
|
|
3485
|
+
U?.isDynamicSeries && (U?.seriesOptions?.includes("ungrouped") ? U?.ungroupedAlias ? Sn(U?.seriesOptions?.map((e) => e === "ungrouped" ? {
|
|
3486
3486
|
value: e,
|
|
3487
|
-
label:
|
|
3487
|
+
label: U?.ungroupedAlias
|
|
3488
3488
|
} : {
|
|
3489
3489
|
value: e,
|
|
3490
3490
|
label: e
|
|
3491
|
-
})) :
|
|
3491
|
+
})) : Sn(U?.seriesOptions?.map((e) => ({
|
|
3492
3492
|
value: e,
|
|
3493
3493
|
label: e
|
|
3494
|
-
}))) :
|
|
3494
|
+
}))) : Sn([...U?.seriesOptions?.map((e) => ({
|
|
3495
3495
|
value: e,
|
|
3496
3496
|
label: e
|
|
3497
3497
|
})) ?? []]));
|
|
3498
3498
|
}, [
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3499
|
+
U?.seriesOptions,
|
|
3500
|
+
U?.isDynamicSeries,
|
|
3501
|
+
U?.ungroupedAlias
|
|
3502
3502
|
]);
|
|
3503
|
-
let [Si, Ci] =
|
|
3503
|
+
let [Si, Ci] = L(!1), wi = (e) => {
|
|
3504
3504
|
e.key === "Control" && Ci(!0);
|
|
3505
3505
|
}, Ti = (e) => {
|
|
3506
3506
|
e.key === "Control" && Ci(!1);
|
|
3507
3507
|
};
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
}, [
|
|
3508
|
+
P(() => {
|
|
3509
|
+
X?.length && Vt(Object.keys(X?.[0] || {}));
|
|
3510
|
+
}, [X?.length]), P(() => (U?.customSettings?.chartZoom?.isZoomEnabled && (window.addEventListener("keydown", wi), window.addEventListener("keyup", Ti)), () => {
|
|
3511
3511
|
window.removeEventListener("keydown", wi), window.removeEventListener("keyup", Ti);
|
|
3512
3512
|
}), []);
|
|
3513
|
-
let Ei =
|
|
3513
|
+
let Ei = F(() => {
|
|
3514
3514
|
let e = !1;
|
|
3515
|
-
if (
|
|
3516
|
-
let t =
|
|
3517
|
-
e =
|
|
3515
|
+
if (X?.length) {
|
|
3516
|
+
let t = U?.singleValue;
|
|
3517
|
+
e = X[0][t] === null && U?.chartType === E.singleValue;
|
|
3518
3518
|
}
|
|
3519
3519
|
return e;
|
|
3520
3520
|
}, [
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
]), Di =
|
|
3525
|
-
chartOptions:
|
|
3526
|
-
data:
|
|
3521
|
+
X?.length,
|
|
3522
|
+
U?.singleValue,
|
|
3523
|
+
U?.chartType === E.singleValue
|
|
3524
|
+
]), Di = F(() => rt({
|
|
3525
|
+
chartOptions: U,
|
|
3526
|
+
data: X || []
|
|
3527
3527
|
}), [
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
]), Oi =
|
|
3539
|
-
text:
|
|
3540
|
-
selectedLanguage:
|
|
3541
|
-
translationDictionary:
|
|
3528
|
+
X,
|
|
3529
|
+
U?.xAxis,
|
|
3530
|
+
U?.yAxisList,
|
|
3531
|
+
U?.dynamicXAxis?.isEnabled,
|
|
3532
|
+
U?.chartType,
|
|
3533
|
+
U?.seriesField,
|
|
3534
|
+
U?.customSettings?.cumulativeBar,
|
|
3535
|
+
U?.isGroupXAxis,
|
|
3536
|
+
U?.timeSeriesSettings?.seriesType[0],
|
|
3537
|
+
U?.timeSeriesSettings?.groupBySettings?.fillXAxis
|
|
3538
|
+
]), Oi = F(() => ke({
|
|
3539
|
+
text: We(e?.name || "", gn) || "",
|
|
3540
|
+
selectedLanguage: O,
|
|
3541
|
+
translationDictionary: k
|
|
3542
3542
|
}), [
|
|
3543
3543
|
e?.name,
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
]), ki =
|
|
3548
|
-
text:
|
|
3549
|
-
selectedLanguage:
|
|
3550
|
-
translationDictionary:
|
|
3544
|
+
gn,
|
|
3545
|
+
k,
|
|
3546
|
+
O
|
|
3547
|
+
]), ki = F(() => ke({
|
|
3548
|
+
text: We(e?.longDescription || "", gn) || "",
|
|
3549
|
+
selectedLanguage: O,
|
|
3550
|
+
translationDictionary: k
|
|
3551
3551
|
}), [
|
|
3552
3552
|
e?.longDescription,
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
]), Ai =
|
|
3557
|
-
text:
|
|
3558
|
-
selectedLanguage:
|
|
3559
|
-
translationDictionary:
|
|
3553
|
+
gn,
|
|
3554
|
+
O,
|
|
3555
|
+
k
|
|
3556
|
+
]), Ai = F(() => ke({
|
|
3557
|
+
text: We(e?.description || "", gn) || "",
|
|
3558
|
+
selectedLanguage: O,
|
|
3559
|
+
translationDictionary: k
|
|
3560
3560
|
}), [
|
|
3561
3561
|
e?.description,
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
]), ji =
|
|
3566
|
-
text:
|
|
3567
|
-
selectedLanguage:
|
|
3568
|
-
translationDictionary:
|
|
3562
|
+
gn,
|
|
3563
|
+
O,
|
|
3564
|
+
k
|
|
3565
|
+
]), ji = F(() => ke({
|
|
3566
|
+
text: We(e?.footNote || "", gn) || "",
|
|
3567
|
+
selectedLanguage: O,
|
|
3568
|
+
translationDictionary: k
|
|
3569
3569
|
}), [
|
|
3570
3570
|
e?.footNote,
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
]), Mi =
|
|
3571
|
+
gn,
|
|
3572
|
+
O,
|
|
3573
|
+
k
|
|
3574
|
+
]), Mi = F(() => `${X?.[0]?.dbn_metric_expression_data || "No Data Found"}`, [X]), Ni = F(() => e?.rlsConditions?.map((e) => {
|
|
3575
3575
|
if (e?.datatype === "date" && e?.options?.find((e) => e.range === "Custom Date") && e?.isEnableDynamicDate && e?.dynamicDate?.value) {
|
|
3576
|
-
let t =
|
|
3576
|
+
let t = he(Ve?.find((t) => t.value === e?.dynamicDate?.value)?.count || 0), n = Ke(t), r = Ke(t);
|
|
3577
3577
|
return {
|
|
3578
3578
|
...e,
|
|
3579
3579
|
options: e?.options?.map((e) => e.range === "Custom Date" ? {
|
|
@@ -3586,9 +3586,9 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3586
3586
|
}
|
|
3587
3587
|
return e;
|
|
3588
3588
|
}), [e?.rlsConditions]);
|
|
3589
|
-
|
|
3590
|
-
if (
|
|
3591
|
-
if (
|
|
3589
|
+
ht(() => {
|
|
3590
|
+
if (Gn && w?.((t) => {
|
|
3591
|
+
if (Br(t?.get(e?.id), Vn)) return t;
|
|
3592
3592
|
let n = new Map(t);
|
|
3593
3593
|
return n.set(e?.id, {
|
|
3594
3594
|
data: {
|
|
@@ -3596,18 +3596,18 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3596
3596
|
name: "",
|
|
3597
3597
|
description: ""
|
|
3598
3598
|
},
|
|
3599
|
-
isLoading:
|
|
3600
|
-
key:
|
|
3599
|
+
isLoading: Gn,
|
|
3600
|
+
key: Vn
|
|
3601
3601
|
}), n;
|
|
3602
|
-
}),
|
|
3603
|
-
let t =
|
|
3604
|
-
|
|
3605
|
-
if (
|
|
3602
|
+
}), Y?.data && C) {
|
|
3603
|
+
let t = vi(e?.id, ie) ? Y?.data : void 0;
|
|
3604
|
+
w?.((n) => {
|
|
3605
|
+
if (Gr(n?.get(e?.id), {
|
|
3606
3606
|
data: t,
|
|
3607
3607
|
name: e?.name || "",
|
|
3608
3608
|
description: e?.description || "",
|
|
3609
|
-
isLoading:
|
|
3610
|
-
key:
|
|
3609
|
+
isLoading: Gn,
|
|
3610
|
+
key: Vn
|
|
3611
3611
|
})) return n;
|
|
3612
3612
|
let r = new Map(n);
|
|
3613
3613
|
return r.set(e?.id, {
|
|
@@ -3616,22 +3616,22 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3616
3616
|
name: e?.name || "",
|
|
3617
3617
|
description: e?.description || ""
|
|
3618
3618
|
},
|
|
3619
|
-
isLoading:
|
|
3620
|
-
key:
|
|
3619
|
+
isLoading: Gn,
|
|
3620
|
+
key: Vn
|
|
3621
3621
|
}), r;
|
|
3622
3622
|
});
|
|
3623
3623
|
}
|
|
3624
3624
|
}, [
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3625
|
+
Y?.data,
|
|
3626
|
+
Gn,
|
|
3627
|
+
Vn
|
|
3628
3628
|
]);
|
|
3629
|
-
let Pi =
|
|
3629
|
+
let Pi = I(e?.id);
|
|
3630
3630
|
Pi.current = e?.id;
|
|
3631
|
-
let Fi =
|
|
3632
|
-
Fi.current =
|
|
3633
|
-
let Ii =
|
|
3634
|
-
Ii.current =
|
|
3631
|
+
let Fi = I(C);
|
|
3632
|
+
Fi.current = C;
|
|
3633
|
+
let Ii = I(w);
|
|
3634
|
+
Ii.current = w, P(() => () => {
|
|
3635
3635
|
let e = Pi.current, t = Fi.current, n = Ii.current;
|
|
3636
3636
|
e && t && n && t.get(e)?.data?.data && n((t) => {
|
|
3637
3637
|
let n = t.get(e);
|
|
@@ -3646,30 +3646,30 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3646
3646
|
}), r;
|
|
3647
3647
|
});
|
|
3648
3648
|
}, []);
|
|
3649
|
-
let Li = !!e?.elementSettings?.summary?.metricList?.length, [Ri, zi] =
|
|
3650
|
-
|
|
3651
|
-
let e =
|
|
3649
|
+
let Li = !!e?.elementSettings?.summary?.metricList?.length, [Ri, zi] = L(0);
|
|
3650
|
+
P(() => {
|
|
3651
|
+
let e = C?.subscribe;
|
|
3652
3652
|
if (Li && typeof e == "function") return e(() => zi((e) => e + 1));
|
|
3653
|
-
}, [
|
|
3654
|
-
|
|
3655
|
-
}, [
|
|
3656
|
-
let Bi = () => !!e?.elementSettings?.summary?.metricList?.some((e) =>
|
|
3657
|
-
|
|
3653
|
+
}, [C, Li]), ht(() => {
|
|
3654
|
+
wt.current !== Hn && (wt.current = Hn, yt());
|
|
3655
|
+
}, [Hn, yt]);
|
|
3656
|
+
let Bi = () => !!e?.elementSettings?.summary?.metricList?.some((e) => C?.get(e.value)?.isLoading === !0);
|
|
3657
|
+
ht(() => {
|
|
3658
3658
|
let t = e?.elementSettings?.summary;
|
|
3659
|
-
if (!t?.metricList?.length || !
|
|
3660
|
-
let n = t.metricList.map((e) =>
|
|
3659
|
+
if (!t?.metricList?.length || !C?.get(e?.id)) return;
|
|
3660
|
+
let n = t.metricList.map((e) => C.get(e.value));
|
|
3661
3661
|
if (n.some((e) => e?.isLoading)) return;
|
|
3662
3662
|
let i = JSON.stringify({
|
|
3663
3663
|
keys: n.map((e) => [e?.key, !!e?.data?.data?.length]),
|
|
3664
3664
|
prompt: t.summaryPrompt,
|
|
3665
3665
|
id: e?.id,
|
|
3666
|
-
identity:
|
|
3666
|
+
identity: Hn
|
|
3667
3667
|
}), a = n.map((e) => ({
|
|
3668
3668
|
data: e?.data?.data || [],
|
|
3669
3669
|
metricName: e?.data?.name,
|
|
3670
3670
|
metricDescription: e?.data?.description
|
|
3671
3671
|
})), o = a.every((e) => e.data.length > 0);
|
|
3672
|
-
|
|
3672
|
+
_t(i, o ? (i) => pt.mutateAsync({
|
|
3673
3673
|
signal: i,
|
|
3674
3674
|
data: {
|
|
3675
3675
|
metricData: a,
|
|
@@ -3678,43 +3678,43 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3678
3678
|
filters: n.map((e) => e?.key).join("###"),
|
|
3679
3679
|
name: e?.name,
|
|
3680
3680
|
description: e?.description,
|
|
3681
|
-
workspaceId:
|
|
3681
|
+
workspaceId: S
|
|
3682
3682
|
},
|
|
3683
|
-
token:
|
|
3684
|
-
clientId:
|
|
3685
|
-
isFrontendApp:
|
|
3683
|
+
token: _ || "",
|
|
3684
|
+
clientId: g ? v || "" : r,
|
|
3685
|
+
isFrontendApp: g
|
|
3686
3686
|
}) : void 0);
|
|
3687
3687
|
}, [
|
|
3688
3688
|
e?.elementSettings,
|
|
3689
3689
|
e?.id,
|
|
3690
3690
|
e?.name,
|
|
3691
3691
|
e?.description,
|
|
3692
|
-
|
|
3692
|
+
C,
|
|
3693
3693
|
Ri,
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
T,
|
|
3698
|
-
b,
|
|
3699
|
-
v,
|
|
3694
|
+
Hn,
|
|
3695
|
+
_t,
|
|
3696
|
+
pt,
|
|
3700
3697
|
S,
|
|
3698
|
+
_,
|
|
3699
|
+
g,
|
|
3700
|
+
v,
|
|
3701
3701
|
r
|
|
3702
|
-
]),
|
|
3703
|
-
let e =
|
|
3704
|
-
if (
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
].includes(
|
|
3709
|
-
let e =
|
|
3710
|
-
|
|
3702
|
+
]), P(() => {
|
|
3703
|
+
let e = ot(U?.customSettings?.comboAxisSettings || []), t = e?.flatMap((e) => e?.measures), n = U?.yAxisList?.every((e) => t?.includes(e));
|
|
3704
|
+
if (U?.yAxisList?.length && U?.yAxisList?.length !== t?.length && !t?.length && [
|
|
3705
|
+
E.combo,
|
|
3706
|
+
E.timeSeries,
|
|
3707
|
+
E.horizontalCombo
|
|
3708
|
+
].includes(U?.chartType || "")) {
|
|
3709
|
+
let e = U?.yAxisList?.filter((e) => !U?.comboBarList?.includes(e))?.filter((e) => !t?.includes(e)), n = U?.customSettings?.comboStackAxisSymbols?.name || "", r = U?.customSettings?.comboLabelFormatter?.find((e) => e.axis === (n || "stack"))?.formatter, i = U?.comboBarList?.join(" and "), a = U?.customSettings?.comboLabelFormatter?.find((e) => e.axis === i)?.formatter;
|
|
3710
|
+
W((t) => ({
|
|
3711
3711
|
...t,
|
|
3712
3712
|
customSettings: {
|
|
3713
3713
|
...t.customSettings,
|
|
3714
|
-
comboAxisSettings:
|
|
3714
|
+
comboAxisSettings: ot([
|
|
3715
3715
|
...t.customSettings?.comboAxisSettings || [],
|
|
3716
3716
|
...e?.map((e) => {
|
|
3717
|
-
let t =
|
|
3717
|
+
let t = U?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = U?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
|
|
3718
3718
|
return {
|
|
3719
3719
|
axis: e,
|
|
3720
3720
|
measures: [e],
|
|
@@ -3722,36 +3722,36 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3722
3722
|
axis: e,
|
|
3723
3723
|
type: "line"
|
|
3724
3724
|
}],
|
|
3725
|
-
numberFormatter:
|
|
3725
|
+
numberFormatter: U?.customSettings?.numberFormatter,
|
|
3726
3726
|
labelFormatter: t,
|
|
3727
3727
|
prefix: n?.prefix || "",
|
|
3728
3728
|
suffix: n?.suffix || "",
|
|
3729
3729
|
isEnableLabelFormatter: !!t?.length
|
|
3730
3730
|
};
|
|
3731
3731
|
}),
|
|
3732
|
-
...
|
|
3733
|
-
axis:
|
|
3734
|
-
measures:
|
|
3735
|
-
chartTypes:
|
|
3732
|
+
...U?.comboBarList?.length && (U?.customSettings?.isCombineBarAxis || U?.customSettings?.isStackBar) ? [{
|
|
3733
|
+
axis: U?.customSettings?.isStackBar && n || i,
|
|
3734
|
+
measures: U?.comboBarList,
|
|
3735
|
+
chartTypes: U?.comboBarList?.map((e) => ({
|
|
3736
3736
|
axis: e,
|
|
3737
3737
|
type: "bar"
|
|
3738
3738
|
})),
|
|
3739
|
-
isEnableStackBar:
|
|
3740
|
-
numberFormatter:
|
|
3741
|
-
...
|
|
3742
|
-
prefix:
|
|
3743
|
-
suffix:
|
|
3739
|
+
isEnableStackBar: U?.customSettings?.isStackBar,
|
|
3740
|
+
numberFormatter: U?.customSettings?.numberFormatter,
|
|
3741
|
+
...U?.customSettings?.isStackBar ? {
|
|
3742
|
+
prefix: U?.customSettings?.comboStackAxisSymbols?.prefix || "",
|
|
3743
|
+
suffix: U?.customSettings?.comboStackAxisSymbols?.suffix || "",
|
|
3744
3744
|
labelFormatter: r,
|
|
3745
3745
|
isEnableLabelFormatter: !!r?.length
|
|
3746
3746
|
} : {
|
|
3747
|
-
prefix:
|
|
3748
|
-
suffix:
|
|
3747
|
+
prefix: U?.customSettings?.combinedAxisPrefix || "",
|
|
3748
|
+
suffix: U?.customSettings?.combinedAxisSuffix || "",
|
|
3749
3749
|
labelFormatter: a,
|
|
3750
3750
|
isEnableLabelFormatter: !!a?.length
|
|
3751
3751
|
}
|
|
3752
3752
|
}] : [],
|
|
3753
|
-
...
|
|
3754
|
-
let t =
|
|
3753
|
+
...U?.comboBarList?.length && !U?.customSettings?.isCombineBarAxis && !U?.customSettings?.isStackBar ? U?.comboBarList?.map((e) => {
|
|
3754
|
+
let t = U?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = U?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
|
|
3755
3755
|
return {
|
|
3756
3756
|
axis: e,
|
|
3757
3757
|
measures: [e],
|
|
@@ -3759,7 +3759,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3759
3759
|
axis: e,
|
|
3760
3760
|
type: "bar"
|
|
3761
3761
|
}],
|
|
3762
|
-
numberFormatter:
|
|
3762
|
+
numberFormatter: U?.customSettings?.numberFormatter,
|
|
3763
3763
|
labelFormatter: t,
|
|
3764
3764
|
prefix: n?.prefix || "",
|
|
3765
3765
|
suffix: n?.suffix || "",
|
|
@@ -3778,29 +3778,29 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3778
3778
|
comboBarList: []
|
|
3779
3779
|
}));
|
|
3780
3780
|
}
|
|
3781
|
-
if (t?.length &&
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
].includes(
|
|
3786
|
-
let e =
|
|
3787
|
-
(t?.filter((e) => !
|
|
3788
|
-
let t =
|
|
3789
|
-
|
|
3781
|
+
if (t?.length && U?.yAxisList?.length && (U?.yAxisList?.length !== t?.length || U?.yAxisList?.length === t?.length && !n) && [
|
|
3782
|
+
E.combo,
|
|
3783
|
+
E.timeSeries,
|
|
3784
|
+
E.horizontalCombo
|
|
3785
|
+
].includes(U?.chartType || "")) {
|
|
3786
|
+
let e = U?.yAxisList?.filter((e) => !t?.includes(e));
|
|
3787
|
+
(t?.filter((e) => !U?.yAxisList?.includes(e)))?.forEach((e) => {
|
|
3788
|
+
let t = U?.customSettings?.comboAxisSettings?.find((t) => t.measures?.includes(e)), n = t?.axis, r = (t?.measures?.length || 0) > 1;
|
|
3789
|
+
W((t) => ({
|
|
3790
3790
|
...t,
|
|
3791
3791
|
customSettings: {
|
|
3792
3792
|
...t.customSettings,
|
|
3793
|
-
comboAxisSettings:
|
|
3793
|
+
comboAxisSettings: ot(r ? t.customSettings?.comboAxisSettings?.map((t) => t.axis === n ? {
|
|
3794
3794
|
...t,
|
|
3795
3795
|
measures: t?.measures?.filter((t) => t !== e)
|
|
3796
3796
|
} : t)?.filter((e) => e?.measures?.length) || [] : t.customSettings?.comboAxisSettings?.filter((e) => e.axis !== n && e?.measures?.length) || [])
|
|
3797
3797
|
}
|
|
3798
3798
|
}));
|
|
3799
|
-
}), e?.length &&
|
|
3799
|
+
}), e?.length && W((t) => ({
|
|
3800
3800
|
...t,
|
|
3801
3801
|
customSettings: {
|
|
3802
3802
|
...t.customSettings,
|
|
3803
|
-
comboAxisSettings:
|
|
3803
|
+
comboAxisSettings: ot([...t.customSettings?.comboAxisSettings || [], ...e?.map((e) => ({
|
|
3804
3804
|
axis: e,
|
|
3805
3805
|
measures: [e],
|
|
3806
3806
|
chartTypes: [{
|
|
@@ -3811,11 +3811,11 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3811
3811
|
}
|
|
3812
3812
|
}));
|
|
3813
3813
|
}
|
|
3814
|
-
t?.length &&
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
].includes(
|
|
3814
|
+
t?.length && U?.yAxisList?.length && U?.yAxisList?.length === t?.length && n && [
|
|
3815
|
+
E.combo,
|
|
3816
|
+
E.timeSeries,
|
|
3817
|
+
E.horizontalCombo
|
|
3818
|
+
].includes(U?.chartType || "") && U?.customSettings?.comboAxisSettings?.length !== e?.length && W((t) => ({
|
|
3819
3819
|
...t,
|
|
3820
3820
|
customSettings: {
|
|
3821
3821
|
...t?.customSettings,
|
|
@@ -3823,43 +3823,43 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3823
3823
|
}
|
|
3824
3824
|
}));
|
|
3825
3825
|
}, [
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
]),
|
|
3841
|
-
|
|
3826
|
+
U?.yAxisList,
|
|
3827
|
+
U?.customSettings?.comboAxisSettings,
|
|
3828
|
+
U?.comboBarList,
|
|
3829
|
+
U?.customSettings?.isCombineBarAxis,
|
|
3830
|
+
U?.customSettings?.isStackBar,
|
|
3831
|
+
U?.customSettings?.comboStackAxisSymbols?.name,
|
|
3832
|
+
U?.customSettings?.comboStackAxisSymbols?.prefix,
|
|
3833
|
+
U?.customSettings?.comboStackAxisSymbols?.suffix,
|
|
3834
|
+
U?.customSettings?.comboLabelFormatter,
|
|
3835
|
+
U?.customSettings?.comboAxisSymbols,
|
|
3836
|
+
U?.customSettings?.numberFormatter,
|
|
3837
|
+
U?.customSettings?.combinedAxisPrefix,
|
|
3838
|
+
U?.customSettings?.combinedAxisSuffix,
|
|
3839
|
+
U?.chartType
|
|
3840
|
+
]), P(() => {
|
|
3841
|
+
U?.yAxisList?.length && U?.yAxisList?.length < 5 && U?.chartType === E.boxplot && W((e) => ({
|
|
3842
3842
|
...e,
|
|
3843
|
-
chartType:
|
|
3844
|
-
})), !
|
|
3843
|
+
chartType: E.line
|
|
3844
|
+
})), !U?.yAxisList?.length && U?.chartType === E.funnelV2 && W((e) => ({
|
|
3845
3845
|
...e,
|
|
3846
|
-
chartType:
|
|
3846
|
+
chartType: E.singleValue
|
|
3847
3847
|
}));
|
|
3848
|
-
}, [
|
|
3848
|
+
}, [U?.chartType, U?.yAxisList?.length]);
|
|
3849
3849
|
let Vi = ({ columnAlias: t, value: n, isClear: r = !1 }) => {
|
|
3850
3850
|
let i = e?.datasetMetricSettings;
|
|
3851
|
-
i &&
|
|
3851
|
+
i && Ue({
|
|
3852
3852
|
columnAlias: t,
|
|
3853
3853
|
datasetSettings: i,
|
|
3854
|
-
setTableColumnFilters:
|
|
3854
|
+
setTableColumnFilters: Nt,
|
|
3855
3855
|
value: n,
|
|
3856
3856
|
isClear: r
|
|
3857
3857
|
});
|
|
3858
3858
|
};
|
|
3859
|
-
|
|
3860
|
-
if (!
|
|
3861
|
-
let e =
|
|
3862
|
-
|
|
3859
|
+
P(() => {
|
|
3860
|
+
if (!U?.dynamicYAxis?.isEnabled || !U?.dynamicYAxis?.selectedOption || Array.isArray(U?.dynamicYAxis?.selectedOption)) return;
|
|
3861
|
+
let e = U?.dynamicYAxis?.selectedOption;
|
|
3862
|
+
W((t) => ({
|
|
3863
3863
|
...t,
|
|
3864
3864
|
dynamicYAxis: {
|
|
3865
3865
|
...t?.dynamicYAxis,
|
|
@@ -3867,14 +3867,14 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3867
3867
|
},
|
|
3868
3868
|
yAxisList: [e?.value]
|
|
3869
3869
|
}));
|
|
3870
|
-
}, [
|
|
3871
|
-
let t =
|
|
3872
|
-
if (!
|
|
3873
|
-
|
|
3870
|
+
}, [U?.dynamicYAxis?.selectedOption, U?.dynamicYAxis?.isEnabled]), P(() => {
|
|
3871
|
+
let t = M?.yAxisSettings?.find((t) => t?.yAxisSettings?.isEnable && t?.id === e?.id && t?.yAxisSettings?.yAxis && Array.isArray(t?.yAxisSettings?.yAxis) && t?.yAxisSettings?.yAxis?.length > 0), n = M?.xAxisSettings?.find((t) => t?.xAxisSettings?.isEnable && t?.id === e?.id && t?.xAxisSettings?.xaxis), r = V?.configV2?.levels?.length ? V : e?.drillDownSettings, i = hi(e?.chartOptions, r), a = i !== e?.chartOptions;
|
|
3872
|
+
if (!U?.dynamicYAxis?.isEnabled && !U?.dynamicXAxis?.isEnabled && !a || !t && !n && !a) {
|
|
3873
|
+
W((t) => e?.chartOptions || t);
|
|
3874
3874
|
return;
|
|
3875
3875
|
}
|
|
3876
3876
|
let o = t?.yAxisSettings?.yAxis?.[0];
|
|
3877
|
-
|
|
3877
|
+
W((e) => {
|
|
3878
3878
|
let t = a ? {
|
|
3879
3879
|
...e,
|
|
3880
3880
|
...i
|
|
@@ -3897,18 +3897,18 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3897
3897
|
};
|
|
3898
3898
|
});
|
|
3899
3899
|
}, [
|
|
3900
|
-
|
|
3900
|
+
M?.yAxisSettings,
|
|
3901
3901
|
e?.id,
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3902
|
+
M?.xAxisSettings,
|
|
3903
|
+
U?.dynamicYAxis?.isEnabled,
|
|
3904
|
+
U?.dynamicXAxis?.isEnabled,
|
|
3905
|
+
V,
|
|
3906
|
+
V?.configV2?.isEnable,
|
|
3907
|
+
V?.configV2?.levels,
|
|
3908
3908
|
e?.chartOptions,
|
|
3909
3909
|
e?.drillDownSettings
|
|
3910
|
-
]),
|
|
3911
|
-
|
|
3910
|
+
]), P(() => {
|
|
3911
|
+
U?.customSettings?.isShowDuration && U?.chartType === E.gantt && !U?.customSettings?.ganttTooltipKeys?.includes("Duration") && W((e) => ({
|
|
3912
3912
|
...e,
|
|
3913
3913
|
customSettings: {
|
|
3914
3914
|
...e?.customSettings,
|
|
@@ -3916,56 +3916,56 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3916
3916
|
}
|
|
3917
3917
|
}));
|
|
3918
3918
|
}, [
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3919
|
+
U?.customSettings?.isShowDuration,
|
|
3920
|
+
U?.chartType,
|
|
3921
|
+
U?.customSettings?.ganttTooltipKeys
|
|
3922
3922
|
]);
|
|
3923
|
-
let Hi =
|
|
3923
|
+
let Hi = F(() => e?.datasetMetricSettings?.selectedDimensions?.map((e) => de(e || "none")) || mi, [e?.datasetMetricSettings?.selectedDimensions]);
|
|
3924
3924
|
return {
|
|
3925
|
-
drillBlockedNotice:
|
|
3926
|
-
dismissDrillBlockedNotice: () =>
|
|
3927
|
-
elementSummary:
|
|
3928
|
-
elementSummaryError:
|
|
3929
|
-
elementSummaryEmpty:
|
|
3930
|
-
isLoadingSummary:
|
|
3931
|
-
stopSummary:
|
|
3925
|
+
drillBlockedNotice: mt,
|
|
3926
|
+
dismissDrillBlockedNotice: () => R(null),
|
|
3927
|
+
elementSummary: bt,
|
|
3928
|
+
elementSummaryError: xt,
|
|
3929
|
+
elementSummaryEmpty: St,
|
|
3930
|
+
isLoadingSummary: Ct,
|
|
3931
|
+
stopSummary: vt,
|
|
3932
3932
|
isMetricListLoading: Bi,
|
|
3933
3933
|
onDrillLevelClick: Jr,
|
|
3934
|
-
onDrillDown:
|
|
3934
|
+
onDrillDown: Ir,
|
|
3935
3935
|
onFilterDashboardTo: Nr,
|
|
3936
|
-
onFilterMetricTo:
|
|
3937
|
-
handleChartClick:
|
|
3938
|
-
dataDb:
|
|
3939
|
-
truncation:
|
|
3940
|
-
truncationNotice:
|
|
3936
|
+
onFilterMetricTo: Pr,
|
|
3937
|
+
handleChartClick: Cr,
|
|
3938
|
+
dataDb: X,
|
|
3939
|
+
truncation: Xn,
|
|
3940
|
+
truncationNotice: Zn,
|
|
3941
3941
|
getUnderlyingData: jr,
|
|
3942
3942
|
onChangeFilterValue: Sr,
|
|
3943
|
-
isShowChartPopup:
|
|
3944
|
-
setShowChartPopup:
|
|
3943
|
+
isShowChartPopup: Pt,
|
|
3944
|
+
setShowChartPopup: Ft,
|
|
3945
3945
|
columnName: Tr,
|
|
3946
|
-
chartParams:
|
|
3947
|
-
isQueryLoading: !
|
|
3946
|
+
chartParams: It,
|
|
3947
|
+
isQueryLoading: !zn && (Gn || st || dt || we && (!X?.length || Ei)),
|
|
3948
3948
|
isSingleValueNull: Ei,
|
|
3949
|
-
dynamicOptions:
|
|
3950
|
-
chartSettings:
|
|
3951
|
-
setChartSettings:
|
|
3949
|
+
dynamicOptions: xn,
|
|
3950
|
+
chartSettings: U,
|
|
3951
|
+
setChartSettings: W,
|
|
3952
3952
|
isEnableZoom: Si,
|
|
3953
|
-
filterValues:
|
|
3954
|
-
containerRef:
|
|
3955
|
-
drilledLevel:
|
|
3953
|
+
filterValues: An,
|
|
3954
|
+
containerRef: Tt,
|
|
3955
|
+
drilledLevel: Qt.length,
|
|
3956
3956
|
dimensions: Hi,
|
|
3957
|
-
rlsConditions:
|
|
3958
|
-
setRlsConditions:
|
|
3959
|
-
setTableLimit:
|
|
3960
|
-
isEnableNextBtn:
|
|
3961
|
-
isEnablePrevBtn:
|
|
3957
|
+
rlsConditions: B,
|
|
3958
|
+
setRlsConditions: jt,
|
|
3959
|
+
setTableLimit: Dt,
|
|
3960
|
+
isEnableNextBtn: Ot > Et?.limit + Et?.offset,
|
|
3961
|
+
isEnablePrevBtn: Et?.offset !== 0,
|
|
3962
3962
|
paginationInfo: {
|
|
3963
|
-
limit:
|
|
3964
|
-
offset:
|
|
3965
|
-
totalRecords:
|
|
3963
|
+
limit: Et?.limit,
|
|
3964
|
+
offset: Et?.offset,
|
|
3965
|
+
totalRecords: Ot
|
|
3966
3966
|
},
|
|
3967
3967
|
onChangePage: (e, t, n) => {
|
|
3968
|
-
|
|
3968
|
+
Dt(t ? {
|
|
3969
3969
|
limit: t,
|
|
3970
3970
|
offset: 0
|
|
3971
3971
|
} : (t) => {
|
|
@@ -3976,13 +3976,13 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3976
3976
|
};
|
|
3977
3977
|
});
|
|
3978
3978
|
},
|
|
3979
|
-
isExternalChart:
|
|
3980
|
-
isEnablePivotTable:
|
|
3981
|
-
groupByList:
|
|
3979
|
+
isExternalChart: U?.tableSettings?.isServerSidePagination && U?.chartType === E.table,
|
|
3980
|
+
isEnablePivotTable: ln,
|
|
3981
|
+
groupByList: sn,
|
|
3982
3982
|
hasNumberKeys: !0,
|
|
3983
3983
|
isEnableGauge: !0,
|
|
3984
3984
|
updateFilter: (e) => {
|
|
3985
|
-
|
|
3985
|
+
jt((t) => t?.map((t) => t.name === e.name && t.datatype === e.datatype && t.tableName === e.tableName && t.columnName === e.columnName ? {
|
|
3986
3986
|
...t,
|
|
3987
3987
|
isAddOnMetrics: !t.isAddOnMetrics
|
|
3988
3988
|
} : t));
|
|
@@ -3990,64 +3990,64 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
|
|
|
3990
3990
|
metricFilters: ii,
|
|
3991
3991
|
leftPositionedMetricFilters: ai,
|
|
3992
3992
|
rightPositionedMetricFilters: oi,
|
|
3993
|
-
drillFilters:
|
|
3993
|
+
drillFilters: Qt,
|
|
3994
3994
|
underlyingDataColumnMetadata: Ar,
|
|
3995
|
-
underlyingDataDrillFilters:
|
|
3996
|
-
drillType:
|
|
3997
|
-
tableResultsDownloadData:
|
|
3998
|
-
filterCsvColumns:
|
|
3999
|
-
appliedMetricFilters:
|
|
3995
|
+
underlyingDataDrillFilters: Or,
|
|
3996
|
+
drillType: V?.drillType,
|
|
3997
|
+
tableResultsDownloadData: _i,
|
|
3998
|
+
filterCsvColumns: fi,
|
|
3999
|
+
appliedMetricFilters: H,
|
|
4000
4000
|
pivotHeaderOptions: ni,
|
|
4001
|
-
pivotDrillState:
|
|
4001
|
+
pivotDrillState: wn,
|
|
4002
4002
|
onDrillPivotTable: qr,
|
|
4003
4003
|
legendData: Di,
|
|
4004
4004
|
timeseriesDimension: gr,
|
|
4005
|
-
isPythonMode:
|
|
4006
|
-
sortOrder:
|
|
4007
|
-
setSortOrder:
|
|
4008
|
-
isNotFirstRender:
|
|
4009
|
-
setNotFirstRender:
|
|
4010
|
-
isSorted:
|
|
4011
|
-
isInavlidForSort:
|
|
4005
|
+
isPythonMode: G,
|
|
4006
|
+
sortOrder: Rt,
|
|
4007
|
+
setSortOrder: zt,
|
|
4008
|
+
isNotFirstRender: Wt,
|
|
4009
|
+
setNotFirstRender: Gt,
|
|
4010
|
+
isSorted: vn,
|
|
4011
|
+
isInavlidForSort: si,
|
|
4012
4012
|
onAddComparison: Yr,
|
|
4013
4013
|
groupedRlsConditions: ei,
|
|
4014
4014
|
onGenerateMetricSummary: Xr,
|
|
4015
|
-
summary:
|
|
4016
|
-
setSummary:
|
|
4017
|
-
dataMartRelationships:
|
|
4015
|
+
summary: Ht,
|
|
4016
|
+
setSummary: Ut,
|
|
4017
|
+
dataMartRelationships: kn,
|
|
4018
4018
|
onChartChange: $r,
|
|
4019
|
-
isCompareValue:
|
|
4020
|
-
isShowChartPropertyPanel:
|
|
4021
|
-
setShowChartPropertyPanel:
|
|
4022
|
-
columnList:
|
|
4023
|
-
variables:
|
|
4019
|
+
isCompareValue: yr,
|
|
4020
|
+
isShowChartPropertyPanel: dn,
|
|
4021
|
+
setShowChartPropertyPanel: fn,
|
|
4022
|
+
columnList: Bt,
|
|
4023
|
+
variables: gn,
|
|
4024
4024
|
metricName: Oi,
|
|
4025
4025
|
longDescription: ki,
|
|
4026
4026
|
footNote: ji,
|
|
4027
4027
|
description: Ai,
|
|
4028
|
-
drilldownCols:
|
|
4028
|
+
drilldownCols: Kt,
|
|
4029
4029
|
switchMeasureOptions: ri,
|
|
4030
4030
|
metricExpressionResult: Mi,
|
|
4031
4031
|
dateFilter: ti,
|
|
4032
|
-
drillDownSettings:
|
|
4033
|
-
onDrillIntoDimension:
|
|
4034
|
-
adhocDrillDims:
|
|
4035
|
-
enabledCharts:
|
|
4036
|
-
tableColumnFilters:
|
|
4032
|
+
drillDownSettings: V,
|
|
4033
|
+
onDrillIntoDimension: Rr,
|
|
4034
|
+
adhocDrillDims: an,
|
|
4035
|
+
enabledCharts: Zr,
|
|
4036
|
+
tableColumnFilters: Mt,
|
|
4037
4037
|
onChangePaginationColumnFilters: Vi,
|
|
4038
|
-
queryError:
|
|
4039
|
-
queryPermissionDenied: !!
|
|
4040
|
-
refetchMetricData:
|
|
4041
|
-
customSwitchXAxis:
|
|
4042
|
-
savedMetricFilters: Ni ||
|
|
4038
|
+
queryError: zn || qn || Y?.error,
|
|
4039
|
+
queryPermissionDenied: !!qn?.isBatchAuth,
|
|
4040
|
+
refetchMetricData: Jn,
|
|
4041
|
+
customSwitchXAxis: jn,
|
|
4042
|
+
savedMetricFilters: Ni || pi
|
|
4043
4043
|
};
|
|
4044
4044
|
};
|
|
4045
|
-
function
|
|
4045
|
+
function vi(e, t) {
|
|
4046
4046
|
return t === void 0 || t.has(e);
|
|
4047
4047
|
}
|
|
4048
4048
|
//#endregion
|
|
4049
4049
|
//#region src/helpers/getValidRlsConditionOptions.ts
|
|
4050
|
-
var
|
|
4050
|
+
var yi = (e, t) => {
|
|
4051
4051
|
if (!t?.[e.name]) return;
|
|
4052
4052
|
let n = t?.[e.name]?.defaultOption?.toString(), r = (t?.[e.name]?.options)?.filter((t) => {
|
|
4053
4053
|
if (t == null) return !1;
|
|
@@ -4065,7 +4065,7 @@ var vi = (e, t) => {
|
|
|
4065
4065
|
"last",
|
|
4066
4066
|
"this",
|
|
4067
4067
|
"custom"
|
|
4068
|
-
].includes(e || "") || n && !
|
|
4068
|
+
].includes(e || "") || n && !Se({
|
|
4069
4069
|
endDate: t.endDate ?? t.toDate,
|
|
4070
4070
|
endTime: t.endTime,
|
|
4071
4071
|
startDate: t.startDate ?? t.fromDate,
|
|
@@ -4094,16 +4094,16 @@ var vi = (e, t) => {
|
|
|
4094
4094
|
}) ? n : void 0,
|
|
4095
4095
|
options: r
|
|
4096
4096
|
};
|
|
4097
|
-
},
|
|
4097
|
+
}, bi = ({ rlsConditions: e, isFrontendApp: t }) => e.filter((e) => (t || !e.isAppFilter) && !e.isHiddenInUi), xi = (e) => !!e && e !== "null" && e !== "undefined", Si = (e) => {
|
|
4098
4098
|
if (e == null) return null;
|
|
4099
4099
|
let t = typeof e == "string" ? e : String(e);
|
|
4100
4100
|
return t.length ? t : null;
|
|
4101
|
-
},
|
|
4101
|
+
}, Ci = ({ config: e, value: t, carryFilters: n = [] }) => {
|
|
4102
4102
|
if (!e?.isEnable) return {
|
|
4103
4103
|
ok: !1,
|
|
4104
4104
|
reason: "disabled"
|
|
4105
4105
|
};
|
|
4106
|
-
if (!
|
|
4106
|
+
if (!xi(e.dashboardId)) return {
|
|
4107
4107
|
ok: !1,
|
|
4108
4108
|
reason: "no_destination"
|
|
4109
4109
|
};
|
|
@@ -4112,7 +4112,7 @@ var vi = (e, t) => {
|
|
|
4112
4112
|
ok: !1,
|
|
4113
4113
|
reason: "no_target_filter"
|
|
4114
4114
|
};
|
|
4115
|
-
let i =
|
|
4115
|
+
let i = Si(t);
|
|
4116
4116
|
if (i === null) return {
|
|
4117
4117
|
ok: !1,
|
|
4118
4118
|
reason: "no_value"
|
|
@@ -4124,7 +4124,7 @@ var vi = (e, t) => {
|
|
|
4124
4124
|
a.forEach((e) => {
|
|
4125
4125
|
o.set(e.column, e.value);
|
|
4126
4126
|
});
|
|
4127
|
-
let s = `/externalDashboard/${encodeURIComponent(e.dashboardId)}/?${o.toString()}`, c =
|
|
4127
|
+
let s = `/externalDashboard/${encodeURIComponent(e.dashboardId)}/?${o.toString()}`, c = dt(s, { routeType: "internal" });
|
|
4128
4128
|
return c.ok ? {
|
|
4129
4129
|
ok: !0,
|
|
4130
4130
|
intent: {
|
|
@@ -4141,7 +4141,7 @@ var vi = (e, t) => {
|
|
|
4141
4141
|
navigation: c.code
|
|
4142
4142
|
}
|
|
4143
4143
|
};
|
|
4144
|
-
},
|
|
4144
|
+
}, wi = (e, t) => {
|
|
4145
4145
|
let n = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : null, { params: r, rowFilters: i } = t, a = e?.valueColumn?.trim();
|
|
4146
4146
|
if (a) {
|
|
4147
4147
|
let e = (i ?? []).find((e) => e?.columnName === a);
|
|
@@ -4150,7 +4150,7 @@ var vi = (e, t) => {
|
|
|
4150
4150
|
if (r && r.name !== void 0 && r.name !== null) return n(r.name);
|
|
4151
4151
|
let o = (i ?? []).find((e) => e?.value !== void 0 && e?.value !== null);
|
|
4152
4152
|
return o ? n(o.value) : null;
|
|
4153
|
-
},
|
|
4153
|
+
}, Ti = ft("triangle-alert", [
|
|
4154
4154
|
["path", {
|
|
4155
4155
|
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
4156
4156
|
key: "wmoenq"
|
|
@@ -4166,70 +4166,70 @@ var vi = (e, t) => {
|
|
|
4166
4166
|
]);
|
|
4167
4167
|
//#endregion
|
|
4168
4168
|
//#region src/charts/filteredEmptyState.ts
|
|
4169
|
-
function
|
|
4169
|
+
function Ei(e) {
|
|
4170
4170
|
let t = e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics, n = t?.length === 1 && typeof t[0]?.label == "string" && t[0].label.trim() ? t[0].label.trim().toLowerCase() : "data";
|
|
4171
4171
|
return {
|
|
4172
4172
|
title: `No ${n} in this selection.`,
|
|
4173
4173
|
hint: `Loosen the period, ${n} basis, or filters.`
|
|
4174
4174
|
};
|
|
4175
4175
|
}
|
|
4176
|
-
var
|
|
4176
|
+
var Di = {
|
|
4177
4177
|
notice: "_notice_vwpz7_1",
|
|
4178
4178
|
icon: "_icon_vwpz7_15"
|
|
4179
|
-
},
|
|
4180
|
-
className:
|
|
4179
|
+
}, Oi = ({ text: e }) => e ? /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
4180
|
+
className: Di.notice,
|
|
4181
4181
|
role: "status",
|
|
4182
4182
|
"data-testid": "custom-sql-filter-notice",
|
|
4183
|
-
children: [/* @__PURE__ */ (0,
|
|
4184
|
-
className:
|
|
4183
|
+
children: [/* @__PURE__ */ (0, R.jsx)(Ti, {
|
|
4184
|
+
className: Di.icon,
|
|
4185
4185
|
"aria-hidden": "true"
|
|
4186
|
-
}), /* @__PURE__ */ (0,
|
|
4187
|
-
}) : null,
|
|
4186
|
+
}), /* @__PURE__ */ (0, R.jsx)("span", { children: e })]
|
|
4187
|
+
}) : null, ki = (e) => {
|
|
4188
4188
|
let t = e.value ?? e.selectedVariableValue?.value;
|
|
4189
4189
|
return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim().length > 0 : t != null;
|
|
4190
|
-
},
|
|
4190
|
+
}, Ai = (e) => {
|
|
4191
4191
|
let t = e.label ?? e.name ?? e.column;
|
|
4192
4192
|
return typeof t == "string" && t.trim() ? t.trim() : "Filter";
|
|
4193
|
-
},
|
|
4193
|
+
}, ji = ({ isCustomSqlMetric: e, query: t, metricId: n, filters: r }) => {
|
|
4194
4194
|
if (!e) return [];
|
|
4195
|
-
let i =
|
|
4195
|
+
let i = Me(t || "");
|
|
4196
4196
|
return (r || []).flatMap((e) => {
|
|
4197
4197
|
let t = e.restrictedMetrics?.some((e) => e.value === n);
|
|
4198
|
-
if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !
|
|
4198
|
+
if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !ki(e)) return [];
|
|
4199
4199
|
let r = (e.variableStrings || []).filter(Boolean), a = r.filter((e) => !i.includes(e));
|
|
4200
4200
|
return r.length > 0 && a.length === 0 ? [] : [{
|
|
4201
|
-
label:
|
|
4201
|
+
label: Ai(e),
|
|
4202
4202
|
missingVariables: a
|
|
4203
4203
|
}];
|
|
4204
4204
|
});
|
|
4205
|
-
},
|
|
4206
|
-
let t =
|
|
4205
|
+
}, Mi = (e) => e.length === 1 ? e[0] : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e.at(-1)}`, Ni = (e) => {
|
|
4206
|
+
let t = ji(e);
|
|
4207
4207
|
if (!t.length) return null;
|
|
4208
4208
|
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.`;
|
|
4209
|
-
return n.length ? `${r} Add ${
|
|
4210
|
-
},
|
|
4209
|
+
return n.length ? `${r} Add ${Mi(n)} to the metric SQL.` : `${r} Configure matching filter variables in the metric SQL.`;
|
|
4210
|
+
}, Pi = ({ chart: e, valueColumn: t, isDrillEnabled: n, drilledLevel: r, dimensionCount: i, params: a, passAllData: o }) => {
|
|
4211
4211
|
let s = e?.chartType;
|
|
4212
|
-
return s ===
|
|
4212
|
+
return s === E.table || s === E.singleValue || n && r === i ? o ? a?.reduce((e, t) => (e[t.columnName] = t.value, e), {}) : a?.find((e) => e.columnName === t)?.value : [E.sankey, E.treeMap].includes(s) ? o ? {
|
|
4213
4213
|
name: a?.name,
|
|
4214
4214
|
value: a?.value
|
|
4215
4215
|
} : a?.value : o ? {
|
|
4216
4216
|
name: a?.name,
|
|
4217
4217
|
value: a?.value,
|
|
4218
4218
|
columnName: a?.seriesName
|
|
4219
|
-
} : t === e?.xAxis || s ===
|
|
4220
|
-
},
|
|
4221
|
-
let c =
|
|
4219
|
+
} : t === e?.xAxis || s === E.gauge && t === e?.gaugeSettings?.dimensions?.join(", ") ? a?.name : a?.seriesName === t || s === E.gauge && t === e?.gaugeSettings?.metric || [E.funnel].includes(s) ? a?.value : null;
|
|
4220
|
+
}, Fi = (e, t, n) => !e || t === n, Ii = ({ chart: e, chartWithMetric: t, chartWithDashboard: n, isDrillEnabled: r, drilledLevel: i, dimensionCount: a, isLastConfiguredDrillLevel: o, isTableRedirectAllowed: s = !0 }) => {
|
|
4221
|
+
let c = Fi(r, i, a), l = c || !!o, u = !!e?.isEnable && l && s, d = e?.routeType === "user";
|
|
4222
4222
|
return {
|
|
4223
4223
|
navigate: u && !d,
|
|
4224
4224
|
host: u && d,
|
|
4225
4225
|
openNestedMetric: !!t?.isEnable && c,
|
|
4226
4226
|
openDashboard: !!n?.isEnable && l
|
|
4227
4227
|
};
|
|
4228
|
-
},
|
|
4228
|
+
}, Li = mt.createContext({
|
|
4229
4229
|
navigate: null,
|
|
4230
4230
|
carryFilters: []
|
|
4231
|
-
}),
|
|
4232
|
-
let i = r?.length ? r :
|
|
4231
|
+
}), Ri = [], zi = ({ children: e, isEnabled: t = !1, onNavigate: n, carryFilters: r }) => {
|
|
4232
|
+
let i = r?.length ? r : Ri, a = mt.useMemo(() => ({
|
|
4233
4233
|
navigate: t && n ? n : null,
|
|
4234
4234
|
carryFilters: i
|
|
4235
4235
|
}), [
|
|
@@ -4237,25 +4237,25 @@ var Ei = {
|
|
|
4237
4237
|
n,
|
|
4238
4238
|
i
|
|
4239
4239
|
]);
|
|
4240
|
-
return /* @__PURE__ */ (0,
|
|
4240
|
+
return /* @__PURE__ */ (0, R.jsx)(Li.Provider, {
|
|
4241
4241
|
value: a,
|
|
4242
4242
|
children: e
|
|
4243
4243
|
});
|
|
4244
|
-
},
|
|
4245
|
-
let { navigate: e, carryFilters: t } =
|
|
4244
|
+
}, Bi = () => {
|
|
4245
|
+
let { navigate: e, carryFilters: t } = mt.useContext(Li), n = mt.useCallback((n, r) => {
|
|
4246
4246
|
if (!e) return !1;
|
|
4247
4247
|
let i = n?.clickActions?.chartWithDashboard;
|
|
4248
4248
|
if (!i?.isEnable) return !1;
|
|
4249
|
-
let a =
|
|
4249
|
+
let a = Ci({
|
|
4250
4250
|
config: i,
|
|
4251
|
-
value:
|
|
4251
|
+
value: wi(i, r),
|
|
4252
4252
|
carryFilters: t
|
|
4253
4253
|
});
|
|
4254
4254
|
return a.ok ? (e(a.intent), !0) : (typeof a.reason == "object" && a.reason.code === "unsafe_target" && console.warn(`[chartNavigation] dashboard navigation rejected: ${a.reason.navigation}`), !1);
|
|
4255
4255
|
}, [e, t]);
|
|
4256
4256
|
return e ? n : null;
|
|
4257
|
-
},
|
|
4257
|
+
}, Vi = (e) => {
|
|
4258
4258
|
if (typeof e == "function") return (t) => e(t);
|
|
4259
4259
|
};
|
|
4260
4260
|
//#endregion
|
|
4261
|
-
export {
|
|
4261
|
+
export { or as A, kn as B, Sr as C, tr as D, Xn as E, Mn as F, rn as G, Dn as H, Fn as I, an as J, un as K, jn as L, X as M, Kn as N, nr as O, qn as P, tn as Q, Ln as R, yr as S, lr as T, Tn as U, wn as V, ln as W, on as X, sn as Y, cn as Z, Nr as _, Pi as a, sr as b, Ei as c, bi as d, _i as f, Fr as g, Pr as h, Ii as i, Jn as j, er as k, Ti as l, Ir as m, Vi as n, Ni as o, $r as p, hn as q, Bi as r, Oi as s, zi as t, Ci as u, Dr as v, Z as w, vr as x, kr as y, q as z };
|