@databrainhq/plugin 0.17.9-beta.33 → 0.17.9-beta.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Accordion-BdGcYoH_.mjs → Accordion-DtzU-kv3.mjs} +1 -1
- package/dist/{Chart-D3fn0ghg.mjs → Chart-BKjKglnR.mjs} +760 -760
- package/dist/{CreateGlobalFilter-8t6GSGyT.mjs → CreateGlobalFilter-COJr9pxx.mjs} +195 -195
- package/dist/{CreateMetricV2-BJoSn42i.mjs → CreateMetricV2-CfcDgw3E.mjs} +146 -146
- package/dist/{DraggableItem-CzPHM5Ek.mjs → DraggableItem-B8IW0_no.mjs} +139 -139
- package/dist/{HorizontalStackTable-DNBbrIFn.mjs → HorizontalStackTable-BgTor_KQ.mjs} +48 -48
- package/dist/{ManageMetricsV2-1fBC-FFm.mjs → ManageMetricsV2-DM8gofxF.mjs} +3 -3
- package/dist/{MetricCardV2-D7p6yAv5.mjs → MetricCardV2-Ff__3yWl.mjs} +146 -146
- package/dist/{NoDataFound-1gLzunO6.mjs → NoDataFound-Ifpvns9-.mjs} +1 -1
- package/dist/{NoDataState-rNtw1p0V.mjs → NoDataState-DPVhHP6M.mjs} +2 -2
- package/dist/{Panel-DQXH8IBE.mjs → Panel-BUwtA4r-.mjs} +1 -1
- package/dist/{PivotTableV2-DfzyY9RC.mjs → PivotTableV2-DQU2H33d.mjs} +2 -2
- package/dist/{PivotTableV3-B97O3ZLD.mjs → PivotTableV3-BLp5-cQr.mjs} +4 -4
- package/dist/{Portal-DE_CdG2S.mjs → Portal-BP2ivXF8.mjs} +2480 -2388
- package/dist/{RadioButton-BOkJ0ZLZ.mjs → RadioButton-oGBMxhHq.mjs} +2 -2
- package/dist/{ScheduleEmail-BpdnxS9q.mjs → ScheduleEmail-CiO6PMLd.mjs} +517 -517
- package/dist/{SearchMetricData-sBWIMhvT.mjs → SearchMetricData-C4stwNY9.mjs} +1272 -1272
- package/dist/{SortPanel-CNjSmhPX.mjs → SortPanel-Cy82r5dX.mjs} +1332 -1332
- package/dist/{Table-ODMPh1l7.mjs → Table-Cg4EZCAG.mjs} +296 -296
- package/dist/{TagInputField-DYDsUtvi.mjs → TagInputField-DuY_whs7.mjs} +9 -9
- package/dist/{TextAreaField-D4VprIA4.mjs → TextAreaField-D5O-kEVL.mjs} +297 -297
- package/dist/{TimeSeriesSettings-BTj3ofRS.mjs → TimeSeriesSettings-TXu0_07R.mjs} +11 -11
- package/dist/{arrayToCsvString-D9T6ms_d.mjs → arrayToCsvString-Bj2E5XgM.mjs} +1 -1
- package/dist/{cardActions-BLBLsjcd.mjs → cardActions-BPRHHm2G.mjs} +21 -7
- package/dist/{cardQueryError-tZcXyRqS.mjs → cardQueryError-DFKFCfFx.mjs} +1274 -1274
- package/dist/{charts-CY0Vq7Bn.mjs → charts-C2loGjFP.mjs} +3 -3
- package/dist/{chevron-down-mMC3ps2h.mjs → chevron-down-BWD1dxqC.mjs} +6 -6
- package/dist/{conditionalFormatting-LaI9Vca7.mjs → conditionalFormatting-Ca-leGbK.mjs} +1 -1
- package/dist/{contrast-Clo5ZlPI.mjs → contrast-EppiiunY.mjs} +117 -112
- package/dist/{createGlobalFilter.module-CWkuVq9m.mjs → createGlobalFilter.module-B3yI7_04.mjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/{echarts-mz_HZpET.mjs → echarts-CsSfDZ5q.mjs} +2 -2
- package/dist/{metric.mutation-B8OUNYhj.mjs → metric.mutation-hYspHj1p.mjs} +1 -1
- package/dist/{option-ywDB8mz_.mjs → option-B1zeYJnm.mjs} +1 -1
- package/dist/{permissions-Rp1874rG.mjs → permissions-Bc9NDT2w.mjs} +359 -359
- package/dist/{pluginV3Request-CK6p_HfU.mjs → pluginV3Request-DFy6TETh.mjs} +1 -1
- package/dist/{renderer-DEc5om01.mjs → renderer-Bk8GbA94.mjs} +2 -2
- package/dist/{theme-CU-AvQm_.mjs → theme-BA-MvZE0.mjs} +1 -1
- package/dist/{timeseries-BBiiZaG9.mjs → timeseries-kGhqoQ6V.mjs} +1948 -1942
- package/dist/{toTasteAppearance-BnmM-nar.mjs → toTasteAppearance-CGUd4zvZ.mjs} +1 -1
- package/dist/{useGuesTokenUsageLog-CTqOyx82.mjs → useGuesTokenUsageLog-CVeQacbL.mjs} +1 -1
- package/dist/{usePublishArchivedMetrics-BsHt2ki1.mjs → usePublishArchivedMetrics-BGEBFLub.mjs} +2 -2
- package/dist/{useQuery-B_9KK0aG.mjs → useQuery-CNVFkkjT.mjs} +1 -1
- package/dist/webcomponents.es.js +3942 -3939
- package/dist/webcomponents.umd.js +184 -184
- package/package.json +2 -2
|
@@ -2,54 +2,54 @@ import "react";
|
|
|
2
2
|
import "react-dom";
|
|
3
3
|
import "react-dom/client";
|
|
4
4
|
import { a as e, c as t, i as n, s as r } from "./cardStates-DiUMQ7_o.mjs";
|
|
5
|
-
import { _t as i, p as a, vt as o } from "./pluginV3Request-
|
|
6
|
-
import { K as s, et as c, it as l, l as u, ot as d } from "./metric.mutation-
|
|
7
|
-
import { $ as f,
|
|
8
|
-
import { a as
|
|
9
|
-
import { c as
|
|
10
|
-
import { useCallback as
|
|
5
|
+
import { _t as i, p as a, vt as o } from "./pluginV3Request-DFy6TETh.mjs";
|
|
6
|
+
import { K as s, et as c, it as l, l as u, ot as d } from "./metric.mutation-hYspHj1p.mjs";
|
|
7
|
+
import { $ as f, Bi as p, Br as m, En as h, Fr as g, Gi as ee, Gt as _, Ha as te, Ht as ne, Ir as re, Jr as ie, Kr as ae, Kt as oe, La as se, Lr as ce, Lt as le, Ni as ue, On as v, Pr as de, Qr as fe, Sn as pe, Wn as me, Wr as y, Wt as he, Xt as b, Yi as ge, Zt as _e, _i as ve, bi as x, dn as S, en as ye, eo as be, fn as xe, gn as Se, hn as Ce, ii as we, ja as C, on as w, sn as Te, vi as Ee, vn as T } from "./Portal-BP2ivXF8.mjs";
|
|
8
|
+
import { a as De } from "./timeseries-kGhqoQ6V.mjs";
|
|
9
|
+
import { c as Oe, l as ke, m as Ae, n as je, s as Me, u as Ne } from "./RadioButton-oGBMxhHq.mjs";
|
|
10
|
+
import { useCallback as Pe, useEffect as Fe, useMemo as E, useRef as Ie, useState as D } from "react";
|
|
11
11
|
//#region src/helpers/chartDisplayValue.ts
|
|
12
|
-
var
|
|
12
|
+
var O = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
13
13
|
if (typeof e != "object" || !e) return e;
|
|
14
14
|
if (e instanceof Date) return e.toJSON();
|
|
15
15
|
if (t.has(e)) return "[Circular]";
|
|
16
16
|
if (t.add(e), Array.isArray(e)) {
|
|
17
|
-
let n = e.map((e) =>
|
|
17
|
+
let n = e.map((e) => O(e, t));
|
|
18
18
|
return t.delete(e), n;
|
|
19
19
|
}
|
|
20
|
-
let n = Object.keys(e).sort().reduce((n, r) => (n[r] =
|
|
20
|
+
let n = Object.keys(e).sort().reduce((n, r) => (n[r] = O(e[r], t), n), {});
|
|
21
21
|
return t.delete(e), n;
|
|
22
|
-
},
|
|
22
|
+
}, k = (e) => {
|
|
23
23
|
if (e == null) return "";
|
|
24
24
|
if (typeof e != "object") return `${e}`;
|
|
25
25
|
try {
|
|
26
|
-
return JSON.stringify(
|
|
26
|
+
return JSON.stringify(O(e));
|
|
27
27
|
} catch {
|
|
28
28
|
return `${e}`;
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, Le = (e) => !e || typeof e != "object" || Array.isArray(e) ? e : Object.keys(e).reduce((t, n) => {
|
|
31
31
|
let r = e[n];
|
|
32
|
-
return t[n] = typeof r == "object" && r ?
|
|
33
|
-
}, {}),
|
|
32
|
+
return t[n] = typeof r == "object" && r ? k(r) : r, t;
|
|
33
|
+
}, {}), Re = (e) => Array.isArray(e) ? e.map(Le) : e, ze = (e, t) => e?.label || t || e?.tableName || "", A = (e) => {
|
|
34
34
|
let t = /* @__PURE__ */ new Set();
|
|
35
35
|
return e.filter((e) => {
|
|
36
36
|
let n = JSON.stringify(e?.measures?.sort());
|
|
37
37
|
return !t.has(n) && (t.add(n), !0);
|
|
38
38
|
});
|
|
39
|
-
},
|
|
39
|
+
}, Be = (e) => e?.dataMartColumnAlias || e?.name || "", Ve = ({ configuration: e, savedConfiguration: t }) => e.table?.name?.trim() ? e : t?.table?.name?.trim() ? t : e, j = (e) => {
|
|
40
40
|
let t = /* @__PURE__ */ new Map();
|
|
41
41
|
e.alias && e.name && t.set(e.alias, e.name);
|
|
42
42
|
for (let n of e.joins || []) n.alias && n.name && t.set(n.alias, n.name);
|
|
43
43
|
return t;
|
|
44
|
-
},
|
|
44
|
+
}, M = (e, t, n) => {
|
|
45
45
|
let r = e.firstOperand, i = e.secondOperand, a = r?.parentAlias ? t.get(r.parentAlias) : void 0, o = i?.parentAlias ? t.get(i.parentAlias) : void 0;
|
|
46
46
|
return !a || !o || !r?.columnName || !i?.columnName ? !1 : n.some((e) => e.parentTableName === a && e.parentColumnName === r.columnName && e.childTableName === o && e.childColumnName === i.columnName || e.parentTableName === o && e.parentColumnName === i.columnName && e.childTableName === a && e.childColumnName === r.columnName);
|
|
47
|
-
},
|
|
47
|
+
}, He = (e, t) => {
|
|
48
48
|
let n = e.table, r = n?.joins || [];
|
|
49
49
|
if (!r.length || !t.length) return e;
|
|
50
|
-
let i =
|
|
50
|
+
let i = j(n), a = !1, o = r.map((e) => {
|
|
51
51
|
let n = e.conditions || [], r = n.filter((e) => {
|
|
52
|
-
let n =
|
|
52
|
+
let n = M(e, i, t);
|
|
53
53
|
return a ||= n, !n;
|
|
54
54
|
});
|
|
55
55
|
return r.length === n.length ? e : {
|
|
@@ -64,10 +64,10 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
64
64
|
joins: o
|
|
65
65
|
}
|
|
66
66
|
} : e;
|
|
67
|
-
},
|
|
67
|
+
}, Ue = (e, t, n) => M(e, j(t), n), We = (e) => !!e && e.operandType === "number", Ge = (e) => e.configType === "AGGREGATE" ? "number" : e.helperFunction ? "string" : e.cast?.value && e?.cast?.value !== "NONE" ? e?.cast?.value : e.datatype, N = (e, t = []) => {
|
|
68
68
|
let n = new Set(t.filter((e) => e?.name).map((e) => e.name));
|
|
69
69
|
return e.filter((e) => ["ASC", "DESC"].includes(e?.defaultSort || "")).map((e) => {
|
|
70
|
-
let t =
|
|
70
|
+
let t = m.includes(e?.helperFunction || ""), n = b([e])?.dimensions?.[0];
|
|
71
71
|
return e?.helperFunction === "date format" && e?.functionConfiguration ? {
|
|
72
72
|
method: e.defaultSort,
|
|
73
73
|
name: e?.alias || e?.name,
|
|
@@ -122,7 +122,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
122
122
|
}, u = (e) => {
|
|
123
123
|
let t = s(c[e.parentAlias]);
|
|
124
124
|
return t ? ` in table ${Ye(t)}` : "";
|
|
125
|
-
}, d = a.flatMap((e) => (e?.conditions || []).flatMap((e) =>
|
|
125
|
+
}, d = a.flatMap((e) => (e?.conditions || []).flatMap((e) => Ue(e, i, r) ? [] : [e?.firstOperand, e?.secondOperand])).find(l);
|
|
126
126
|
if (d) return {
|
|
127
127
|
code: "JOIN_COLUMN_HIDDEN",
|
|
128
128
|
message: `A column${u(d)} is hidden from viewers, but this join needs it.`,
|
|
@@ -134,27 +134,27 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
134
134
|
message: `A column${f ? u(f) : ""} is hidden from viewers, but this metric uses it.`,
|
|
135
135
|
hint: "Ask your admin to unhide it in the datamart, or pick another column."
|
|
136
136
|
};
|
|
137
|
-
}, Ze = ({ type: e, firstOperand: t, secondOperand: n }) => e === "METRIC" ||
|
|
138
|
-
let { mutate: pt } = u(), mt =
|
|
137
|
+
}, Ze = ({ type: e, firstOperand: t, secondOperand: n }) => e === "METRIC" || p.includes(t?.helperFunction || "") || p.includes(n?.helperFunction || "") ? "AGGREGATE" : "DIMENSION", Qe = ({ clientId: r, shouldApplyClientDataScope: p, clientSubsetData: O, setChartSettings: k, setError: Le, dbName: A = "", chartSettings: j, setData: M, setQuery: Ue, setLoading: N, setGroupByList: qe, data: F, limit: Ye, setDatasetSettings: Qe, token: $e, workspaceId: et, isDatabaseTenancy: tt, companyTenancyType: nt, clientColumnType: rt, setDrillDownSettings: it, drillDownSettings: I, datasourceId: at, datasetSettings: L, dashboardId: ot, id: R, companyId: st, isIncrementalJoin: z, onServerEvent: ct, metricEncryptedQuery: lt, rlsConditions: ut, isFrontendApp: dt, encryptedClientId: ft }) => {
|
|
138
|
+
let { mutate: pt } = u(), mt = be(), [ht, gt] = D(null), B = Pe((t) => {
|
|
139
139
|
let r = typeof t == "string" && t && e() === "viewer" ? Je(t, mt, R) : t;
|
|
140
140
|
if (typeof r == "string" || r == null) {
|
|
141
|
-
gt(null),
|
|
141
|
+
gt(null), Le(r);
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
gt(r),
|
|
144
|
+
gt(r), Le(n(r));
|
|
145
145
|
}, [
|
|
146
|
-
|
|
146
|
+
Le,
|
|
147
147
|
mt,
|
|
148
148
|
R
|
|
149
|
-
]), [_t, vt] =
|
|
149
|
+
]), [_t, vt] = D(!0), [V, yt] = D(), [H, bt] = D([]), [xt, St] = D([]), [Ct, wt] = D([]), [Tt, Et] = D({
|
|
150
150
|
data: [],
|
|
151
151
|
error: "",
|
|
152
152
|
isLoading: !1,
|
|
153
153
|
currentValue: ""
|
|
154
|
-
}), [U, W] =
|
|
154
|
+
}), [U, W] = D(ae), [G, K] = D([]), [q, J] = D([]), [Dt, Ot] = D({
|
|
155
155
|
value: "",
|
|
156
156
|
label: ""
|
|
157
|
-
}), [kt, At] =
|
|
157
|
+
}), [kt, At] = D([]), [jt, Mt] = D([]), [Y, Nt] = D([]), { data: Pt } = te(), Ft = nt || (tt ? "DATABASE" : "TABLE"), It = nt || Pt?.companyTenancyType || (tt ? "DATABASE" : void 0), Lt = !!tt || je(It), { mutate: Rt, error: zt } = f(), X = E(() => {
|
|
158
158
|
if (z) {
|
|
159
159
|
if (U?.table?.name && V?.tableName) {
|
|
160
160
|
if (U?.table?.joins?.length) return H?.filter((e) => e.tableName === U?.table?.name || U?.table?.joins?.[0]?.name === e.tableName);
|
|
@@ -172,35 +172,35 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
172
172
|
U,
|
|
173
173
|
z,
|
|
174
174
|
Ct
|
|
175
|
-
]), Bt =
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
].includes(
|
|
175
|
+
]), Bt = E(() => U.dimensions.length > 1 && !!U.aggregates.length, [U.dimensions, U.aggregates]), Vt = E(() => [
|
|
176
|
+
C.boxplot,
|
|
177
|
+
C.funnel,
|
|
178
|
+
C.funnelV2,
|
|
179
|
+
C.gauge,
|
|
180
|
+
C.geoBarMap,
|
|
181
|
+
C.geoMap,
|
|
182
|
+
C.geoScatterMap,
|
|
183
|
+
C.horizontalStackTable,
|
|
184
|
+
C.pivot,
|
|
185
|
+
C.pivotV2,
|
|
186
|
+
C.pivotV3,
|
|
187
|
+
C.sankey,
|
|
188
|
+
C.singleValue,
|
|
189
|
+
C.timeSeries,
|
|
190
|
+
C.treeMap
|
|
191
|
+
].includes(j.chartType), [j.chartType]), Z = E(() => G.length + q.length === 0, [G, q]), Ht = E(() => [fe, Ee].includes(A?.toLowerCase() || ""), [A]), Ut = E(() => ({ sorting: {
|
|
192
192
|
isEnabled: !0,
|
|
193
193
|
isEnabledAutoSort: !1,
|
|
194
194
|
sortingType: "both-axis",
|
|
195
195
|
list: G,
|
|
196
196
|
setList: K
|
|
197
|
-
} }), [G]), Wt =
|
|
197
|
+
} }), [G]), Wt = E(() => ({ sorting: {
|
|
198
198
|
isEnabled: !0,
|
|
199
199
|
isEnabledAutoSort: !1,
|
|
200
200
|
sortingType: "both-axis",
|
|
201
201
|
list: q,
|
|
202
202
|
setList: J
|
|
203
|
-
} }), [q]), Gt =
|
|
203
|
+
} }), [q]), Gt = E(() => j.chartType === C.timeSeries, [j.chartType]), Kt = Ie(null), qt = E(() => V ? V?.type === "custom" ? {
|
|
204
204
|
value: `none^^^^^^${V?.sql}^^^^^^${V?.alias || "dbn_sql_table"}^^^^^^custom`,
|
|
205
205
|
label: V?.alias || "dbn_sql_table",
|
|
206
206
|
icon: "table"
|
|
@@ -212,8 +212,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
212
212
|
value: "",
|
|
213
213
|
label: "",
|
|
214
214
|
icon: "table"
|
|
215
|
-
}, [V]), Jt =
|
|
216
|
-
let [e, t, n, r] = Dt.value?.split("^^^^^^"), i = r === "custom" ? n || "dbn_sql_table" : `${w(e,
|
|
215
|
+
}, [V]), Jt = E(() => {
|
|
216
|
+
let [e, t, n, r] = Dt.value?.split("^^^^^^"), i = r === "custom" ? n || "dbn_sql_table" : `${w(e, A)}_${t?.replaceAll(" ", "_")?.replace("*", "_")}`;
|
|
217
217
|
return r === "custom" ? (X?.find((e) => e.tableName === n)?.columnsWithDataType || [])?.map((e) => ({
|
|
218
218
|
value: `${n}^^^^^^${e.name}^^^^^^${e.dataType || ""}^^^^^^none^^^^^^${n}`,
|
|
219
219
|
label: `${e?.label || e.dataMartColumnAlias || e.name}`,
|
|
@@ -240,36 +240,36 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
240
240
|
}, [
|
|
241
241
|
X,
|
|
242
242
|
Dt.value,
|
|
243
|
-
|
|
244
|
-
]), Yt =
|
|
243
|
+
A
|
|
244
|
+
]), Yt = E(() => {
|
|
245
245
|
let e = U?.table?.joins?.map((e) => X?.find((t) => t?.schemaName === e?.schema && t?.tableName === e?.name))?.filter((e) => e) || [], t = X?.find((e) => e?.schemaName === U?.table?.schema && e?.tableName === U?.table?.name);
|
|
246
246
|
return (t ? [t, ...e?.filter((e) => e?.tableName !== t?.tableName) || []] : e || [])?.map((e) => ({
|
|
247
247
|
value: `${e.schemaName}^^^^^^${e.tableName}`,
|
|
248
|
-
label:
|
|
248
|
+
label: ze(e),
|
|
249
249
|
table: e
|
|
250
250
|
})) || [];
|
|
251
|
-
}, [U, X]), Xt =
|
|
252
|
-
|
|
253
|
-
let e =
|
|
251
|
+
}, [U, X]), Xt = E(() => {
|
|
252
|
+
j?.pivotTableSettings2;
|
|
253
|
+
let e = j?.chartType === C.timeSeries, [t, n, r] = Dt?.value?.split("^^^^^^");
|
|
254
254
|
return [...q, ...G?.filter((t) => !(S(t.cast?.value?.toLowerCase() || t.datatype?.toLowerCase()) && e))].filter((e) => e.table?.type === "custom" ? e.table?.alias === r : e.table?.tableName === n && e.table?.schemaName === t)?.map((e) => ({
|
|
255
255
|
value: `${e.parentAlias}^^^^^^${e.name || e.alias}^^^^^^${e.datatype}^^^^^^${e?.table?.schemaName}^^^^^^${e.table?.tableName}^^^^^^new`,
|
|
256
|
-
label: `${
|
|
256
|
+
label: `${_e(e) || e?.alias}`,
|
|
257
257
|
badge: "New",
|
|
258
258
|
column: e
|
|
259
259
|
}));
|
|
260
260
|
}, [
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
j?.pivotTableSettings2,
|
|
262
|
+
j.chartType,
|
|
263
263
|
Dt?.value,
|
|
264
264
|
q,
|
|
265
265
|
G
|
|
266
|
-
]), Zt =
|
|
266
|
+
]), Zt = E(() => {
|
|
267
267
|
if (!V) return [];
|
|
268
268
|
let e = U?.table?.joins?.map((e) => X?.find((t) => t?.schemaName === e?.schema && t?.tableName === e?.name))?.filter((e) => e) || [], t = X?.find((e) => tt ? e?.tableName === U?.table?.name : e?.tableName === U?.table?.name && e?.schemaName === U?.table?.schema);
|
|
269
269
|
return (t ? [...e, t] : [...e]).flatMap((e) => {
|
|
270
|
-
let t = X?.find((t) => tt ? t?.tableName === e?.tableName : t?.tableName === e?.tableName && t?.schemaName === e?.schemaName) || e, n = t?.type === "custom" ? t?.alias || "dbn_sql_table" : `${w(t?.schemaName,
|
|
270
|
+
let t = X?.find((t) => tt ? t?.tableName === e?.tableName : t?.tableName === e?.tableName && t?.schemaName === e?.schemaName) || e, n = t?.type === "custom" ? t?.alias || "dbn_sql_table" : `${w(t?.schemaName, A)}_${t?.tableName?.replaceAll(" ", "_")?.replace("*", "_")}`;
|
|
271
271
|
return t?.columnsWithDataType?.map((e) => ({
|
|
272
|
-
alias:
|
|
272
|
+
alias: Be(e),
|
|
273
273
|
label: e?.label || e?.dataMartColumnAlias || e?.name,
|
|
274
274
|
configType: e?.isAggregate ? "AGGREGATE" : "DIMENSION",
|
|
275
275
|
isApplyTimezone: e?.isApplyTimezone,
|
|
@@ -290,11 +290,11 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
290
290
|
})) || [];
|
|
291
291
|
});
|
|
292
292
|
}, [
|
|
293
|
-
|
|
293
|
+
A,
|
|
294
294
|
U?.table,
|
|
295
295
|
X
|
|
296
|
-
]), Qt =
|
|
297
|
-
let [e, t, n, r] = Dt?.value?.split("^^^^^^"), i = r === "custom" ? n || "dbn_sql_table" : `${w(e,
|
|
296
|
+
]), Qt = E(() => {
|
|
297
|
+
let [e, t, n, r] = Dt?.value?.split("^^^^^^"), i = r === "custom" ? n || "dbn_sql_table" : `${w(e, A)}_${t?.replaceAll(" ", "_")?.replace("*", "_")}`, a = Jt?.filter((e) => {
|
|
298
298
|
let [t, n] = e?.value?.split("^^^^^^");
|
|
299
299
|
return ![...G, ...q].some((e) => t === e?.parentAlias && n === e?.name && !e?.helperFunction);
|
|
300
300
|
})?.map((e) => ({
|
|
@@ -304,7 +304,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
304
304
|
let t = Ge(e);
|
|
305
305
|
return {
|
|
306
306
|
value: `${e?.parentAlias}^^^^^^${e?.name || e?.alias}^^^^^^${t}^^^^^^${e?.table?.schemaName}^^^^^^${e?.table?.tableName}^^^^^^${e?.helperFunction}^^^^^^${e?.alias}^^^^^^${e?.configType}^^^^^^${e?.isApplyTimezone}`,
|
|
307
|
-
label: `${
|
|
307
|
+
label: `${_e(e)}`,
|
|
308
308
|
badge: "New",
|
|
309
309
|
column: e,
|
|
310
310
|
dimension: {
|
|
@@ -326,9 +326,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
326
326
|
]), $t = (e, t) => {
|
|
327
327
|
let n = e?.cast?.value === "NONE" ? void 0 : e?.cast?.value, r = t || n || e?.datatype;
|
|
328
328
|
if (r) {
|
|
329
|
-
if (S(r)) return
|
|
330
|
-
if (
|
|
331
|
-
if (
|
|
329
|
+
if (S(r)) return j.chartType === C.timeSeries ? [] : ce;
|
|
330
|
+
if (ve.includes(r?.toLowerCase()) || r?.toLowerCase()?.startsWith("decimal") || r?.toLowerCase()?.startsWith("numeric")) return de;
|
|
331
|
+
if (ue.includes(r?.toLowerCase()) || r?.toLowerCase()?.includes("char")) return Ht ? r?.toLowerCase() === "keyword" || r?.toLowerCase().includes("keyword") || e?.datatype?.toLowerCase() === "keyword" || e?.name && e.name.endsWith(".keyword") || r && (ue.includes(r?.toLowerCase()) || r?.toLowerCase()?.includes("char")) && !r?.toLowerCase().includes("text") ? [
|
|
332
332
|
{
|
|
333
333
|
value: "lowercase",
|
|
334
334
|
label: "Lowercase"
|
|
@@ -344,9 +344,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
344
344
|
] : [{
|
|
345
345
|
value: "NONE",
|
|
346
346
|
label: "Original Value"
|
|
347
|
-
}] : t ?
|
|
347
|
+
}] : t ? re.filter((e) => !we.includes(e.value)) : re;
|
|
348
348
|
}
|
|
349
|
-
return
|
|
349
|
+
return g;
|
|
350
350
|
}, Q = (e) => {
|
|
351
351
|
let t = /* @__PURE__ */ new Map();
|
|
352
352
|
return [
|
|
@@ -356,7 +356,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
356
356
|
].forEach((e) => {
|
|
357
357
|
let n = e?.uniqueId || e?.alias;
|
|
358
358
|
n && t.set(n, e);
|
|
359
|
-
}),
|
|
359
|
+
}), _(e, A || "", [...t.values()]);
|
|
360
360
|
}, en = (e, t) => e?.isDataMartLabel ? Q([e])?.[0] === t : e?.alias === t, tn = (e, t) => e?.find((e) => en(e, t)), nn = (e, t) => {
|
|
361
361
|
if ((t || F)?.length) {
|
|
362
362
|
let n = Object.keys((t || F)?.[0] || {});
|
|
@@ -370,24 +370,24 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
370
370
|
"<=",
|
|
371
371
|
">",
|
|
372
372
|
">="
|
|
373
|
-
].includes(t), l =
|
|
373
|
+
].includes(t), l = ve.includes(n) || n?.startsWith("decimal") || n?.startsWith("numeric");
|
|
374
374
|
return r ? "NULL" : t === "BETWEEN" ? "DATE_RANGE" : o ? "INPUT_TEXT_FIELD" : s && (a && !i || c) ? "TIME_FILTER" : l && !r ? i ? "MULTI_FILTER_DROPDOWN" : "INPUT_NUMBER_FIELD" : i ? "MULTI_FILTER_DROPDOWN" : "FILTER_DROPDOWN";
|
|
375
375
|
}, an = (e) => {
|
|
376
376
|
if (e) return H?.find((t) => e?.type === "custom" || t?.type === "custom" ? t?.alias === e?.alias : t?.schemaName === e?.schemaName && t?.tableName === e?.tableName);
|
|
377
377
|
}, on = (e) => {
|
|
378
|
-
let t = (e) => e?.schema ? `${e.schema}.${e.name}` : e?.name || "", n = (e) => e?.schemaName ? `${e.schemaName}.${e.tableName}` : e?.tableName || "", r = e?.table?.type === "custom" || !!
|
|
378
|
+
let t = (e) => e?.schema ? `${e.schema}.${e.name}` : e?.name || "", n = (e) => e?.schemaName ? `${e.schemaName}.${e.tableName}` : e?.tableName || "", r = e?.table?.type === "custom" || !!Me({
|
|
379
379
|
candidates: H || [],
|
|
380
380
|
getName: n,
|
|
381
381
|
target: t(e?.table),
|
|
382
382
|
companyTenancyType: Ft,
|
|
383
|
-
dbName:
|
|
384
|
-
}), i = (e?.table?.joins || []).every((e) => !!
|
|
383
|
+
dbName: A
|
|
384
|
+
}), i = (e?.table?.joins || []).every((e) => !!Me({
|
|
385
385
|
candidates: H || [],
|
|
386
386
|
getName: n,
|
|
387
387
|
target: t(e),
|
|
388
388
|
companyTenancyType: Ft,
|
|
389
|
-
dbName:
|
|
390
|
-
})), a =
|
|
389
|
+
dbName: A
|
|
390
|
+
})), a = O?.relationships || [], o = ke(e?.table?.joins || [], a, !0, Ft, A, e?.table), s = Oe(He(e, a), O?.tableList || [], !0, Ft, A);
|
|
391
391
|
return {
|
|
392
392
|
isValid: r && i && o && s,
|
|
393
393
|
tableExists: r,
|
|
@@ -397,19 +397,19 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
397
397
|
tenancyType: Ft
|
|
398
398
|
};
|
|
399
399
|
}, sn = () => {
|
|
400
|
-
|
|
400
|
+
Ue(""), N(!1), H?.length ? yt(H?.[0]) : yt(void 0), M([]), At([]), Mt([]), K([]), J([]), W(ae), k((e) => ({
|
|
401
401
|
...e,
|
|
402
402
|
isDynamicSeries: !1,
|
|
403
403
|
seriesField: "ungrouped",
|
|
404
404
|
seriesOptions: []
|
|
405
405
|
}));
|
|
406
406
|
}, cn = ({ chartType: e, chartDimensions: t, chartMetrics: n, chartAggregateColumns: r, resultData: i, configAggregates: a, pivotHeaderColumns: o, chartTimeColumns: s, seriesName: c, isRemoveGroupBy: l }) => {
|
|
407
|
-
let u = t ?? nn(Q(G), i || F), d = n ?? nn(Q(q), i || F), f = r ?? nn(Q(q.filter((e) => e.configType === "AGGREGATE")), i || F), p =
|
|
407
|
+
let u = t ?? nn(Q(G), i || F), d = n ?? nn(Q(q), i || F), f = r ?? nn(Q(q.filter((e) => e.configType === "AGGREGATE")), i || F), p = y;
|
|
408
408
|
if ([
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
].includes(e || "") && (
|
|
409
|
+
C.progressBar,
|
|
410
|
+
C.linearGauge,
|
|
411
|
+
C.progressBarV2
|
|
412
|
+
].includes(e || "") && (k((t) => ({
|
|
413
413
|
...t,
|
|
414
414
|
chartType: e || t.chartType,
|
|
415
415
|
progressColumn: d?.[0] || "",
|
|
@@ -417,30 +417,30 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
417
417
|
progressMaxColumn: d?.length > 2 ? d?.[2] : d?.[1] || ""
|
|
418
418
|
})), p = {
|
|
419
419
|
...p,
|
|
420
|
-
chartType: e ||
|
|
420
|
+
chartType: e || C.progressBar,
|
|
421
421
|
progressColumn: d?.[0] || "",
|
|
422
422
|
progressMinColumn: d?.length > 2 ? d?.[1] : "",
|
|
423
423
|
progressMaxColumn: d?.length > 2 ? d?.[2] : d?.[1] || ""
|
|
424
|
-
}), e ===
|
|
424
|
+
}), e === C.singleValue) k((t) => ({
|
|
425
425
|
...t,
|
|
426
426
|
chartType: e || t.chartType,
|
|
427
427
|
singleValue: d?.[0] || u?.[0],
|
|
428
428
|
dateColumns: s
|
|
429
429
|
})), p = {
|
|
430
430
|
...p,
|
|
431
|
-
chartType: e ||
|
|
431
|
+
chartType: e || C.singleValue,
|
|
432
432
|
singleValue: d?.[0] || u?.[0],
|
|
433
433
|
dateColumns: s
|
|
434
434
|
};
|
|
435
435
|
else if (f.length && [
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
].includes(e || "") && (F?.length || i?.length))
|
|
436
|
+
C.pivot,
|
|
437
|
+
C.treeMap,
|
|
438
|
+
C.gantt
|
|
439
|
+
].includes(e || "") && (F?.length || i?.length)) k((t) => ({
|
|
440
440
|
...t,
|
|
441
441
|
chartType: e || t.chartType,
|
|
442
442
|
pivotTableSettings: {
|
|
443
|
-
...
|
|
443
|
+
...j.pivotTableSettings,
|
|
444
444
|
columns: u,
|
|
445
445
|
rows: f
|
|
446
446
|
},
|
|
@@ -448,20 +448,20 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
448
448
|
dateColumns: s
|
|
449
449
|
})), p = {
|
|
450
450
|
...p,
|
|
451
|
-
chartType: e ||
|
|
451
|
+
chartType: e || C.pivot,
|
|
452
452
|
pivotTableSettings: {
|
|
453
|
-
...
|
|
453
|
+
...j.pivotTableSettings,
|
|
454
454
|
columns: u,
|
|
455
455
|
rows: f
|
|
456
456
|
},
|
|
457
457
|
yAxisList: [...u, ...f],
|
|
458
458
|
dateColumns: s
|
|
459
459
|
};
|
|
460
|
-
else if (f.length && [
|
|
460
|
+
else if (f.length && [C.pivotV2].includes(e || j.chartType) && (F?.length || i?.length)) k((n) => ({
|
|
461
461
|
...n,
|
|
462
462
|
chartType: e || n.chartType,
|
|
463
463
|
pivotTableSettings2: {
|
|
464
|
-
...
|
|
464
|
+
...j.pivotTableSettings2,
|
|
465
465
|
dimensions: u,
|
|
466
466
|
headers: o || [],
|
|
467
467
|
measures: f,
|
|
@@ -471,9 +471,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
471
471
|
dateColumns: s
|
|
472
472
|
})), p = {
|
|
473
473
|
...p,
|
|
474
|
-
chartType: e ||
|
|
474
|
+
chartType: e || C.pivot,
|
|
475
475
|
pivotTableSettings2: {
|
|
476
|
-
...
|
|
476
|
+
...j.pivotTableSettings2,
|
|
477
477
|
dimensions: u,
|
|
478
478
|
headers: o || [],
|
|
479
479
|
measures: f,
|
|
@@ -482,11 +482,11 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
482
482
|
},
|
|
483
483
|
dateColumns: s
|
|
484
484
|
};
|
|
485
|
-
else if (f.length && [
|
|
485
|
+
else if (f.length && [C.pivotV3].includes(e || j.chartType) && (F?.length || i?.length)) k((n) => ({
|
|
486
486
|
...n,
|
|
487
487
|
chartType: e || n.chartType,
|
|
488
488
|
pivotTableSettings3: {
|
|
489
|
-
...
|
|
489
|
+
...j.pivotTableSettings3,
|
|
490
490
|
columns: [...u, ...d],
|
|
491
491
|
rows: o || [],
|
|
492
492
|
dims: t || Q(G) || [],
|
|
@@ -495,9 +495,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
495
495
|
dateColumns: s
|
|
496
496
|
})), p = {
|
|
497
497
|
...p,
|
|
498
|
-
chartType: e ||
|
|
498
|
+
chartType: e || C.pivot,
|
|
499
499
|
pivotTableSettings3: {
|
|
500
|
-
...
|
|
500
|
+
...j.pivotTableSettings3,
|
|
501
501
|
columns: [...u, ...d],
|
|
502
502
|
rows: o || [],
|
|
503
503
|
dims: t || Q(G) || [],
|
|
@@ -505,9 +505,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
505
505
|
},
|
|
506
506
|
dateColumns: s
|
|
507
507
|
};
|
|
508
|
-
else if ([
|
|
508
|
+
else if ([C.table, C.trendAnalyzer].includes(e || "")) {
|
|
509
509
|
let { numberKeys: t } = h(i || F || []);
|
|
510
|
-
|
|
510
|
+
k((n) => ({
|
|
511
511
|
...n,
|
|
512
512
|
chartType: e || n.chartType,
|
|
513
513
|
yAxisList: [...u, ...d],
|
|
@@ -515,12 +515,12 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
515
515
|
dateColumns: s
|
|
516
516
|
})), p = {
|
|
517
517
|
...p,
|
|
518
|
-
chartType: e ||
|
|
518
|
+
chartType: e || C.table,
|
|
519
519
|
yAxisList: [...u, ...d],
|
|
520
520
|
numberColumns: t,
|
|
521
521
|
dateColumns: s
|
|
522
522
|
};
|
|
523
|
-
} else if ([
|
|
523
|
+
} else if ([C.waterfall, C.waterfallV2].includes(e || "")) k((t) => ({
|
|
524
524
|
...t,
|
|
525
525
|
chartType: e || t.chartType,
|
|
526
526
|
xAxis: u?.[0],
|
|
@@ -528,12 +528,12 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
528
528
|
dateColumns: s
|
|
529
529
|
})), p = {
|
|
530
530
|
...p,
|
|
531
|
-
chartType: e ||
|
|
531
|
+
chartType: e || C.waterfall,
|
|
532
532
|
xAxis: u?.[0],
|
|
533
533
|
yAxisList: [d?.[0]],
|
|
534
534
|
dateColumns: s
|
|
535
535
|
};
|
|
536
|
-
else if (e ===
|
|
536
|
+
else if (e === C.sankey) {
|
|
537
537
|
let t = u?.length > 1 ? [
|
|
538
538
|
u?.[0],
|
|
539
539
|
u?.[1],
|
|
@@ -543,7 +543,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
543
543
|
d?.[1],
|
|
544
544
|
d?.[2]
|
|
545
545
|
];
|
|
546
|
-
|
|
546
|
+
k((n) => ({
|
|
547
547
|
...n,
|
|
548
548
|
chartType: e || n.chartType,
|
|
549
549
|
sankeyValues: t,
|
|
@@ -551,12 +551,12 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
551
551
|
dateColumns: s
|
|
552
552
|
})), p = {
|
|
553
553
|
...p,
|
|
554
|
-
chartType: e ||
|
|
554
|
+
chartType: e || C.sankey,
|
|
555
555
|
sankeyValues: t,
|
|
556
556
|
yAxisList: t,
|
|
557
557
|
dateColumns: s
|
|
558
558
|
};
|
|
559
|
-
} else [
|
|
559
|
+
} else [C.funnel, C.funnelV2].includes(e || "") ? (k((t) => ({
|
|
560
560
|
...t,
|
|
561
561
|
chartType: e || t.chartType,
|
|
562
562
|
step: u?.[0] || "",
|
|
@@ -566,13 +566,13 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
566
566
|
dateColumns: s
|
|
567
567
|
})), p = {
|
|
568
568
|
...p,
|
|
569
|
-
chartType: e ||
|
|
569
|
+
chartType: e || C.funnel,
|
|
570
570
|
step: u?.[0] || "",
|
|
571
571
|
measure: d?.[0],
|
|
572
572
|
xAxis: u?.[0] || "",
|
|
573
573
|
yAxisList: [d?.[0]],
|
|
574
574
|
dateColumns: s
|
|
575
|
-
}) : e ===
|
|
575
|
+
}) : e === C.horizontalStackTable ? (k((t) => ({
|
|
576
576
|
...t,
|
|
577
577
|
chartType: e || t.chartType,
|
|
578
578
|
stackTableCols: d || [],
|
|
@@ -580,11 +580,11 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
580
580
|
dateColumns: s
|
|
581
581
|
})), p = {
|
|
582
582
|
...p,
|
|
583
|
-
chartType: e ||
|
|
583
|
+
chartType: e || C.horizontalStackTable,
|
|
584
584
|
stackTableCols: d || [],
|
|
585
585
|
yAxisList: u,
|
|
586
586
|
dateColumns: s
|
|
587
|
-
}) : [
|
|
587
|
+
}) : [C.gauge, C.gaugeV2].includes(e || "") ? (k((t) => ({
|
|
588
588
|
...t,
|
|
589
589
|
chartType: e || t.chartType,
|
|
590
590
|
gaugeSettings: {
|
|
@@ -595,14 +595,14 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
595
595
|
dateColumns: s
|
|
596
596
|
})), p = {
|
|
597
597
|
...p,
|
|
598
|
-
chartType: e ||
|
|
598
|
+
chartType: e || C.gauge,
|
|
599
599
|
gaugeSettings: {
|
|
600
600
|
dimensions: u,
|
|
601
601
|
metric: f?.[0] || d?.[0]
|
|
602
602
|
},
|
|
603
603
|
yAxisList: [...u, ...d],
|
|
604
604
|
dateColumns: s
|
|
605
|
-
}) : [
|
|
605
|
+
}) : [C.bubbleV2].includes(e || "") ? (k((t) => ({
|
|
606
606
|
...t,
|
|
607
607
|
chartType: e || t?.chartType,
|
|
608
608
|
xAxis: u?.[0],
|
|
@@ -616,7 +616,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
616
616
|
yAxisList: d,
|
|
617
617
|
dateColumns: s,
|
|
618
618
|
bubbleDims: [u?.[0] || "", u?.[1] || ""]
|
|
619
|
-
}) : (
|
|
619
|
+
}) : (k((t) => ({
|
|
620
620
|
...t,
|
|
621
621
|
chartType: e || t.chartType,
|
|
622
622
|
xAxis: u?.[0],
|
|
@@ -632,7 +632,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
632
632
|
dateColumns: s,
|
|
633
633
|
seriesField: l ? "" : c || p?.seriesField
|
|
634
634
|
});
|
|
635
|
-
|
|
635
|
+
k((e) => ({
|
|
636
636
|
...e,
|
|
637
637
|
seriesField: l ? "" : c || e?.seriesField,
|
|
638
638
|
isMultiDimension: !l && !!(c || e?.seriesField && e?.seriesField !== "ungrouped")
|
|
@@ -651,26 +651,26 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
651
651
|
aggregates: r,
|
|
652
652
|
orders: Ke(e?.orders || [], t)
|
|
653
653
|
};
|
|
654
|
-
}, $ = ({ prevConfiguration: e, onSuccess: n, prevLimit: i, chartFieldParams: a, updatedDims: o, updatedMetrics: u, selectedMainTable: f, isTimeseriesAction:
|
|
655
|
-
let
|
|
654
|
+
}, $ = ({ prevConfiguration: e, onSuccess: n, prevLimit: i, chartFieldParams: a, updatedDims: o, updatedMetrics: u, selectedMainTable: f, isTimeseriesAction: m, isPivotAction: h, isGroupByAction: g, isAddComparisonAction: ee, sqlChartType: _, updatedSqlColumnList: te, updatedTable: ne, isRemoveGroupBy: re, queryConfiguration: ae }) => {
|
|
655
|
+
let oe = !!ae, ce = I?.isEnableGroupBy && I?.configV2?.isEnable ? pe({
|
|
656
656
|
config: I.configV2,
|
|
657
657
|
selectedDims: o || G,
|
|
658
658
|
selectedMetrics: u || q,
|
|
659
659
|
previousSelectedDims: G,
|
|
660
660
|
previousSelectedMetrics: q
|
|
661
661
|
}) : !1;
|
|
662
|
-
|
|
662
|
+
ee || k((e) => ({
|
|
663
663
|
...e,
|
|
664
664
|
isEnableComparisonFilter: !1
|
|
665
665
|
}));
|
|
666
|
-
let ue =
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
666
|
+
let ue = _ || a?.chartType || j.chartType, v = !u?.length && ue === C.combo ? C.line : ue, de = !oe && !h && [C.pivotV2, C.pivotV3].includes(v), fe = !oe && !m && v === C.timeSeries, me = !oe && !g && !!j.isMultiDimension && j.seriesField !== "ungrouped" && [
|
|
667
|
+
C.line,
|
|
668
|
+
C.bar,
|
|
669
|
+
C.stack,
|
|
670
|
+
C.row,
|
|
671
|
+
C.horizontalStack
|
|
672
672
|
].includes(v);
|
|
673
|
-
|
|
673
|
+
de && Et({
|
|
674
674
|
data: [],
|
|
675
675
|
error: "",
|
|
676
676
|
isLoading: !1,
|
|
@@ -679,13 +679,13 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
679
679
|
let y = e ? {
|
|
680
680
|
...e,
|
|
681
681
|
isAllClient: !1
|
|
682
|
-
} : void 0, he =
|
|
683
|
-
...
|
|
682
|
+
} : void 0, he = ae ? {
|
|
683
|
+
...ae,
|
|
684
684
|
isAllClient: !1
|
|
685
685
|
} : void 0;
|
|
686
686
|
y && W(y);
|
|
687
|
-
let
|
|
688
|
-
selectedTable:
|
|
687
|
+
let _e = {
|
|
688
|
+
selectedTable: ne || qt,
|
|
689
689
|
selectedJoins: [],
|
|
690
690
|
configuration: {
|
|
691
691
|
...y || U,
|
|
@@ -708,14 +708,14 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
708
708
|
label: "",
|
|
709
709
|
value: ""
|
|
710
710
|
},
|
|
711
|
-
forecast:
|
|
711
|
+
forecast: ie,
|
|
712
712
|
createdNewColumnOptions: [],
|
|
713
713
|
selectedCustomColumns: [],
|
|
714
714
|
selectedManageColumns: [],
|
|
715
715
|
selectedNewManageColumns: [],
|
|
716
716
|
createdFilters: kt,
|
|
717
717
|
createdSorts: jt,
|
|
718
|
-
comparisonLagSettings:
|
|
718
|
+
comparisonLagSettings: ge,
|
|
719
719
|
selectedCustomGroups: [],
|
|
720
720
|
selectedGroupColumns: [],
|
|
721
721
|
metrics: (y || U).aggregates?.map((e) => ({
|
|
@@ -747,162 +747,162 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
747
747
|
isAutoCompleteMode: !1,
|
|
748
748
|
isDataMartQuery: !1
|
|
749
749
|
}
|
|
750
|
-
},
|
|
750
|
+
}, ve = I?.isEnableGroupBy && I?.configV2?.isEnable && !ce ? Ce({
|
|
751
751
|
config: I.configV2,
|
|
752
|
-
selectedDims:
|
|
753
|
-
selectedMetrics:
|
|
752
|
+
selectedDims: _e.newDatasetSettings?.selectedDims,
|
|
753
|
+
selectedMetrics: _e.newDatasetSettings?.selectedMetrics,
|
|
754
754
|
previousSelectedDims: G,
|
|
755
755
|
previousSelectedMetrics: q
|
|
756
756
|
}) : void 0;
|
|
757
|
-
if (Qe(
|
|
757
|
+
if (Qe(_e), B(""), N(!0), M([]), ve && it((e) => ({
|
|
758
758
|
...e,
|
|
759
|
-
configV2:
|
|
760
|
-
})),
|
|
759
|
+
configV2: ve
|
|
760
|
+
})), ce && it((e) => ({
|
|
761
761
|
...e,
|
|
762
762
|
isEnableGroupBy: !1,
|
|
763
763
|
isEnableCrossFilter: !1,
|
|
764
764
|
drilldownChartSettings: void 0,
|
|
765
765
|
drillType: "",
|
|
766
766
|
configV2: void 0
|
|
767
|
-
})), (
|
|
767
|
+
})), (_e.newDatasetSettings?.selectedDims?.length || 0) + (_e.newDatasetSettings?.selectedMetrics?.length || 0) === 0) {
|
|
768
768
|
sn();
|
|
769
769
|
return;
|
|
770
770
|
}
|
|
771
|
-
let
|
|
772
|
-
if (
|
|
773
|
-
let e =
|
|
771
|
+
let x = he || y || U, be = [], Se = [], we = [];
|
|
772
|
+
if (de) {
|
|
773
|
+
let e = j.pivotTableSettings2?.headers || [], { headerColumns: t, nonHeaderColumns: n } = (o || G).reduce((t, n) => (e.some((e) => en(n, e)) ? t.headerColumns.push(n) : t.nonHeaderColumns.push(n), t), {
|
|
774
774
|
headerColumns: [],
|
|
775
775
|
nonHeaderColumns: []
|
|
776
776
|
});
|
|
777
|
-
|
|
777
|
+
be = n.slice(0, 1), Se = u || q, we = t;
|
|
778
778
|
let r = [
|
|
779
|
-
...
|
|
779
|
+
...be,
|
|
780
780
|
...u || q,
|
|
781
781
|
...t
|
|
782
782
|
], { aggregates: i, dimensions: a } = b(r);
|
|
783
|
-
|
|
784
|
-
...
|
|
783
|
+
x = {
|
|
784
|
+
...x,
|
|
785
785
|
dimensions: a,
|
|
786
786
|
aggregates: i,
|
|
787
|
-
orders: P(
|
|
788
|
-
}, W(
|
|
787
|
+
orders: P(x?.orders || [], r)
|
|
788
|
+
}, W(x);
|
|
789
789
|
}
|
|
790
|
-
let
|
|
790
|
+
let Te = {
|
|
791
791
|
chartDimensions: a?.chartDimensions,
|
|
792
792
|
chartMetrics: Q(Se),
|
|
793
793
|
chartAggregateColumns: Q(Se.filter((e) => e.configType === "AGGREGATE")),
|
|
794
|
-
pivotHeaderColumns: Q(
|
|
795
|
-
},
|
|
796
|
-
if (
|
|
797
|
-
let e =
|
|
794
|
+
pivotHeaderColumns: Q(we)
|
|
795
|
+
}, Ee = [], T = [];
|
|
796
|
+
if (fe) {
|
|
797
|
+
let e = j?.seriesField || "", t = j?.timeSeriesSettings?.groupBySettings?.value || "montly", n = e && e !== "ungrouped", r = (o || G).find((e) => {
|
|
798
798
|
let t = e.cast?.value && e?.cast?.value !== "NONE" ? e.cast.value : e.datatype || "";
|
|
799
799
|
return S(t);
|
|
800
800
|
});
|
|
801
801
|
if (!r) {
|
|
802
|
-
B("Date column is not found for Timeseries chart"), N(!1),
|
|
802
|
+
B("Date column is not found for Timeseries chart"), N(!1), M([]), Ue("");
|
|
803
803
|
return;
|
|
804
804
|
}
|
|
805
805
|
let i = {
|
|
806
806
|
...r,
|
|
807
807
|
helperFunction: "date format",
|
|
808
|
-
functionConfiguration: { dateFormat:
|
|
808
|
+
functionConfiguration: { dateFormat: De({
|
|
809
809
|
label: t,
|
|
810
810
|
value: t
|
|
811
|
-
},
|
|
811
|
+
}, A) }
|
|
812
812
|
};
|
|
813
813
|
K((e) => e?.map((e) => e.alias === r.alias ? i : e));
|
|
814
814
|
let a = n ? tn(o || G, e) : void 0, s = a ? [i, a] : [i];
|
|
815
|
-
|
|
816
|
-
let c = [...s, ...
|
|
815
|
+
Ee = s, T = u || q;
|
|
816
|
+
let c = [...s, ...T], { aggregates: l, dimensions: d } = b(c), f = [{
|
|
817
817
|
method: "ASC",
|
|
818
818
|
name: r.alias,
|
|
819
819
|
type: "selected_column"
|
|
820
820
|
}];
|
|
821
|
-
|
|
822
|
-
...
|
|
821
|
+
x = {
|
|
822
|
+
...x,
|
|
823
823
|
dimensions: d,
|
|
824
824
|
aggregates: l,
|
|
825
|
-
orders: P([...f, ...Ke(
|
|
826
|
-
}, W(
|
|
825
|
+
orders: P([...f, ...Ke(x?.orders || [], c).filter((e) => e?.name !== r?.alias && !f.some((t) => t?.name === e?.name))], c)
|
|
826
|
+
}, W(x);
|
|
827
827
|
}
|
|
828
|
-
let
|
|
829
|
-
chartDimensions: Q(
|
|
830
|
-
chartMetrics: Q(
|
|
831
|
-
chartAggregateColumns: Q(
|
|
832
|
-
},
|
|
828
|
+
let Oe = {
|
|
829
|
+
chartDimensions: Q(Ee),
|
|
830
|
+
chartMetrics: Q(T),
|
|
831
|
+
chartAggregateColumns: Q(T.filter((e) => e.configType === "AGGREGATE"))
|
|
832
|
+
}, ke = [], Ae = [];
|
|
833
833
|
if (me) {
|
|
834
|
-
let e =
|
|
835
|
-
|
|
836
|
-
let i = [...r, ...
|
|
837
|
-
|
|
838
|
-
...
|
|
834
|
+
let e = j?.seriesField || "", t = e && e !== "ungrouped" ? tn(o || G, e) : void 0, n = (o || G)?.[0], r = t ? [n, t] : [n];
|
|
835
|
+
Ae = u || q, ke = r;
|
|
836
|
+
let i = [...r, ...Ae], { aggregates: a, dimensions: s } = b(i);
|
|
837
|
+
x = {
|
|
838
|
+
...x,
|
|
839
839
|
dimensions: s,
|
|
840
840
|
aggregates: a,
|
|
841
|
-
orders: P(
|
|
841
|
+
orders: P(x?.orders || [], i),
|
|
842
842
|
isApplyMetricFilter: !0,
|
|
843
843
|
rlsConditions: (y || U)?.rlsConditions || []
|
|
844
|
-
}, W(
|
|
844
|
+
}, W(x);
|
|
845
845
|
}
|
|
846
|
-
let
|
|
847
|
-
chartDimensions: Q(
|
|
848
|
-
chartMetrics: Q(
|
|
849
|
-
chartAggregateColumns: Q(
|
|
850
|
-
},
|
|
846
|
+
let je = {
|
|
847
|
+
chartDimensions: Q(ke),
|
|
848
|
+
chartMetrics: Q(Ae),
|
|
849
|
+
chartAggregateColumns: Q(Ae.filter((e) => e.configType === "AGGREGATE"))
|
|
850
|
+
}, Me = H?.find((e) => e.tableName === x?.table?.name && e.schemaName === x?.table?.schema), Ne = x?.table?.joins?.map((e) => H?.find((t) => t?.schemaName === e?.schema && t?.tableName === e?.name))?.filter((e) => e) || [], Pe = (Me ? [...Ne || [], Me] : Ne)?.map((e) => ({
|
|
851
851
|
name: e?.clientColumn || "",
|
|
852
852
|
datatype: e?.columnsWithDataType?.find((t) => t.name === e?.clientColumn)?.dataType || "",
|
|
853
853
|
table: e
|
|
854
|
-
}))?.filter((e) => e.name) || [],
|
|
854
|
+
}))?.filter((e) => e.name) || [], Fe = p && Pe?.map((e) => ({
|
|
855
855
|
alias: e.name,
|
|
856
856
|
columnName: e.name,
|
|
857
857
|
dataType: e.datatype,
|
|
858
858
|
method: "=",
|
|
859
|
-
parentAlias: `${w(e?.table?.schemaName || "",
|
|
859
|
+
parentAlias: `${w(e?.table?.schemaName || "", A)}_${e?.table?.tableName}`,
|
|
860
860
|
type: "client",
|
|
861
861
|
value: rt === "NUMBER" ? Number(r) : r,
|
|
862
862
|
relationOperator: "AND",
|
|
863
863
|
isApplyTimezone: !1
|
|
864
864
|
})) || [];
|
|
865
|
-
if (
|
|
865
|
+
if (x?.dimensions?.some((e) => e?.helperFunction?.toLowerCase() === "distinct") && ["mssql", "microsoft fabric"].includes(A?.toLowerCase() || "") && x?.orders?.length && !x?.orders?.some((e) => x?.dimensions?.some((t) => t?.alias === e?.name))) {
|
|
866
866
|
c("generate-metric-blocked", {
|
|
867
867
|
reason: "MSSQL_DISTINCT_ORDER_BY",
|
|
868
|
-
dbName:
|
|
869
|
-
orderCount:
|
|
870
|
-
dimensionCount:
|
|
871
|
-
}), B("Error: Select list must be in order by clause if distinct is used"),
|
|
868
|
+
dbName: A,
|
|
869
|
+
orderCount: x?.orders?.length || 0,
|
|
870
|
+
dimensionCount: x?.dimensions?.length || 0
|
|
871
|
+
}), B("Error: Select list must be in order by clause if distinct is used"), M([]), N(!1);
|
|
872
872
|
return;
|
|
873
873
|
}
|
|
874
|
-
let
|
|
875
|
-
if (!
|
|
874
|
+
let E = on(x);
|
|
875
|
+
if (!E.isValid) {
|
|
876
876
|
c("generate-metric-blocked", {
|
|
877
877
|
reason: "INVALID_DATASET_CONFIG",
|
|
878
|
-
tableExists:
|
|
879
|
-
joinsExist:
|
|
880
|
-
relationshipPresent:
|
|
881
|
-
columnPresent:
|
|
882
|
-
tenancyType:
|
|
878
|
+
tableExists: E.tableExists,
|
|
879
|
+
joinsExist: E.joinsExist,
|
|
880
|
+
relationshipPresent: E.relationshipPresent,
|
|
881
|
+
columnPresent: E.columnPresent,
|
|
882
|
+
tenancyType: E.tenancyType,
|
|
883
883
|
subsetTableCount: H?.length || 0,
|
|
884
|
-
...l(
|
|
884
|
+
...l(x)
|
|
885
885
|
});
|
|
886
|
-
let e = t(Xe(
|
|
887
|
-
s("metric.builder_validation_failed", { error_code: e.code }), mt("builder", e, void 0, { metricId: R }), B(e),
|
|
886
|
+
let e = t(Xe(E, x, O?.tableList || [], O?.relationships || []), { surface: "builder" });
|
|
887
|
+
s("metric.builder_validation_failed", { error_code: e.code }), mt("builder", e, void 0, { metricId: R }), B(e), M([]), Ue(""), N(!1);
|
|
888
888
|
return;
|
|
889
889
|
}
|
|
890
|
-
let
|
|
890
|
+
let Ie = Date.now();
|
|
891
891
|
c("generate-metric-start", {
|
|
892
892
|
hasWorkspaceId: !!et,
|
|
893
893
|
hasDatasourceId: !!at,
|
|
894
894
|
hasToken: !!$e,
|
|
895
895
|
chartType: v,
|
|
896
896
|
limit: i || Ye,
|
|
897
|
-
clientColumnFilterCount:
|
|
897
|
+
clientColumnFilterCount: Fe?.length || 0,
|
|
898
898
|
isDatabaseTenancy: !!tt,
|
|
899
|
-
...l(
|
|
899
|
+
...l(x)
|
|
900
900
|
}), Rt({
|
|
901
901
|
data: {
|
|
902
902
|
cId: r,
|
|
903
903
|
configuration: {
|
|
904
|
-
...
|
|
905
|
-
filters: !Lt &&
|
|
904
|
+
...x,
|
|
905
|
+
filters: !Lt && Fe?.length ? [...x?.filters, ...Fe] : x?.filters,
|
|
906
906
|
limit: i || Ye
|
|
907
907
|
},
|
|
908
908
|
id: et,
|
|
@@ -914,37 +914,37 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
914
914
|
}, {
|
|
915
915
|
onSuccess(e) {
|
|
916
916
|
let t = e?.error, r = e?.data, i = e?.query;
|
|
917
|
-
i &&=
|
|
917
|
+
i &&= se(i, st || "");
|
|
918
918
|
let s = e?.metaData;
|
|
919
919
|
if (t || zt) {
|
|
920
920
|
c("generate-metric-failed", {
|
|
921
921
|
source: "response-error",
|
|
922
|
-
durationMs: Date.now() -
|
|
922
|
+
durationMs: Date.now() - Ie,
|
|
923
923
|
hasGenerateError: !!zt,
|
|
924
924
|
...d(t || zt)
|
|
925
|
-
}), B(Je(t || zt, mt, R)), N(!1),
|
|
925
|
+
}), B(Je(t || zt, mt, R)), N(!1), M([]), Ue("");
|
|
926
926
|
return;
|
|
927
927
|
}
|
|
928
928
|
if ((!r || !i) && c("generate-metric-indeterminate", {
|
|
929
|
-
durationMs: Date.now() -
|
|
929
|
+
durationMs: Date.now() - Ie,
|
|
930
930
|
hasResult: !!r,
|
|
931
931
|
hasOutputQuery: !!i,
|
|
932
932
|
hasMetaData: !!s
|
|
933
933
|
}), r && i) {
|
|
934
934
|
c("generate-metric-success", {
|
|
935
|
-
durationMs: Date.now() -
|
|
935
|
+
durationMs: Date.now() - Ie,
|
|
936
936
|
rowCount: Array.isArray(r) ? r.length : 0,
|
|
937
937
|
columnCount: Object.keys(r?.[0] || {}).length,
|
|
938
938
|
queryLength: i?.length || 0,
|
|
939
939
|
chartType: v
|
|
940
940
|
}), B(""), N(!1);
|
|
941
|
-
let e = [...
|
|
942
|
-
n = t(n), n =
|
|
943
|
-
...
|
|
941
|
+
let e = [...x?.aggregates?.map((e) => e?.alias), ...x?.dimensions?.map((e) => e?.alias)], t = (t) => Array.isArray(t) ? A?.toLowerCase() === "redshift" ? xe(e, t) : t : [], n = le(r, o || G, u || q);
|
|
942
|
+
n = t(n), n = Re(n), M(() => n), cn(de ? {
|
|
943
|
+
...Te,
|
|
944
944
|
resultData: n,
|
|
945
945
|
configAggregates: y?.aggregates,
|
|
946
946
|
seriesName: a?.seriesName,
|
|
947
|
-
isRemoveGroupBy:
|
|
947
|
+
isRemoveGroupBy: re
|
|
948
948
|
} : {
|
|
949
949
|
chartType: v,
|
|
950
950
|
chartDimensions: a?.chartDimensions,
|
|
@@ -953,27 +953,27 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
953
953
|
resultData: n,
|
|
954
954
|
configAggregates: y?.aggregates,
|
|
955
955
|
pivotHeaderColumns: a?.pivotHeaderColumns,
|
|
956
|
-
...
|
|
957
|
-
...me ?
|
|
956
|
+
...fe ? Oe : {},
|
|
957
|
+
...me ? je : {},
|
|
958
958
|
chartTimeColumns: a?.chartTimeColumns,
|
|
959
959
|
seriesName: a?.seriesName,
|
|
960
|
-
isRemoveGroupBy:
|
|
961
|
-
}),
|
|
960
|
+
isRemoveGroupBy: re
|
|
961
|
+
}), ee || Ue(i), qe?.(ye(s?.groupbyColumnList));
|
|
962
962
|
}
|
|
963
963
|
n?.();
|
|
964
964
|
},
|
|
965
965
|
onError(e) {
|
|
966
966
|
c("generate-metric-failed", {
|
|
967
967
|
source: "network",
|
|
968
|
-
durationMs: Date.now() -
|
|
968
|
+
durationMs: Date.now() - Ie,
|
|
969
969
|
...d(e)
|
|
970
|
-
}), B(Je(e, mt, R)), N(!1),
|
|
970
|
+
}), B(Je(e, mt, R)), N(!1), M([]), Ue("");
|
|
971
971
|
}
|
|
972
972
|
});
|
|
973
973
|
}, dn = (e, t) => {
|
|
974
974
|
let n = (e) => H?.find((t) => t.tableName === e), r = (t) => {
|
|
975
975
|
let r = n(t)?.schemaName || e.schemaName;
|
|
976
|
-
return `${w(r,
|
|
976
|
+
return `${w(r, A)}_${t.replaceAll(" ", "_")?.replace("*", "_")}`;
|
|
977
977
|
}, i = /* @__PURE__ */ new Map();
|
|
978
978
|
t.forEach((e) => {
|
|
979
979
|
i.has(e.parentTableName) || i.set(e.parentTableName, []), i.has(e.childTableName) || i.set(e.childTableName, []), i.get(e.parentTableName).push(e), i.get(e.childTableName).push(e);
|
|
@@ -1008,7 +1008,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1008
1008
|
};
|
|
1009
1009
|
return s(e.tableName), o;
|
|
1010
1010
|
}, fn = (e, t, n) => {
|
|
1011
|
-
let r = n.find((n) => n.parentTableName === e.tableName && n.childTableName === t.tableName || n.parentTableName === t.tableName && n.childTableName === e.tableName), i = e.type === "custom" ? e.alias || "dbn_sql_table" : `${w(e?.schemaName,
|
|
1011
|
+
let r = n.find((n) => n.parentTableName === e.tableName && n.childTableName === t.tableName || n.parentTableName === t.tableName && n.childTableName === e.tableName), i = e.type === "custom" ? e.alias || "dbn_sql_table" : `${w(e?.schemaName, A)}_${e.tableName.replaceAll(" ", "_")?.replace("*", "_")}`, a = t.type === "custom" ? t.alias || "dbn_sql_table" : `${w(t?.schemaName, A)}_${t.tableName.replaceAll(" ", "_")?.replace("*", "_")}`, o = r?.parentTableName === e.tableName, s = r ? [{
|
|
1012
1012
|
alias: o ? a : i,
|
|
1013
1013
|
name: o ? t.tableName : e.tableName,
|
|
1014
1014
|
schema: o ? t.schemaName : e.schemaName,
|
|
@@ -1035,7 +1035,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1035
1035
|
type: o ? e.type === "custom" ? "custom" : "default" : t.type === "custom" ? "custom" : "default"
|
|
1036
1036
|
};
|
|
1037
1037
|
}, pn = ({ column: e, table: t, sorting: n, type: r, identifier: a }) => {
|
|
1038
|
-
let s = [...G], c = [...q], l = t.type === "custom" ? t.alias || "dbn_sql_table" : `${w(t?.schemaName,
|
|
1038
|
+
let s = [...G], c = [...q], l = t.type === "custom" ? t.alias || "dbn_sql_table" : `${w(t?.schemaName, A)}_${t.tableName.replaceAll(" ", "_")?.replace("*", "_")}`;
|
|
1039
1039
|
if (Z) {
|
|
1040
1040
|
let e = t.type === "custom" ? {
|
|
1041
1041
|
value: `none^^^^^^${t.sql}^^^^^^${l}^^^^^^custom`,
|
|
@@ -1053,24 +1053,24 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1053
1053
|
"metrics",
|
|
1054
1054
|
"aggregate_dimensions",
|
|
1055
1055
|
"aggregate_metrics"
|
|
1056
|
-
].includes(a?.type || ""), p = f ? [...G, ...q].find((e) => e?.alias === a?.id) : void 0,
|
|
1056
|
+
].includes(a?.type || ""), p = f ? [...G, ...q].find((e) => e?.alias === a?.id) : void 0, m = r === "METRIC" ? oe({
|
|
1057
1057
|
allowAggregate: e?.allowAggregate,
|
|
1058
1058
|
defaultAggregation: e?.defaultAggregation
|
|
1059
|
-
}) : void 0,
|
|
1060
|
-
a?.type === "column" && [...G, ...q].some((e) =>
|
|
1061
|
-
let
|
|
1062
|
-
uniqueId:
|
|
1063
|
-
alias:
|
|
1064
|
-
configType:
|
|
1059
|
+
}) : void 0, h = r === "METRIC" && m && !f ? `${v(`${m.toLowerCase()} of`, A || "")} ${e?.dataMartColumnAlias || e?.name}` : d;
|
|
1060
|
+
a?.type === "column" && [...G, ...q].some((e) => h === e?.alias) && (h = `${h}_${he(4)?.toLowerCase()}`), h = A?.toLowerCase() === "opensearch" ? h.replaceAll(" ", "_")?.replace("*", "_") : h;
|
|
1061
|
+
let g = {
|
|
1062
|
+
uniqueId: he(10),
|
|
1063
|
+
alias: h,
|
|
1064
|
+
configType: m || e.isAggregate ? "AGGREGATE" : "DIMENSION",
|
|
1065
1065
|
isApplyTimezone: e.isApplyTimezone,
|
|
1066
1066
|
datatype: e.dataType,
|
|
1067
1067
|
dropType: r,
|
|
1068
1068
|
index: r === "DIMENSION" ? G.length : q.length,
|
|
1069
|
-
name: e?.type === "custom" &&
|
|
1069
|
+
name: e?.type === "custom" && A?.toLowerCase() === "opensearch" ? e?.name?.replaceAll(" ", "_")?.replace("*", "_") : e?.name,
|
|
1070
1070
|
parentAlias: l,
|
|
1071
1071
|
table: t,
|
|
1072
1072
|
type: e.type === "custom" ? "CUSTOM" : e.type === "python" ? "PYTHON" : "DEFAULT",
|
|
1073
|
-
helperFunction:
|
|
1073
|
+
helperFunction: m,
|
|
1074
1074
|
sql: e.sql || "",
|
|
1075
1075
|
draggableItemData: {
|
|
1076
1076
|
column: e,
|
|
@@ -1089,43 +1089,43 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1089
1089
|
switch (r) {
|
|
1090
1090
|
case "DIMENSION":
|
|
1091
1091
|
K((t) => {
|
|
1092
|
-
let r = t.findIndex((e) => e.alias ===
|
|
1093
|
-
a?.type === "metrics" && J((t) => (c = [...t.filter((t) => t.alias !==
|
|
1094
|
-
let i = Z ? [
|
|
1092
|
+
let r = t.findIndex((e) => e.alias === h);
|
|
1093
|
+
a?.type === "metrics" && J((t) => (c = [...t.filter((t) => t.alias !== h && t.alias !== e.dataMartColumnAlias)], c));
|
|
1094
|
+
let i = Z ? [g] : r === -1 ? [...t, g] : t;
|
|
1095
1095
|
if (n) {
|
|
1096
1096
|
let { before: e, after: t } = n.sortingIndexes;
|
|
1097
1097
|
return s = [...n.ArrayElementSwap(e, t, i)], s;
|
|
1098
1098
|
}
|
|
1099
1099
|
return s = [...i], i;
|
|
1100
|
-
}), ct?.(i,
|
|
1100
|
+
}), ct?.(i, h);
|
|
1101
1101
|
break;
|
|
1102
1102
|
case "METRIC":
|
|
1103
1103
|
J((t) => {
|
|
1104
|
-
let r = t.findIndex((e) => e.alias ===
|
|
1105
|
-
a?.type === "dimensions" && K((t) => (s = [...t.filter((t) => t.alias !==
|
|
1106
|
-
let i = Z ? [
|
|
1104
|
+
let r = t.findIndex((e) => e.alias === h);
|
|
1105
|
+
a?.type === "dimensions" && K((t) => (s = [...t.filter((t) => t.alias !== h && t.alias !== e.dataMartColumnAlias)], s));
|
|
1106
|
+
let i = Z ? [g] : r === -1 ? [...t, g] : t;
|
|
1107
1107
|
if (n) {
|
|
1108
1108
|
let { before: e, after: t } = n.sortingIndexes;
|
|
1109
1109
|
return c = [...n.ArrayElementSwap(e, t, i)], c;
|
|
1110
1110
|
}
|
|
1111
1111
|
return c = [...i], i;
|
|
1112
|
-
}), ct?.(o,
|
|
1112
|
+
}), ct?.(o, h);
|
|
1113
1113
|
break;
|
|
1114
1114
|
default: console.warn("Invalid Drop");
|
|
1115
1115
|
}
|
|
1116
1116
|
let ee = [
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
].includes(
|
|
1123
|
-
ee && (
|
|
1124
|
-
let
|
|
1117
|
+
C.line,
|
|
1118
|
+
C.bar,
|
|
1119
|
+
C.stack,
|
|
1120
|
+
C.row,
|
|
1121
|
+
C.horizontalStack
|
|
1122
|
+
].includes(j?.chartType), _ = Z ? r === "DIMENSION" ? [g] : [] : s, te = Z ? r === "METRIC" ? [g] : [] : c, ne, re = !1;
|
|
1123
|
+
ee && (_.length === 2 && te.length === 1 ? ne = Q([_[1]])?.[0] : re = !0);
|
|
1124
|
+
let ie = Z ? [g] : [...s, ...c], { aggregates: ae, dimensions: se } = b(ie), ce = !Z && z && U?.table?.name !== t.tableName, le = {
|
|
1125
1125
|
...U,
|
|
1126
|
-
dimensions:
|
|
1127
|
-
aggregates:
|
|
1128
|
-
orders: P(U?.orders || [],
|
|
1126
|
+
dimensions: se,
|
|
1127
|
+
aggregates: ae,
|
|
1128
|
+
orders: P(U?.orders || [], ie),
|
|
1129
1129
|
table: Z ? {
|
|
1130
1130
|
alias: l,
|
|
1131
1131
|
id: t.id,
|
|
@@ -1134,23 +1134,23 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1134
1134
|
schema: t.schemaName,
|
|
1135
1135
|
type: t.type === "custom" ? "custom" : "default"
|
|
1136
1136
|
} : U.table
|
|
1137
|
-
},
|
|
1138
|
-
|
|
1139
|
-
...
|
|
1140
|
-
table: fn(
|
|
1141
|
-
}), W(
|
|
1142
|
-
prevConfiguration:
|
|
1137
|
+
}, ue = H?.find((e) => e.tableName === U?.table?.name);
|
|
1138
|
+
ce && ue && !U?.table?.joins?.length && (le = {
|
|
1139
|
+
...le,
|
|
1140
|
+
table: fn(ue, t, Ct || [])
|
|
1141
|
+
}), W(le), $({
|
|
1142
|
+
prevConfiguration: le,
|
|
1143
1143
|
chartFieldParams: {
|
|
1144
|
-
chartDimensions: Q(
|
|
1145
|
-
chartMetrics: Q(
|
|
1146
|
-
chartAggregateColumns: Q(
|
|
1147
|
-
chartTimeColumns: Q(
|
|
1148
|
-
seriesName:
|
|
1144
|
+
chartDimensions: Q(ie.filter((e) => e.dropType === "DIMENSION")),
|
|
1145
|
+
chartMetrics: Q(ie.filter((e) => e.dropType === "METRIC")),
|
|
1146
|
+
chartAggregateColumns: Q(ie.filter((e) => e.configType === "AGGREGATE")),
|
|
1147
|
+
chartTimeColumns: Q(ie?.filter((e) => S(e?.datatype))),
|
|
1148
|
+
seriesName: ne
|
|
1149
1149
|
},
|
|
1150
|
-
isRemoveGroupBy:
|
|
1151
|
-
isGroupByAction: !!
|
|
1152
|
-
updatedDims: r === "DIMENSION" ? Z ? [
|
|
1153
|
-
updatedMetrics: r === "METRIC" ? Z ? [
|
|
1150
|
+
isRemoveGroupBy: re,
|
|
1151
|
+
isGroupByAction: !!ne,
|
|
1152
|
+
updatedDims: r === "DIMENSION" ? Z ? [g] : [...s] : void 0,
|
|
1153
|
+
updatedMetrics: r === "METRIC" ? Z ? [g] : [...c] : void 0,
|
|
1154
1154
|
selectedMainTable: Z ? t : void 0
|
|
1155
1155
|
});
|
|
1156
1156
|
}, mn = (e, t) => {
|
|
@@ -1160,7 +1160,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1160
1160
|
generatedAlias: r ? n : void 0
|
|
1161
1161
|
};
|
|
1162
1162
|
}, hn = ({ alias: e, column: t, type: n, cast: r, isColumnCasted: i }) => {
|
|
1163
|
-
let a =
|
|
1163
|
+
let a = A?.toLowerCase() === "opensearch" ? e.replaceAll(" ", "_")?.replace("*", "_") : e, o = [...G, ...q].filter((e) => e?.alias !== t?.alias).map((e) => e?.alias).filter((e) => !!e), s = Te(a, o, () => he(4)?.toLowerCase(), { caseInsensitive: A?.toLowerCase() === x }), c = n === "DIMENSION" ? G?.map((e) => e.alias === t.alias ? {
|
|
1164
1164
|
...e,
|
|
1165
1165
|
alias: s,
|
|
1166
1166
|
...mn(e, s),
|
|
@@ -1184,12 +1184,12 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1184
1184
|
break;
|
|
1185
1185
|
default: console.warn("Invalid Drop");
|
|
1186
1186
|
}
|
|
1187
|
-
let u = [...c, ...l], d =
|
|
1187
|
+
let u = [...c, ...l], d = Se({
|
|
1188
1188
|
drillFilters: U.drillFilters || Y,
|
|
1189
1189
|
drilldownChartSettings: I?.drilldownChartSettings,
|
|
1190
1190
|
previousDims: G,
|
|
1191
1191
|
selectedDims: c
|
|
1192
|
-
}), f = I?.configV2?.levels?.length ?
|
|
1192
|
+
}), f = I?.configV2?.levels?.length ? Ce({
|
|
1193
1193
|
config: I.configV2,
|
|
1194
1194
|
selectedDims: c,
|
|
1195
1195
|
selectedMetrics: l,
|
|
@@ -1220,8 +1220,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1220
1220
|
updatedMetrics: n === "METRIC" ? l : void 0
|
|
1221
1221
|
});
|
|
1222
1222
|
}, gn = ({ column: e, helperFunction: t, type: n, functionConfiguration: r, percentileValue: i, partitionBy: o, partitionByColumns: s }) => {
|
|
1223
|
-
let c = t.value === "NONE", l =
|
|
1224
|
-
[...G, ...q].some((e) => d === e?.alias) && (d = `${d}_${
|
|
1223
|
+
let c = t.value === "NONE", l = ee?.includes(t?.value || "") && G?.length && G?.[0]?.helperFunction !== "distinct", u = l ? `${v("distinct of", A || "")} ${G?.[0]?.dataMartColumnAlias || G?.[0]?.name}` : "", d = `${c ? e.dataMartColumnAlias || e.name : `${v(`${t.label?.toLowerCase()} of`, A || "")} ${e.dataMartColumnAlias || e.name}`}`;
|
|
1224
|
+
[...G, ...q].some((e) => d === e?.alias) && (d = `${d}_${he(4)?.toLowerCase()}`), d = A?.toLowerCase() === "opensearch" ? d.replaceAll(" ", "_")?.replace("*", "_") : d, ct?.(a, e.dataMartColumnAlias || e.name);
|
|
1225
1225
|
let f = n === "DIMENSION" ? G?.map((n) => n.alias === e.alias ? {
|
|
1226
1226
|
...n,
|
|
1227
1227
|
helperFunction: t.value,
|
|
@@ -1257,12 +1257,12 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1257
1257
|
break;
|
|
1258
1258
|
default: console.warn("Invalid Drop");
|
|
1259
1259
|
}
|
|
1260
|
-
let m = [...f, ...p], h =
|
|
1260
|
+
let m = [...f, ...p], h = Se({
|
|
1261
1261
|
drillFilters: U.drillFilters || Y,
|
|
1262
1262
|
drilldownChartSettings: I?.drilldownChartSettings,
|
|
1263
1263
|
previousDims: G,
|
|
1264
1264
|
selectedDims: f
|
|
1265
|
-
}), g = I?.configV2?.levels?.length ?
|
|
1265
|
+
}), g = I?.configV2?.levels?.length ? Ce({
|
|
1266
1266
|
config: I.configV2,
|
|
1267
1267
|
selectedDims: f,
|
|
1268
1268
|
selectedMetrics: p,
|
|
@@ -1274,15 +1274,15 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1274
1274
|
drilldownChartSettings: n === "DIMENSION" ? h.drilldownChartSettings : e.drilldownChartSettings,
|
|
1275
1275
|
configV2: g
|
|
1276
1276
|
}))), Mt((e) => e.filter((e) => m?.some((t) => t.alias === (e.columnName?.column?.alias || e.columnName?.label))));
|
|
1277
|
-
let { aggregates: _, dimensions:
|
|
1277
|
+
let { aggregates: _, dimensions: te } = b(m), ne = {
|
|
1278
1278
|
...U,
|
|
1279
|
-
dimensions:
|
|
1279
|
+
dimensions: te,
|
|
1280
1280
|
aggregates: _,
|
|
1281
1281
|
drillFilters: h.drillFilters,
|
|
1282
1282
|
orders: P(U?.orders || [], m)
|
|
1283
1283
|
};
|
|
1284
|
-
W(
|
|
1285
|
-
prevConfiguration:
|
|
1284
|
+
W(ne), $({
|
|
1285
|
+
prevConfiguration: ne,
|
|
1286
1286
|
chartFieldParams: {
|
|
1287
1287
|
chartDimensions: Q(f),
|
|
1288
1288
|
chartMetrics: Q(p),
|
|
@@ -1298,10 +1298,10 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1298
1298
|
return i ? [...n?.filter((e) => !a(e)), r] : [...n, r];
|
|
1299
1299
|
}, vn = ({ alias: e, column: t, type: n, editCol: r, editColumn: i }) => {
|
|
1300
1300
|
if (!t) return;
|
|
1301
|
-
let a =
|
|
1301
|
+
let a = A?.toLowerCase() === "opensearch" ? e.replaceAll(" ", "_")?.replace("*", "_") : e, o = i || (r ? (n === "DIMENSION" ? G : q).find((e) => e?.alias === r) : void 0), s = [...G, ...q].filter((e) => o?.uniqueId ? e?.uniqueId !== o.uniqueId : !o || !(e === o || o.arithmeticConfig && e?.arithmeticConfig === o.arithmeticConfig)).map((e) => e?.alias).filter((e) => !!e), c = Te(a, s, () => he(4)?.toLowerCase(), { caseInsensitive: A?.toLowerCase() === x }), l = We(t.firstOperand) ? void 0 : t.firstOperand, u = We(t.secondOperand) ? void 0 : t.secondOperand, d = l || u;
|
|
1302
1302
|
if (!d) return;
|
|
1303
1303
|
let f = {
|
|
1304
|
-
uniqueId: o?.uniqueId ||
|
|
1304
|
+
uniqueId: o?.uniqueId || he(10),
|
|
1305
1305
|
alias: c,
|
|
1306
1306
|
configType: Ze({
|
|
1307
1307
|
type: n,
|
|
@@ -1348,7 +1348,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1348
1348
|
break;
|
|
1349
1349
|
default: console.warn("Invalid Drop");
|
|
1350
1350
|
}
|
|
1351
|
-
|
|
1351
|
+
k((e) => ({
|
|
1352
1352
|
...e,
|
|
1353
1353
|
dynamicXAxis: {
|
|
1354
1354
|
...e.dynamicXAxis,
|
|
@@ -1373,13 +1373,13 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1373
1373
|
}]
|
|
1374
1374
|
}
|
|
1375
1375
|
}));
|
|
1376
|
-
let h = [...p, ...m], { aggregates: g, dimensions:
|
|
1376
|
+
let h = [...p, ...m], { aggregates: g, dimensions: ee } = b(h), _ = {
|
|
1377
1377
|
...U,
|
|
1378
|
-
dimensions:
|
|
1378
|
+
dimensions: ee,
|
|
1379
1379
|
aggregates: g
|
|
1380
1380
|
};
|
|
1381
|
-
W(
|
|
1382
|
-
prevConfiguration:
|
|
1381
|
+
W(_), $({
|
|
1382
|
+
prevConfiguration: _,
|
|
1383
1383
|
chartFieldParams: {
|
|
1384
1384
|
chartDimensions: Q(p),
|
|
1385
1385
|
chartMetrics: Q(m),
|
|
@@ -1419,9 +1419,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1419
1419
|
joins: []
|
|
1420
1420
|
} : e;
|
|
1421
1421
|
};
|
|
1422
|
-
return
|
|
1423
|
-
let e =
|
|
1424
|
-
if (e || !
|
|
1422
|
+
return Fe(() => {
|
|
1423
|
+
let e = O?.error, t = O;
|
|
1424
|
+
if (e || !O) B(e ? Je(e, mt, R) : void 0);
|
|
1425
1425
|
else if (t?.tableList?.length) {
|
|
1426
1426
|
let e = t?.tableList || [], n = t?.relationships || [];
|
|
1427
1427
|
wt(n);
|
|
@@ -1431,7 +1431,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1431
1431
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
1432
1432
|
return t.forEach((t) => {
|
|
1433
1433
|
let i = e.filter((e) => {
|
|
1434
|
-
let n =
|
|
1434
|
+
let n = Ne(t, e.tableName, { caseInsensitive: !0 }), r = e.wildcard === t;
|
|
1435
1435
|
return n || r;
|
|
1436
1436
|
});
|
|
1437
1437
|
if (i.length > 0) {
|
|
@@ -1477,7 +1477,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1477
1477
|
defaultSort: t?.defaultSort || null,
|
|
1478
1478
|
transform: n
|
|
1479
1479
|
};
|
|
1480
|
-
}) || [], { prefix: n, name: r } =
|
|
1480
|
+
}) || [], { prefix: n, name: r } = me(e.tableName);
|
|
1481
1481
|
return {
|
|
1482
1482
|
id: "",
|
|
1483
1483
|
tableName: e.wildcard ? e.wildcard : r,
|
|
@@ -1495,17 +1495,17 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1495
1495
|
bt(r), r?.length && !R && yt(r?.[0]);
|
|
1496
1496
|
}
|
|
1497
1497
|
}, [
|
|
1498
|
-
|
|
1498
|
+
O,
|
|
1499
1499
|
Pt?.dataMartTables,
|
|
1500
1500
|
R
|
|
1501
|
-
]),
|
|
1501
|
+
]), Fe(() => {
|
|
1502
1502
|
let e = [...G || [], ...q || []].filter((e) => e.transform && e.transform !== "original").map((e) => ({
|
|
1503
1503
|
columns: [e.alias || e.name],
|
|
1504
1504
|
formatter: e.transform,
|
|
1505
1505
|
prefix: "",
|
|
1506
1506
|
suffix: ""
|
|
1507
1507
|
}));
|
|
1508
|
-
e.length > 0 &&
|
|
1508
|
+
e.length > 0 && k((t) => ({
|
|
1509
1509
|
...t,
|
|
1510
1510
|
tableSettings: (() => {
|
|
1511
1511
|
let n = [...t.tableSettings?.tableNumberFormatter || [], ...e.filter((e) => !t.tableSettings?.tableNumberFormatter?.some((t) => t.columns?.[0] === e.columns?.[0]))];
|
|
@@ -1519,8 +1519,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1519
1519
|
}, [
|
|
1520
1520
|
G,
|
|
1521
1521
|
q,
|
|
1522
|
-
|
|
1523
|
-
]),
|
|
1522
|
+
k
|
|
1523
|
+
]), Fe(() => {
|
|
1524
1524
|
if (!L && R && _t && H?.length) {
|
|
1525
1525
|
let e = H[0];
|
|
1526
1526
|
yt(e), lt && (N(!0), pt({
|
|
@@ -1530,7 +1530,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1530
1530
|
workspaceId: et,
|
|
1531
1531
|
metricId: R,
|
|
1532
1532
|
isCustomSql: !0,
|
|
1533
|
-
databaseName:
|
|
1533
|
+
databaseName: A || "",
|
|
1534
1534
|
datasourceId: at
|
|
1535
1535
|
},
|
|
1536
1536
|
token: $e || "",
|
|
@@ -1540,8 +1540,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1540
1540
|
onSuccess(t) {
|
|
1541
1541
|
let n = t?.data;
|
|
1542
1542
|
if (Array.isArray(n) && n.length) {
|
|
1543
|
-
|
|
1544
|
-
let t =
|
|
1543
|
+
M(Re(n));
|
|
1544
|
+
let t = j?.xAxis, r = j?.yAxisList || [], i = e || {}, a = `${w(i?.schemaName || "", A)}_${(i?.tableName || "").replaceAll(" ", "_")?.replace("*", "_")}`, o = (e) => {
|
|
1545
1545
|
let t = {
|
|
1546
1546
|
percentile_cont_: "PERCENTILE_CONT",
|
|
1547
1547
|
percentile_disc_: "PERCENTILE_DISC",
|
|
@@ -1559,7 +1559,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1559
1559
|
}, s = (e, t, n) => {
|
|
1560
1560
|
let r = t === "METRIC" ? o(e) : void 0;
|
|
1561
1561
|
return {
|
|
1562
|
-
uniqueId:
|
|
1562
|
+
uniqueId: he(10),
|
|
1563
1563
|
alias: e,
|
|
1564
1564
|
configType: t === "METRIC" ? "AGGREGATE" : "DIMENSION",
|
|
1565
1565
|
datatype: t === "METRIC" ? "number" : "string",
|
|
@@ -1593,23 +1593,23 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1593
1593
|
return;
|
|
1594
1594
|
}
|
|
1595
1595
|
if (L && R && _t && H?.length) {
|
|
1596
|
-
let e = L?.configuration ||
|
|
1597
|
-
...L?.configuration ||
|
|
1596
|
+
let e = L?.configuration || ae, t = O?.relationships || [], n = !ke(e?.table?.joins || [], t, !0, Ft, A, e?.table) || !Oe(He(e, t), O?.tableList || [], !0, Ft, A), r = L?.newDatasetSettings?.isChatMode || !1, i = Ae(L, an), a = i?.newDatasetSettings?.selectedMainTable || (r ? H?.[0] : void 0), o = i?.newDatasetSettings?.selectedDims || [], s = i?.newDatasetSettings?.selectedMetrics || [], c = {
|
|
1597
|
+
...L?.configuration || ae,
|
|
1598
1598
|
rlsConditions: ut
|
|
1599
1599
|
};
|
|
1600
1600
|
if (W(c), At(L?.createdFilters?.map((e) => ({
|
|
1601
1601
|
...e,
|
|
1602
|
-
tableName:
|
|
1603
|
-
columnName:
|
|
1602
|
+
tableName: T(e.tableName),
|
|
1603
|
+
columnName: T(e.columnName)
|
|
1604
1604
|
}))?.filter((e) => e.type !== "client") || []), Mt(L?.createdSorts?.map((e) => ({
|
|
1605
1605
|
...e,
|
|
1606
|
-
columnName:
|
|
1607
|
-
tableName:
|
|
1608
|
-
})) || []), Ot(L?.selectedTable?.value ?
|
|
1606
|
+
columnName: T(e.columnName),
|
|
1607
|
+
tableName: T(e.tableName)
|
|
1608
|
+
})) || []), Ot(L?.selectedTable?.value ? T(L.selectedTable) : {
|
|
1609
1609
|
label: "",
|
|
1610
1610
|
value: ""
|
|
1611
1611
|
}), K(o), J(s), yt(a), n && !r) {
|
|
1612
|
-
B("Something went wrong! Please try again later."),
|
|
1612
|
+
B("Something went wrong! Please try again later."), M([]), Ue(""), N(!1), vt(!1);
|
|
1613
1613
|
return;
|
|
1614
1614
|
}
|
|
1615
1615
|
if (r) {
|
|
@@ -1637,7 +1637,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1637
1637
|
dt,
|
|
1638
1638
|
ft,
|
|
1639
1639
|
Ft,
|
|
1640
|
-
|
|
1640
|
+
A
|
|
1641
1641
|
]), {
|
|
1642
1642
|
selectedMainTable: V,
|
|
1643
1643
|
companySubsetTableList: X,
|
|
@@ -1673,14 +1673,14 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1673
1673
|
default: console.warn("Invalid Drop");
|
|
1674
1674
|
}
|
|
1675
1675
|
let r = t === "DIMENSION" ? G.filter((t) => t.uniqueId ? t.uniqueId !== e?.uniqueId : t.alias !== e.alias) : G, i = t === "METRIC" ? q.filter((t) => t.uniqueId ? t.uniqueId !== e?.uniqueId : t.alias !== e.alias) : q, a = [
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
].includes(
|
|
1676
|
+
C.line,
|
|
1677
|
+
C.bar,
|
|
1678
|
+
C.stack,
|
|
1679
|
+
C.row,
|
|
1680
|
+
C.horizontalStack
|
|
1681
|
+
].includes(j?.chartType), o, s = !1;
|
|
1682
1682
|
a && (r.length === 2 && i.length === 1 ? o = Q([r[1]])?.[0] : s = !0);
|
|
1683
|
-
let c = [...r, ...i], l = [...G, ...q], u = P(
|
|
1683
|
+
let c = [...r, ...i], l = [...G, ...q], u = P(ne(n).filter((e) => e.name), c), d = U.table;
|
|
1684
1684
|
z && (d = yn(d, G.filter((t) => t.uniqueId ? t.uniqueId !== e?.uniqueId : t.alias !== e.alias), q.filter((t) => t.uniqueId ? t.uniqueId !== e?.uniqueId : t.alias !== e.alias), kt, n));
|
|
1685
1685
|
let f = {
|
|
1686
1686
|
...U,
|
|
@@ -1789,7 +1789,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1789
1789
|
method: "",
|
|
1790
1790
|
name: ""
|
|
1791
1791
|
};
|
|
1792
|
-
let i =
|
|
1792
|
+
let i = m.includes(r?.helperFunction || "");
|
|
1793
1793
|
if (r?.helperFunction && r.helperFunction === "date format" && r?.functionConfiguration) return {
|
|
1794
1794
|
method: n,
|
|
1795
1795
|
name: r?.alias || e.columnName.label,
|
|
@@ -1829,7 +1829,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1829
1829
|
setCreatedFilters: At,
|
|
1830
1830
|
getFilterDropDownType: rn,
|
|
1831
1831
|
onSelectTimeSeries: (e) => {
|
|
1832
|
-
if (e !==
|
|
1832
|
+
if (e !== C.timeSeries) return;
|
|
1833
1833
|
let t = G.find((e) => {
|
|
1834
1834
|
let t = e.cast?.value && e?.cast?.value !== "NONE" ? e.cast.value : e.datatype || "";
|
|
1835
1835
|
return S(t);
|
|
@@ -1838,10 +1838,10 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1838
1838
|
let n = `monthly of ${t.name}`, r = {
|
|
1839
1839
|
...t,
|
|
1840
1840
|
helperFunction: "date format",
|
|
1841
|
-
functionConfiguration: { dateFormat:
|
|
1841
|
+
functionConfiguration: { dateFormat: De({
|
|
1842
1842
|
value: "monthly",
|
|
1843
1843
|
label: "monthly"
|
|
1844
|
-
},
|
|
1844
|
+
}, A) },
|
|
1845
1845
|
alias: n
|
|
1846
1846
|
};
|
|
1847
1847
|
K((e) => e?.map((e) => e.alias === t.alias ? r : e));
|
|
@@ -1893,7 +1893,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1893
1893
|
});
|
|
1894
1894
|
},
|
|
1895
1895
|
onDrillPivotTable: ({ filters: e, nextLevel: t, currentValue: n }) => {
|
|
1896
|
-
let { headerColumns: i, nonHeaderColumns: a } = G.reduce((e, t) => (
|
|
1896
|
+
let { headerColumns: i, nonHeaderColumns: a } = G.reduce((e, t) => (j.pivotTableSettings2?.headers?.includes(t.alias) ? e.headerColumns.push(t) : e.nonHeaderColumns.push(t), e), {
|
|
1897
1897
|
headerColumns: [],
|
|
1898
1898
|
nonHeaderColumns: []
|
|
1899
1899
|
}), o = e?.map((e) => `${e.columnName};;${e.value}`).join(";;");
|
|
@@ -1905,7 +1905,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1905
1905
|
currentValue: n
|
|
1906
1906
|
}));
|
|
1907
1907
|
let s = a.slice(0, t), c = e?.map((e) => {
|
|
1908
|
-
let t = G.find((t) => t.alias === e.columnName ||
|
|
1908
|
+
let t = G.find((t) => t.alias === e.columnName || _e(t) === e.columnName);
|
|
1909
1909
|
if (t) return {
|
|
1910
1910
|
alias: t.alias || "",
|
|
1911
1911
|
columnName: t.name,
|
|
@@ -1921,14 +1921,14 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1921
1921
|
...s,
|
|
1922
1922
|
...q,
|
|
1923
1923
|
...i
|
|
1924
|
-
], { aggregates: u, dimensions: d } = b(l), f = P(
|
|
1924
|
+
], { aggregates: u, dimensions: d } = b(l), f = P(ne(jt), l), m = {
|
|
1925
1925
|
...U,
|
|
1926
1926
|
dimensions: d,
|
|
1927
1927
|
aggregates: u,
|
|
1928
1928
|
filters: [...U.filters, ...c],
|
|
1929
1929
|
isApplyMetricFilter: !0,
|
|
1930
1930
|
orders: f
|
|
1931
|
-
},
|
|
1931
|
+
}, h = H?.find((e) => e.tableName === m?.table?.name && e.schemaName === m?.table?.schema), g = m?.table?.joins?.map((e) => H?.find((t) => t?.schemaName === e?.schema && t?.tableName === e?.name))?.filter(Boolean) || [], ee = h ? [...g, h] : g, _ = p && ee?.map((e) => ({
|
|
1932
1932
|
name: e?.clientColumn || "",
|
|
1933
1933
|
datatype: e?.columnsWithDataType?.find((t) => t.name === e?.clientColumn)?.dataType || "",
|
|
1934
1934
|
table: e
|
|
@@ -1937,7 +1937,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1937
1937
|
columnName: e.name,
|
|
1938
1938
|
dataType: e.datatype,
|
|
1939
1939
|
method: "=",
|
|
1940
|
-
parentAlias: `${w(e.table?.schemaName || "",
|
|
1940
|
+
parentAlias: `${w(e.table?.schemaName || "", A)}_${e.table?.tableName}`,
|
|
1941
1941
|
type: "client",
|
|
1942
1942
|
value: rt === "NUMBER" ? Number(r) : r,
|
|
1943
1943
|
relationOperator: "AND",
|
|
@@ -1947,8 +1947,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1947
1947
|
data: {
|
|
1948
1948
|
cId: r,
|
|
1949
1949
|
configuration: {
|
|
1950
|
-
...
|
|
1951
|
-
filters: !Lt && _?.length ? [...
|
|
1950
|
+
...m,
|
|
1951
|
+
filters: !Lt && _?.length ? [...m?.filters, ..._] : m?.filters
|
|
1952
1952
|
},
|
|
1953
1953
|
id: et,
|
|
1954
1954
|
datasourceId: at,
|
|
@@ -1965,7 +1965,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1965
1965
|
currentValue: ""
|
|
1966
1966
|
}));
|
|
1967
1967
|
else {
|
|
1968
|
-
let e =
|
|
1968
|
+
let e = Re(le(Array.isArray(n) ? n : [], G, q));
|
|
1969
1969
|
Et((t) => ({
|
|
1970
1970
|
data: [...t.data, {
|
|
1971
1971
|
key: o,
|
|
@@ -1974,10 +1974,10 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1974
1974
|
error: "",
|
|
1975
1975
|
isLoading: !1,
|
|
1976
1976
|
currentValue: ""
|
|
1977
|
-
})),
|
|
1977
|
+
})), k((e) => ({
|
|
1978
1978
|
...e,
|
|
1979
1979
|
pivotTableSettings2: {
|
|
1980
|
-
...
|
|
1980
|
+
...j.pivotTableSettings2,
|
|
1981
1981
|
dimensions: Q(a),
|
|
1982
1982
|
headers: Q(i)
|
|
1983
1983
|
}
|
|
@@ -1995,11 +1995,11 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
1995
1995
|
let { headerColumns: n, nonHeaderColumns: r } = G.reduce((e, n) => (t.includes(n.alias) ? e.headerColumns.push(n) : e.nonHeaderColumns.push(n), e), {
|
|
1996
1996
|
headerColumns: [],
|
|
1997
1997
|
nonHeaderColumns: []
|
|
1998
|
-
}), i = r.slice(0, 1), a = e ===
|
|
1998
|
+
}), i = r.slice(0, 1), a = e === C.pivotV3 ? [...G, ...q] : [
|
|
1999
1999
|
...i,
|
|
2000
2000
|
...q,
|
|
2001
2001
|
...n
|
|
2002
|
-
], { aggregates: o, dimensions: s } = b(a), c =
|
|
2002
|
+
], { aggregates: o, dimensions: s } = b(a), c = Ve({
|
|
2003
2003
|
configuration: U,
|
|
2004
2004
|
savedConfiguration: L?.configuration
|
|
2005
2005
|
}), l = {
|
|
@@ -2025,7 +2025,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
2025
2025
|
});
|
|
2026
2026
|
},
|
|
2027
2027
|
onChangeChartGroupByValue: (e) => {
|
|
2028
|
-
let t = e ||
|
|
2028
|
+
let t = e || j?.seriesField || "", n = t && t !== "ungrouped" ? tn(G, t) : void 0, r = G?.[0], i = n ? [r, n] : [r], a = [...i, ...q], { aggregates: o, dimensions: s } = b(a), c = {
|
|
2029
2029
|
...U,
|
|
2030
2030
|
dimensions: s,
|
|
2031
2031
|
aggregates: o,
|
|
@@ -2046,8 +2046,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
2046
2046
|
});
|
|
2047
2047
|
},
|
|
2048
2048
|
onChangeTimeseriesFormat: (e, t) => {
|
|
2049
|
-
if (
|
|
2050
|
-
let n = t ||
|
|
2049
|
+
if (j.chartType !== C.timeSeries) return;
|
|
2050
|
+
let n = t || j?.seriesField || "", r = n && n !== "ungrouped", i = G.find((e) => {
|
|
2051
2051
|
let t = e.cast?.value && e?.cast?.value !== "NONE" ? e.cast.value : e.datatype || "";
|
|
2052
2052
|
return S(t);
|
|
2053
2053
|
});
|
|
@@ -2055,7 +2055,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
2055
2055
|
let a = `${e.value} of ${i.name}`, o = {
|
|
2056
2056
|
...i,
|
|
2057
2057
|
helperFunction: "date format",
|
|
2058
|
-
functionConfiguration: { dateFormat:
|
|
2058
|
+
functionConfiguration: { dateFormat: De(e, A) },
|
|
2059
2059
|
alias: `${e.value} of ${i.name}`
|
|
2060
2060
|
};
|
|
2061
2061
|
K((e) => e?.map((e) => e.alias === i.alias ? o : e));
|
|
@@ -2113,7 +2113,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
2113
2113
|
...e,
|
|
2114
2114
|
drilldownChartSettings: [...e.drilldownChartSettings?.filter((e) => e.name !== s) || [], {
|
|
2115
2115
|
name: s,
|
|
2116
|
-
chartSettings:
|
|
2116
|
+
chartSettings: j
|
|
2117
2117
|
}]
|
|
2118
2118
|
}));
|
|
2119
2119
|
}
|
|
@@ -2127,29 +2127,29 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
2127
2127
|
onChangeChartType: (e) => {
|
|
2128
2128
|
let t = q, n = G;
|
|
2129
2129
|
([
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2130
|
+
C.singleValue,
|
|
2131
|
+
C.gaugeV2,
|
|
2132
|
+
C.progressBarV2,
|
|
2133
|
+
C.funnelV2,
|
|
2134
|
+
C.waterfall,
|
|
2135
|
+
C.treeMap
|
|
2136
2136
|
].includes(e) && q?.length > 1 || [
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
].includes(e) && G?.length) && (t = [q?.[0]], J(t)), ![
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2137
|
+
C.rose,
|
|
2138
|
+
C.pie,
|
|
2139
|
+
C.doughnut
|
|
2140
|
+
].includes(e) && G?.length) && (t = [q?.[0]], J(t)), ![C.table, C.pivotV2].includes(e) && !([
|
|
2141
|
+
C.line,
|
|
2142
|
+
C.bar,
|
|
2143
|
+
C.stack,
|
|
2144
|
+
C.row,
|
|
2145
|
+
C.horizontalStack
|
|
2146
2146
|
].includes(e) && G?.length === 2 && q?.length === 1) && G?.length > 1 && (n = [G?.[0]], K(n));
|
|
2147
2147
|
let r = [
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2148
|
+
C.line,
|
|
2149
|
+
C.bar,
|
|
2150
|
+
C.stack,
|
|
2151
|
+
C.row,
|
|
2152
|
+
C.horizontalStack
|
|
2153
2153
|
].includes(e), i, a = !1;
|
|
2154
2154
|
r && n.length === 2 && t.length === 1 ? i = Q([n[1]])?.[0] : a = !0;
|
|
2155
2155
|
let o = [...n, ...t], { aggregates: s, dimensions: c } = b(o), l = {
|
|
@@ -2179,7 +2179,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
2179
2179
|
setCurrentSelectedTable: Ot,
|
|
2180
2180
|
arithmeticColumnOptions: Zt,
|
|
2181
2181
|
onSaveArithMetricOption: vn,
|
|
2182
|
-
onSaveMetricFilter:
|
|
2182
|
+
onSaveMetricFilter: Pe((e, t) => {
|
|
2183
2183
|
let n = (e) => (e || "").trim().toLowerCase(), r = n(e.name), i = n(t);
|
|
2184
2184
|
if ((U?.rlsConditions || []).some((e) => {
|
|
2185
2185
|
let t = n(e.name);
|
|
@@ -2203,7 +2203,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
2203
2203
|
$,
|
|
2204
2204
|
Qe
|
|
2205
2205
|
]),
|
|
2206
|
-
onRemoveMetricFilter:
|
|
2206
|
+
onRemoveMetricFilter: Pe((e) => {
|
|
2207
2207
|
let t = {
|
|
2208
2208
|
...U,
|
|
2209
2209
|
rlsConditions: (U?.rlsConditions || []).filter((t) => t.name !== e)
|
|
@@ -2221,7 +2221,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
|
|
|
2221
2221
|
$,
|
|
2222
2222
|
Qe
|
|
2223
2223
|
]),
|
|
2224
|
-
onChangeMetricFilterValue:
|
|
2224
|
+
onChangeMetricFilterValue: Pe((e, t, n, r, i, a) => {
|
|
2225
2225
|
let o = (U?.rlsConditions || []).map((o) => o.name === e ? r ? {
|
|
2226
2226
|
...o,
|
|
2227
2227
|
value: t,
|
|
@@ -2287,4 +2287,4 @@ function $e(e, t) {
|
|
|
2287
2287
|
};
|
|
2288
2288
|
}
|
|
2289
2289
|
//#endregion
|
|
2290
|
-
export {
|
|
2290
|
+
export { A as a, Qe as i, F as n, ze as o, P as r, Re as s, $e as t };
|