react-semaphor 0.1.546 → 0.1.547
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/analytics-protocol/index.js +70 -67
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
- package/dist/chunks/{assistant-chat-BPXhulAx.js → assistant-chat-CK84cPAB.js} +106 -106
- package/dist/chunks/{bookmark-state-C4vetoa0.js → bookmark-state-Cu-a5ie_.js} +2 -8
- package/dist/chunks/{custom-visual-inputs-CkJW9pBS.js → custom-visual-inputs-ChL54gGm.js} +1 -1
- package/dist/chunks/{dashboard-C3CoKbGY.js → dashboard-DCk26-6i.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Be4h-7My.js → dashboard-briefing-launcher-CQ1eYsGy.js} +528 -528
- package/dist/chunks/{dashboard-controls-bxPrlSyp.js → dashboard-controls-BMeZjF7r.js} +45 -45
- package/dist/chunks/{dashboard-json-BrjxIiRt.js → dashboard-json-BZqCoanC.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-CRVHpIHp.js → document-dashboard-inputs-tYd7ao0o.js} +94 -94
- package/dist/chunks/{edit-dashboard-visual-DYYYDjY6.js → edit-dashboard-visual-Bv3MHM_G.js} +281 -281
- package/dist/chunks/{column-catalog-BYnochWQ.js → filter-reach-copy-CGWsL_ez.js} +978 -861
- package/dist/chunks/{global-date-filter-utils-9d6m9-FE.js → global-date-filter-utils-BhAu8zIM.js} +4070 -3792
- package/dist/chunks/{index-DkQkMKa1.js → index-DmrLP5Ro.js} +30 -30
- package/dist/chunks/{raw-temporal-presentation-CBzrDOjM.js → raw-temporal-presentation-DypB7sMX.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-4QEZWe5U.js → report-preferences-dialog-DoVyriYC.js} +59 -59
- package/dist/chunks/{resolve-dashboard-input-context-UpK_LBpL.js → resolve-dashboard-input-context-D0JDUa4h.js} +1511 -1612
- package/dist/chunks/{saved-dashboard-context-D_I3Lxk0.js → saved-dashboard-context-BfAH5j4L.js} +5 -5
- package/dist/chunks/{semaphor-ready-indicator-4zpRHE-X.js → semaphor-ready-indicator-CRm17oIP.js} +37137 -36459
- package/dist/chunks/{shelf-drop-preview-context-Cfw7TRAx.js → shelf-drop-preview-context-vy6P9THz.js} +80 -80
- package/dist/chunks/{table-settings-CunhoDUi.js → table-settings-WysCBj62.js} +133 -124
- package/dist/chunks/{use-create-flow-overlay-state-DZBZiiD-.js → use-create-flow-overlay-state-Csx_Xjsh.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1419 -1340
- package/dist/index.js +14 -14
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +7 -0
- package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -4
- package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
- package/dist/types/index.js +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +346 -21
- package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +83 -13
- package/dist/types/lib/stores/dashboard-store.d.ts +12 -0
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
- package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
- package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
- package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +26 -4
- package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
- package/package.json +1 -1
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { D as
|
|
5
|
-
import { N as
|
|
6
|
-
import { M as
|
|
7
|
-
import {
|
|
8
|
-
import { x as
|
|
1
|
+
var Ot = Object.defineProperty;
|
|
2
|
+
var Nt = (e, t, a) => t in e ? Ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var ke = (e, t, a) => Nt(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import { D as it, r as It, b as qt, c as Pt, a as nt, d as Mt } from "../chunks/filter-reach-copy-CGWsL_ez.js";
|
|
5
|
+
import { N as yi, R as _i, f as Ci, j as Si, l as vi, k as wi, u as xi, q as Di, e as Ti, i as ki, y as $i, z as Fi, s as Ai, v as Ri, t as Ei, m as Oi, n as Ni, p as qi, g as Pi, o as Mi, h as Li, x as Bi, w as Vi } from "../chunks/filter-reach-copy-CGWsL_ez.js";
|
|
6
|
+
import { M as Lt, N as Bt, O as $e, P as Vt, Q as Gt, R as Ut, S as jt, T as zt, U as Qt, V as Kt, W as Ht, X as Wt, Y as de, Z as Yt, _ as Xt, $ as fe, a0 as Jt, a1 as Zt, a2 as Me, a3 as yt, a4 as oe, a5 as ne, a6 as Ee, a7 as ea, a8 as Le, a9 as ta, aa, ab as sa, ac as ot, ad as ia, ae as na, af as _t, ag as ie, ah as rt, ai as oa, aj as ra, ak as Oe, al as da, am as dt, an as la, ao as lt, ap as ca, aq as ce, ar as ua, as as ct, b as ha, at as fa, au as pa, av as ma, aw as ga, ax as ut, ay as ba, az as Ia, aA as ya, aB as _a, aC as Ca, aD as Sa, aE as va, aF as wa, aG as xa, aH as Fe, aI as Da } from "../chunks/global-date-filter-utils-BhAu8zIM.js";
|
|
7
|
+
import { cx as Ui, aT as ji, c8 as zi, c9 as Qi, co as Ki, cn as Hi, ch as Wi, cp as Yi, cq as Xi, bO as Ji, bP as Zi, bQ as en, bL as tn, bM as an, bN as sn, bH as nn, bI as on, bK as rn, bJ as dn, bR as ln, cK as cn, ca as un, b7 as hn, b6 as fn, c2 as pn, cz as mn, bh as gn, cD as bn, cl as In, cm as yn, aQ as _n, cC as Cn, bk as Sn, cA as vn, by as wn, cg as xn, bS as Dn, bz as Tn, cM as kn, aL as $n, cE as Fn, ck as An, aM as Rn, c1 as En, c0 as On, bb as Nn, a$ as qn, b3 as Pn, cI as Mn, bt as Ln, d as Bn, a as Vn, bl as Gn, aN as Un, cw as jn, cO as zn, b0 as Qn, b1 as Kn, b2 as Hn, bg as Wn, bi as Yn, c5 as Xn, g as Jn, bG as Zn, bp as eo, bF as to, bC as ao, c6 as so, aV as io, aW as no, cG as oo, bm as ro, b8 as lo, ci as co, bd as uo, cu as ho, br as fo, bY as po, cN as mo, aR as go, b_ as bo, b$ as Io, cJ as yo, bw as _o, bo as Co, bq as So, bc as vo, bs as wo, cr as xo, cF as Do, aO as To, cy as ko, bv as $o, b9 as Fo, bB as Ao, cs as Ro, c3 as Eo, c4 as Oo, aU as No, cL as qo, c7 as Po, ce as Mo, bE as Lo, aY as Bo, ct as Vo, cH as Go, aJ as Uo, cv as jo, bx as zo, ba as Qo, bU as Ko, a_ as Ho, b4 as Wo, b5 as Yo, cb as Xo, cc as Jo, aZ as Zo, bW as er, bX as tr, bV as ar, aX as sr, bD as ir, cd as nr, bu as or, cj as rr, aK as dr, bA as lr, bZ as cr, aS as ur, cB as hr, bj as fr, bn as pr, aP as mr, bT as gr, bf as br, be as Ir, cf as yr } from "../chunks/global-date-filter-utils-BhAu8zIM.js";
|
|
8
|
+
import { x as Ta, ao as Be, ap as ka, a3 as Ct, ab as $a, a6 as Fa, ad as St, aD as Aa, aB as vt, aC as Ra } from "../chunks/validators-C-aOQlTB.js";
|
|
9
9
|
import "../chunks/matrix-operation-contract-D6vYkZK4.js";
|
|
10
10
|
import "../chunks/analytics-base-schemas-BKs3flFS.js";
|
|
11
11
|
import "zod";
|
|
12
|
-
import { a as
|
|
13
|
-
import { n as
|
|
14
|
-
import { a as
|
|
15
|
-
import { w as re } from "../chunks/table-settings-
|
|
16
|
-
import { D as
|
|
17
|
-
import { v as
|
|
18
|
-
import {
|
|
19
|
-
import { G as
|
|
20
|
-
import { e as
|
|
21
|
-
import { p as
|
|
22
|
-
import { m as
|
|
23
|
-
import { n as
|
|
12
|
+
import { a as Ea, r as Oa } from "../chunks/index-CtoK1Lgu.js";
|
|
13
|
+
import { n as Na } from "../chunks/operators-B3zZoskU.js";
|
|
14
|
+
import { a as Cr, b as Sr, r as vr } from "../chunks/raw-temporal-presentation-DypB7sMX.js";
|
|
15
|
+
import { w as re } from "../chunks/table-settings-WysCBj62.js";
|
|
16
|
+
import { D as xr, x as Dr, y as Tr, F as kr, B as $r, z as Fr, G as Ar, A as Rr, v as Er } from "../chunks/table-settings-WysCBj62.js";
|
|
17
|
+
import { v as ve, w as qa } from "../chunks/resolve-dashboard-input-context-D0JDUa4h.js";
|
|
18
|
+
import { J as Nr, P as qr, K as Pr, b as Mr, N as Lr, I as Br, z as Vr, Q as Gr, R as Ur, M as jr, C as zr, D as Qr, G as Kr, H as Hr, F as Wr, x as Yr, y as Xr, p as Jr, O as Zr, E as ed, A as td, L as ad, B as sd } from "../chunks/resolve-dashboard-input-context-D0JDUa4h.js";
|
|
19
|
+
import { G as nd, F as od, D as rd, E as dd, H as ld, I as cd } from "../chunks/pivot-result-lifecycle-pwq3b7LC.js";
|
|
20
|
+
import { e as Pa, w as Ma } from "../chunks/metric-comparison-zpGw4lD6.js";
|
|
21
|
+
import { p as La } from "../chunks/report-runtime-context-hWiTCzFV.js";
|
|
22
|
+
import { m as hd, a as fd, r as pd } from "../chunks/matrix-card-LiMEipvq.js";
|
|
23
|
+
import { n as ht, t as Ba } from "../chunks/matrix-analytical-definition-B9vW-osb.js";
|
|
24
24
|
import "../chunks/index-CuHybtft.js";
|
|
25
25
|
import "../value-format-preferences/index.js";
|
|
26
26
|
import "../chunks/_commonjsHelpers-DimLPMtv.js";
|
|
27
|
-
function
|
|
27
|
+
function Y(e) {
|
|
28
28
|
return e && typeof e == "object" ? e : null;
|
|
29
29
|
}
|
|
30
30
|
function Z(e) {
|
|
31
31
|
return typeof e == "string" ? e : null;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Va(e) {
|
|
34
34
|
var t, a, s;
|
|
35
|
-
return !!(e && typeof e == "object") && (((t =
|
|
35
|
+
return !!(e && typeof e == "object") && (((t = Y(e)) == null ? void 0 : t.kind) === "semantic" || ((a = Y(e)) == null ? void 0 : a.kind) === "physical" || ((s = Y(e)) == null ? void 0 : s.kind) === "sql");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function me(e) {
|
|
38
|
+
return Va(e) ? e.kind === "semantic" ? !!(e.domainId && e.datasetName) : e.kind === "physical" ? !!(e.connectionId && e.tableName) : !1 : !1;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function ni(e) {
|
|
41
|
+
return Ta(e);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function wt(e, t) {
|
|
44
44
|
return Be(e, t);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
46
|
+
function Ga(e, t) {
|
|
47
|
+
return ka(e, t);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function we(e) {
|
|
50
50
|
const t = [];
|
|
51
51
|
for (const a of e) {
|
|
52
52
|
const s = t.findIndex(
|
|
53
|
-
(
|
|
53
|
+
(r) => wt(r, a)
|
|
54
54
|
);
|
|
55
|
-
s === -1 ? t.push(a) : t[s] =
|
|
55
|
+
s === -1 ? t.push(a) : t[s] = Ga(
|
|
56
56
|
t[s],
|
|
57
57
|
a
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
return t;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
return
|
|
62
|
+
function oi(e) {
|
|
63
|
+
return we(e)[0];
|
|
64
64
|
}
|
|
65
65
|
function Ne(e, t) {
|
|
66
66
|
return e.kind !== "semantic" || e.connectionId || (t == null ? void 0 : t.kind) !== "semantic" || !Be(e, t) || !t.connectionId ? e : { ...e, connectionId: t.connectionId };
|
|
67
67
|
}
|
|
68
68
|
function qe(e) {
|
|
69
|
-
return
|
|
69
|
+
return me(e) ? e : void 0;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function ft(e, t) {
|
|
72
72
|
if (!(e.kind !== "semantic" || e.connectionId))
|
|
73
73
|
return t.find(
|
|
74
74
|
(a) => (a == null ? void 0 : a.kind) === "semantic" && Be(e, a) && !!a.connectionId
|
|
@@ -78,72 +78,72 @@ function J(e, t) {
|
|
|
78
78
|
const a = qe(e == null ? void 0 : e.source);
|
|
79
79
|
return a ? Ne(a, t) : void 0;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function Ua({
|
|
82
82
|
explicitSource: e,
|
|
83
83
|
field: t,
|
|
84
84
|
defaultSource: a,
|
|
85
85
|
fallbackSources: s
|
|
86
86
|
}) {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
const r = [a, ...s || []], n = qe(e), i = n ? Ne(
|
|
88
|
+
n,
|
|
89
|
+
ft(n, r)
|
|
90
90
|
) : void 0;
|
|
91
|
-
if (
|
|
92
|
-
return
|
|
91
|
+
if (i)
|
|
92
|
+
return i;
|
|
93
93
|
if (e !== void 0)
|
|
94
94
|
return;
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
const d = J(t, a), u = d ? Ne(
|
|
96
|
+
d,
|
|
97
|
+
ft(d, r)
|
|
98
98
|
) : void 0;
|
|
99
|
-
if (
|
|
100
|
-
return
|
|
99
|
+
if (u)
|
|
100
|
+
return u;
|
|
101
101
|
if ((t == null ? void 0 : t.source) === void 0)
|
|
102
102
|
return qe(a);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function ri(e, t) {
|
|
105
105
|
if (!(e != null && e.name) || !(t != null && t.name) || e.name !== t.name)
|
|
106
106
|
return !1;
|
|
107
107
|
const a = J(e), s = J(t);
|
|
108
|
-
return !a || !s ? !0 :
|
|
108
|
+
return !a || !s ? !0 : wt(a, s);
|
|
109
109
|
}
|
|
110
110
|
function se(e) {
|
|
111
111
|
var t;
|
|
112
|
-
return Z((t =
|
|
112
|
+
return Z((t = Y(e)) == null ? void 0 : t.kind);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function xt(e) {
|
|
115
115
|
var t, a;
|
|
116
|
-
return se(e) !== "semantic" ? null : ((a = Z((t =
|
|
117
|
-
}
|
|
118
|
-
function Ga(e) {
|
|
119
|
-
var t;
|
|
120
|
-
return se(e) !== "semantic" ? null : Z((t = H(e)) == null ? void 0 : t.datasetName);
|
|
121
|
-
}
|
|
122
|
-
function Ua(e) {
|
|
123
|
-
var t;
|
|
124
|
-
return se(e) !== "semantic" ? null : Z((t = H(e)) == null ? void 0 : t.datasetId);
|
|
116
|
+
return se(e) !== "semantic" ? null : ((a = Z((t = Y(e)) == null ? void 0 : t.domainId)) == null ? void 0 : a.trim()) || null;
|
|
125
117
|
}
|
|
126
118
|
function ja(e) {
|
|
127
119
|
var t;
|
|
128
|
-
return se(e) !== "
|
|
120
|
+
return se(e) !== "semantic" ? null : Z((t = Y(e)) == null ? void 0 : t.datasetName);
|
|
129
121
|
}
|
|
130
122
|
function za(e) {
|
|
131
123
|
var t;
|
|
132
|
-
return se(e) !== "
|
|
124
|
+
return se(e) !== "semantic" ? null : Z((t = Y(e)) == null ? void 0 : t.datasetId);
|
|
133
125
|
}
|
|
134
126
|
function Qa(e) {
|
|
135
127
|
var t;
|
|
136
|
-
return se(e) !== "physical" ?
|
|
128
|
+
return se(e) !== "physical" ? null : Z((t = Y(e)) == null ? void 0 : t.connectionId);
|
|
137
129
|
}
|
|
138
130
|
function Ka(e) {
|
|
139
131
|
var t;
|
|
140
|
-
return se(e) !== "physical" ?
|
|
132
|
+
return se(e) !== "physical" ? null : Z((t = Y(e)) == null ? void 0 : t.tableName);
|
|
133
|
+
}
|
|
134
|
+
function Ha(e) {
|
|
135
|
+
var t;
|
|
136
|
+
return se(e) !== "physical" ? "" : Z((t = Y(e)) == null ? void 0 : t.databaseName) || "";
|
|
141
137
|
}
|
|
142
138
|
function Wa(e) {
|
|
139
|
+
var t;
|
|
140
|
+
return se(e) !== "physical" ? "" : Z((t = Y(e)) == null ? void 0 : t.schemaName) || "";
|
|
141
|
+
}
|
|
142
|
+
function Ya(e) {
|
|
143
143
|
if (e.analyticsIntent && typeof e.analyticsIntent == "object" && "source" in e.analyticsIntent)
|
|
144
144
|
return e.analyticsIntent.source;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Xa({
|
|
147
147
|
datasets: e,
|
|
148
148
|
requireAtLeastOne: t
|
|
149
149
|
}) {
|
|
@@ -151,24 +151,24 @@ function Ha({
|
|
|
151
151
|
return { ok: !1, issue: "invalid_dataset_count" };
|
|
152
152
|
if (e.length <= 1)
|
|
153
153
|
return { ok: !0 };
|
|
154
|
-
const a = e.map(
|
|
155
|
-
return a.some((
|
|
154
|
+
const a = e.map(xt), s = new Set(a.filter(Boolean));
|
|
155
|
+
return a.some((r) => !r) || s.size !== 1 ? { ok: !1, issue: "invalid_multi_dataset_scope" } : { ok: !0 };
|
|
156
156
|
}
|
|
157
157
|
function Ve(e, t) {
|
|
158
158
|
if (!t)
|
|
159
159
|
return !1;
|
|
160
160
|
if (t.kind === "semantic") {
|
|
161
|
-
const a =
|
|
162
|
-
return
|
|
161
|
+
const a = za(e);
|
|
162
|
+
return xt(e) === t.domainId ? a && t.datasetId ? a === t.datasetId : ja(e) === t.datasetName : !1;
|
|
163
163
|
}
|
|
164
|
-
return t.kind === "physical" ?
|
|
164
|
+
return t.kind === "physical" ? Qa(e) === t.connectionId && Ka(e) === t.tableName && Ha(e) === (t.databaseName || "") && Wa(e) === (t.schemaName || "") : !1;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function di(e, t) {
|
|
167
167
|
return e.find(
|
|
168
168
|
(a) => Ve(a, t)
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function M(e, t, a) {
|
|
172
172
|
return a ? { code: e, message: t, cardId: a } : { code: e, message: t };
|
|
173
173
|
}
|
|
174
174
|
function ye(e) {
|
|
@@ -180,19 +180,19 @@ function ye(e) {
|
|
|
180
180
|
}
|
|
181
181
|
return null;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function Ja({
|
|
184
184
|
card: e,
|
|
185
185
|
datasets: t,
|
|
186
186
|
errors: a
|
|
187
187
|
}) {
|
|
188
188
|
if (e.type === "text")
|
|
189
189
|
return;
|
|
190
|
-
const s =
|
|
190
|
+
const s = Ya(e);
|
|
191
191
|
if (!s) {
|
|
192
192
|
if (t.length <= 1)
|
|
193
193
|
return;
|
|
194
194
|
a.push(
|
|
195
|
-
|
|
195
|
+
M(
|
|
196
196
|
"missing_card_analytics_source",
|
|
197
197
|
"Multi-dataset dashboard cards must include analytics intent with a source so the materializer can choose the correct dataset.",
|
|
198
198
|
e.id
|
|
@@ -200,8 +200,8 @@ function Ya({
|
|
|
200
200
|
);
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
|
-
t.some((
|
|
204
|
-
|
|
203
|
+
t.some((r) => Ve(r, s)) || a.push(
|
|
204
|
+
M(
|
|
205
205
|
"invalid_card_analytics_source",
|
|
206
206
|
"Dashboard cards with an explicit analytics source must use one of the selected datasets.",
|
|
207
207
|
e.id
|
|
@@ -211,35 +211,35 @@ function Ya({
|
|
|
211
211
|
function _e(e) {
|
|
212
212
|
return e.map((t) => t == null ? void 0 : t.source).filter((t) => !!t);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Ae(e) {
|
|
215
215
|
return Array.isArray(e) ? e.filter(
|
|
216
216
|
(t) => !!(t && typeof t == "object")
|
|
217
217
|
) : [];
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function pt(e) {
|
|
220
220
|
return Array.isArray(e) ? e.filter(
|
|
221
221
|
(t) => !!(t && typeof t == "object")
|
|
222
222
|
) : [];
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Za(e) {
|
|
225
225
|
var a, s;
|
|
226
226
|
if (!e)
|
|
227
227
|
return [];
|
|
228
228
|
const t = [e.source];
|
|
229
229
|
return e.kind === "metric" ? t.push(
|
|
230
230
|
..._e([
|
|
231
|
-
...
|
|
231
|
+
...Ae(e.measures),
|
|
232
232
|
e.primaryMeasure,
|
|
233
233
|
e.dateField,
|
|
234
|
-
...
|
|
235
|
-
...
|
|
234
|
+
...Ae(e.dimensions),
|
|
235
|
+
...pt(e.filters).map((r) => r.field)
|
|
236
236
|
])
|
|
237
237
|
) : e.kind === "records" ? t.push(
|
|
238
238
|
..._e([
|
|
239
|
-
...
|
|
239
|
+
...Ae(e.fields),
|
|
240
240
|
e.dateField,
|
|
241
241
|
(a = e.orderBy) == null ? void 0 : a.field,
|
|
242
|
-
...
|
|
242
|
+
...pt(e.filters).map((r) => r.field)
|
|
243
243
|
])
|
|
244
244
|
) : e.kind === "inputOptions" ? (((s = e.population) == null ? void 0 : s.kind) === "related_population" && t.push(e.population.baseSource), t.push(
|
|
245
245
|
..._e([
|
|
@@ -250,18 +250,18 @@ function Xa(e) {
|
|
|
250
250
|
])
|
|
251
251
|
)) : e.kind === "sql" && t.push(..._e(e.fields || [])), t;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function es({
|
|
254
254
|
card: e,
|
|
255
255
|
datasets: t,
|
|
256
256
|
errors: a
|
|
257
257
|
}) {
|
|
258
258
|
if (e.type !== "text") {
|
|
259
|
-
for (const s of
|
|
259
|
+
for (const s of Za(e.analyticsIntent))
|
|
260
260
|
if (s && !t.some(
|
|
261
|
-
(
|
|
261
|
+
(r) => Ve(r, s)
|
|
262
262
|
)) {
|
|
263
263
|
a.push(
|
|
264
|
-
|
|
264
|
+
M(
|
|
265
265
|
"invalid_card_query_source",
|
|
266
266
|
"Dashboard card query field references must use one of the selected datasets.",
|
|
267
267
|
e.id
|
|
@@ -271,36 +271,36 @@ function Ja({
|
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function ts({
|
|
275
275
|
card: e,
|
|
276
276
|
errors: t
|
|
277
277
|
}) {
|
|
278
278
|
if (e.type === "text" || !e.analyticsIntent)
|
|
279
279
|
return;
|
|
280
|
-
const a =
|
|
280
|
+
const a = Ct(e.analyticsIntent);
|
|
281
281
|
if (!a.ok)
|
|
282
282
|
for (const s of a.errors)
|
|
283
283
|
t.push(
|
|
284
|
-
|
|
284
|
+
M(
|
|
285
285
|
s.code,
|
|
286
286
|
s.path ? `${s.path}: ${s.message}` : s.message,
|
|
287
287
|
e.id
|
|
288
288
|
)
|
|
289
289
|
);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function as({
|
|
292
292
|
datasets: e,
|
|
293
293
|
errors: t,
|
|
294
294
|
requireAtLeastOne: a
|
|
295
295
|
}) {
|
|
296
|
-
const s =
|
|
296
|
+
const s = Xa({
|
|
297
297
|
datasets: e,
|
|
298
298
|
requireAtLeastOne: a
|
|
299
299
|
});
|
|
300
300
|
if (!s.ok) {
|
|
301
301
|
if (s.issue === "invalid_dataset_count") {
|
|
302
302
|
t.push(
|
|
303
|
-
|
|
303
|
+
M(
|
|
304
304
|
"invalid_dataset_count",
|
|
305
305
|
"Dashboard authoring requires at least one selected dataset."
|
|
306
306
|
)
|
|
@@ -308,57 +308,57 @@ function es({
|
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
310
|
t.push(
|
|
311
|
-
|
|
311
|
+
M(
|
|
312
312
|
"invalid_multi_dataset_scope",
|
|
313
313
|
"Multi-dataset dashboard authoring is limited to semantic datasets from one domain."
|
|
314
314
|
)
|
|
315
315
|
);
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function ss({
|
|
319
319
|
input: e,
|
|
320
320
|
errors: t
|
|
321
321
|
}) {
|
|
322
322
|
var a;
|
|
323
323
|
(a = e.filter.sql) != null && a.trim() && t.push(
|
|
324
|
-
|
|
324
|
+
M(
|
|
325
325
|
"generated_filter_sql_out_of_scope",
|
|
326
326
|
`Generated dashboard filter "${e.label}" must use grounded filter configuration; custom SQL is outside the dashboard-authoring contract.`
|
|
327
327
|
)
|
|
328
328
|
);
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function is({
|
|
331
331
|
card: e,
|
|
332
332
|
errors: t
|
|
333
333
|
}) {
|
|
334
334
|
"interactionConfig" in e && t.push(
|
|
335
|
-
|
|
335
|
+
M(
|
|
336
336
|
"legacy_card_interactions_unsupported",
|
|
337
337
|
"Dashboard authoring accepts click-to-filter settings only through card.clickToFilter.",
|
|
338
338
|
e.id
|
|
339
339
|
)
|
|
340
|
-
), e.clickToFilter !== void 0 && !
|
|
341
|
-
|
|
340
|
+
), e.clickToFilter !== void 0 && !Lt.safeParse(e.clickToFilter).success && t.push(
|
|
341
|
+
M(
|
|
342
342
|
"invalid_click_to_filter",
|
|
343
343
|
"Dashboard card clickToFilter settings do not match the canonical schema.",
|
|
344
344
|
e.id
|
|
345
345
|
)
|
|
346
|
-
), e.respondsToSelections !== void 0 && !
|
|
347
|
-
|
|
346
|
+
), e.respondsToSelections !== void 0 && !Bt.safeParse(e.respondsToSelections).success && t.push(
|
|
347
|
+
M(
|
|
348
348
|
"invalid_responds_to_selections",
|
|
349
349
|
"Dashboard card respondsToSelections must be a boolean.",
|
|
350
350
|
e.id
|
|
351
351
|
)
|
|
352
352
|
);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
var
|
|
354
|
+
function ns(e) {
|
|
355
|
+
var A, c;
|
|
356
356
|
const t = [];
|
|
357
357
|
if (!e || typeof e != "object")
|
|
358
358
|
return {
|
|
359
359
|
ok: !1,
|
|
360
360
|
errors: [
|
|
361
|
-
|
|
361
|
+
M(
|
|
362
362
|
"invalid_plan",
|
|
363
363
|
"Dashboard plan must be a structured object."
|
|
364
364
|
)
|
|
@@ -366,102 +366,102 @@ function ss(e) {
|
|
|
366
366
|
warnings: []
|
|
367
367
|
};
|
|
368
368
|
const a = e, s = [...a.warnings || []];
|
|
369
|
-
a.version !== 1 && t.push(
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
369
|
+
a.version !== 1 && t.push(M("invalid_version", "Dashboard plan version must be 1.")), (A = a.title) != null && A.trim() || t.push(M("missing_title", "Dashboard plan needs a title."));
|
|
370
|
+
const r = Array.isArray(a.datasets) ? a.datasets : [], n = Array.isArray(a.sheets) ? a.sheets : [];
|
|
371
|
+
as({ datasets: r, errors: t, requireAtLeastOne: !0 }), n.length !== 1 && t.push(
|
|
372
|
+
M(
|
|
373
373
|
"invalid_sheet_count",
|
|
374
374
|
"MVP dashboard authoring creates exactly one dashboard sheet."
|
|
375
375
|
)
|
|
376
376
|
);
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
|
|
377
|
+
const i = n[0];
|
|
378
|
+
i && i.kind !== "dashboard" && t.push(
|
|
379
|
+
M("invalid_sheet_kind", 'Generated sheet must use kind "dashboard".')
|
|
380
380
|
);
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
|
|
381
|
+
const d = (i == null ? void 0 : i.cards) || [];
|
|
382
|
+
d.length > it && t.push(
|
|
383
|
+
M(
|
|
384
384
|
"too_many_cards",
|
|
385
|
-
`Generated dashboards can contain at most ${
|
|
385
|
+
`Generated dashboards can contain at most ${it} cards.`
|
|
386
386
|
)
|
|
387
387
|
);
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
|
|
388
|
+
const u = ye(d.map((m) => m.id));
|
|
389
|
+
u && t.push(
|
|
390
|
+
M("duplicate_card_id", `Duplicate generated card id: ${u}.`)
|
|
391
391
|
);
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
|
|
392
|
+
const b = ye(d.map((m) => m.frameId));
|
|
393
|
+
b && t.push(
|
|
394
|
+
M(
|
|
395
395
|
"duplicate_frame_id",
|
|
396
|
-
`Duplicate generated frame id: ${
|
|
396
|
+
`Duplicate generated frame id: ${b}.`
|
|
397
397
|
)
|
|
398
398
|
);
|
|
399
|
-
for (const
|
|
400
|
-
(
|
|
401
|
-
|
|
399
|
+
for (const m of d)
|
|
400
|
+
(c = m.title) != null && c.trim() || t.push(M("missing_card_title", "Card title is required.", m.id)), m.type === "custom" && t.push(
|
|
401
|
+
M(
|
|
402
402
|
"custom_visual_out_of_scope",
|
|
403
403
|
"Whole-dashboard authoring supports built-in visual types only.",
|
|
404
|
-
|
|
404
|
+
m.id
|
|
405
405
|
)
|
|
406
|
-
),
|
|
407
|
-
|
|
406
|
+
), m.type !== "text" && !m.analyticsIntent && s.push(
|
|
407
|
+
M(
|
|
408
408
|
"missing_analytics_intent",
|
|
409
409
|
"Non-text card has no analytics intent and may be skipped by the app layer.",
|
|
410
|
-
|
|
410
|
+
m.id
|
|
411
411
|
)
|
|
412
|
-
),
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
412
|
+
), Ja({ card: m, datasets: r, errors: t }), ts({ card: m, errors: t }), es({ card: m, datasets: r, errors: t }), is({ card: m, errors: t });
|
|
413
|
+
const y = Array.isArray(a.filterInputs) ? a.filterInputs : [], C = y.map((m) => m.id), p = ye(C);
|
|
414
|
+
p && t.push(
|
|
415
|
+
M(
|
|
416
416
|
"duplicate_input_id",
|
|
417
|
-
`Duplicate dashboard input id: ${
|
|
417
|
+
`Duplicate dashboard input id: ${p}.`
|
|
418
418
|
)
|
|
419
419
|
);
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
|
|
420
|
+
const $ = y.map((m) => m.variableName).filter(Boolean) || [], _ = ye($);
|
|
421
|
+
_ && t.push(
|
|
422
|
+
M(
|
|
423
423
|
"duplicate_input_variable",
|
|
424
|
-
`Duplicate dashboard input variable name: ${
|
|
424
|
+
`Duplicate dashboard input variable name: ${_}.`
|
|
425
425
|
)
|
|
426
426
|
);
|
|
427
|
-
for (const
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
for (const
|
|
431
|
-
|
|
432
|
-
|
|
427
|
+
for (const m of y)
|
|
428
|
+
ss({ input: m, errors: t });
|
|
429
|
+
const g = Array.isArray(a.calculatedFields) ? a.calculatedFields : [];
|
|
430
|
+
for (const m of g)
|
|
431
|
+
m.scope === "domain" && m.reuseOnly !== !0 && t.push(
|
|
432
|
+
M(
|
|
433
433
|
"domain_calculated_field_create_out_of_scope",
|
|
434
|
-
`Creating domain calculated field "${
|
|
434
|
+
`Creating domain calculated field "${m.name}" is outside MVP.`
|
|
435
435
|
)
|
|
436
436
|
);
|
|
437
437
|
return { ok: t.length === 0, errors: t, warnings: s };
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
const t =
|
|
439
|
+
function os(e) {
|
|
440
|
+
const t = $a(e);
|
|
441
441
|
return t === "datetime" ? "date" : t === "unknown" ? "string" : t;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function rs(e) {
|
|
444
444
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
return
|
|
446
|
+
function ds(e) {
|
|
447
|
+
return rs(e) && typeof e.filterId == "string" && typeof e.operation == "string" && Array.isArray(e.values);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function ls(e) {
|
|
450
450
|
return e.filter(
|
|
451
451
|
(t) => typeof t == "string" || typeof t == "number"
|
|
452
452
|
);
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function cs(e) {
|
|
455
455
|
return e.filter(
|
|
456
456
|
(t) => t instanceof Date || typeof t == "string"
|
|
457
457
|
);
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function Dt(e, t) {
|
|
460
460
|
if (t === void 0)
|
|
461
461
|
return;
|
|
462
|
-
const a =
|
|
463
|
-
if (
|
|
464
|
-
return
|
|
462
|
+
const a = os(e.dataType), s = e.operation || "in";
|
|
463
|
+
if (ds(t))
|
|
464
|
+
return $e({
|
|
465
465
|
definition: e,
|
|
466
466
|
sourceValue: t,
|
|
467
467
|
value: {
|
|
@@ -475,7 +475,7 @@ function xt(e, t) {
|
|
|
475
475
|
}
|
|
476
476
|
});
|
|
477
477
|
if (s === "is null" || s === "is not null")
|
|
478
|
-
return
|
|
478
|
+
return $e({
|
|
479
479
|
definition: e,
|
|
480
480
|
value: {
|
|
481
481
|
filterId: e.id,
|
|
@@ -488,29 +488,29 @@ function xt(e, t) {
|
|
|
488
488
|
semanticContext: e.semanticContext
|
|
489
489
|
}
|
|
490
490
|
});
|
|
491
|
-
const
|
|
492
|
-
if (
|
|
493
|
-
return
|
|
491
|
+
const r = Array.isArray(t) ? t : [t], n = a === "date" ? cs(r) : ls(r);
|
|
492
|
+
if (n.length !== 0 && !((s === "between" || s === "not between") && n.length < 2))
|
|
493
|
+
return $e({
|
|
494
494
|
definition: e,
|
|
495
495
|
value: {
|
|
496
496
|
filterId: e.id,
|
|
497
497
|
name: e.column,
|
|
498
498
|
operation: s,
|
|
499
499
|
valueType: a,
|
|
500
|
-
values:
|
|
500
|
+
values: n,
|
|
501
501
|
dataType: e.dataType,
|
|
502
502
|
fieldMeta: e.fieldMeta,
|
|
503
503
|
semanticContext: e.semanticContext
|
|
504
504
|
}
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Tt(e, t, a) {
|
|
508
508
|
return a ? { code: e, message: t, cardId: a } : { code: e, message: t };
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function us(e, t, a) {
|
|
511
511
|
const s = (t || []).filter(
|
|
512
|
-
(
|
|
513
|
-
).map((
|
|
512
|
+
(r) => r.scope === "card" && r.targetCardId === a
|
|
513
|
+
).map((r) => r.field).filter(Boolean);
|
|
514
514
|
return s.length === 0 ? e : {
|
|
515
515
|
...e,
|
|
516
516
|
calculatedFields: [
|
|
@@ -519,11 +519,11 @@ function ls(e, t, a) {
|
|
|
519
519
|
]
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function hs(e, t, a) {
|
|
523
523
|
return t.clickToFilter === void 0 && t.respondsToSelections === void 0 ? e : {
|
|
524
524
|
...e,
|
|
525
525
|
...t.clickToFilter ? {
|
|
526
|
-
clickToFilter:
|
|
526
|
+
clickToFilter: Vt(
|
|
527
527
|
t.clickToFilter,
|
|
528
528
|
{ cardIds: Object.fromEntries(a) }
|
|
529
529
|
)
|
|
@@ -531,52 +531,52 @@ function cs(e, t, a) {
|
|
|
531
531
|
...t.respondsToSelections !== void 0 ? { respondsToSelections: t.respondsToSelections } : {}
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function fs(e, t) {
|
|
535
535
|
if (!e) return e;
|
|
536
|
-
const a =
|
|
536
|
+
const a = Ut(e, {
|
|
537
537
|
renamedCardIds: t,
|
|
538
538
|
keepOnlyRenamedCardIds: !0
|
|
539
539
|
});
|
|
540
|
-
return
|
|
540
|
+
return jt(a) ? null : a;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function ps(e, t) {
|
|
543
543
|
const a = {}, s = [];
|
|
544
544
|
return {
|
|
545
545
|
inputs: (e.filterInputs || []).flatMap(
|
|
546
|
-
(
|
|
547
|
-
const
|
|
548
|
-
if (
|
|
546
|
+
(n, i) => {
|
|
547
|
+
const d = fs(n.scope, t);
|
|
548
|
+
if (d === null)
|
|
549
549
|
return s.push(
|
|
550
|
-
|
|
550
|
+
Tt(
|
|
551
551
|
"filter_input_scope_empty",
|
|
552
|
-
`Filter input "${
|
|
552
|
+
`Filter input "${n.label}" was skipped because all scoped cards or tabs were skipped during query validation.`
|
|
553
553
|
)
|
|
554
554
|
), [];
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
|
|
555
|
+
const u = Dt(
|
|
556
|
+
n.filter,
|
|
557
|
+
n.defaultValue
|
|
558
558
|
);
|
|
559
|
-
return
|
|
559
|
+
return u && (a.shared ?? (a.shared = {}), a.shared[n.id] = {
|
|
560
560
|
status: "set",
|
|
561
561
|
value: {
|
|
562
562
|
kind: "filter",
|
|
563
|
-
filterValue:
|
|
563
|
+
filterValue: u
|
|
564
564
|
}
|
|
565
565
|
}), [
|
|
566
566
|
{
|
|
567
|
-
id:
|
|
567
|
+
id: n.id,
|
|
568
568
|
kind: "filter",
|
|
569
|
-
label:
|
|
570
|
-
variableName:
|
|
571
|
-
scope:
|
|
569
|
+
label: n.label,
|
|
570
|
+
variableName: n.variableName,
|
|
571
|
+
scope: d || { kind: "allSheets", sheetKinds: ["dashboard"] },
|
|
572
572
|
runtimeScope: "shared",
|
|
573
573
|
presentation: {
|
|
574
574
|
placement: "toolbar",
|
|
575
|
-
order:
|
|
575
|
+
order: i
|
|
576
576
|
},
|
|
577
577
|
exports: ["label", "value", "start", "end", "range"],
|
|
578
578
|
// Reach is the scope (S-1): a filter definition stores none.
|
|
579
|
-
filter:
|
|
579
|
+
filter: Gt(n.filter)
|
|
580
580
|
}
|
|
581
581
|
];
|
|
582
582
|
}
|
|
@@ -585,57 +585,57 @@ function fs(e, t) {
|
|
|
585
585
|
defaultInputValues: a.shared && Object.keys(a.shared).length > 0 ? a : void 0
|
|
586
586
|
};
|
|
587
587
|
}
|
|
588
|
-
function
|
|
589
|
-
var
|
|
590
|
-
const t =
|
|
588
|
+
function li(e) {
|
|
589
|
+
var g, A;
|
|
590
|
+
const t = ns(e.plan);
|
|
591
591
|
if (!t.ok)
|
|
592
592
|
throw new Error(
|
|
593
|
-
t.errors.map((
|
|
593
|
+
t.errors.map((c) => c.message).join(`
|
|
594
594
|
`) || "Dashboard plan is invalid."
|
|
595
595
|
);
|
|
596
|
-
const a = e.plan.sheets[0], s = [...t.warnings],
|
|
597
|
-
e.cardArtifacts.map((
|
|
598
|
-
),
|
|
599
|
-
e.cardArtifacts.map((
|
|
600
|
-
|
|
601
|
-
|
|
596
|
+
const a = e.plan.sheets[0], s = [...t.warnings], r = [], n = new Map(
|
|
597
|
+
e.cardArtifacts.map((c) => [c.planCardId, c])
|
|
598
|
+
), i = new Map(
|
|
599
|
+
e.cardArtifacts.map((c) => [
|
|
600
|
+
c.planCardId,
|
|
601
|
+
c.card.id
|
|
602
602
|
])
|
|
603
|
-
),
|
|
604
|
-
for (const
|
|
605
|
-
const
|
|
606
|
-
if (!
|
|
607
|
-
const
|
|
603
|
+
), d = [];
|
|
604
|
+
for (const c of a.cards) {
|
|
605
|
+
const m = n.get(c.id);
|
|
606
|
+
if (!m) {
|
|
607
|
+
const k = Tt(
|
|
608
608
|
"missing_card_artifact",
|
|
609
|
-
`Card "${
|
|
610
|
-
|
|
609
|
+
`Card "${c.title}" was skipped because no generated artifact was supplied.`,
|
|
610
|
+
c.id
|
|
611
611
|
);
|
|
612
|
-
|
|
612
|
+
r.push(k);
|
|
613
613
|
continue;
|
|
614
614
|
}
|
|
615
|
-
s.push(...
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
|
|
615
|
+
s.push(...m.warnings || []);
|
|
616
|
+
const F = hs(
|
|
617
|
+
us(
|
|
618
|
+
m.card,
|
|
619
619
|
e.plan.calculatedFields,
|
|
620
|
-
|
|
620
|
+
c.id
|
|
621
621
|
),
|
|
622
|
-
|
|
623
|
-
|
|
622
|
+
c,
|
|
623
|
+
i
|
|
624
624
|
);
|
|
625
|
-
|
|
626
|
-
id:
|
|
627
|
-
cards: [
|
|
628
|
-
activeCardId:
|
|
625
|
+
d.push({
|
|
626
|
+
id: c.frameId,
|
|
627
|
+
cards: [F],
|
|
628
|
+
activeCardId: F.id
|
|
629
629
|
});
|
|
630
630
|
}
|
|
631
|
-
if (
|
|
631
|
+
if (d.length === 0)
|
|
632
632
|
throw new Error("Dashboard plan did not produce any persistable cards.");
|
|
633
|
-
const { inputs:
|
|
634
|
-
s.push(...
|
|
635
|
-
const
|
|
636
|
-
(
|
|
637
|
-
).map(({ frame:
|
|
638
|
-
if (
|
|
633
|
+
const { inputs: u, defaultInputValues: b, warnings: y } = ps(e.plan, i);
|
|
634
|
+
s.push(...y);
|
|
635
|
+
const C = new Map(a.cards.map((c) => [c.frameId, c.priority])), p = d.map((c, m) => ({ frame: c, index: m })).sort(
|
|
636
|
+
(c, m) => (C.get(c.frame.id) ?? 0) - (C.get(m.frame.id) ?? 0) || c.index - m.index
|
|
637
|
+
).map(({ frame: c }) => c), $ = Ea({ id: a.id, frames: p, layouts: void 0 }, { kind: "arrange" });
|
|
638
|
+
if (!$.ok) throw new Error($.failure.message);
|
|
639
639
|
return { dashboard: {
|
|
640
640
|
id: e.dashboardId,
|
|
641
641
|
title: e.plan.title,
|
|
@@ -649,24 +649,24 @@ function ri(e) {
|
|
|
649
649
|
kind: "dashboard",
|
|
650
650
|
title: a.title,
|
|
651
651
|
description: a.description,
|
|
652
|
-
frames:
|
|
653
|
-
layouts:
|
|
654
|
-
customizedBreakpoints:
|
|
655
|
-
calculatedFields: (
|
|
652
|
+
frames: $.frames,
|
|
653
|
+
layouts: $.layouts,
|
|
654
|
+
customizedBreakpoints: $.customizedBreakpoints,
|
|
655
|
+
calculatedFields: (g = e.plan.calculatedFields) == null ? void 0 : g.filter((c) => c.scope === "sheet" && c.field).map((c) => c.field)
|
|
656
656
|
}
|
|
657
657
|
],
|
|
658
|
-
calculatedFields: (
|
|
659
|
-
inputs:
|
|
660
|
-
...
|
|
661
|
-
}, warnings: s, skippedOperations:
|
|
658
|
+
calculatedFields: (A = e.plan.calculatedFields) == null ? void 0 : A.filter((c) => c.scope === "dashboard" && c.field).map((c) => c.field),
|
|
659
|
+
inputs: u,
|
|
660
|
+
...b ? { defaultInputValues: b } : {}
|
|
661
|
+
}, warnings: s, skippedOperations: r };
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function H(e, t, a) {
|
|
664
664
|
return a ? { code: e, message: t, cardId: a } : { code: e, message: t };
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function he(e, t) {
|
|
667
667
|
return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || t;
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function kt(e, t) {
|
|
670
670
|
if (!t.has(e))
|
|
671
671
|
return t.add(e), e;
|
|
672
672
|
let a = 2, s = `${e}-${a}`;
|
|
@@ -674,22 +674,22 @@ function Dt(e, t) {
|
|
|
674
674
|
a += 1, s = `${e}-${a}`;
|
|
675
675
|
return t.add(s), s;
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function ge(e) {
|
|
678
678
|
return !!(e && typeof e == "object");
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function $t(e) {
|
|
681
681
|
return Array.isArray(e.inputs) ? e.inputs.filter(
|
|
682
|
-
(t) =>
|
|
682
|
+
(t) => ge(t) && typeof t.id == "string"
|
|
683
683
|
) : [];
|
|
684
684
|
}
|
|
685
685
|
function Ge(e) {
|
|
686
686
|
return Array.isArray(e.sections) ? e.sections.filter(
|
|
687
|
-
(t) =>
|
|
687
|
+
(t) => ge(t)
|
|
688
688
|
) : [];
|
|
689
689
|
}
|
|
690
690
|
function Ue(e) {
|
|
691
691
|
return Array.isArray(e.views) ? e.views.filter(
|
|
692
|
-
(t) =>
|
|
692
|
+
(t) => ge(t)
|
|
693
693
|
) : [];
|
|
694
694
|
}
|
|
695
695
|
function te(e) {
|
|
@@ -702,98 +702,98 @@ function te(e) {
|
|
|
702
702
|
}
|
|
703
703
|
return t;
|
|
704
704
|
}
|
|
705
|
-
function
|
|
706
|
-
var s,
|
|
705
|
+
function ms(e) {
|
|
706
|
+
var s, r, n;
|
|
707
707
|
if (!e)
|
|
708
708
|
return [];
|
|
709
709
|
const t = [];
|
|
710
|
-
if (
|
|
710
|
+
if (me(e.source) && t.push(e.source), e.kind === "metric") {
|
|
711
711
|
t.push(...te(e.measures));
|
|
712
|
-
const
|
|
713
|
-
|
|
712
|
+
const i = J(e.dateField);
|
|
713
|
+
i && t.push(i), t.push(...te(e.dimensions)), t.push(
|
|
714
714
|
...te(
|
|
715
|
-
(s = e.filters) == null ? void 0 : s.map((
|
|
715
|
+
(s = e.filters) == null ? void 0 : s.map((d) => d.field)
|
|
716
716
|
)
|
|
717
717
|
);
|
|
718
718
|
} else if (e.kind === "records") {
|
|
719
|
-
const
|
|
720
|
-
|
|
719
|
+
const i = J(e.dateField);
|
|
720
|
+
i && t.push(i), t.push(...te(e.fields)), t.push(
|
|
721
721
|
...te(
|
|
722
|
-
(
|
|
722
|
+
(r = e.filters) == null ? void 0 : r.map((d) => d.field)
|
|
723
723
|
)
|
|
724
724
|
);
|
|
725
|
-
} else e.kind === "inputOptions" ? (((
|
|
725
|
+
} else e.kind === "inputOptions" ? (((n = e.population) == null ? void 0 : n.kind) === "related_population" && me(e.population.baseSource) && t.push(e.population.baseSource), t.push(
|
|
726
726
|
...te([
|
|
727
727
|
e.labelField,
|
|
728
728
|
e.valueField,
|
|
729
729
|
e.searchField,
|
|
730
730
|
...e.disambiguationFields || []
|
|
731
|
-
].filter((
|
|
731
|
+
].filter((i) => !!i))
|
|
732
732
|
)) : e.kind === "sql" && t.push(...te(e.fields));
|
|
733
733
|
const a = "inputs" in e && Array.isArray(e.inputs) ? e.inputs : [];
|
|
734
|
-
for (const
|
|
735
|
-
const
|
|
736
|
-
|
|
734
|
+
for (const i of a) {
|
|
735
|
+
const d = J(i.field);
|
|
736
|
+
d && t.push(d);
|
|
737
737
|
}
|
|
738
738
|
return t;
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function gs(e) {
|
|
741
741
|
const t = [];
|
|
742
|
-
for (const a of
|
|
742
|
+
for (const a of $t(e)) {
|
|
743
743
|
const s = J(a.field);
|
|
744
744
|
s && t.push(s);
|
|
745
745
|
}
|
|
746
746
|
for (const a of Ge(e))
|
|
747
747
|
for (const s of Ue(a))
|
|
748
|
-
t.push(...
|
|
748
|
+
t.push(...ms(s.analytics));
|
|
749
749
|
return t;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function bs(e) {
|
|
752
752
|
var a;
|
|
753
753
|
const t = [];
|
|
754
754
|
for (const s of Ge(e))
|
|
755
|
-
for (const
|
|
756
|
-
|
|
755
|
+
for (const r of Ue(s))
|
|
756
|
+
me((a = r.analytics) == null ? void 0 : a.source) && t.push(r.analytics.source);
|
|
757
757
|
return t;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
const a =
|
|
759
|
+
function Is(e, t) {
|
|
760
|
+
const a = we(e).filter(me);
|
|
761
761
|
if (a.length === 0)
|
|
762
762
|
return t.push(
|
|
763
|
-
|
|
763
|
+
H(
|
|
764
764
|
"missing_materializable_dataset",
|
|
765
765
|
"No semantic or physical source could be converted into the current dashboard authoring dataset reference."
|
|
766
766
|
)
|
|
767
767
|
), [];
|
|
768
|
-
const s = a.every((
|
|
768
|
+
const s = a.every((n) => n.kind === "semantic"), r = Array.from(
|
|
769
769
|
new Set(
|
|
770
|
-
a.filter((
|
|
770
|
+
a.filter((n) => n.kind === "semantic").map((n) => n.domainId)
|
|
771
771
|
)
|
|
772
772
|
);
|
|
773
|
-
return a.length > 1 && (!s ||
|
|
774
|
-
|
|
773
|
+
return a.length > 1 && (!s || r.length !== 1) ? (t.push(
|
|
774
|
+
H(
|
|
775
775
|
"multiple_datasets_out_of_scope",
|
|
776
776
|
"The dashboard authoring compiler supports multiple datasets only within one semantic domain; using the first source and deferring the rest."
|
|
777
777
|
)
|
|
778
778
|
), [a[0]]) : a;
|
|
779
779
|
}
|
|
780
|
-
function
|
|
781
|
-
const a = Ge(e), s =
|
|
782
|
-
|
|
780
|
+
function ys(e, t) {
|
|
781
|
+
const a = Ge(e), s = $t(e), r = we(gs(e)), n = we(
|
|
782
|
+
bs(e)
|
|
783
783
|
);
|
|
784
784
|
return {
|
|
785
785
|
sections: a,
|
|
786
786
|
inputs: s,
|
|
787
|
-
sources:
|
|
788
|
-
primarySources:
|
|
789
|
-
defaultSource:
|
|
790
|
-
datasets:
|
|
787
|
+
sources: r,
|
|
788
|
+
primarySources: n,
|
|
789
|
+
defaultSource: n.length === 1 ? n[0] : void 0,
|
|
790
|
+
datasets: Is(r, t)
|
|
791
791
|
};
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
return e &&
|
|
793
|
+
function _s(e) {
|
|
794
|
+
return e && Ct(e).ok ? e : void 0;
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function Cs(e) {
|
|
797
797
|
var t;
|
|
798
798
|
switch ((t = e.presentation) == null ? void 0 : t.kind) {
|
|
799
799
|
case "kpi":
|
|
@@ -812,12 +812,12 @@ function ys(e) {
|
|
|
812
812
|
return null;
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function Ss(e) {
|
|
816
816
|
var t, a, s;
|
|
817
817
|
return ((t = e.presentation) == null ? void 0 : t.kind) === "kpi" ? "kpi" : ((a = e.presentation) == null ? void 0 : a.kind) === "table" ? "table" : ((s = e.presentation) == null ? void 0 : s.kind) === "text" ? "text" : "chart";
|
|
818
818
|
}
|
|
819
|
-
function
|
|
820
|
-
const t =
|
|
819
|
+
function vs(e) {
|
|
820
|
+
const t = Na(e);
|
|
821
821
|
switch (t) {
|
|
822
822
|
case "not_in":
|
|
823
823
|
return "not in";
|
|
@@ -831,77 +831,77 @@ function Cs(e) {
|
|
|
831
831
|
return t || "in";
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
|
-
function
|
|
835
|
-
return
|
|
834
|
+
function ws(e) {
|
|
835
|
+
return ge(e.field) ? e.field.dataType === "datetime" ? "date" : e.field.dataType || "string" : "string";
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function xs(e) {
|
|
838
838
|
if (!(!e || e.kind !== "physical"))
|
|
839
839
|
return [e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".");
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function Ds(e, t, a, s, r, n) {
|
|
842
842
|
if (e.kind !== "filter")
|
|
843
|
-
return
|
|
844
|
-
|
|
843
|
+
return n.push(
|
|
844
|
+
H(
|
|
845
845
|
"control_inputs_deferred",
|
|
846
846
|
`Control input "${e.label}" is represented in the protocol but not yet materialized by the dashboard authoring adapter.`
|
|
847
847
|
)
|
|
848
848
|
), null;
|
|
849
|
-
if (!
|
|
850
|
-
return
|
|
851
|
-
|
|
849
|
+
if (!ge(e.field) || typeof e.field.name != "string")
|
|
850
|
+
return n.push(
|
|
851
|
+
H(
|
|
852
852
|
"filter_requires_field",
|
|
853
853
|
`Filter "${e.label || e.id}" needs a field before the dashboard compiler can materialize it.`
|
|
854
854
|
)
|
|
855
855
|
), null;
|
|
856
|
-
const
|
|
856
|
+
const i = Ua({
|
|
857
857
|
explicitSource: void 0,
|
|
858
858
|
field: e.field,
|
|
859
859
|
defaultSource: t,
|
|
860
860
|
fallbackSources: a
|
|
861
|
-
}),
|
|
862
|
-
if (!
|
|
863
|
-
return
|
|
864
|
-
|
|
861
|
+
}), d = (i == null ? void 0 : i.kind) === "semantic" || (i == null ? void 0 : i.kind) === "physical" ? i.connectionId : void 0;
|
|
862
|
+
if (!d)
|
|
863
|
+
return n.push(
|
|
864
|
+
H(
|
|
865
865
|
"filter_requires_connection_id",
|
|
866
866
|
`Filter "${e.label}" needs a source connectionId before the dashboard compiler can materialize it.`
|
|
867
867
|
)
|
|
868
868
|
), null;
|
|
869
|
-
const
|
|
870
|
-
id: `filter-${
|
|
871
|
-
|
|
872
|
-
|
|
869
|
+
const y = {
|
|
870
|
+
id: `filter-${kt(
|
|
871
|
+
he(e.id, e.field.name),
|
|
872
|
+
r
|
|
873
873
|
)}`,
|
|
874
874
|
variableName: e.id,
|
|
875
|
-
connectionId:
|
|
875
|
+
connectionId: d,
|
|
876
876
|
title: e.label,
|
|
877
877
|
column: e.field.name,
|
|
878
|
-
dataType:
|
|
879
|
-
qualifiedTableName:
|
|
878
|
+
dataType: ws(e),
|
|
879
|
+
qualifiedTableName: xs(i),
|
|
880
880
|
sql: "",
|
|
881
|
-
operation:
|
|
881
|
+
operation: vs(e.operator),
|
|
882
882
|
type: e.multi === !1 ? "single" : "multiple",
|
|
883
883
|
location: "dashboard",
|
|
884
|
-
fieldMeta: (
|
|
884
|
+
fieldMeta: (i == null ? void 0 : i.kind) === "semantic" ? {
|
|
885
885
|
name: e.field.name,
|
|
886
886
|
qualifiedFieldName: e.field.name,
|
|
887
887
|
dataType: e.field.dataType,
|
|
888
888
|
role: e.field.role === "measure" ? "metric" : "groupby"
|
|
889
889
|
} : void 0,
|
|
890
|
-
semanticContext: (
|
|
891
|
-
semanticDomainId:
|
|
892
|
-
connectionId:
|
|
893
|
-
} : (
|
|
894
|
-
connectionId:
|
|
895
|
-
connectionType:
|
|
890
|
+
semanticContext: (i == null ? void 0 : i.kind) === "semantic" ? {
|
|
891
|
+
semanticDomainId: i.domainId,
|
|
892
|
+
connectionId: i.connectionId
|
|
893
|
+
} : (i == null ? void 0 : i.kind) === "physical" ? {
|
|
894
|
+
connectionId: i.connectionId,
|
|
895
|
+
connectionType: i.connectionType,
|
|
896
896
|
selectedEntities: [
|
|
897
897
|
{
|
|
898
898
|
type: "table",
|
|
899
|
-
connectionId:
|
|
900
|
-
connectionType:
|
|
901
|
-
dialect:
|
|
902
|
-
database:
|
|
903
|
-
schema:
|
|
904
|
-
name:
|
|
899
|
+
connectionId: i.connectionId,
|
|
900
|
+
connectionType: i.connectionType,
|
|
901
|
+
dialect: i.dialect,
|
|
902
|
+
database: i.databaseName,
|
|
903
|
+
schema: i.schemaName,
|
|
904
|
+
name: i.tableName
|
|
905
905
|
}
|
|
906
906
|
]
|
|
907
907
|
} : void 0
|
|
@@ -911,37 +911,37 @@ function xs(e, t, a, s, d, i) {
|
|
|
911
911
|
label: e.label,
|
|
912
912
|
variableName: e.id,
|
|
913
913
|
scope: s,
|
|
914
|
-
filter:
|
|
915
|
-
defaultValue:
|
|
916
|
-
|
|
914
|
+
filter: y,
|
|
915
|
+
defaultValue: Dt(
|
|
916
|
+
y,
|
|
917
917
|
e.defaultValue
|
|
918
918
|
)
|
|
919
919
|
};
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function Re(e) {
|
|
922
922
|
const t = [], a = [];
|
|
923
923
|
for (const s of e.viewIds) {
|
|
924
|
-
const
|
|
925
|
-
|
|
924
|
+
const r = e.viewIdToCardId.get(s);
|
|
925
|
+
r ? t.push(r) : a.push(s);
|
|
926
926
|
}
|
|
927
927
|
return a.length > 0 && e.warnings.push(
|
|
928
|
-
|
|
928
|
+
H(
|
|
929
929
|
"input_scope_view_not_found",
|
|
930
930
|
`Filter "${e.inputLabel}" referenced unknown view ids: ${a.join(", ")}.`
|
|
931
931
|
)
|
|
932
932
|
), Array.from(new Set(t));
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
var s,
|
|
934
|
+
function Ts(e) {
|
|
935
|
+
var s, r;
|
|
936
936
|
if (!e.protocolScope) {
|
|
937
|
-
const
|
|
938
|
-
return
|
|
937
|
+
const n = Array.from(new Set(e.boundCardIds));
|
|
938
|
+
return n.length > 0 && n.length < e.allCardIds.length ? { kind: "cards", cardIds: n } : void 0;
|
|
939
939
|
}
|
|
940
940
|
if (e.protocolScope.level === "dashboard") {
|
|
941
941
|
if (!((s = e.protocolScope.excludeViewIds) != null && s.length))
|
|
942
942
|
return;
|
|
943
|
-
const
|
|
944
|
-
|
|
943
|
+
const n = new Set(
|
|
944
|
+
Re({
|
|
945
945
|
inputLabel: e.inputLabel,
|
|
946
946
|
viewIds: e.protocolScope.excludeViewIds,
|
|
947
947
|
viewIdToCardId: e.viewIdToCardId,
|
|
@@ -950,35 +950,35 @@ function ws(e) {
|
|
|
950
950
|
);
|
|
951
951
|
return {
|
|
952
952
|
kind: "cards",
|
|
953
|
-
cardIds: e.allCardIds.filter((
|
|
953
|
+
cardIds: e.allCardIds.filter((i) => !n.has(i))
|
|
954
954
|
};
|
|
955
955
|
}
|
|
956
956
|
if (e.protocolScope.level === "view") {
|
|
957
|
-
const
|
|
957
|
+
const n = Re({
|
|
958
958
|
inputLabel: e.inputLabel,
|
|
959
959
|
viewIds: e.protocolScope.viewIds,
|
|
960
960
|
viewIdToCardId: e.viewIdToCardId,
|
|
961
961
|
warnings: e.warnings
|
|
962
962
|
});
|
|
963
|
-
return
|
|
964
|
-
|
|
963
|
+
return n.length === 0 ? (e.warnings.push(
|
|
964
|
+
H(
|
|
965
965
|
"input_scope_has_no_materialized_cards",
|
|
966
966
|
`Filter "${e.inputLabel}" was deferred because its view scope does not match any materialized cards.`
|
|
967
967
|
)
|
|
968
|
-
), null) : { kind: "cards", cardIds:
|
|
968
|
+
), null) : { kind: "cards", cardIds: n };
|
|
969
969
|
}
|
|
970
970
|
const t = e.sectionIdToCardIds.get(e.protocolScope.sectionId) || [];
|
|
971
971
|
if (t.length === 0)
|
|
972
972
|
return e.warnings.push(
|
|
973
|
-
|
|
973
|
+
H(
|
|
974
974
|
"input_scope_section_not_found",
|
|
975
975
|
`Filter "${e.inputLabel}" was deferred because section "${e.protocolScope.sectionId}" does not match any materialized cards.`
|
|
976
976
|
)
|
|
977
977
|
), null;
|
|
978
|
-
if (!((
|
|
978
|
+
if (!((r = e.protocolScope.excludeViewIds) != null && r.length))
|
|
979
979
|
return { kind: "cards", cardIds: t };
|
|
980
980
|
const a = new Set(
|
|
981
|
-
|
|
981
|
+
Re({
|
|
982
982
|
inputLabel: e.inputLabel,
|
|
983
983
|
viewIds: e.protocolScope.excludeViewIds,
|
|
984
984
|
viewIdToCardId: e.viewIdToCardId,
|
|
@@ -987,107 +987,107 @@ function ws(e) {
|
|
|
987
987
|
);
|
|
988
988
|
return {
|
|
989
989
|
kind: "cards",
|
|
990
|
-
cardIds: t.filter((
|
|
990
|
+
cardIds: t.filter((n) => !a.has(n))
|
|
991
991
|
};
|
|
992
992
|
}
|
|
993
|
-
function
|
|
994
|
-
var
|
|
995
|
-
const t = [], a =
|
|
996
|
-
for (const
|
|
997
|
-
t.push(
|
|
998
|
-
for (const
|
|
999
|
-
t.push(
|
|
1000
|
-
const s =
|
|
1001
|
-
let
|
|
1002
|
-
for (const [
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1005
|
-
for (const [
|
|
1006
|
-
const
|
|
1007
|
-
|
|
1008
|
-
`card-${
|
|
993
|
+
function ci(e) {
|
|
994
|
+
var $, _, g;
|
|
995
|
+
const t = [], a = Fa(e);
|
|
996
|
+
for (const A of a.warnings)
|
|
997
|
+
t.push(H(A.code, A.message));
|
|
998
|
+
for (const A of a.errors)
|
|
999
|
+
t.push(H(A.code, A.message));
|
|
1000
|
+
const s = ys(e, t), r = [], n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set();
|
|
1001
|
+
let y = 0;
|
|
1002
|
+
for (const [A, c] of s.sections.entries()) {
|
|
1003
|
+
const m = typeof c.title == "string" ? c.title : `Section ${A + 1}`, F = c.id || he(m, `section-${A + 1}`);
|
|
1004
|
+
i.set(F, []);
|
|
1005
|
+
for (const [k, D] of Ue(c).entries()) {
|
|
1006
|
+
const N = Cs(D), R = he(
|
|
1007
|
+
D.id || `${m}-${D.title || `View ${k + 1}`}`,
|
|
1008
|
+
`card-${A + 1}-${k + 1}`
|
|
1009
1009
|
);
|
|
1010
|
-
if (!
|
|
1010
|
+
if (!N) {
|
|
1011
1011
|
t.push(
|
|
1012
|
-
|
|
1012
|
+
H(
|
|
1013
1013
|
"unsupported_presentation",
|
|
1014
|
-
`Dashboard presentation "${((
|
|
1015
|
-
`card-${
|
|
1014
|
+
`Dashboard presentation "${(($ = D.presentation) == null ? void 0 : $.kind) || "unknown"}" is not supported by the dashboard authoring adapter.`,
|
|
1015
|
+
`card-${R}`
|
|
1016
1016
|
)
|
|
1017
1017
|
);
|
|
1018
1018
|
continue;
|
|
1019
1019
|
}
|
|
1020
|
-
if (((
|
|
1020
|
+
if (((_ = D.analytics) == null ? void 0 : _.kind) === "sql") {
|
|
1021
1021
|
t.push(
|
|
1022
|
-
|
|
1022
|
+
H(
|
|
1023
1023
|
"sql_intent_deferred",
|
|
1024
1024
|
"SQL analytics intent is valid protocol, but the current dashboard authoring adapter only materializes semantic and physical config-card intents.",
|
|
1025
|
-
`card-${
|
|
1025
|
+
`card-${R}`
|
|
1026
1026
|
)
|
|
1027
1027
|
);
|
|
1028
1028
|
continue;
|
|
1029
1029
|
}
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
const
|
|
1033
|
-
for (const
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1030
|
+
const O = kt(R, u), E = `card-${O}`;
|
|
1031
|
+
D.id && n.set(D.id, E), (g = i.get(F)) == null || g.push(E);
|
|
1032
|
+
const V = D.analytics && "inputs" in D.analytics ? D.analytics.inputs : void 0;
|
|
1033
|
+
for (const K of V || []) {
|
|
1034
|
+
const L = d.get(K.inputId) || [];
|
|
1035
|
+
L.push(E), d.set(K.inputId, L);
|
|
1036
1036
|
}
|
|
1037
|
-
|
|
1038
|
-
id:
|
|
1039
|
-
frameId: `frame-${
|
|
1040
|
-
title:
|
|
1041
|
-
description:
|
|
1042
|
-
type:
|
|
1043
|
-
role:
|
|
1044
|
-
priority:
|
|
1045
|
-
section:
|
|
1046
|
-
analyticsIntent:
|
|
1047
|
-
text:
|
|
1048
|
-
}),
|
|
1037
|
+
r.push({
|
|
1038
|
+
id: E,
|
|
1039
|
+
frameId: `frame-${O}`,
|
|
1040
|
+
title: D.title,
|
|
1041
|
+
description: D.description,
|
|
1042
|
+
type: N,
|
|
1043
|
+
role: Ss(D),
|
|
1044
|
+
priority: y,
|
|
1045
|
+
section: m,
|
|
1046
|
+
analyticsIntent: _s(D.analytics),
|
|
1047
|
+
text: D.text
|
|
1048
|
+
}), y += 1;
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
|
-
const
|
|
1052
|
-
const
|
|
1053
|
-
protocolScope:
|
|
1054
|
-
inputLabel:
|
|
1055
|
-
allCardIds:
|
|
1056
|
-
boundCardIds:
|
|
1057
|
-
viewIdToCardId:
|
|
1058
|
-
sectionIdToCardIds:
|
|
1051
|
+
const C = s.inputs.map((A) => {
|
|
1052
|
+
const c = Ts({
|
|
1053
|
+
protocolScope: A.scope,
|
|
1054
|
+
inputLabel: A.label,
|
|
1055
|
+
allCardIds: r.map((m) => m.id),
|
|
1056
|
+
boundCardIds: d.get(A.id) || [],
|
|
1057
|
+
viewIdToCardId: n,
|
|
1058
|
+
sectionIdToCardIds: i,
|
|
1059
1059
|
warnings: t
|
|
1060
1060
|
});
|
|
1061
|
-
return
|
|
1062
|
-
|
|
1061
|
+
return c === null ? null : Ds(
|
|
1062
|
+
A,
|
|
1063
1063
|
s.defaultSource,
|
|
1064
1064
|
s.sources,
|
|
1065
|
-
|
|
1066
|
-
|
|
1065
|
+
c,
|
|
1066
|
+
b,
|
|
1067
1067
|
t
|
|
1068
1068
|
);
|
|
1069
|
-
}).filter((
|
|
1069
|
+
}).filter((A) => !!A);
|
|
1070
1070
|
return { plan: {
|
|
1071
1071
|
version: 1,
|
|
1072
|
-
id: `plan-${
|
|
1072
|
+
id: `plan-${he(e.title, "dashboard")}`,
|
|
1073
1073
|
title: e.title,
|
|
1074
1074
|
description: e.description,
|
|
1075
1075
|
datasets: s.datasets,
|
|
1076
1076
|
sheets: [
|
|
1077
1077
|
{
|
|
1078
|
-
id: `sheet-${
|
|
1078
|
+
id: `sheet-${he(e.title, "dashboard")}`,
|
|
1079
1079
|
title: e.title,
|
|
1080
1080
|
description: e.description,
|
|
1081
1081
|
kind: "dashboard",
|
|
1082
|
-
cards:
|
|
1082
|
+
cards: r
|
|
1083
1083
|
}
|
|
1084
1084
|
],
|
|
1085
|
-
filterInputs:
|
|
1085
|
+
filterInputs: C.length ? C : void 0,
|
|
1086
1086
|
warnings: t.length ? t : void 0,
|
|
1087
|
-
unresolvedRequests: a.ok ? void 0 : a.errors.map((
|
|
1087
|
+
unresolvedRequests: a.ok ? void 0 : a.errors.map((A) => A.message)
|
|
1088
1088
|
}, warnings: t };
|
|
1089
1089
|
}
|
|
1090
|
-
const
|
|
1090
|
+
const ui = [
|
|
1091
1091
|
"cardType",
|
|
1092
1092
|
"sql",
|
|
1093
1093
|
"python",
|
|
@@ -1102,7 +1102,7 @@ const li = [
|
|
|
1102
1102
|
"resolvedPrimaryDateField",
|
|
1103
1103
|
"globalDateComparison",
|
|
1104
1104
|
"calendarContext"
|
|
1105
|
-
],
|
|
1105
|
+
], hi = [
|
|
1106
1106
|
"cardId",
|
|
1107
1107
|
"cardTitle",
|
|
1108
1108
|
"cache_config",
|
|
@@ -1110,11 +1110,11 @@ const li = [
|
|
|
1110
1110
|
"tableConfig"
|
|
1111
1111
|
];
|
|
1112
1112
|
class W extends Error {
|
|
1113
|
-
constructor(a, s,
|
|
1113
|
+
constructor(a, s, r) {
|
|
1114
1114
|
super(a);
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
Object.setPrototypeOf(this, W.prototype), this.name = "CardQueryRequestError", this.field = s, this.details =
|
|
1115
|
+
ke(this, "field");
|
|
1116
|
+
ke(this, "details");
|
|
1117
|
+
Object.setPrototypeOf(this, W.prototype), this.name = "CardQueryRequestError", this.field = s, this.details = r;
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
1120
|
function je(e) {
|
|
@@ -1126,229 +1126,249 @@ function ae(e) {
|
|
|
1126
1126
|
function Ce(e) {
|
|
1127
1127
|
return typeof e == "string" ? e : "";
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1130
|
-
const a = ae(e), s = je(t),
|
|
1129
|
+
function ks(e, t = {}) {
|
|
1130
|
+
const a = ae(e), s = je(t), r = {};
|
|
1131
1131
|
if (a.calendarContext !== void 0) {
|
|
1132
|
-
const
|
|
1133
|
-
if (!
|
|
1132
|
+
const i = La(a.calendarContext);
|
|
1133
|
+
if (!i.ok)
|
|
1134
1134
|
throw new W(
|
|
1135
|
-
`${s}calendarContext: ${
|
|
1135
|
+
`${s}calendarContext: ${i.issues.map((d) => d.message).join("; ")}`,
|
|
1136
1136
|
"calendarContext",
|
|
1137
|
-
|
|
1137
|
+
i.issues
|
|
1138
1138
|
);
|
|
1139
|
-
|
|
1139
|
+
r.calendarContext = i.value;
|
|
1140
1140
|
}
|
|
1141
|
-
const
|
|
1142
|
-
if (!
|
|
1141
|
+
const n = zt(a.resolvedPrimaryDateField);
|
|
1142
|
+
if (!n.ok)
|
|
1143
1143
|
throw new W(
|
|
1144
|
-
`${s}${
|
|
1144
|
+
`${s}${Qt(n.issues)}`,
|
|
1145
1145
|
"resolvedPrimaryDateField",
|
|
1146
|
-
|
|
1146
|
+
n.issues
|
|
1147
1147
|
);
|
|
1148
|
-
if (a.resolvedPrimaryDateField && (
|
|
1149
|
-
const
|
|
1150
|
-
if (!
|
|
1148
|
+
if (a.resolvedPrimaryDateField && (r.resolvedPrimaryDateField = a.resolvedPrimaryDateField), a.globalDateComparison !== void 0) {
|
|
1149
|
+
const i = Pa(a.globalDateComparison);
|
|
1150
|
+
if (!i.ok)
|
|
1151
1151
|
throw new W(
|
|
1152
|
-
`${s}Invalid globalDateComparison: ${
|
|
1152
|
+
`${s}Invalid globalDateComparison: ${i.errors.map((d) => `${d.path}: ${d.message}`).join("; ")}`,
|
|
1153
1153
|
"globalDateComparison",
|
|
1154
|
-
|
|
1154
|
+
i.errors
|
|
1155
1155
|
);
|
|
1156
|
-
|
|
1156
|
+
r.globalDateComparison = Ma(
|
|
1157
1157
|
a.globalDateComparison
|
|
1158
1158
|
);
|
|
1159
1159
|
}
|
|
1160
|
-
return
|
|
1160
|
+
return r;
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1163
|
-
const a = ae(e), s = je(t),
|
|
1162
|
+
function fi(e, t = {}) {
|
|
1163
|
+
const a = ae(e), s = je(t), r = {};
|
|
1164
1164
|
if (a.pagination !== void 0) {
|
|
1165
|
-
const
|
|
1166
|
-
if (!Number.isInteger(
|
|
1165
|
+
const n = ae(a.pagination), i = n.page, d = n.pageSize;
|
|
1166
|
+
if (!Number.isInteger(i) || i < 1 || !Number.isInteger(d) || d < 1)
|
|
1167
1167
|
throw new W(
|
|
1168
1168
|
`${s}pagination must name a page and a page size of at least 1`,
|
|
1169
1169
|
"pagination"
|
|
1170
1170
|
);
|
|
1171
|
-
|
|
1171
|
+
r.pagination = { page: i, pageSize: d };
|
|
1172
1172
|
}
|
|
1173
1173
|
if (a.tableTotalsRequest !== void 0) {
|
|
1174
1174
|
if (!a.tableTotalsRequest || typeof a.tableTotalsRequest != "object" || Array.isArray(a.tableTotalsRequest))
|
|
1175
1175
|
throw new W(`${s}tableTotalsRequest must be an object`, "tableTotalsRequest");
|
|
1176
|
-
|
|
1176
|
+
r.tableTotalsRequest = a.tableTotalsRequest;
|
|
1177
1177
|
}
|
|
1178
1178
|
if (a.sourceRowProbe !== void 0) {
|
|
1179
|
-
const
|
|
1180
|
-
if (!Number.isInteger(
|
|
1179
|
+
const n = ae(a.sourceRowProbe).limit;
|
|
1180
|
+
if (!Number.isInteger(n) || n < 1)
|
|
1181
1181
|
throw new W(
|
|
1182
1182
|
`${s}sourceRowProbe must name a limit of at least 1`,
|
|
1183
1183
|
"sourceRowProbe"
|
|
1184
1184
|
);
|
|
1185
|
-
if (
|
|
1185
|
+
if (r.pagination)
|
|
1186
1186
|
throw new W(
|
|
1187
1187
|
`${s}sourceRowProbe cannot be combined with pagination`,
|
|
1188
1188
|
"sourceRowProbe"
|
|
1189
1189
|
);
|
|
1190
|
-
|
|
1190
|
+
r.sourceRowProbe = { limit: n };
|
|
1191
1191
|
}
|
|
1192
|
-
return
|
|
1193
|
-
}
|
|
1194
|
-
function
|
|
1195
|
-
const a = ae(e), s = je(t),
|
|
1196
|
-
if (!
|
|
1197
|
-
const
|
|
1198
|
-
if (!
|
|
1199
|
-
const
|
|
1200
|
-
if (
|
|
1201
|
-
throw
|
|
1202
|
-
const
|
|
1203
|
-
if (
|
|
1204
|
-
if (
|
|
1205
|
-
const
|
|
1206
|
-
hasExecutableConfig:
|
|
1207
|
-
sql:
|
|
1208
|
-
normalizedPython:
|
|
1192
|
+
return r;
|
|
1193
|
+
}
|
|
1194
|
+
function pi(e, t = {}) {
|
|
1195
|
+
const a = ae(e), s = je(t), r = (g) => new W(`${s}${g} is required`, g), n = Ce(a.connection_id).trim();
|
|
1196
|
+
if (!n) throw r("connection_id");
|
|
1197
|
+
const i = Ce(a.cardType).trim();
|
|
1198
|
+
if (!i) throw r("cardType");
|
|
1199
|
+
const d = a.resultOwner;
|
|
1200
|
+
if (d !== "config" && d !== "freeform" && d !== "none")
|
|
1201
|
+
throw r("resultOwner");
|
|
1202
|
+
const u = ae(a.cardConfig), b = Ce(a.sql), y = Ce(a.python), C = !!t.configOptional || Object.keys(u).length > 0;
|
|
1203
|
+
if (d === "config" && !C) throw r("cardConfig");
|
|
1204
|
+
if (d === "freeform" && !b.trim()) throw r("sql");
|
|
1205
|
+
const p = Kt({
|
|
1206
|
+
hasExecutableConfig: C,
|
|
1207
|
+
sql: b,
|
|
1208
|
+
normalizedPython: y
|
|
1209
1209
|
});
|
|
1210
|
-
if (
|
|
1210
|
+
if (d !== p)
|
|
1211
1211
|
throw new W(
|
|
1212
|
-
`${s}resultOwner must match the normalized execution owner "${
|
|
1212
|
+
`${s}resultOwner must match the normalized execution owner "${p}"`,
|
|
1213
1213
|
"resultOwner"
|
|
1214
1214
|
);
|
|
1215
|
-
if (
|
|
1216
|
-
const
|
|
1217
|
-
if (Object.keys(
|
|
1218
|
-
const
|
|
1215
|
+
if (d === "none") throw r("cardConfig");
|
|
1216
|
+
const $ = ae(a.cardDataSource);
|
|
1217
|
+
if (Object.keys($).length === 0) throw r("cardDataSource");
|
|
1218
|
+
const _ = Ht({
|
|
1219
1219
|
controlValues: a.controlValues,
|
|
1220
1220
|
controlDefinitions: a.controlDefinitions,
|
|
1221
1221
|
cardControlDefinitions: a.cardControlDefinitions,
|
|
1222
1222
|
controlBindings: a.controlBindings
|
|
1223
1223
|
});
|
|
1224
1224
|
return {
|
|
1225
|
-
connection_id:
|
|
1226
|
-
cardType:
|
|
1227
|
-
sql:
|
|
1228
|
-
python:
|
|
1229
|
-
resultOwner:
|
|
1230
|
-
cardConfig:
|
|
1231
|
-
cardDataSource:
|
|
1225
|
+
connection_id: n,
|
|
1226
|
+
cardType: i,
|
|
1227
|
+
sql: b,
|
|
1228
|
+
python: y,
|
|
1229
|
+
resultOwner: d,
|
|
1230
|
+
cardConfig: u,
|
|
1231
|
+
cardDataSource: $,
|
|
1232
1232
|
active_filters: Array.isArray(a.active_filters) ? a.active_filters : [],
|
|
1233
|
-
controlValues:
|
|
1234
|
-
controlDefinitions:
|
|
1235
|
-
cardControlDefinitions:
|
|
1236
|
-
controlBindings:
|
|
1237
|
-
...
|
|
1233
|
+
controlValues: _.controlValues,
|
|
1234
|
+
controlDefinitions: _.controlDefinitions,
|
|
1235
|
+
cardControlDefinitions: _.cardControlDefinitions,
|
|
1236
|
+
controlBindings: _.controlBindings,
|
|
1237
|
+
...ks(a, t)
|
|
1238
1238
|
};
|
|
1239
1239
|
}
|
|
1240
|
-
const
|
|
1240
|
+
const $s = {
|
|
1241
1241
|
global_date: "The date filter for the whole report can't be changed through the MCP. Change it in the editor; removing or excluding it works.",
|
|
1242
1242
|
not_semantic: "This filter reads a database table, not a dataset, so it can't be changed through the MCP. Change it in the editor; removing or excluding it works.",
|
|
1243
1243
|
scope_not_expressible: "This filter applies to chosen cards rather than whole sheets, so it can't be changed through the MCP. Change it in the editor; removing or excluding it works."
|
|
1244
1244
|
};
|
|
1245
|
-
function
|
|
1246
|
-
var
|
|
1247
|
-
const
|
|
1245
|
+
function Fs(e, t, a = {}) {
|
|
1246
|
+
var d;
|
|
1247
|
+
const s = de(e), r = Yt(t.scope), n = new Set(re(e).map((u) => u.cardId)), i = {
|
|
1248
1248
|
reaches: [],
|
|
1249
1249
|
excluded: [
|
|
1250
1250
|
.../* @__PURE__ */ new Set([
|
|
1251
|
-
...(((
|
|
1252
|
-
...
|
|
1251
|
+
...(((d = t.application) == null ? void 0 : d.cards) ?? []).filter((u) => u.kind === "excluded").map((u) => u.cardId),
|
|
1252
|
+
...r.filter((u) => n.has(u))
|
|
1253
1253
|
])
|
|
1254
1254
|
],
|
|
1255
1255
|
notReached: []
|
|
1256
1256
|
};
|
|
1257
1257
|
if (t.filter.kind === "global-date") {
|
|
1258
|
-
const
|
|
1259
|
-
return i.reaches =
|
|
1258
|
+
const u = new Set(i.excluded);
|
|
1259
|
+
return i.reaches = Xt(e, t.filter).filter(({ card: b }) => !u.has(b.id) && fe(b)).map(({ card: b }) => b.id), i;
|
|
1260
1260
|
}
|
|
1261
|
-
for (const
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1261
|
+
for (const u of s.reachedCards({ inputId: t.id })) {
|
|
1262
|
+
const b = ve(t, u.card, a), y = b.reach, C = () => {
|
|
1263
|
+
const p = fe(u.card);
|
|
1264
|
+
return {
|
|
1265
|
+
cardId: u.cardId,
|
|
1266
|
+
title: u.card.title ?? "",
|
|
1267
|
+
...(p == null ? void 0 : p.kind) === "semantic" ? { datasetName: p.datasetName } : {}
|
|
1268
|
+
};
|
|
1269
|
+
};
|
|
1270
|
+
switch (y) {
|
|
1271
|
+
case "bound":
|
|
1272
|
+
case "automatic":
|
|
1273
|
+
case "sql":
|
|
1274
|
+
case "relationshipApplied":
|
|
1275
|
+
i.reaches.push(u.cardId);
|
|
1276
|
+
break;
|
|
1277
|
+
case "blocked":
|
|
1278
|
+
case "ambiguous":
|
|
1279
|
+
(i.blocked ?? (i.blocked = [])).push({ cardId: u.cardId, title: u.card.title ?? "", reason: y });
|
|
1280
|
+
break;
|
|
1281
|
+
case "relationship":
|
|
1282
|
+
(i.relationshipPending ?? (i.relationshipPending = [])).push(C());
|
|
1283
|
+
break;
|
|
1284
|
+
case "excluded":
|
|
1285
|
+
break;
|
|
1286
|
+
case "notApplicable":
|
|
1287
|
+
fe(u.card) && i.notReached.push({ ...C(), ...b.reason ? { reason: b.reason } : {} });
|
|
1288
|
+
break;
|
|
1289
|
+
default: {
|
|
1290
|
+
const p = y;
|
|
1291
|
+
throw new Error(`Unhandled filter reach ${String(p)}`);
|
|
1292
|
+
}
|
|
1274
1293
|
}
|
|
1275
1294
|
}
|
|
1276
1295
|
return i;
|
|
1277
1296
|
}
|
|
1278
|
-
function
|
|
1279
|
-
var
|
|
1297
|
+
function As(e, t) {
|
|
1298
|
+
var r;
|
|
1280
1299
|
const a = t.scope;
|
|
1281
1300
|
if (a.kind === "allSheets") {
|
|
1282
|
-
if ((
|
|
1283
|
-
const
|
|
1301
|
+
if ((r = a.sheetKinds) != null && r.length && !a.sheetKinds.includes("dashboard")) return;
|
|
1302
|
+
const n = Jt(a);
|
|
1284
1303
|
return {
|
|
1285
1304
|
sheetIds: "all",
|
|
1286
|
-
...
|
|
1287
|
-
...
|
|
1305
|
+
...n.length ? { exceptSheetIds: [...n] } : {},
|
|
1306
|
+
...Zt(a) ? { includesDocumentSheets: !0 } : {}
|
|
1288
1307
|
};
|
|
1289
1308
|
}
|
|
1290
1309
|
if (a.kind !== "sheets") return;
|
|
1291
|
-
const s = [...Me(e).values()].filter((
|
|
1310
|
+
const s = [...Me(e).values()].filter((n) => yt(t, n));
|
|
1292
1311
|
return {
|
|
1293
|
-
sheetIds: s.filter((
|
|
1312
|
+
sheetIds: s.filter((n) => n.sheetKind === "dashboard").map((n) => n.sheetId),
|
|
1294
1313
|
// Document sheets it names stay through a change of sheets (`withUnstatedScopeParts`).
|
|
1295
|
-
...s.some((
|
|
1314
|
+
...s.some((n) => n.sheetKind === "document") ? { includesDocumentSheets: !0 } : {}
|
|
1296
1315
|
};
|
|
1297
1316
|
}
|
|
1298
|
-
function
|
|
1317
|
+
function Ft(e, t) {
|
|
1299
1318
|
return e ?? { tz: "UTC", weekStart: 1, anchor: { iso: t ?? "1970-01-01T00:00:00.000Z" } };
|
|
1300
1319
|
}
|
|
1301
|
-
function
|
|
1302
|
-
var
|
|
1303
|
-
const { input:
|
|
1304
|
-
filterId:
|
|
1305
|
-
label:
|
|
1320
|
+
function At(e, t, a, s) {
|
|
1321
|
+
var g, A, c;
|
|
1322
|
+
const { input: r } = t, n = Fs(e, r, s), i = (m, F) => ({
|
|
1323
|
+
filterId: r.id,
|
|
1324
|
+
label: r.label,
|
|
1306
1325
|
editable: !1,
|
|
1307
|
-
kind:
|
|
1308
|
-
notEditable: { reason:
|
|
1309
|
-
reaches:
|
|
1310
|
-
excluded:
|
|
1311
|
-
...
|
|
1326
|
+
kind: F,
|
|
1327
|
+
notEditable: { reason: m, message: $s[m] },
|
|
1328
|
+
reaches: n.reaches,
|
|
1329
|
+
excluded: n.excluded,
|
|
1330
|
+
...n.blocked ? { blocked: n.blocked } : {},
|
|
1331
|
+
...n.relationshipPending ? { relationshipPending: n.relationshipPending } : {}
|
|
1312
1332
|
});
|
|
1313
|
-
if (
|
|
1314
|
-
const
|
|
1315
|
-
if (
|
|
1316
|
-
const
|
|
1317
|
-
if (!
|
|
1318
|
-
const
|
|
1333
|
+
if (r.filter.kind === "global-date") return i("global_date", "global_date");
|
|
1334
|
+
const d = Wt(r.filter).filter((m) => m.kind === "semantic");
|
|
1335
|
+
if (d.length !== 1 || d[0].kind !== "semantic") return i("not_semantic", "field");
|
|
1336
|
+
const u = As(e, r);
|
|
1337
|
+
if (!u || t.origin !== "embeddedInput") return i("scope_not_expressible", "field");
|
|
1338
|
+
const b = ((g = r.filter.fieldMeta) == null ? void 0 : g.name) ?? ((A = r.filter.column) == null ? void 0 : A.split(".").pop()) ?? "", y = It({
|
|
1319
1339
|
dashboard: e,
|
|
1320
|
-
target: { kind: "dashboardInput", input:
|
|
1321
|
-
calendar:
|
|
1322
|
-
}).value,
|
|
1340
|
+
target: { kind: "dashboardInput", input: r, scope: {} },
|
|
1341
|
+
calendar: Ft(a, void 0)
|
|
1342
|
+
}).value, C = St(r.filter.dataType), p = C || (c = y == null ? void 0 : y.values) == null ? void 0 : c.filter((m) => ["string", "number", "boolean"].includes(typeof m)), $ = y && "relativeMeta" in y ? y.relativeMeta : void 0, _ = C && $ ? Aa($) : null;
|
|
1323
1343
|
return {
|
|
1324
|
-
filterId:
|
|
1325
|
-
label:
|
|
1344
|
+
filterId: r.id,
|
|
1345
|
+
label: r.label,
|
|
1326
1346
|
editable: !0,
|
|
1327
|
-
domainId:
|
|
1328
|
-
datasetName:
|
|
1329
|
-
field:
|
|
1330
|
-
selection:
|
|
1331
|
-
...
|
|
1332
|
-
...
|
|
1333
|
-
...
|
|
1334
|
-
...
|
|
1335
|
-
...
|
|
1347
|
+
domainId: d[0].domainId,
|
|
1348
|
+
datasetName: d[0].datasetName,
|
|
1349
|
+
field: b,
|
|
1350
|
+
selection: r.filter.type === "single" ? "single" : "multiple",
|
|
1351
|
+
...p != null && p.length ? { defaultValues: p } : {},
|
|
1352
|
+
..._ ? { defaultPeriod: _ } : {},
|
|
1353
|
+
...C ? { datePicker: r.filter.dateSelectionMode === "day" ? "day" : r.filter.dateSelectionMode === "months" ? "month" : "range" } : {},
|
|
1354
|
+
...u,
|
|
1355
|
+
...n
|
|
1336
1356
|
};
|
|
1337
1357
|
}
|
|
1338
|
-
function
|
|
1339
|
-
return de(e).inputs.map((
|
|
1340
|
-
}
|
|
1341
|
-
function
|
|
1342
|
-
const
|
|
1343
|
-
return
|
|
1344
|
-
}
|
|
1345
|
-
function
|
|
1346
|
-
var
|
|
1347
|
-
const
|
|
1348
|
-
if (!
|
|
1349
|
-
const
|
|
1350
|
-
if ("sql" in t) return
|
|
1351
|
-
const
|
|
1358
|
+
function Rt(e, t, a) {
|
|
1359
|
+
return de(e).inputs.map((s) => At(e, s, t, a));
|
|
1360
|
+
}
|
|
1361
|
+
function pe(e, t, a, s) {
|
|
1362
|
+
const r = de(e).findFilterInput({ inputId: t });
|
|
1363
|
+
return r ? At(e, r, a, s) : void 0;
|
|
1364
|
+
}
|
|
1365
|
+
function Rs(e, t, a, s, r) {
|
|
1366
|
+
var c, m, F, k, D, N;
|
|
1367
|
+
const n = oe(e, { sql: !0 });
|
|
1368
|
+
if (!n.editable) return [n.message];
|
|
1369
|
+
const i = n.query, d = t;
|
|
1370
|
+
if ("sql" in t) return d.sql === i.sql && d.connectionId === i.connectionId ? [] : ["the SQL"];
|
|
1371
|
+
const u = (s == null ? void 0 : s.source.kind) === "semantic" ? oe({
|
|
1352
1372
|
id: e.id,
|
|
1353
1373
|
title: e.title,
|
|
1354
1374
|
type: s.type,
|
|
@@ -1356,472 +1376,472 @@ function Fs(e, t, a, s, d) {
|
|
|
1356
1376
|
connectionId: s.source.connectionId,
|
|
1357
1377
|
config: s.config
|
|
1358
1378
|
}, { sql: !0 }) : void 0;
|
|
1359
|
-
if (
|
|
1360
|
-
const
|
|
1361
|
-
const
|
|
1362
|
-
(
|
|
1379
|
+
if (u && !u.editable) return ["the compiled query"];
|
|
1380
|
+
const b = u != null && u.editable ? u.query : void 0, y = String(d.datasetName ?? ""), C = [], p = (R) => ne(R, y), $ = (R, O, E) => {
|
|
1381
|
+
const V = O ?? [], K = E ?? [];
|
|
1382
|
+
(V.length !== K.length || V.some((L, q) => p(L) !== p(K[q]))) && C.push(R);
|
|
1363
1383
|
};
|
|
1364
|
-
for (const
|
|
1365
|
-
if (
|
|
1366
|
-
const
|
|
1367
|
-
|
|
1384
|
+
for (const R of ["domainId", "datasetName"]) d[R] !== i[R] && C.push(R);
|
|
1385
|
+
if ($("measures", d.measures, i.measures), $("columns", d.columns, i.columns), a || n.matrix) {
|
|
1386
|
+
const R = (E) => new Set(((E == null ? void 0 : E.columns) ?? []).map(p)), O = (E, V) => (E ?? []).filter((K) => !R(V).has(p(K)));
|
|
1387
|
+
$("dimensions", O(d.dimensions, a), O(i.dimensions, n.matrix)), $("matrix.columns", a == null ? void 0 : a.columns, (c = n.matrix) == null ? void 0 : c.columns);
|
|
1368
1388
|
} else
|
|
1369
|
-
|
|
1370
|
-
const
|
|
1371
|
-
|
|
1372
|
-
const
|
|
1373
|
-
(
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1389
|
+
$("dimensions", d.dimensions, i.dimensions);
|
|
1390
|
+
const _ = d.timeWindow !== void 0 && !d.timeGrain, g = _ && i.timeWindow === void 0 ? void 0 : _ && d.dateField === void 0 ? b == null ? void 0 : b.dateField : d.dateField;
|
|
1391
|
+
g !== void 0 && (i.dateField === void 0 || p(g) !== p(i.dateField)) && C.push("dateField"), d.timeGrain !== void 0 && d.timeGrain !== i.timeGrain && C.push("timeGrain");
|
|
1392
|
+
const A = (m = e.config) != null && m.matrix ? e.config.matrix.spec.measures.map((R) => R.kind === "aggregate" ? { aggregate: R.aggregate } : {}) : ((F = e.config) == null ? void 0 : F.metricColumns) ?? [];
|
|
1393
|
+
(d.measures ?? []).forEach((R, O) => {
|
|
1394
|
+
const E = R && typeof R == "object" ? R.aggregate : void 0;
|
|
1395
|
+
E && ht(A[O] ?? {}) !== E && C.push(`the aggregate of measures[${O}]`);
|
|
1376
1396
|
});
|
|
1377
|
-
for (const { key:
|
|
1378
|
-
|
|
1379
|
-
if (!
|
|
1380
|
-
const
|
|
1381
|
-
let
|
|
1382
|
-
const
|
|
1383
|
-
const
|
|
1384
|
-
return
|
|
1397
|
+
for (const { key: R, label: O } of Ee(t))
|
|
1398
|
+
ea(e, R) !== O && C.push(`the label "${O}"`);
|
|
1399
|
+
if (!r || r.aspects.includes("filters")) {
|
|
1400
|
+
const R = d.filters ?? [];
|
|
1401
|
+
let O = i.filters ?? [];
|
|
1402
|
+
const E = d.timeWindow, V = i.timeWindow, K = (L, q) => {
|
|
1403
|
+
const j = (De) => JSON.stringify((De ?? []).map(String));
|
|
1404
|
+
return p(L.field) === p(q.field) && L.operator === q.operator && (L.scope ?? "row") === (q.scope ?? "row") && (typeof L.field == "object" ? L.field.aggregate : void 0) === (typeof q.field == "object" ? q.field.aggregate : void 0) && (L.values === void 0 || j(L.values) === j(q.values));
|
|
1385
1405
|
};
|
|
1386
|
-
if (
|
|
1387
|
-
const
|
|
1388
|
-
(
|
|
1406
|
+
if (E && !V) {
|
|
1407
|
+
const L = ((b == null ? void 0 : b.filters) ?? []).filter(
|
|
1408
|
+
(q) => !(b != null && b.timeWindow) && !R.some((j) => K(j, q))
|
|
1389
1409
|
);
|
|
1390
|
-
(!
|
|
1391
|
-
} else
|
|
1392
|
-
(
|
|
1410
|
+
(!L.length || L.some((q) => !O.some((j) => K(q, j)))) && C.push("timeWindow"), O = O.filter((q) => !L.some((j) => K(j, q)));
|
|
1411
|
+
} else E ? Object.keys(E).filter((q) => !(q === "kind" && E.kind === "relative" && (V == null ? void 0 : V.kind) === void 0)).some((q) => !Le(E[q], V == null ? void 0 : V[q])) && C.push("timeWindow") : V && C.push("timeWindow");
|
|
1412
|
+
(R.length !== O.length || R.some((L, q) => !K(L, O[q]))) && C.push("filters");
|
|
1393
1413
|
}
|
|
1394
|
-
if (
|
|
1395
|
-
const
|
|
1396
|
-
(!
|
|
1414
|
+
if (d.orderBy !== void 0) {
|
|
1415
|
+
const R = d.orderBy, O = (D = (k = e.config) == null ? void 0 : k.sortByColumns) == null ? void 0 : D[0], E = O && ta(e.config ?? {}, O), V = R.field && typeof R.field == "object" ? R.field.aggregate : void 0;
|
|
1416
|
+
(!O || !E || O.direction !== R.direction || p(R.field) !== aa(E.name, sa(E)) || V !== void 0 && ht(E) !== V) && C.push("orderBy");
|
|
1397
1417
|
}
|
|
1398
|
-
return
|
|
1418
|
+
return d.limit !== void 0 && ((N = e.config) == null ? void 0 : N.rowLimit) !== d.limit && C.push("limit"), C;
|
|
1399
1419
|
}
|
|
1400
1420
|
class ue extends Error {
|
|
1401
1421
|
}
|
|
1402
|
-
const Pe = (e) => (e ?? "").trim().toLowerCase(),
|
|
1422
|
+
const Pe = (e) => (e ?? "").trim().toLowerCase(), xe = ua, mt = { measures: ma, records: pa, sql: fa }, Se = {
|
|
1403
1423
|
measures: "a measures query (measures, with optional dimensions)",
|
|
1404
1424
|
records: "a records query (columns)",
|
|
1405
1425
|
sql: "a SQL query"
|
|
1406
1426
|
};
|
|
1407
|
-
function
|
|
1427
|
+
function Et(e, t) {
|
|
1408
1428
|
return t.path.reduce((a, s) => typeof s == "number" ? `${a}[${s}]` : `${a}.${s}`, e);
|
|
1409
1429
|
}
|
|
1410
|
-
async function
|
|
1411
|
-
var
|
|
1412
|
-
const s = [],
|
|
1413
|
-
let
|
|
1414
|
-
if (t.length >
|
|
1430
|
+
async function mi(e, t, a) {
|
|
1431
|
+
var Qe, Ke, He, We, Ye, Xe, Je, Ze, et;
|
|
1432
|
+
const s = [], r = [], n = [], i = [], d = /* @__PURE__ */ new Set(), u = [], b = /* @__PURE__ */ new Map(), y = { calendar: a.calendar }, C = a.relationshipReach ? { relationshipReach: a.relationshipReach } : {};
|
|
1433
|
+
let p = e, $ = 0;
|
|
1434
|
+
if (t.length > ot)
|
|
1415
1435
|
return {
|
|
1416
1436
|
ok: !1,
|
|
1417
1437
|
problems: [
|
|
1418
1438
|
{
|
|
1419
1439
|
code: "too_many_changes",
|
|
1420
|
-
message: `A proposal takes at most ${
|
|
1440
|
+
message: `A proposal takes at most ${ot} changes; this one has ${t.length}.`,
|
|
1421
1441
|
path: "changes",
|
|
1422
1442
|
fix: "Split the changes into several proposals."
|
|
1423
1443
|
}
|
|
1424
1444
|
]
|
|
1425
1445
|
};
|
|
1426
|
-
const
|
|
1427
|
-
if (t.forEach((
|
|
1428
|
-
const l =
|
|
1446
|
+
const _ = [];
|
|
1447
|
+
if (t.forEach((f, o) => {
|
|
1448
|
+
const l = ia.safeParse(f);
|
|
1429
1449
|
if (l.success) {
|
|
1430
|
-
|
|
1450
|
+
_.push(l.data);
|
|
1431
1451
|
return;
|
|
1432
1452
|
}
|
|
1433
|
-
for (const
|
|
1453
|
+
for (const h of l.error.issues)
|
|
1434
1454
|
s.push({
|
|
1435
1455
|
code: "invalid_change",
|
|
1436
|
-
message:
|
|
1437
|
-
path:
|
|
1456
|
+
message: h.message,
|
|
1457
|
+
path: Et(`changes[${o}]`, h),
|
|
1438
1458
|
fix: "Send the change in the shape the tool schema gives."
|
|
1439
1459
|
});
|
|
1440
1460
|
}), s.length) return { ok: !1, problems: s };
|
|
1441
|
-
const
|
|
1442
|
-
throw s.push(
|
|
1443
|
-
},
|
|
1444
|
-
a.capabilities.sql ||
|
|
1461
|
+
const g = (f) => {
|
|
1462
|
+
throw s.push(f), new ue();
|
|
1463
|
+
}, A = (f) => {
|
|
1464
|
+
a.capabilities.sql || g({
|
|
1445
1465
|
code: "capability_required",
|
|
1446
1466
|
message: "This change creates, reads or changes a SQL card, which needs SQL access.",
|
|
1447
|
-
path:
|
|
1467
|
+
path: f,
|
|
1448
1468
|
fix: "Use a measures or records query, or ask an administrator for SQL access."
|
|
1449
|
-
}),
|
|
1450
|
-
},
|
|
1451
|
-
const l =
|
|
1452
|
-
l.ok ? (
|
|
1453
|
-
},
|
|
1454
|
-
if (
|
|
1455
|
-
const l =
|
|
1456
|
-
return (!l || l.kind !== "card") &&
|
|
1469
|
+
}), d.add("sql");
|
|
1470
|
+
}, c = (f, o) => {
|
|
1471
|
+
const l = nt(p, [f], y);
|
|
1472
|
+
l.ok ? (p = l.dashboard, n.push(f)) : g({ code: "invalid_change", message: l.failedAt.message, path: o, ...l.failedAt.fix ? { fix: l.failedAt.fix } : {} });
|
|
1473
|
+
}, m = (f, o) => {
|
|
1474
|
+
if (f.startsWith("$")) {
|
|
1475
|
+
const l = b.get(f);
|
|
1476
|
+
return (!l || l.kind !== "card") && g({
|
|
1457
1477
|
code: "handle_unknown",
|
|
1458
|
-
message: `${
|
|
1459
|
-
path:
|
|
1478
|
+
message: `${f} isn't a card handle defined earlier in this list.`,
|
|
1479
|
+
path: o,
|
|
1460
1480
|
fix: "Define the handle with an earlier card.add, or use the card id from the outline."
|
|
1461
1481
|
}), l.id;
|
|
1462
1482
|
}
|
|
1463
|
-
return re(
|
|
1483
|
+
return re(p).some((l) => l.cardId === f) || g({
|
|
1464
1484
|
code: "card_not_found",
|
|
1465
|
-
message: `There's no card ${
|
|
1466
|
-
path:
|
|
1485
|
+
message: `There's no card ${f} on this dashboard.`,
|
|
1486
|
+
path: o,
|
|
1467
1487
|
fix: "Read the outline again and use its card ids."
|
|
1468
|
-
}),
|
|
1469
|
-
},
|
|
1470
|
-
if (
|
|
1471
|
-
const
|
|
1472
|
-
return (!
|
|
1488
|
+
}), f;
|
|
1489
|
+
}, F = (f, o) => {
|
|
1490
|
+
if (f.startsWith("$")) {
|
|
1491
|
+
const h = b.get(f);
|
|
1492
|
+
return (!h || h.kind !== "filter") && g({
|
|
1473
1493
|
code: "handle_unknown",
|
|
1474
|
-
message: `${
|
|
1475
|
-
path:
|
|
1494
|
+
message: `${f} isn't a filter handle defined earlier in this list.`,
|
|
1495
|
+
path: o,
|
|
1476
1496
|
fix: "Define the handle with an earlier filter.add, or use the filter id from the outline."
|
|
1477
|
-
}),
|
|
1497
|
+
}), h.id;
|
|
1478
1498
|
}
|
|
1479
|
-
return (Array.isArray(
|
|
1499
|
+
return (Array.isArray(p.inputs) ? p.inputs : []).some((h) => h.id === f && h.kind === "filter") || g({
|
|
1480
1500
|
code: "filter_not_found",
|
|
1481
|
-
message: `There's no filter ${
|
|
1482
|
-
path:
|
|
1501
|
+
message: `There's no filter ${f} on this dashboard.`,
|
|
1502
|
+
path: o,
|
|
1483
1503
|
fix: "Read the outline again and use its filter ids."
|
|
1484
|
-
}),
|
|
1485
|
-
},
|
|
1486
|
-
const l = (
|
|
1487
|
-
return l ||
|
|
1488
|
-
},
|
|
1489
|
-
var
|
|
1490
|
-
for (const
|
|
1491
|
-
const I = ce[
|
|
1492
|
-
if (S && typeof S != "string" && S.label && !
|
|
1504
|
+
}), f;
|
|
1505
|
+
}, k = () => (p.sheets ?? []).filter((f) => !ct(f)), D = () => k().map((f) => ({ sheetId: f.id, title: f.title ?? "" })), N = (f, o) => {
|
|
1506
|
+
const l = (p.sheets ?? []).find((h) => h.id === f);
|
|
1507
|
+
return l || g({ code: "sheet_not_found", message: `There's no sheet ${f} on this dashboard.`, path: o, fix: "Read the outline again and use its sheet ids.", details: { sheets: D() } }), ct(l) && g({ code: "sheet_not_a_grid", message: `"${l.title}" is a Document sheet.`, path: o, fix: "Add the card to a grid sheet; Document sheets are changed in the editor.", details: { sheets: D() } }), l;
|
|
1508
|
+
}, R = (f, o, l, h) => {
|
|
1509
|
+
var T;
|
|
1510
|
+
for (const w of ga(o, l)) g({ ...w, path: `${h}.${w.path}` });
|
|
1511
|
+
const I = ce[f], v = xe(o), S = o.dateField;
|
|
1512
|
+
if (S && typeof S != "string" && S.label && !o.timeGrain && g({
|
|
1493
1513
|
code: "invalid_change",
|
|
1494
1514
|
message: "A label names a column, and the date field is a column only when the card groups by it.",
|
|
1495
|
-
path: `${
|
|
1515
|
+
path: `${h}.query.dateField.label`,
|
|
1496
1516
|
fix: "Send timeGrain to group by the date, or leave the label out."
|
|
1497
|
-
}), !I.forms.includes(
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1517
|
+
}), !I.forms.includes(v)) {
|
|
1518
|
+
const w = Object.keys(ce).filter((x) => ce[x].forms.includes(v));
|
|
1519
|
+
g({
|
|
1500
1520
|
code: "type_not_supported",
|
|
1501
|
-
message: `A ${
|
|
1502
|
-
path: `${
|
|
1503
|
-
fix: `Send ${I.forms.map((
|
|
1521
|
+
message: `A ${f.replace(/_/g, " ")} card takes ${I.forms.map((x) => Se[x]).join(" or ")}, not ${Se[v]}.`,
|
|
1522
|
+
path: `${h}.query`,
|
|
1523
|
+
fix: `Send ${I.forms.map((x) => Se[x]).join(" or ")}, or use a type this query fits: ${w.join(", ")}.`
|
|
1504
1524
|
});
|
|
1505
1525
|
}
|
|
1506
|
-
if (
|
|
1507
|
-
const
|
|
1508
|
-
I.measures && (
|
|
1526
|
+
if (v === "measures") {
|
|
1527
|
+
const w = o, x = w.measures.length;
|
|
1528
|
+
I.measures && (x < I.measures.min || I.measures.max !== void 0 && x > I.measures.max) && g({
|
|
1509
1529
|
code: "type_not_supported",
|
|
1510
|
-
message: `A ${
|
|
1511
|
-
path: `${
|
|
1530
|
+
message: `A ${f.replace(/_/g, " ")} card shows exactly ${I.measures.max} measure.`,
|
|
1531
|
+
path: `${h}.query.measures`,
|
|
1512
1532
|
fix: "Send one measure, or use a table or chart for several."
|
|
1513
|
-
}), !I.dimensions && ((
|
|
1533
|
+
}), !I.dimensions && ((T = w.dimensions) != null && T.length) && g({
|
|
1514
1534
|
code: "type_not_supported",
|
|
1515
|
-
message: `A ${
|
|
1516
|
-
path: `${
|
|
1535
|
+
message: `A ${f.replace(/_/g, " ")} card shows one number, so it has no dimensions.`,
|
|
1536
|
+
path: `${h}.query.dimensions`,
|
|
1517
1537
|
fix: "Remove the dimensions, or use a table or chart."
|
|
1518
|
-
}),
|
|
1538
|
+
}), f === "matrix" && (w.orderBy || w.limit) && g({
|
|
1519
1539
|
code: "type_not_supported",
|
|
1520
1540
|
message: "A Matrix's sorting and top N are set in the editor.",
|
|
1521
|
-
path: `${
|
|
1541
|
+
path: `${h}.query`,
|
|
1522
1542
|
fix: "Leave out orderBy and limit for a Matrix."
|
|
1523
1543
|
});
|
|
1524
1544
|
}
|
|
1525
|
-
if (I.matrixColumns && !l &&
|
|
1545
|
+
if (I.matrixColumns && !l && g({
|
|
1526
1546
|
code: "type_not_supported",
|
|
1527
1547
|
message: "A Matrix needs matrix.columns: the query fields that run across the top.",
|
|
1528
|
-
path: `${
|
|
1548
|
+
path: `${h}.matrix`,
|
|
1529
1549
|
fix: "Send matrix: { columns: [...] } naming dimensions or the date field of the query (an empty list puts nothing across the top)."
|
|
1530
|
-
}), !I.matrixColumns && l &&
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1550
|
+
}), !I.matrixColumns && l && g({ code: "type_not_supported", message: "matrix.columns is only for Matrix cards.", path: `${h}.matrix`, fix: 'Leave out matrix, or use type "matrix".' }), l && v === "measures") {
|
|
1551
|
+
const w = o, x = w.datasetName, G = [...w.dimensions ?? [], ...w.timeGrain && w.dateField ? [w.dateField] : []];
|
|
1552
|
+
G.length && l.columns.length >= G.length && G.every((P) => l.columns.some((B) => ne(B, x) === ne(P, x))) && g({
|
|
1533
1553
|
code: "type_not_supported",
|
|
1534
1554
|
message: "A Matrix needs at least one field down the side.",
|
|
1535
|
-
path: `${
|
|
1555
|
+
path: `${h}.matrix.columns`,
|
|
1536
1556
|
fix: "Leave one dimension or the date field out of matrix.columns."
|
|
1537
1557
|
});
|
|
1538
|
-
const Q = new Set([...
|
|
1539
|
-
l.columns.forEach((
|
|
1540
|
-
Q.has(ne(
|
|
1558
|
+
const Q = new Set([...w.dimensions ?? [], ...w.dateField ? [w.dateField] : []].map((P) => ne(P, x)));
|
|
1559
|
+
l.columns.forEach((P, B) => {
|
|
1560
|
+
Q.has(ne(P, x)) || g({
|
|
1541
1561
|
code: "type_not_supported",
|
|
1542
|
-
message: `"${
|
|
1543
|
-
path: `${
|
|
1562
|
+
message: `"${ut(P)}" isn't one of the query's dimensions or its date field.`,
|
|
1563
|
+
path: `${h}.matrix.columns[${B}]`,
|
|
1544
1564
|
fix: "Name dimensions or the date field of the query in matrix.columns."
|
|
1545
1565
|
});
|
|
1546
1566
|
});
|
|
1547
1567
|
}
|
|
1548
|
-
},
|
|
1549
|
-
code:
|
|
1550
|
-
message:
|
|
1551
|
-
path: `${
|
|
1552
|
-
fix:
|
|
1553
|
-
details: { reason: "not_expressible", ..."parts" in
|
|
1554
|
-
}),
|
|
1555
|
-
const
|
|
1556
|
-
|
|
1568
|
+
}, O = (f, o) => g({
|
|
1569
|
+
code: f.code === "query_not_kept" ? "card_not_editable" : "invalid_change",
|
|
1570
|
+
message: f.message,
|
|
1571
|
+
path: `${o}.query`,
|
|
1572
|
+
fix: f.code === "query_not_kept" ? "Tell the user to make this change in the editor." : "Read the outline again and propose again.",
|
|
1573
|
+
details: { reason: "not_expressible", ..."parts" in f ? { parts: f.parts } : {} }
|
|
1574
|
+
}), E = (f, o, l, h, I, v, S) => {
|
|
1575
|
+
const T = Rs(f, o, l, v, S);
|
|
1576
|
+
T.length && g({
|
|
1557
1577
|
code: "card_not_editable",
|
|
1558
1578
|
message: `As changed, "${I}" wouldn't run the query asked for, so make this change in the editor.`,
|
|
1559
|
-
path: `${
|
|
1579
|
+
path: `${h}.query`,
|
|
1560
1580
|
fix: "Tell the user to make this change in the editor.",
|
|
1561
|
-
details: { reason: "not_expressible", detail: `doesn't hold: ${
|
|
1581
|
+
details: { reason: "not_expressible", detail: `doesn't hold: ${T.join(", ")}` }
|
|
1562
1582
|
});
|
|
1563
|
-
},
|
|
1564
|
-
const I =
|
|
1565
|
-
if ("sql" in
|
|
1566
|
-
return
|
|
1567
|
-
const
|
|
1583
|
+
}, V = async (f, o, l, h) => {
|
|
1584
|
+
const I = rt(f);
|
|
1585
|
+
if ("sql" in o)
|
|
1586
|
+
return A(`${h}.query`), { type: I, source: { kind: "sql", connectionId: o.connectionId, sql: o.sql } };
|
|
1587
|
+
const v = I === "matrixTable" || I === "detailTable" ? "table" : I, S = await a.compileCardQuery({ query: o, chartType: v });
|
|
1568
1588
|
if (!S.ok)
|
|
1569
|
-
throw s.push(...S.problems.map((
|
|
1570
|
-
|
|
1571
|
-
let
|
|
1572
|
-
const
|
|
1589
|
+
throw s.push(...S.problems.map((x) => ({ ...x, path: x.path ? `${h}.query.${x.path}` : `${h}.query` }))), new ue();
|
|
1590
|
+
r.push(...S.warnings.map((x) => ({ ...x, path: x.path ?? `${h}.query` })));
|
|
1591
|
+
let T = { ...S.part, type: I };
|
|
1592
|
+
const w = T.config ?? {};
|
|
1573
1593
|
if (I === "detailTable") {
|
|
1574
|
-
const
|
|
1575
|
-
|
|
1594
|
+
const x = ba(Ia("table", "detailTable", w)) ?? {};
|
|
1595
|
+
T = { ...T, config: Os(x) };
|
|
1576
1596
|
}
|
|
1577
|
-
return I === "matrixTable" && (
|
|
1578
|
-
},
|
|
1597
|
+
return I === "matrixTable" && (T = await K(T, w, o, l, h)), Ns(T, Ee(o));
|
|
1598
|
+
}, K = async (f, o, l, h, I) => {
|
|
1579
1599
|
var Q;
|
|
1580
|
-
const
|
|
1581
|
-
if (
|
|
1582
|
-
const S = { id: "scratch", title: "", type: "table", dataSource:
|
|
1583
|
-
(
|
|
1600
|
+
const v = await a.loadCardSource({ domainId: l.domainId, datasetName: l.datasetName });
|
|
1601
|
+
if (v || g({ code: "field_not_found", message: `The dataset "${l.datasetName}" isn't available.`, path: `${I}.query.datasetName`, fix: "Find datasets with semaphor_list_datasets." }), f.source.kind !== "semantic") throw new ue();
|
|
1602
|
+
const S = { id: "scratch", title: "", type: "table", dataSource: f.source.dataSource, config: o }, T = Ca(S, "matrixTable", { catalog: v.fields, createId: a.newId }), w = T.status === "changed" ? (Q = T.card.config) == null ? void 0 : Q.matrix : void 0;
|
|
1603
|
+
(T.status !== "changed" || T.leftOut.length || !w) && g({
|
|
1584
1604
|
code: "type_not_supported",
|
|
1585
|
-
message:
|
|
1605
|
+
message: T.status === "changed" && T.leftOut.length ? `These fields can't run in a Matrix: ${T.leftOut.join(", ")}.` : "This query can't be shown as a Matrix.",
|
|
1586
1606
|
path: `${I}.query`,
|
|
1587
1607
|
fix: "Use plain dataset fields for a Matrix, or use a table."
|
|
1588
1608
|
});
|
|
1589
|
-
let
|
|
1590
|
-
const
|
|
1591
|
-
for (const [
|
|
1592
|
-
const
|
|
1593
|
-
(z) =>
|
|
1609
|
+
let x = w;
|
|
1610
|
+
const G = l.datasetName;
|
|
1611
|
+
for (const [P, B] of h.columns.entries()) {
|
|
1612
|
+
const U = [...x.spec.rows, ...x.spec.columns].find(
|
|
1613
|
+
(z) => Sa(z.field) === ne(B, G)
|
|
1594
1614
|
);
|
|
1595
|
-
|
|
1615
|
+
U || g({ code: "type_not_supported", message: `"${ut(B)}" isn't a level of this Matrix.`, path: `${I}.matrix.columns[${P}]`, fix: "Name dimensions or the date field of the query in matrix.columns." }), x = va(x, wa(x.spec, U.id, "columns")).config;
|
|
1596
1616
|
}
|
|
1597
|
-
return { ...
|
|
1598
|
-
},
|
|
1599
|
-
for (const [
|
|
1600
|
-
const l = `changes[${
|
|
1617
|
+
return { ...f, config: { matrix: x } };
|
|
1618
|
+
}, L = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map();
|
|
1619
|
+
for (const [f, o] of _.entries()) {
|
|
1620
|
+
const l = `changes[${f}]`;
|
|
1601
1621
|
try {
|
|
1602
|
-
switch (
|
|
1622
|
+
switch (o.op) {
|
|
1603
1623
|
case "card.add": {
|
|
1604
|
-
const
|
|
1605
|
-
const
|
|
1606
|
-
(z) => z.cardId ===
|
|
1624
|
+
const h = o.position && typeof o.position == "object" ? (() => {
|
|
1625
|
+
const B = m(o.position.after, `${l}.position.after`), U = re(p).find(
|
|
1626
|
+
(z) => z.cardId === B && z.kind === "frameCard"
|
|
1607
1627
|
);
|
|
1608
|
-
return !
|
|
1628
|
+
return !U || U.kind !== "frameCard" ? g({
|
|
1609
1629
|
code: "card_not_found",
|
|
1610
|
-
message: `${
|
|
1630
|
+
message: `${o.position.after} isn't a card on a grid sheet.`,
|
|
1611
1631
|
path: `${l}.position.after`,
|
|
1612
1632
|
fix: "Use a cardId from semaphor_get_dashboard_details on the same sheet, or a handle from this proposal."
|
|
1613
|
-
}) : (
|
|
1633
|
+
}) : (o.sheetId && o.sheetId !== U.sheetId && g({
|
|
1614
1634
|
code: "invalid_change",
|
|
1615
|
-
message: `position.after names a card on another sheet than ${
|
|
1635
|
+
message: `position.after names a card on another sheet than ${o.sheetId}.`,
|
|
1616
1636
|
path: `${l}.position.after`,
|
|
1617
1637
|
fix: "Leave out sheetId, or name the card's sheet."
|
|
1618
|
-
}), { sheetId:
|
|
1619
|
-
})() : void 0, I =
|
|
1620
|
-
const
|
|
1621
|
-
return
|
|
1622
|
-
code:
|
|
1623
|
-
message:
|
|
1638
|
+
}), { sheetId: U.sheetId, frameId: U.frameId });
|
|
1639
|
+
})() : void 0, I = h ? N(h.sheetId, `${l}.position.after`) : o.sheetId ? N(o.sheetId, `${l}.sheetId`) : (() => {
|
|
1640
|
+
const B = k();
|
|
1641
|
+
return B.length !== 1 && g({
|
|
1642
|
+
code: B.length ? "sheet_required" : "sheet_not_a_grid",
|
|
1643
|
+
message: B.length ? "This dashboard has several grid sheets; say which one gets the card." : "This dashboard has no grid sheet to add a card to.",
|
|
1624
1644
|
path: `${l}.sheetId`,
|
|
1625
|
-
fix:
|
|
1645
|
+
fix: B.length ? "Send sheetId: one of details.sheets." : "Add a grid sheet in the editor first.",
|
|
1626
1646
|
details: { sheets: D() }
|
|
1627
|
-
}),
|
|
1647
|
+
}), B[0];
|
|
1628
1648
|
})();
|
|
1629
|
-
|
|
1630
|
-
const
|
|
1631
|
-
...
|
|
1632
|
-
type:
|
|
1633
|
-
},
|
|
1634
|
-
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1637
|
-
const
|
|
1638
|
-
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1649
|
+
R(o.type, o.query, o.matrix, l);
|
|
1650
|
+
const v = await V(o.type, o.query, o.matrix, l), S = {
|
|
1651
|
+
...Pt({ id: a.newId(), title: o.title, ...o.description ? { description: o.description } : {} }),
|
|
1652
|
+
type: v.type
|
|
1653
|
+
}, T = lt(S, v);
|
|
1654
|
+
T.ok || g({ code: "invalid_change", message: T.message, path: l });
|
|
1655
|
+
const w = T.ok ? T.card : S;
|
|
1656
|
+
E(w, o.query, o.matrix, l, o.title, v);
|
|
1657
|
+
const x = { id: a.newId(), cards: [w], activeCardId: w.id }, G = h ? { after: h.frameId } : typeof o.position == "string" ? o.position : void 0, Q = G || o.width ? { ...G ? { position: G } : {}, ...o.width ? { width: o.width } : {} } : void 0;
|
|
1658
|
+
c({ op: "card.add", sheetId: I.id, frame: x, ...Q ? { placement: Q } : {}, changeIndex: f }, l);
|
|
1659
|
+
const P = o.handle ?? `$card_${++$}`;
|
|
1660
|
+
b.has(P) && g({ code: "invalid_change", message: `The handle ${P} is defined twice.`, path: `${l}.handle`, fix: "Give each new card or filter its own handle." }), b.set(P, { kind: "card", id: w.id, title: o.title }), i.push({ ref: P, kind: "card", id: w.id, title: o.title, changeIndex: f }), u.push(w.id);
|
|
1641
1661
|
break;
|
|
1642
1662
|
}
|
|
1643
1663
|
case "card.update": {
|
|
1644
|
-
const
|
|
1645
|
-
I ||
|
|
1646
|
-
const
|
|
1647
|
-
((
|
|
1664
|
+
const h = m(o.cardId, `${l}.cardId`), I = ie(p, h);
|
|
1665
|
+
I || g({ code: "card_not_editable", message: "Cards in Document sections are changed in the editor.", path: `${l}.cardId`, fix: "Tell the user to change it in the editor.", details: { reason: "document_section" } });
|
|
1666
|
+
const v = I.card, S = oe(v, { sql: !0 });
|
|
1667
|
+
((Qe = S.source) == null ? void 0 : Qe.kind) === "sql" && A(`${l}.cardId`), S.editable || g({
|
|
1648
1668
|
code: "card_not_editable",
|
|
1649
1669
|
message: S.message,
|
|
1650
1670
|
path: `${l}.cardId`,
|
|
1651
1671
|
fix: S.reason === "needs_sql_access" ? "Ask for SQL access." : "Tell the user to change it in the editor.",
|
|
1652
1672
|
details: { reason: S.reason, ...S.detail ? { detail: S.detail } : {} }
|
|
1653
|
-
}), I.frame.visualId &&
|
|
1673
|
+
}), I.frame.visualId && r.push({
|
|
1654
1674
|
code: "detaches_linked_visual",
|
|
1655
|
-
message: `"${
|
|
1675
|
+
message: `"${v.title}" will stop following its library visual and become local to this dashboard.`,
|
|
1656
1676
|
path: l,
|
|
1657
|
-
details: { cardIds: [
|
|
1677
|
+
details: { cardIds: [h] }
|
|
1658
1678
|
});
|
|
1659
|
-
let
|
|
1660
|
-
const
|
|
1661
|
-
if (
|
|
1662
|
-
const
|
|
1679
|
+
let T = !1;
|
|
1680
|
+
const w = o.type ? rt(o.type) : void 0;
|
|
1681
|
+
if (w && w !== v.type) {
|
|
1682
|
+
const x = S.editable ? S.source : void 0, G = oa(v, w), Q = G && x && x.kind === "semantic" ? (Ke = await a.loadCardSource({ domainId: x.domainId, datasetName: x.datasetName })) == null ? void 0 : Ke.fields : void 0, P = [], B = ra(v, w, {
|
|
1663
1683
|
...Q ? { catalog: Q } : {},
|
|
1664
|
-
...
|
|
1684
|
+
...G && !Q ? { catalogLoading: !0 } : {},
|
|
1665
1685
|
createId: () => {
|
|
1666
|
-
const
|
|
1667
|
-
return
|
|
1686
|
+
const U = a.newId();
|
|
1687
|
+
return P.push(U), U;
|
|
1668
1688
|
}
|
|
1669
1689
|
});
|
|
1670
|
-
if (
|
|
1671
|
-
const
|
|
1672
|
-
|
|
1690
|
+
if (B.status === "refused" && g({ code: "type_not_supported", message: "The card's dataset fields couldn't be loaded for a change to or from a Matrix.", path: `${l}.type`, fix: "Send a complete query with the type change." }), B.status === "changed") {
|
|
1691
|
+
const U = [...B.leftOut, ...B.droppedPreferences];
|
|
1692
|
+
U.length && r.push({
|
|
1673
1693
|
code: "type_change_drops",
|
|
1674
|
-
message: `Changing "${
|
|
1694
|
+
message: `Changing "${v.title}" to ${o.type.replace(/_/g, " ")} leaves out ${U.join(", ")}.`,
|
|
1675
1695
|
path: `${l}.type`,
|
|
1676
|
-
details: { dropped:
|
|
1677
|
-
}),
|
|
1678
|
-
{ op: "card.update", cardId:
|
|
1696
|
+
details: { dropped: U }
|
|
1697
|
+
}), c(
|
|
1698
|
+
{ op: "card.update", cardId: h, update: { kind: "retype", type: w, ...Q ? { catalog: Q } : {}, newIds: P }, changeIndex: f },
|
|
1679
1699
|
`${l}.type`
|
|
1680
|
-
),
|
|
1700
|
+
), T = !0;
|
|
1681
1701
|
}
|
|
1682
1702
|
}
|
|
1683
|
-
if (
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1686
|
-
const z =
|
|
1687
|
-
|
|
1688
|
-
let
|
|
1689
|
-
if (z && !("sql" in
|
|
1690
|
-
const { orderBy: X, ...be } =
|
|
1691
|
-
|
|
1703
|
+
if (o.query || o.matrix) {
|
|
1704
|
+
const x = ie(p, h).card, G = oe(x, { sql: !0 }), Q = G.editable ? G.query : void 0, P = Ms(Q, o.query ?? {}, `${l}.query`, g), B = Oe(x.type), U = o.matrix ?? (G.editable ? G.matrix : void 0);
|
|
1705
|
+
R(B, P, U, l);
|
|
1706
|
+
const z = G.editable ? da(G.query, P, G.matrix, U) : void 0, tt = !z || z.aspects.length > 0, le = z && !("sql" in P) ? Ee(P).filter((X) => !dt(z, X.key.role)) : [], at = la(x, z, le.map((X) => X.key.role));
|
|
1707
|
+
at && O(at, l);
|
|
1708
|
+
let Te = P;
|
|
1709
|
+
if (z && !("sql" in P) && P.orderBy && !z.aspects.includes("order") && ["metric", "group_by", "detail"].some((X) => dt(z, X))) {
|
|
1710
|
+
const { orderBy: X, ...be } = P;
|
|
1711
|
+
Te = be;
|
|
1692
1712
|
}
|
|
1693
|
-
let
|
|
1694
|
-
if (
|
|
1695
|
-
const X = await
|
|
1696
|
-
|
|
1697
|
-
const be = z ? { ...X, change: z } : X, ee =
|
|
1698
|
-
if (ee.ok ||
|
|
1713
|
+
let st;
|
|
1714
|
+
if (tt) {
|
|
1715
|
+
const X = await V(B, Te, U, l);
|
|
1716
|
+
st = X;
|
|
1717
|
+
const be = z ? { ...X, change: z } : X, ee = lt(x, be);
|
|
1718
|
+
if (ee.ok || O(ee, l), ee.ok && ee.droppedBindings.length && r.push({
|
|
1699
1719
|
code: "control_binding_dropped",
|
|
1700
|
-
message: `"${
|
|
1720
|
+
message: `"${x.title}" loses the controls bound to the levels or measures this change removes; they stop changing this card.`,
|
|
1701
1721
|
path: `${l}.query`,
|
|
1702
1722
|
fix: "Keep those fields in the query, or tell the user the controls no longer apply to this card.",
|
|
1703
1723
|
details: { controlIds: ee.droppedBindings }
|
|
1704
1724
|
}), ee.ok)
|
|
1705
1725
|
for (const Ie of ee.keptLabels)
|
|
1706
|
-
|
|
1726
|
+
r.push({
|
|
1707
1727
|
code: "label_kept_after_change",
|
|
1708
|
-
message: `"${
|
|
1728
|
+
message: `"${x.title}" keeps the label "${Ie.label}" on ${Ie.field}, whose aggregate or time grain changed.`,
|
|
1709
1729
|
path: `${l}.query`,
|
|
1710
1730
|
fix: "State a new label on the field ref if the old one no longer fits.",
|
|
1711
1731
|
details: { columns: [{ label: Ie.label, field: Ie.field }] }
|
|
1712
1732
|
});
|
|
1713
|
-
|
|
1733
|
+
c({ op: "card.update", cardId: h, update: { kind: "requery", query: be }, changeIndex: f }, `${l}.query`), T = !0;
|
|
1714
1734
|
}
|
|
1715
|
-
le.length &&
|
|
1735
|
+
le.length && ca(ie(p, h).card, le).changed.length && c({ op: "card.update", cardId: h, update: { kind: "relabel", labels: le }, changeIndex: f }, `${l}.query`), (tt || le.length) && E(ie(p, h).card, Te, U, l, x.title ?? "", st, z);
|
|
1716
1736
|
}
|
|
1717
|
-
(
|
|
1737
|
+
(o.title !== void 0 || o.description !== void 0) && c(
|
|
1718
1738
|
{
|
|
1719
1739
|
op: "card.update",
|
|
1720
|
-
cardId:
|
|
1740
|
+
cardId: h,
|
|
1721
1741
|
update: {
|
|
1722
1742
|
kind: "rename",
|
|
1723
|
-
...
|
|
1724
|
-
...
|
|
1743
|
+
...o.title !== void 0 ? { title: o.title } : {},
|
|
1744
|
+
...o.description !== void 0 ? { description: o.description } : {}
|
|
1725
1745
|
},
|
|
1726
|
-
changeIndex:
|
|
1746
|
+
changeIndex: f
|
|
1727
1747
|
},
|
|
1728
1748
|
l
|
|
1729
|
-
),
|
|
1749
|
+
), T && !u.includes(h) && u.push(h), i.push({ ref: o.cardId, kind: "card", id: h, title: v.title ?? "", changeIndex: f });
|
|
1730
1750
|
break;
|
|
1731
1751
|
}
|
|
1732
1752
|
case "card.remove": {
|
|
1733
|
-
const
|
|
1734
|
-
I ||
|
|
1735
|
-
var
|
|
1736
|
-
return ((
|
|
1737
|
-
}) && I.frame.cards.length > 1 &&
|
|
1753
|
+
const h = m(o.cardId, `${l}.cardId`), I = ie(p, h);
|
|
1754
|
+
I || g({ code: "card_not_editable", message: "Cards in Document sections are removed in the editor.", path: `${l}.cardId`, fix: "Tell the user to remove it in the editor.", details: { reason: "document_section" } }), I.frame.cards.some((S) => {
|
|
1755
|
+
var T, w;
|
|
1756
|
+
return ((T = S.customCardPreferences) == null ? void 0 : T.visualType) === "multiple" || !!((w = S.customCardPreferences) != null && w.dataInputCardIds);
|
|
1757
|
+
}) && I.frame.cards.length > 1 && g({ code: "card_not_editable", message: "This card is an input of a custom visual; remove it in the editor.", path: `${l}.cardId`, fix: "Tell the user to remove it in the editor.", details: { reason: "custom" } }), I.frame.visualId && I.frame.cards.length > 1 && r.push({
|
|
1738
1758
|
code: "detaches_linked_visual",
|
|
1739
1759
|
message: `Removing "${I.card.title}" makes the rest of its tile local to this dashboard; it stops following its library visual.`,
|
|
1740
1760
|
path: l,
|
|
1741
|
-
details: { cardIds: I.frame.cards.filter((S) => S.id !==
|
|
1742
|
-
}),
|
|
1761
|
+
details: { cardIds: I.frame.cards.filter((S) => S.id !== h).map((S) => S.id) }
|
|
1762
|
+
}), c({ op: "card.remove", cardId: h, changeIndex: f }, l), i.push({ ref: o.cardId, kind: "card", id: h, title: I.card.title ?? "", changeIndex: f });
|
|
1743
1763
|
break;
|
|
1744
1764
|
}
|
|
1745
1765
|
case "filter.add": {
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1748
|
-
const I =
|
|
1749
|
-
I ||
|
|
1766
|
+
const h = await a.loadCardSource({ domainId: o.domainId, datasetName: o.datasetName });
|
|
1767
|
+
h || g({ code: "field_not_found", message: `The dataset "${o.datasetName}" isn't available in this domain.`, path: `${l}.datasetName`, fix: "Find datasets with semaphor_list_datasets." });
|
|
1768
|
+
const I = _t(h.fields, o.field, o.datasetName);
|
|
1769
|
+
I || g({
|
|
1750
1770
|
code: "field_not_found",
|
|
1751
|
-
message: `"${
|
|
1771
|
+
message: `"${o.field}" isn't a field of ${o.datasetName}.`,
|
|
1752
1772
|
path: `${l}.field`,
|
|
1753
1773
|
fix: "Use one of details.available, or read semaphor_get_dataset_schema.",
|
|
1754
|
-
details: { available:
|
|
1774
|
+
details: { available: h.fields.slice(0, 20).map((x) => x.name) }
|
|
1755
1775
|
});
|
|
1756
|
-
const
|
|
1776
|
+
const v = gt(o.sheetIds, l, N), S = qt({
|
|
1757
1777
|
field: I,
|
|
1758
|
-
dataSource:
|
|
1759
|
-
connectionId:
|
|
1760
|
-
connectionType:
|
|
1761
|
-
scope:
|
|
1762
|
-
existingInputs: Array.isArray(
|
|
1778
|
+
dataSource: h.dataSource,
|
|
1779
|
+
connectionId: h.connectionId,
|
|
1780
|
+
connectionType: h.connectionType,
|
|
1781
|
+
scope: v,
|
|
1782
|
+
existingInputs: Array.isArray(p.inputs) ? p.inputs : [],
|
|
1763
1783
|
createId: a.newId,
|
|
1764
|
-
label:
|
|
1765
|
-
}),
|
|
1766
|
-
|
|
1767
|
-
const
|
|
1768
|
-
|
|
1784
|
+
label: o.label
|
|
1785
|
+
}), T = { ...S.filter };
|
|
1786
|
+
T.dateSelectionMode || (T.type = o.selection ?? "multiple"), o.defaultValues && (T.defaultValues = o.defaultValues), o.defaultPeriod && (T.defaultDateFilter = bt(o.defaultPeriod, I, `${l}.defaultPeriod`, g)), c({ op: "filter.add", input: { ...S, filter: T }, changeIndex: f }, l), L.set(S.id, { sheetIds: o.sheetIds ?? "all", changeIndex: f }), (o.defaultValues !== void 0 || o.defaultPeriod !== void 0) && q.set(S.id, { values: o.defaultValues, period: o.defaultPeriod, changeIndex: f });
|
|
1787
|
+
const w = o.handle;
|
|
1788
|
+
w && (b.has(w) && g({ code: "invalid_change", message: `The handle ${w} is defined twice.`, path: `${l}.handle`, fix: "Give each new card or filter its own handle." }), b.set(w, { kind: "filter", id: S.id, title: o.label })), i.push({ ref: w ?? S.id, kind: "filter", id: S.id, title: o.label, changeIndex: f });
|
|
1769
1789
|
break;
|
|
1770
1790
|
}
|
|
1771
1791
|
case "filter.update": {
|
|
1772
|
-
const
|
|
1773
|
-
I != null && I.editable ||
|
|
1792
|
+
const h = F(o.filterId, `${l}.filterId`), I = pe(p, h, void 0, C);
|
|
1793
|
+
I != null && I.editable || g({
|
|
1774
1794
|
code: "filter_not_editable",
|
|
1775
1795
|
message: I && !I.editable ? I.notEditable.message : "This filter can't be changed through the MCP.",
|
|
1776
1796
|
path: `${l}.filterId`,
|
|
1777
1797
|
fix: "Tell the user to change it in the editor; removing or excluding it works."
|
|
1778
1798
|
});
|
|
1779
|
-
const
|
|
1780
|
-
if ((
|
|
1781
|
-
const S = { ...
|
|
1782
|
-
let
|
|
1783
|
-
|
|
1784
|
-
|
|
1799
|
+
const v = (p.inputs ?? []).find((x) => x.id === h);
|
|
1800
|
+
if ((v == null ? void 0 : v.kind) !== "filter" || !v.filter) throw new ue();
|
|
1801
|
+
const S = { ...v.filter };
|
|
1802
|
+
let T = !1;
|
|
1803
|
+
o.selection && (S.type = o.selection), o.defaultValues !== void 0 && (T = !0, o.defaultValues === null ? delete S.defaultValues : S.defaultValues = o.defaultValues), o.defaultPeriod !== void 0 && (T = !0, o.defaultPeriod === null ? delete S.defaultDateFilter : S.defaultDateFilter = bt(
|
|
1804
|
+
o.defaultPeriod,
|
|
1785
1805
|
{ dataType: S.dataType },
|
|
1786
1806
|
`${l}.defaultPeriod`,
|
|
1787
|
-
|
|
1807
|
+
g
|
|
1788
1808
|
));
|
|
1789
|
-
const
|
|
1790
|
-
...
|
|
1791
|
-
...
|
|
1809
|
+
const w = {
|
|
1810
|
+
...o.label !== void 0 ? { label: o.label } : {},
|
|
1811
|
+
...o.selection !== void 0 || T ? { definition: S } : {},
|
|
1792
1812
|
// A change of sheets states the sheets; what else the scope says (the cards it leaves out,
|
|
1793
1813
|
// whether it covers Document sheets) stays.
|
|
1794
|
-
...
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
new Set([...Me(
|
|
1814
|
+
...o.sheetIds !== void 0 ? { scope: na(
|
|
1815
|
+
v.scope,
|
|
1816
|
+
gt(o.sheetIds ?? void 0, l, N),
|
|
1817
|
+
new Set([...Me(p).values()].filter((x) => x.sheetKind === "document").map((x) => x.sheetId))
|
|
1798
1818
|
) } : {},
|
|
1799
|
-
...
|
|
1819
|
+
...T ? { values: { defaultChanged: !0, target: {} } } : {}
|
|
1800
1820
|
};
|
|
1801
|
-
|
|
1821
|
+
c({ op: "filter.update", filterId: h, settings: w, changeIndex: f }, l), o.sheetIds !== void 0 && L.set(h, { sheetIds: o.sheetIds ?? "all", changeIndex: f }), T && q.set(h, { values: o.defaultValues, period: o.defaultPeriod, changeIndex: f }), i.push({ ref: o.filterId, kind: "filter", id: h, title: v.label, changeIndex: f });
|
|
1802
1822
|
break;
|
|
1803
1823
|
}
|
|
1804
1824
|
case "filter.remove": {
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1825
|
+
const h = F(o.filterId, `${l}.filterId`), I = ((He = (p.inputs ?? []).find((v) => v.id === h)) == null ? void 0 : He.label) ?? "";
|
|
1826
|
+
c({ op: "filter.remove", filterId: h, changeIndex: f }, l), i.push({ ref: o.filterId, kind: "filter", id: h, title: I, changeIndex: f });
|
|
1807
1827
|
break;
|
|
1808
1828
|
}
|
|
1809
1829
|
case "filter.bind": {
|
|
1810
|
-
const
|
|
1811
|
-
I != null && I.editable ||
|
|
1830
|
+
const h = F(o.filterId, `${l}.filterId`), I = pe(p, h, void 0, C);
|
|
1831
|
+
I != null && I.editable || g({
|
|
1812
1832
|
code: "filter_not_editable",
|
|
1813
1833
|
message: I && !I.editable ? I.notEditable.message : "This filter can't be changed through the MCP.",
|
|
1814
1834
|
path: `${l}.filterId`,
|
|
1815
1835
|
fix: "Tell the user to change it in the editor; removing or excluding it works."
|
|
1816
1836
|
});
|
|
1817
|
-
const
|
|
1818
|
-
|
|
1837
|
+
const v = m(o.cardId, `${l}.cardId`), S = re(p).find((w) => w.cardId === v).card, T = await Ls(S, o.field, a, `${l}.field`, g);
|
|
1838
|
+
c({ op: "filter.bind", filterId: h, cardId: v, binding: { kind: "bound", cardId: v, bindingId: a.newId(), target: T }, changeIndex: f }, l), i.push({ ref: o.filterId, kind: "filter", id: h, title: I.label, changeIndex: f });
|
|
1819
1839
|
break;
|
|
1820
1840
|
}
|
|
1821
1841
|
case "layout.arrange": {
|
|
1822
|
-
const
|
|
1823
|
-
const I =
|
|
1824
|
-
return I.length !== 1 &&
|
|
1842
|
+
const h = o.sheetId ? N(o.sheetId, `${l}.sheetId`) : (() => {
|
|
1843
|
+
const I = k();
|
|
1844
|
+
return I.length !== 1 && g({
|
|
1825
1845
|
code: I.length ? "sheet_required" : "sheet_not_a_grid",
|
|
1826
1846
|
message: I.length ? "This dashboard has several grid sheets; say which one to arrange." : "This dashboard has no grid sheet to arrange.",
|
|
1827
1847
|
path: `${l}.sheetId`,
|
|
@@ -1829,101 +1849,121 @@ async function hi(e, t, a) {
|
|
|
1829
1849
|
details: { sheets: D() }
|
|
1830
1850
|
}), I[0];
|
|
1831
1851
|
})();
|
|
1832
|
-
|
|
1852
|
+
c({ op: "layout.arrange", sheetId: h.id, ...o.keepOrder ? { keepOrder: !0 } : {}, changeIndex: f }, l);
|
|
1833
1853
|
break;
|
|
1834
1854
|
}
|
|
1835
1855
|
case "filter.exclude": {
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1856
|
+
const h = F(o.filterId, `${l}.filterId`), I = m(o.cardId, `${l}.cardId`), v = ((We = (p.inputs ?? []).find((S) => S.id === h)) == null ? void 0 : We.label) ?? "";
|
|
1857
|
+
c({ op: "filter.exclude", filterId: h, cardId: I, changeIndex: f }, l), i.push({ ref: o.filterId, kind: "filter", id: h, title: v, changeIndex: f });
|
|
1838
1858
|
break;
|
|
1839
1859
|
}
|
|
1840
1860
|
}
|
|
1841
|
-
} catch (
|
|
1842
|
-
if (!(
|
|
1861
|
+
} catch (h) {
|
|
1862
|
+
if (!(h instanceof ue)) throw h;
|
|
1843
1863
|
}
|
|
1844
1864
|
}
|
|
1845
1865
|
if (s.length) return { ok: !1, problems: s };
|
|
1846
|
-
const
|
|
1847
|
-
if (!
|
|
1866
|
+
const j = nt(e, n, y);
|
|
1867
|
+
if (!j.ok)
|
|
1848
1868
|
return {
|
|
1849
1869
|
ok: !1,
|
|
1850
1870
|
problems: [
|
|
1851
1871
|
{
|
|
1852
1872
|
code: "invalid_change",
|
|
1853
|
-
message:
|
|
1854
|
-
path: `changes[${((
|
|
1873
|
+
message: j.failedAt.message,
|
|
1874
|
+
path: `changes[${((Ye = n[j.failedAt.index]) == null ? void 0 : Ye.changeIndex) ?? 0}]`,
|
|
1855
1875
|
fix: "Read the outline again and propose again."
|
|
1856
1876
|
}
|
|
1857
1877
|
]
|
|
1858
1878
|
};
|
|
1859
|
-
for (const
|
|
1860
|
-
const
|
|
1861
|
-
if (!
|
|
1862
|
-
const l = ((
|
|
1863
|
-
|
|
1879
|
+
for (const f of u) {
|
|
1880
|
+
const o = ie(j.dashboard, f);
|
|
1881
|
+
if (!o) continue;
|
|
1882
|
+
const l = ((Xe = n.find((S) => ze(S) === f)) == null ? void 0 : Xe.changeIndex) ?? 0, h = oe(o.card, { sql: !0 }), I = Oe(o.card.type);
|
|
1883
|
+
h.editable && ("sql" in h.query ? !!h.query.sql : "measures" in h.query ? h.query.measures.length > 0 : h.query.columns.length > 0) && ((Je = ce[I]) == null ? void 0 : Je.forms.includes(xe(h.query))) || s.push({
|
|
1864
1884
|
code: "type_not_supported",
|
|
1865
|
-
message: `As changed, "${
|
|
1885
|
+
message: `As changed, "${o.card.title}" would have no query a ${I.replace(/_/g, " ")} can run.`,
|
|
1866
1886
|
path: `changes[${l}]`,
|
|
1867
|
-
fix: `Send a complete query with the type change: ${((
|
|
1887
|
+
fix: `Send a complete query with the type change: ${((Ze = ce[I]) == null ? void 0 : Ze.forms.map((S) => Se[S]).join(" or ")) ?? "a measures query"}.`
|
|
1868
1888
|
});
|
|
1869
1889
|
}
|
|
1870
|
-
if (s.push(...
|
|
1871
|
-
for (const
|
|
1872
|
-
if (
|
|
1873
|
-
const
|
|
1874
|
-
if (!(l != null && l.editable)
|
|
1875
|
-
const
|
|
1876
|
-
|
|
1877
|
-
const T
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1890
|
+
if (s.push(...qs(e, j.dashboard, n, L, C)), s.push(...Ps(j.dashboard, q, a.calendar)), s.length) return { ok: !1, problems: s };
|
|
1891
|
+
for (const f of n) {
|
|
1892
|
+
if (f.op !== "filter.add" && !(f.op === "filter.update" && f.settings.scope)) continue;
|
|
1893
|
+
const o = f.op === "filter.add" ? f.input.id : f.filterId, l = pe(j.dashboard, o, void 0, C);
|
|
1894
|
+
if (!(l != null && l.editable)) continue;
|
|
1895
|
+
const h = async (v) => {
|
|
1896
|
+
const S = [];
|
|
1897
|
+
for (const T of v) {
|
|
1898
|
+
const w = T.datasetName ? await a.findRelationshipFields({
|
|
1899
|
+
domainId: l.domainId,
|
|
1900
|
+
fromDataset: l.datasetName,
|
|
1901
|
+
field: l.field,
|
|
1902
|
+
toDataset: T.datasetName
|
|
1903
|
+
}) : [];
|
|
1904
|
+
S.push({ ...T, suggestedFields: w });
|
|
1905
|
+
}
|
|
1906
|
+
return S;
|
|
1907
|
+
}, I = (v) => v.map((S) => `"${S.title}"`).join(", ");
|
|
1908
|
+
if (l.notReached.length) {
|
|
1909
|
+
const v = await h(l.notReached);
|
|
1910
|
+
r.push({
|
|
1911
|
+
code: "filter_not_reaching_cards",
|
|
1912
|
+
message: `"${l.label}" doesn't reach ${v.length} card${v.length === 1 ? "" : "s"} on its sheets: ${I(v)}.`,
|
|
1913
|
+
path: `changes[${f.changeIndex ?? 0}]`,
|
|
1914
|
+
fix: "Add filter.bind with one of the suggested fields to reach a card, or leave it unfiltered.",
|
|
1915
|
+
details: { cards: v }
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
if ((et = l.relationshipPending) != null && et.length) {
|
|
1919
|
+
const v = await h(l.relationshipPending);
|
|
1920
|
+
r.push({
|
|
1921
|
+
code: "filter_reach_through_relationships",
|
|
1922
|
+
message: `"${l.label}" may reach ${v.length} card${v.length === 1 ? "" : "s"} on its sheets through the domain's relationships: ${I(v)}. Whether it applies is decided when each card runs.`,
|
|
1923
|
+
path: `changes[${f.changeIndex ?? 0}]`,
|
|
1924
|
+
fix: "Add filter.bind with one of the suggested fields to make it certain, or leave it to the relationships.",
|
|
1925
|
+
details: { cards: v }
|
|
1926
|
+
});
|
|
1884
1927
|
}
|
|
1885
|
-
d.push({
|
|
1886
|
-
code: "filter_not_reaching_cards",
|
|
1887
|
-
message: `"${l.label}" doesn't reach ${u.length} card${u.length === 1 ? "" : "s"} on its sheets: ${u.map((I) => `"${I.title}"`).join(", ")}.`,
|
|
1888
|
-
path: `changes[${h.changeIndex ?? 0}]`,
|
|
1889
|
-
fix: "Add filter.bind with one of the suggested fields to reach a card, or leave it unfiltered.",
|
|
1890
|
-
details: { cards: u }
|
|
1891
|
-
});
|
|
1892
1928
|
}
|
|
1893
|
-
const
|
|
1929
|
+
const De = Es(j.dashboard, n, j.descriptions, C);
|
|
1894
1930
|
return {
|
|
1895
1931
|
ok: !0,
|
|
1896
|
-
operations:
|
|
1897
|
-
context:
|
|
1898
|
-
dashboard:
|
|
1899
|
-
refs:
|
|
1900
|
-
descriptions:
|
|
1901
|
-
changedCardIds:
|
|
1902
|
-
requires: [...
|
|
1903
|
-
warnings:
|
|
1932
|
+
operations: n,
|
|
1933
|
+
context: y,
|
|
1934
|
+
dashboard: j.dashboard,
|
|
1935
|
+
refs: i,
|
|
1936
|
+
descriptions: De,
|
|
1937
|
+
changedCardIds: u,
|
|
1938
|
+
requires: [...d],
|
|
1939
|
+
warnings: r
|
|
1904
1940
|
};
|
|
1905
1941
|
}
|
|
1906
|
-
function
|
|
1907
|
-
const
|
|
1908
|
-
if (!
|
|
1909
|
-
const
|
|
1910
|
-
if (!
|
|
1911
|
-
const i = (
|
|
1912
|
-
for (const
|
|
1913
|
-
const
|
|
1914
|
-
if (!
|
|
1915
|
-
const y =
|
|
1916
|
-
var
|
|
1917
|
-
return "notReached" in
|
|
1918
|
-
}).map((
|
|
1942
|
+
function Es(e, t, a, s) {
|
|
1943
|
+
const r = t.filter((u) => u.op === "card.add");
|
|
1944
|
+
if (!r.length) return [...a];
|
|
1945
|
+
const n = Rt(e, void 0, s);
|
|
1946
|
+
if (!n.length) return [...a];
|
|
1947
|
+
const i = (u) => ya(u.map((b) => `"${b}"`)), d = /* @__PURE__ */ new Map();
|
|
1948
|
+
for (const u of r) {
|
|
1949
|
+
const b = ze(u);
|
|
1950
|
+
if (!b || u.changeIndex === void 0) continue;
|
|
1951
|
+
const y = n.filter((_) => _.reaches.includes(b)).map((_) => _.label), C = n.filter((_) => {
|
|
1952
|
+
var g;
|
|
1953
|
+
return "notReached" in _ && ((g = _.notReached) == null ? void 0 : g.some((A) => A.cardId === b));
|
|
1954
|
+
}).map((_) => _.label), p = n.filter((_) => {
|
|
1955
|
+
var g;
|
|
1956
|
+
return (g = _.relationshipPending) == null ? void 0 : g.some((A) => A.cardId === b);
|
|
1957
|
+
}).map((_) => _.label), $ = [
|
|
1919
1958
|
...y.length ? [`The dashboard's ${i(y)} filter${y.length === 1 ? " applies" : "s apply"} to it.`] : [],
|
|
1920
|
-
...
|
|
1959
|
+
...C.length ? [`${i(C)} ${C.length === 1 ? "doesn't" : "don't"} reach it.`] : [],
|
|
1960
|
+
...p.length ? [`${i(p)} may reach it through the domain's relationships.`] : []
|
|
1921
1961
|
];
|
|
1922
|
-
|
|
1962
|
+
$.length && d.set(u.changeIndex, $.join(" "));
|
|
1923
1963
|
}
|
|
1924
|
-
return a.map((
|
|
1925
|
-
const
|
|
1926
|
-
return
|
|
1964
|
+
return a.map((u) => {
|
|
1965
|
+
const b = u.changeIndex === void 0 ? void 0 : d.get(u.changeIndex);
|
|
1966
|
+
return b ? { ...u, sentence: `${u.sentence} ${b}` } : u;
|
|
1927
1967
|
});
|
|
1928
1968
|
}
|
|
1929
1969
|
function ze(e) {
|
|
@@ -1931,577 +1971,616 @@ function ze(e) {
|
|
|
1931
1971
|
if (e.op === "card.update" || e.op === "card.remove") return e.cardId;
|
|
1932
1972
|
if (e.op === "card.add") return (t = e.frame.cards[0]) == null ? void 0 : t.id;
|
|
1933
1973
|
}
|
|
1934
|
-
function
|
|
1974
|
+
function Os(e) {
|
|
1935
1975
|
return Object.fromEntries(
|
|
1936
|
-
|
|
1976
|
+
_a.flatMap((t) => e[t] === void 0 ? [] : [[t, e[t]]])
|
|
1937
1977
|
);
|
|
1938
1978
|
}
|
|
1939
|
-
function
|
|
1979
|
+
function Ns(e, t) {
|
|
1940
1980
|
if (!t.length || !e.config) return e;
|
|
1941
1981
|
const a = { ...e.config }, s = [];
|
|
1942
1982
|
if (a.matrix) {
|
|
1943
|
-
const
|
|
1944
|
-
for (const { key:
|
|
1945
|
-
if (
|
|
1946
|
-
const
|
|
1947
|
-
if (
|
|
1948
|
-
|
|
1983
|
+
const n = a.matrix, i = xa(n), d = [...n.spec.rows, ...n.spec.columns], u = { ...n.presentation.levelLabels }, b = { ...n.presentation.measureLabels };
|
|
1984
|
+
for (const { key: y, label: C } of t) {
|
|
1985
|
+
if (y.role === "metric") {
|
|
1986
|
+
const p = i.measures.findIndex(($) => Fe($, y));
|
|
1987
|
+
if (p < 0) continue;
|
|
1988
|
+
b[n.spec.measures[p].id] = C;
|
|
1949
1989
|
} else {
|
|
1950
|
-
const
|
|
1951
|
-
if (
|
|
1952
|
-
|
|
1990
|
+
const p = i.levels.findIndex(($) => Fe($, y));
|
|
1991
|
+
if (p < 0) continue;
|
|
1992
|
+
u[d[p].id] = C;
|
|
1953
1993
|
}
|
|
1954
|
-
s.push(
|
|
1994
|
+
s.push(y);
|
|
1955
1995
|
}
|
|
1956
|
-
return a.matrix = { ...
|
|
1996
|
+
return a.matrix = { ...n, presentation: { ...n.presentation, levelLabels: u, measureLabels: b } }, { ...e, config: a, statedLabels: s };
|
|
1957
1997
|
}
|
|
1958
|
-
const
|
|
1959
|
-
for (const { key:
|
|
1960
|
-
const
|
|
1961
|
-
|
|
1998
|
+
const r = { metric: "metricColumns", group_by: "groupByColumns", detail: "detailColumns" };
|
|
1999
|
+
for (const { key: n, label: i } of t) {
|
|
2000
|
+
const d = [...a[r[n.role]] ?? []], u = Da(n.role, d).findIndex((b) => Fe(b, n));
|
|
2001
|
+
u < 0 || (d[u] = Ba(d[u], i), a[r[n.role]] = d, s.push(n));
|
|
1962
2002
|
}
|
|
1963
2003
|
return { ...e, config: a, statedLabels: s };
|
|
1964
2004
|
}
|
|
1965
|
-
function
|
|
1966
|
-
var
|
|
1967
|
-
const
|
|
1968
|
-
var
|
|
1969
|
-
return ((
|
|
1970
|
-
}, y = (
|
|
1971
|
-
var
|
|
1972
|
-
return ((
|
|
1973
|
-
},
|
|
1974
|
-
const
|
|
1975
|
-
if (
|
|
2005
|
+
function qs(e, t, a, s, r) {
|
|
2006
|
+
var A;
|
|
2007
|
+
const n = [], i = new Map(re(t).map((c) => [c.cardId, c])), d = Me(t), u = de(t), b = (c) => {
|
|
2008
|
+
var m, F;
|
|
2009
|
+
return ((F = (m = t.sheets) == null ? void 0 : m.find((k) => k.id === c)) == null ? void 0 : F.title) ?? c;
|
|
2010
|
+
}, y = (c, m) => {
|
|
2011
|
+
var F;
|
|
2012
|
+
return ((F = [...a].reverse().find((k) => ze(k) === m || "filterId" in k && k.filterId === c)) == null ? void 0 : F.changeIndex) ?? 0;
|
|
2013
|
+
}, C = (c, m) => {
|
|
2014
|
+
const F = u.findFilterInput({ inputId: c }).input, k = i.get(m), D = `"${k.card.title ?? ""}"`, N = `"${F.label}"`;
|
|
2015
|
+
if (k.kind === "documentSectionCard")
|
|
1976
2016
|
return {
|
|
1977
2017
|
reason: "document_section",
|
|
1978
2018
|
message: `${D} is in a Document section, which takes only the filters its Document sheet shows.`,
|
|
1979
2019
|
fix: "Tell the user to change where the filter shows in the editor."
|
|
1980
2020
|
};
|
|
1981
|
-
const
|
|
1982
|
-
if (
|
|
2021
|
+
const R = d.get(k.sheetId);
|
|
2022
|
+
if (R && !yt(F, R))
|
|
1983
2023
|
return {
|
|
1984
2024
|
reason: "outside_sheets",
|
|
1985
|
-
message: `${
|
|
2025
|
+
message: `${N} isn't shown on "${b(k.sheetId)}", so it can't filter ${D}.`,
|
|
1986
2026
|
fix: "Show it on that sheet first with filter.update sheetIds (null for every sheet), in the same proposal."
|
|
1987
2027
|
};
|
|
1988
|
-
|
|
2028
|
+
const O = qa(F, k.card);
|
|
2029
|
+
switch (O.status) {
|
|
1989
2030
|
case "incompatible":
|
|
1990
|
-
return { reason: "incompatible_field", message: `${D} can't take ${
|
|
2031
|
+
return { reason: "incompatible_field", message: `${D} can't take ${N}'s values on that field: their types differ.`, fix: "Bind a field of the same type (filter.bind)." };
|
|
1991
2032
|
case "stale":
|
|
1992
2033
|
return {
|
|
1993
2034
|
reason: "field_not_on_card",
|
|
1994
|
-
message: `${D} doesn't have the field ${
|
|
2035
|
+
message: `${D} doesn't have the field ${N} is bound to.`,
|
|
1995
2036
|
fix: "Bind a field the card has (filter.bind), or exclude the card (filter.exclude), in the same proposal."
|
|
1996
2037
|
};
|
|
1997
2038
|
case "ambiguous":
|
|
1998
2039
|
return {
|
|
1999
2040
|
reason: "ambiguous_field",
|
|
2000
|
-
message: `${D} has more than one field ${
|
|
2041
|
+
message: `${D} has more than one field ${N} could filter.`,
|
|
2001
2042
|
fix: "Bind the field it should use (filter.bind), or exclude the card (filter.exclude), in the same proposal."
|
|
2002
2043
|
};
|
|
2003
|
-
|
|
2004
|
-
|
|
2044
|
+
case "relationship": {
|
|
2045
|
+
const E = ve(F, k.card, r);
|
|
2046
|
+
return E.reach === "blocked" ? {
|
|
2047
|
+
reason: "relationship_route_changed",
|
|
2048
|
+
message: `The relationships ${D} used for ${N} changed in the domain.`,
|
|
2049
|
+
fix: "Tell the user to choose the relationship again in the filter's Cards tab."
|
|
2050
|
+
} : E.reason === "relationship_ambiguous" ? {
|
|
2051
|
+
reason: "relationship_ambiguous",
|
|
2052
|
+
message: `${N} connects to ${D} through more than one path.`,
|
|
2053
|
+
fix: "Tell the user to choose a path in the filter's Cards tab, or bind a field the card has (filter.bind)."
|
|
2054
|
+
} : {
|
|
2055
|
+
reason: "relationship_pending",
|
|
2056
|
+
message: `${N} may reach ${D} through the domain's relationships; whether it applies is decided when the card runs.`,
|
|
2057
|
+
fix: "Bind a field the card has (filter.bind) to make it certain, or leave it to the relationships."
|
|
2058
|
+
};
|
|
2059
|
+
}
|
|
2060
|
+
case "excluded":
|
|
2061
|
+
case "bound":
|
|
2062
|
+
case "unsupportedTarget":
|
|
2063
|
+
case "sql":
|
|
2064
|
+
case "automatic":
|
|
2065
|
+
case "passthrough":
|
|
2066
|
+
case "notApplicable":
|
|
2067
|
+
return { reason: "filter_settings_override", message: `${N} still wouldn't filter ${D}: its settings leave that card out.`, fix: "Tell the user to change the filter's settings in the editor." };
|
|
2068
|
+
default: {
|
|
2069
|
+
const E = O;
|
|
2070
|
+
throw new Error(`Unhandled filter card target ${String(E.status)}`);
|
|
2071
|
+
}
|
|
2005
2072
|
}
|
|
2006
|
-
},
|
|
2007
|
-
for (const
|
|
2008
|
-
(
|
|
2009
|
-
for (const
|
|
2010
|
-
const
|
|
2011
|
-
if (!
|
|
2012
|
-
const
|
|
2013
|
-
if (
|
|
2014
|
-
|
|
2015
|
-
const D =
|
|
2016
|
-
|
|
2073
|
+
}, p = /* @__PURE__ */ new Set(), $ = /* @__PURE__ */ new Map();
|
|
2074
|
+
for (const c of a)
|
|
2075
|
+
(c.op === "filter.bind" || c.op === "filter.exclude") && $.set(`${c.filterId}|${c.cardId}`, c);
|
|
2076
|
+
for (const c of $.values()) {
|
|
2077
|
+
const m = pe(t, c.filterId, void 0, r), F = i.get(c.cardId);
|
|
2078
|
+
if (!m || !F) continue;
|
|
2079
|
+
const k = m.reaches.includes(c.cardId);
|
|
2080
|
+
if (c.op === "filter.bind" ? k : !k) continue;
|
|
2081
|
+
p.add(`${c.filterId}|${c.cardId}`);
|
|
2082
|
+
const D = c.op === "filter.bind" ? C(c.filterId, c.cardId) : { reason: "filter_settings_override", message: `"${m.label}" would still filter "${F.card.title ?? ""}".`, fix: "Tell the user to change the filter's settings in the editor." };
|
|
2083
|
+
n.push({
|
|
2017
2084
|
code: "filter_not_editable",
|
|
2018
2085
|
message: D.message,
|
|
2019
|
-
path: `changes[${
|
|
2086
|
+
path: `changes[${c.changeIndex ?? 0}]`,
|
|
2020
2087
|
fix: D.fix,
|
|
2021
|
-
details: { reason: D.reason, cardId:
|
|
2088
|
+
details: { reason: D.reason, cardId: c.cardId }
|
|
2022
2089
|
});
|
|
2023
2090
|
}
|
|
2024
|
-
for (const [
|
|
2025
|
-
const
|
|
2026
|
-
if (!
|
|
2027
|
-
const
|
|
2028
|
-
var
|
|
2029
|
-
return ((
|
|
2030
|
-
})), D =
|
|
2031
|
-
Le(D === "all" || !D ? D : [...D].sort(),
|
|
2091
|
+
for (const [c, m] of s) {
|
|
2092
|
+
const F = pe(t, c, void 0, r);
|
|
2093
|
+
if (!F) continue;
|
|
2094
|
+
const k = F.editable && ((A = F.exceptSheetIds) == null ? void 0 : A.some((R) => {
|
|
2095
|
+
var O;
|
|
2096
|
+
return ((O = d.get(R)) == null ? void 0 : O.sheetKind) === "dashboard";
|
|
2097
|
+
})), D = F.editable && !k ? F.sheetIds : void 0, N = m.sheetIds === "all" ? "all" : [...m.sheetIds].sort();
|
|
2098
|
+
Le(D === "all" || !D ? D : [...D].sort(), N) || n.push({
|
|
2032
2099
|
code: "filter_not_editable",
|
|
2033
|
-
message: `"${
|
|
2034
|
-
path: `changes[${
|
|
2100
|
+
message: `"${F.label}" wouldn't show on the sheets asked for. Change where it shows in the editor.`,
|
|
2101
|
+
path: `changes[${m.changeIndex}].sheetIds`,
|
|
2035
2102
|
fix: "Tell the user to change the filter's sheets in the editor.",
|
|
2036
2103
|
details: { reason: "filter_settings_override", ...D ? { sheetIds: D } : {} }
|
|
2037
2104
|
});
|
|
2038
2105
|
}
|
|
2039
|
-
const
|
|
2040
|
-
for (const
|
|
2041
|
-
const
|
|
2042
|
-
for (const
|
|
2043
|
-
if (
|
|
2044
|
-
const
|
|
2045
|
-
if (
|
|
2046
|
-
const
|
|
2047
|
-
|
|
2106
|
+
const _ = de(e), g = (c) => c === "blocked" || c === "ambiguous";
|
|
2107
|
+
for (const c of u.inputs) {
|
|
2108
|
+
const m = c.input.id;
|
|
2109
|
+
for (const F of u.reachedCards({ inputId: m })) {
|
|
2110
|
+
if (p.has(`${m}|${F.cardId}`) || !g(ve(c.input, F.card, r).reach)) continue;
|
|
2111
|
+
const k = _.findFilterInput({ inputId: m }), D = k && _.reachedCards({ inputId: m }).find((R) => R.cardId === F.cardId);
|
|
2112
|
+
if (k && D && g(ve(k.input, D.card, r).reach)) continue;
|
|
2113
|
+
const N = C(m, F.cardId);
|
|
2114
|
+
n.push({
|
|
2048
2115
|
code: "invalid_change",
|
|
2049
|
-
message: `${
|
|
2050
|
-
path: `changes[${y(
|
|
2051
|
-
fix:
|
|
2052
|
-
details: { reason:
|
|
2116
|
+
message: `${N.message} The card would stop showing data while "${c.input.label}" has a value.`,
|
|
2117
|
+
path: `changes[${y(m, F.cardId)}]`,
|
|
2118
|
+
fix: N.fix,
|
|
2119
|
+
details: { reason: N.reason, filterId: m, cardId: F.cardId }
|
|
2053
2120
|
});
|
|
2054
2121
|
}
|
|
2055
2122
|
}
|
|
2056
|
-
return
|
|
2057
|
-
}
|
|
2058
|
-
function
|
|
2059
|
-
const s = [],
|
|
2060
|
-
for (const [
|
|
2061
|
-
const
|
|
2062
|
-
if (!
|
|
2063
|
-
const
|
|
2123
|
+
return n;
|
|
2124
|
+
}
|
|
2125
|
+
function Ps(e, t, a) {
|
|
2126
|
+
const s = [], r = de(e);
|
|
2127
|
+
for (const [n, i] of t) {
|
|
2128
|
+
const d = r.findFilterInput({ inputId: n });
|
|
2129
|
+
if (!d) continue;
|
|
2130
|
+
const u = It({ dashboard: e, target: { kind: "dashboardInput", input: d.input, scope: {} }, calendar: a }).value, b = d.input.filter.dateSelectionMode, y = b === "day" ? "its date picker takes one day" : void 0, C = (p, $) => s.push({
|
|
2064
2131
|
code: "filter_not_editable",
|
|
2065
|
-
message:
|
|
2066
|
-
path: `changes[${
|
|
2067
|
-
fix:
|
|
2068
|
-
details: { reason: "default_not_applied", ...
|
|
2132
|
+
message: p,
|
|
2133
|
+
path: `changes[${i.changeIndex}]`,
|
|
2134
|
+
fix: $,
|
|
2135
|
+
details: { reason: "default_not_applied", ...b ? { datePicker: b } : {} }
|
|
2069
2136
|
});
|
|
2070
|
-
if (
|
|
2071
|
-
const
|
|
2072
|
-
(
|
|
2073
|
-
`"${
|
|
2074
|
-
|
|
2137
|
+
if (i.period) {
|
|
2138
|
+
const p = vt(i.period), $ = u && "relativeMeta" in u ? u.relativeMeta : void 0;
|
|
2139
|
+
(!$ || !Le($, p)) && C(
|
|
2140
|
+
`"${d.input.label}" wouldn't load with that default${y ? `: ${y}` : ""}.`,
|
|
2141
|
+
y ? "Ask for a default the picker can take, or tell the user to make it a date range in the editor." : "Tell the user to change the filter's default in the editor."
|
|
2075
2142
|
);
|
|
2076
|
-
} else if (
|
|
2077
|
-
const
|
|
2078
|
-
(!
|
|
2143
|
+
} else if (i.values) {
|
|
2144
|
+
const p = ($) => JSON.stringify(($ ?? []).map(String).sort());
|
|
2145
|
+
(!u || p(u.values) !== p(i.values)) && C(`"${d.input.label}" wouldn't load with those values.`, "Tell the user to change the filter's default in the editor.");
|
|
2079
2146
|
} else
|
|
2080
|
-
(
|
|
2147
|
+
(St(d.input.filter.dataType) ? i.period === null : i.values === null) && u && C(`"${d.input.label}" would still load with a default.`, "Tell the user to change the filter's default in the editor.");
|
|
2081
2148
|
}
|
|
2082
2149
|
return s;
|
|
2083
2150
|
}
|
|
2084
|
-
function
|
|
2085
|
-
const
|
|
2086
|
-
if (!e ||
|
|
2087
|
-
const
|
|
2088
|
-
return
|
|
2151
|
+
function Ms(e, t, a, s) {
|
|
2152
|
+
const r = Object.fromEntries(Object.entries(t).filter(([, y]) => y != null)), n = xe(r), i = xe(e), d = (y) => mt[y].safeParse(r);
|
|
2153
|
+
if (!e || n && n !== i) {
|
|
2154
|
+
const y = n ?? i, C = y ? d(y) : void 0;
|
|
2155
|
+
return C != null && C.success ? C.data : s({
|
|
2089
2156
|
code: e ? "query_form_mismatch" : "type_not_supported",
|
|
2090
2157
|
message: e ? "This patch changes the query's form (measures, records or SQL) without a complete query." : "This card's current query can't be patched; send a complete query.",
|
|
2091
2158
|
path: a,
|
|
2092
2159
|
fix: "Send a complete query of the new form: domainId, datasetName and measures (or columns), or connectionId and sql."
|
|
2093
2160
|
});
|
|
2094
2161
|
}
|
|
2095
|
-
const
|
|
2096
|
-
for (const [
|
|
2097
|
-
|
|
2098
|
-
const
|
|
2099
|
-
if (!
|
|
2100
|
-
const
|
|
2162
|
+
const u = { ...e };
|
|
2163
|
+
for (const [y, C] of Object.entries(t))
|
|
2164
|
+
C !== void 0 && (C === null ? delete u[y] : u[y] = C);
|
|
2165
|
+
const b = mt[i].safeParse(u);
|
|
2166
|
+
if (!b.success) {
|
|
2167
|
+
const y = b.error.issues[0];
|
|
2101
2168
|
return s({
|
|
2102
|
-
code: (
|
|
2103
|
-
message: (
|
|
2104
|
-
path:
|
|
2169
|
+
code: (y == null ? void 0 : y.code) === "unrecognized_keys" ? "query_form_mismatch" : "invalid_change",
|
|
2170
|
+
message: (y == null ? void 0 : y.message) ?? "The merged query is not valid.",
|
|
2171
|
+
path: y ? Et(a, y) : a,
|
|
2105
2172
|
fix: "Patch only keys of the card's query form, or send a complete query of a new form."
|
|
2106
2173
|
});
|
|
2107
2174
|
}
|
|
2108
|
-
return
|
|
2109
|
-
}
|
|
2110
|
-
function
|
|
2111
|
-
return e ? (e.forEach((s,
|
|
2112
|
-
}
|
|
2113
|
-
function
|
|
2114
|
-
["date", "datetime", "timestamp"].some((
|
|
2115
|
-
const
|
|
2116
|
-
if (!
|
|
2117
|
-
const
|
|
2118
|
-
if (!
|
|
2119
|
-
const
|
|
2175
|
+
return b.data;
|
|
2176
|
+
}
|
|
2177
|
+
function gt(e, t, a) {
|
|
2178
|
+
return e ? (e.forEach((s, r) => a(s, `${t}.sheetIds[${r}]`)), { kind: "sheets", sheetIds: [...e] }) : { kind: "allSheets", sheetKinds: ["dashboard"] };
|
|
2179
|
+
}
|
|
2180
|
+
function bt(e, t, a, s) {
|
|
2181
|
+
["date", "datetime", "timestamp"].some((i) => Pe(t.dataType).includes(i)) || s({ code: "invalid_change", message: "defaultPeriod is for date filters.", path: a, fix: "Use defaultValues for this field." });
|
|
2182
|
+
const n = vt(e);
|
|
2183
|
+
if (!n) {
|
|
2184
|
+
const i = "anchor" in e && e.anchor === "latest_available";
|
|
2185
|
+
if (!i && Ra(e)) {
|
|
2186
|
+
const d = e.unit;
|
|
2120
2187
|
return s({
|
|
2121
2188
|
code: "invalid_change",
|
|
2122
|
-
message: `A filter's default can't count a partial ${
|
|
2189
|
+
message: `A filter's default can't count a partial ${d} back from now; its presets are whole days with today, complete ${d}s, or a calendar ${d}.`,
|
|
2123
2190
|
path: a,
|
|
2124
|
-
fix: `Use completeness "complete_periods", days ({ unit: "day", value: N }), or { kind: "calendar", unit: "${
|
|
2191
|
+
fix: `Use completeness "complete_periods", days ({ unit: "day", value: N }), or { kind: "calendar", unit: "${d}", period: "this", toDate: true }; ask the user which they mean.`
|
|
2125
2192
|
});
|
|
2126
2193
|
}
|
|
2127
2194
|
return s({
|
|
2128
2195
|
code: "invalid_change",
|
|
2129
|
-
message:
|
|
2196
|
+
message: i ? "A filter's default runs to now, not to the latest available data." : "This period can't be a filter's default.",
|
|
2130
2197
|
path: a,
|
|
2131
|
-
fix:
|
|
2198
|
+
fix: i ? "Leave out anchor (a filter default runs to now)." : 'Use days ({ unit: "day", value: N }), complete periods, or a calendar window ({ kind: "calendar", unit, period }).'
|
|
2132
2199
|
});
|
|
2133
2200
|
}
|
|
2134
|
-
return
|
|
2201
|
+
return n;
|
|
2135
2202
|
}
|
|
2136
|
-
async function
|
|
2137
|
-
const
|
|
2138
|
-
if (!
|
|
2139
|
-
return
|
|
2203
|
+
async function Ls(e, t, a, s, r) {
|
|
2204
|
+
const n = ha(e), i = n.kind === "config" ? n.executableSources : n.kind === "sql" ? n.pinnedCatalogSources.map((_) => _.source) : [], d = fe(e), u = typeof t == "string" ? (d == null ? void 0 : d.kind) === "semantic" ? d.datasetName : void 0 : t.datasetName, b = i.find((_) => _.kind === "semantic" && Pe(_.datasetName) === Pe(u));
|
|
2205
|
+
if (!b || b.kind !== "semantic")
|
|
2206
|
+
return r({
|
|
2140
2207
|
code: "field_not_found",
|
|
2141
|
-
message: `"${e.title}" doesn't read ${
|
|
2208
|
+
message: `"${e.title}" doesn't read ${u ? `the dataset ${u}` : "a dataset"}.`,
|
|
2142
2209
|
path: s,
|
|
2143
2210
|
fix: "Name a field of the card's own dataset, or { name, datasetName } for a dataset its query joins."
|
|
2144
2211
|
});
|
|
2145
|
-
const
|
|
2146
|
-
return
|
|
2212
|
+
const y = await a.loadCardSource({ domainId: b.domainId, datasetName: b.datasetName }), C = typeof t == "string" ? t : t.name, p = y ? _t(y.fields, C, b.datasetName) : void 0, $ = p ? Mt(b, { column_name: p.name, data_type: p.dataType, ...p.sourceField ? { sourceField: p.sourceField } : {} }) : void 0;
|
|
2213
|
+
return $ || r({
|
|
2147
2214
|
code: "field_not_found",
|
|
2148
|
-
message: `"${
|
|
2215
|
+
message: `"${C}" isn't a field of ${b.datasetName}.`,
|
|
2149
2216
|
path: s,
|
|
2150
2217
|
fix: "Use one of details.available, or read semaphor_get_dataset_schema.",
|
|
2151
|
-
details: { available: ((
|
|
2218
|
+
details: { available: ((y == null ? void 0 : y.fields) ?? []).slice(0, 20).map((_) => _.name) }
|
|
2152
2219
|
});
|
|
2153
2220
|
}
|
|
2154
|
-
const
|
|
2155
|
-
function
|
|
2156
|
-
var
|
|
2157
|
-
const a = (
|
|
2158
|
-
(
|
|
2159
|
-
),
|
|
2160
|
-
(e.sheets ?? []).flatMap((
|
|
2161
|
-
),
|
|
2162
|
-
(
|
|
2163
|
-
},
|
|
2164
|
-
sheetId:
|
|
2165
|
-
title:
|
|
2166
|
-
kind:
|
|
2167
|
-
...
|
|
2168
|
-
cards:
|
|
2169
|
-
var
|
|
2170
|
-
const
|
|
2171
|
-
if (
|
|
2172
|
-
const
|
|
2173
|
-
return
|
|
2174
|
-
...
|
|
2175
|
-
type:
|
|
2176
|
-
...
|
|
2221
|
+
const Bs = 50;
|
|
2222
|
+
function gi(e, t) {
|
|
2223
|
+
var p, $;
|
|
2224
|
+
const a = (p = t.sheetIds) != null && p.length ? new Set(t.sheetIds) : void 0, s = ($ = t.cardIds) != null && $.length ? new Set(t.cardIds) : void 0, r = (e.sheets ?? []).filter((_) => !a || a.has(_.id)), n = re(e).filter(
|
|
2225
|
+
(_) => (!a || a.has(_.sheetId)) && (!s || s.has(_.cardId))
|
|
2226
|
+
), i = n.length > (t.maxQueryCards ?? Bs), d = new Map(
|
|
2227
|
+
(e.sheets ?? []).flatMap((_) => (_.frames ?? []).map((g) => [g.id, g]))
|
|
2228
|
+
), u = /* @__PURE__ */ new Map(), b = (_) => {
|
|
2229
|
+
(_ == null ? void 0 : _.kind) === "semantic" && u.set(`${_.domainId}|${_.datasetName}`, { domainId: _.domainId, datasetName: _.datasetName });
|
|
2230
|
+
}, y = r.map((_) => ({
|
|
2231
|
+
sheetId: _.id,
|
|
2232
|
+
title: _.title ?? "",
|
|
2233
|
+
kind: _.kind === "document" ? "document" : "dashboard",
|
|
2234
|
+
..._.kind === "document" ? {} : { layout: Vs(_) },
|
|
2235
|
+
cards: n.filter((g) => g.sheetId === _.id).map((g) => {
|
|
2236
|
+
var D;
|
|
2237
|
+
const A = g.card, c = g.kind === "frameCard" ? (D = d.get(g.frameId)) == null ? void 0 : D.visualId : void 0, m = c ? { linkedVisualId: c } : {}, F = { cardId: g.cardId, title: A.title ?? "" };
|
|
2238
|
+
if (g.kind !== "frameCard") {
|
|
2239
|
+
const N = fe(A);
|
|
2240
|
+
return b(N), {
|
|
2241
|
+
...F,
|
|
2242
|
+
type: Oe(A.type),
|
|
2243
|
+
...N ? { source: N } : {},
|
|
2177
2244
|
editable: !1,
|
|
2178
|
-
notEditable:
|
|
2245
|
+
notEditable: g.kind === "documentSectionCard" ? { reason: "document_section", message: "Cards in Document sections can't be changed through the MCP yet. Change them in the editor." } : {
|
|
2179
2246
|
reason: "not_expressible",
|
|
2180
2247
|
message: "This card isn't in a tile, so it can't be changed through the MCP. Change it in the editor.",
|
|
2181
2248
|
detail: "a card outside a tile"
|
|
2182
2249
|
}
|
|
2183
2250
|
};
|
|
2184
2251
|
}
|
|
2185
|
-
const
|
|
2186
|
-
return
|
|
2187
|
-
...
|
|
2188
|
-
type:
|
|
2189
|
-
source:
|
|
2190
|
-
...
|
|
2252
|
+
const k = oe(A, { sql: t.sql });
|
|
2253
|
+
return b(k.source), k.editable ? {
|
|
2254
|
+
...F,
|
|
2255
|
+
type: k.type,
|
|
2256
|
+
source: k.source,
|
|
2257
|
+
...m,
|
|
2191
2258
|
editable: !0,
|
|
2192
|
-
...
|
|
2259
|
+
...i ? {} : { query: k.query, ...k.matrix ? { matrix: k.matrix } : {} }
|
|
2193
2260
|
} : {
|
|
2194
|
-
...
|
|
2195
|
-
type:
|
|
2196
|
-
...
|
|
2197
|
-
...
|
|
2261
|
+
...F,
|
|
2262
|
+
type: k.type,
|
|
2263
|
+
...k.source ? { source: k.source } : {},
|
|
2264
|
+
...m,
|
|
2198
2265
|
editable: !1,
|
|
2199
|
-
notEditable: { reason:
|
|
2266
|
+
notEditable: { reason: k.reason, message: k.message, ...k.detail ? { detail: k.detail } : {} }
|
|
2200
2267
|
};
|
|
2201
2268
|
})
|
|
2202
|
-
})),
|
|
2203
|
-
|
|
2204
|
-
|
|
2269
|
+
})), C = Rt(e, Ft(t.calendar, t.updatedAt), {
|
|
2270
|
+
...t.relationshipReach ? { relationshipReach: t.relationshipReach } : {}
|
|
2271
|
+
});
|
|
2272
|
+
for (const _ of C)
|
|
2273
|
+
_.editable && u.set(`${_.domainId}|${_.datasetName}`, { domainId: _.domainId, datasetName: _.datasetName });
|
|
2205
2274
|
return {
|
|
2206
2275
|
dashboardId: t.dashboardId,
|
|
2207
2276
|
title: e.title ?? "",
|
|
2208
2277
|
updatedAt: t.updatedAt,
|
|
2209
2278
|
access: t.access,
|
|
2210
|
-
datasets: [...
|
|
2211
|
-
sheets:
|
|
2212
|
-
filters:
|
|
2213
|
-
...
|
|
2279
|
+
datasets: [...u.values()],
|
|
2280
|
+
sheets: y,
|
|
2281
|
+
filters: C,
|
|
2282
|
+
...i ? { truncated: !0 } : {}
|
|
2214
2283
|
};
|
|
2215
2284
|
}
|
|
2216
|
-
function
|
|
2285
|
+
function Vs(e) {
|
|
2217
2286
|
const t = new Map((e.frames ?? []).map((a) => [a.id, a]));
|
|
2218
|
-
return
|
|
2287
|
+
return Oa(e).rows.map((a) => ({
|
|
2219
2288
|
tiles: a.tiles.map((s) => {
|
|
2220
|
-
var
|
|
2221
|
-
const
|
|
2222
|
-
return { cardIds:
|
|
2289
|
+
var d, u;
|
|
2290
|
+
const r = ((d = t.get(s.frameId)) == null ? void 0 : d.cards) ?? [], n = (u = t.get(s.frameId)) == null ? void 0 : u.activeCardId, i = r.map((b) => b.id);
|
|
2291
|
+
return { cardIds: n && i.includes(n) ? [n, ...i.filter((b) => b !== n)] : i, width: s.width };
|
|
2223
2292
|
})
|
|
2224
2293
|
}));
|
|
2225
2294
|
}
|
|
2226
2295
|
export {
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2296
|
+
Ui as AGGREGATES,
|
|
2297
|
+
ji as AUTOMATIC_TEMPORAL_BUCKET_FORMAT,
|
|
2298
|
+
zi as CALCULATED_FIELDS_GROUP_ID,
|
|
2299
|
+
Qi as CALCULATED_FIELDS_GROUP_NAME,
|
|
2300
|
+
Ki as CARD_CONFIG_KEY_CLASSES,
|
|
2301
|
+
Hi as CARD_KEY_CLASSES,
|
|
2302
|
+
_a as CARD_QUERY_CONFIG_KEYS,
|
|
2303
|
+
hi as CARD_QUERY_REQUEST_DESCRIPTIVE_FIELDS,
|
|
2304
|
+
ui as CARD_QUERY_REQUEST_EXECUTED_FIELDS,
|
|
2305
|
+
Wi as CARD_TYPES,
|
|
2237
2306
|
ce as CARD_TYPE_RULES,
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2307
|
+
Yi as COLUMN_KEY_CLASSES,
|
|
2308
|
+
Xi as COLUMN_PRESENTATION_KEYS,
|
|
2309
|
+
Ji as CONTROL_BINDING_MAPPING_MISSING_ERROR_CODE,
|
|
2310
|
+
Zi as CONTROL_BINDING_TARGET_INVALID_ERROR_CODE,
|
|
2311
|
+
en as CONTROL_BINDING_VALUE_INVALID_ERROR_CODE,
|
|
2312
|
+
tn as CONTROL_CONTEXT_UNSUPPORTED_ERROR_CODE,
|
|
2313
|
+
an as CONTROL_DEFINITION_DUPLICATE_ERROR_CODE,
|
|
2314
|
+
sn as CONTROL_DEFINITION_INVALID_ERROR_CODE,
|
|
2315
|
+
nn as CONTROL_PLACEHOLDER_QUOTED_ERROR_CODE,
|
|
2316
|
+
on as CONTROL_REFERENCE_MISSING_ERROR_CODE,
|
|
2317
|
+
rn as CONTROL_VALUE_INVALID_ERROR_CODE,
|
|
2318
|
+
dn as CONTROL_VALUE_MISSING_ERROR_CODE,
|
|
2250
2319
|
W as CardQueryRequestError,
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2320
|
+
ln as ControlResolutionError,
|
|
2321
|
+
it as DASHBOARD_AUTHORING_MAX_GENERATED_CARDS,
|
|
2322
|
+
cn as DASHBOARD_CHANGE_OPS,
|
|
2323
|
+
un as DASHBOARD_DEFAULT_OPTION_DEPENDENCIES,
|
|
2324
|
+
xr as DASHBOARD_FILTER_OPERATIONS,
|
|
2325
|
+
hn as DASHBOARD_INPUT_RUNTIME_SCOPE_KINDS,
|
|
2326
|
+
Dr as DOCUMENT_KPI_SECTION_MAX_CARDS,
|
|
2327
|
+
Tr as DOCUMENT_KPI_SECTION_MAX_TILES,
|
|
2328
|
+
fn as DashboardFilterMappingContractError,
|
|
2329
|
+
pn as ExecutionControlContractError,
|
|
2330
|
+
mn as FILTER_OPERATORS,
|
|
2331
|
+
gn as FilterModelError,
|
|
2332
|
+
ot as MAX_PROPOSED_CHANGES,
|
|
2333
|
+
bn as MAX_QUERY_LIMIT,
|
|
2334
|
+
yi as NEW_CARD_TYPE,
|
|
2335
|
+
In as QUERY_ASPECTS,
|
|
2336
|
+
yn as QUERY_CONFIG_KEY_ASPECTS,
|
|
2337
|
+
_i as RELATIONSHIP_ROUTE_CHANGED_MESSAGE,
|
|
2338
|
+
_n as SEMAPHOR_CARTESIAN_CHART_TYPES,
|
|
2339
|
+
Cn as TIME_GRAINS,
|
|
2340
|
+
Sn as TOOLBAR_FILTER_REACH_FIELDS,
|
|
2341
|
+
vn as analyticsFilterSchema,
|
|
2342
|
+
Nr as applyCardReferenceRemapping,
|
|
2343
|
+
nt as applyDashboardOperations,
|
|
2344
|
+
qr as applyFilterApplicability,
|
|
2345
|
+
Ci as applyFilterSettingsChange,
|
|
2346
|
+
Pr as applyGroupByOverride,
|
|
2347
|
+
wn as applyLinkedClickToFilterOverrides,
|
|
2348
|
+
xn as applyOptionDependencyOverride,
|
|
2349
|
+
Si as buildCardExportFormatOptions,
|
|
2350
|
+
Mr as buildCardExportQueryContext,
|
|
2351
|
+
vi as buildCardExportRequest,
|
|
2352
|
+
wi as buildCardExportRequestFromOptions,
|
|
2353
|
+
xi as buildColumnCatalog,
|
|
2354
|
+
Dn as buildControlDefinitionIndex,
|
|
2355
|
+
ha as buildDashboardCardSourceIndex,
|
|
2356
|
+
Di as buildEntityColumnGroup,
|
|
2357
|
+
Ti as buildFilterInputFromDefinition,
|
|
2358
|
+
qt as buildFilterInputFromField,
|
|
2359
|
+
Tn as buildLinkedClickToFilterOverrides,
|
|
2360
|
+
kn as buildProposeChangeInputSchema,
|
|
2361
|
+
$n as buildSavedEditorCard,
|
|
2362
|
+
ki as buildTableExportFormatOptions,
|
|
2363
|
+
Fn as cardQueryPatchSchema,
|
|
2364
|
+
An as cardTypeSentenceName,
|
|
2365
|
+
Ca as changeCardType,
|
|
2366
|
+
Rn as changeMatrixEditor,
|
|
2367
|
+
Lt as clickToFilterSettingsSchema,
|
|
2368
|
+
Lr as collectJoinPlanIdentifiers,
|
|
2369
|
+
sa as columnDataset,
|
|
2370
|
+
Sa as columnFieldKey,
|
|
2371
|
+
Da as columnKeys,
|
|
2372
|
+
li as compileDashboardFromPlan,
|
|
2373
|
+
Br as composeCardReferenceRemapping,
|
|
2374
|
+
En as controlBindingExecutionSchema,
|
|
2375
|
+
On as controlDefinitionExecutionSchema,
|
|
2376
|
+
la as controlRefusal,
|
|
2377
|
+
Nn as createDashboardFilterBindingId,
|
|
2378
|
+
nd as createMatrixAuthoringDraft,
|
|
2379
|
+
od as createMatrixConfig,
|
|
2380
|
+
Pt as createNewCard,
|
|
2311
2381
|
Ve as dashboardAuthoringDatasetMatchesSource,
|
|
2312
|
-
|
|
2382
|
+
ri as dashboardAuthoringFieldsReferToSameTarget,
|
|
2313
2383
|
J as dashboardAuthoringSourceFromField,
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2384
|
+
ni as dashboardAuthoringSourceKey,
|
|
2385
|
+
wt as dashboardAuthoringSourcesReferToSameDataset,
|
|
2386
|
+
qn as dashboardCardFilterSourceInventoryContains,
|
|
2387
|
+
ia as dashboardChangeSchema,
|
|
2388
|
+
Pn as dashboardFilterTargetMatchesLogicalValue,
|
|
2389
|
+
kr as dashboardFilterValueTypeForDataType,
|
|
2390
|
+
Mn as dashboardGenerateSchema,
|
|
2391
|
+
Zt as dashboardInputScopeIncludesDocumentSheets,
|
|
2392
|
+
ci as dashboardPlanFromSemaphorDashboardIntent,
|
|
2393
|
+
Ln as defaultClickToFilterSettings,
|
|
2394
|
+
Vr as describeDashboardFilterCardReach,
|
|
2395
|
+
ve as describeDashboardFilterCardReachDetail,
|
|
2396
|
+
da as describeQueryChange,
|
|
2397
|
+
$i as describeRelationshipRoute,
|
|
2398
|
+
Fi as describeRelationshipSkip,
|
|
2399
|
+
Bn as doesDashboardInputApplyToTarget,
|
|
2400
|
+
Vn as doesDashboardInputSurviveCarriedContext,
|
|
2401
|
+
Gn as doesToolbarFilterReachTab,
|
|
2402
|
+
Ai as domainCalculatedFields,
|
|
2403
|
+
Un as dropMatrixEditorField,
|
|
2404
|
+
aa as fieldIdentityKey,
|
|
2405
|
+
jn as fieldRefSchema,
|
|
2406
|
+
Gr as filterApplicabilityContextForCard,
|
|
2407
|
+
Ri as filterReachPreviewAnswers,
|
|
2408
|
+
Ur as filterValueReachForCard,
|
|
2409
|
+
zn as filterValueSemanticDataset,
|
|
2410
|
+
_t as findCatalogField,
|
|
2411
|
+
di as findDashboardAuthoringDatasetForSource,
|
|
2412
|
+
Qn as findDashboardCardExecutableSource,
|
|
2413
|
+
Kn as findDashboardCardPinnedCatalogSource,
|
|
2414
|
+
Hn as findDashboardSqlPinnedCatalogSource,
|
|
2415
|
+
ta as findSortedColumn,
|
|
2416
|
+
Ei as flattenEntityColumns,
|
|
2417
|
+
Wn as foldPrototypeDocumentInputs,
|
|
2418
|
+
Yn as formatFilterModelIssues,
|
|
2419
|
+
Qt as formatResolvedPrimaryDateFieldIssues,
|
|
2420
|
+
jr as formatSkippedFilterWarnings,
|
|
2421
|
+
Oi as getCalculatedFieldAggregateOverrides,
|
|
2422
|
+
Xn as getCalculatedFieldNamespace,
|
|
2423
|
+
Ni as getCalculatedFieldParameters,
|
|
2424
|
+
qi as getCalculatedFieldShelfOverrides,
|
|
2425
|
+
Jn as getCardDefinition,
|
|
2426
|
+
Zn as getColumnCatalogFieldId,
|
|
2427
|
+
Ya as getDashboardAuthoringCardSource,
|
|
2428
|
+
Pi as getDashboardFilterSubscriptionHint,
|
|
2429
|
+
eo as getDashboardGlobalDateFilter,
|
|
2430
|
+
$r as getDocumentKpiSectionShapeIssues,
|
|
2431
|
+
Fr as getDocumentSectionCards,
|
|
2432
|
+
Mi as getDomainCalculatedSelectionOverrides,
|
|
2433
|
+
to as getFieldAggregationOptions,
|
|
2434
|
+
ao as getMatrixBindingTargets,
|
|
2435
|
+
rd as getMatrixLevelLabel,
|
|
2436
|
+
dd as getMatrixMeasureLabel,
|
|
2437
|
+
so as getStableDomainCalculatedFieldId,
|
|
2438
|
+
io as getTemporalBucketAuthoringOptions,
|
|
2439
|
+
no as getTemporalBucketAuthoringSelection,
|
|
2440
|
+
oo as handleSchema,
|
|
2441
|
+
Li as hasDashboardFilterSubscription,
|
|
2442
|
+
ro as hasToolbarFilterReachField,
|
|
2443
|
+
zr as hostFilterValueFor,
|
|
2444
|
+
Qr as hostFilterValuesToSlots,
|
|
2445
|
+
Kr as isAdHocFilterValueOnTab,
|
|
2446
|
+
lo as isAllowedDashboardInputScopeCombination,
|
|
2447
|
+
co as isCardType,
|
|
2448
|
+
Ar as isDashboardFilterOperationCompatible,
|
|
2449
|
+
yt as isDashboardInputOnTab,
|
|
2450
|
+
uo as isDashboardInputOwnedBySheet,
|
|
2451
|
+
jt as isDashboardInputScopeEmpty,
|
|
2452
|
+
ho as isGroupedDate,
|
|
2453
|
+
fo as isHiddenFilterInput,
|
|
2454
|
+
me as isMaterializableDashboardAuthoringSource,
|
|
2455
|
+
po as isPresentationCurrencyBinding,
|
|
2456
|
+
mo as isSemanticAutoJoinCard,
|
|
2457
|
+
go as isSemaphorCartesianChartType,
|
|
2458
|
+
Va as isSemaphorSourceRef,
|
|
2459
|
+
bo as isStructuralControlBinding,
|
|
2460
|
+
Io as isValidControlOptionPresentation,
|
|
2461
|
+
ea as labelAt,
|
|
2462
|
+
yo as layoutArrangeSchema,
|
|
2463
|
+
_o as linkedClickToFilterOverridesSchema,
|
|
2464
|
+
Hr as listAdHocFilterValuesOnTab,
|
|
2389
2465
|
re as listDashboardCardLocations,
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2466
|
+
Co as listDashboardFilterDefinitions,
|
|
2467
|
+
So as listDashboardFilterInputsOnTab,
|
|
2468
|
+
vo as listDashboardInputReachKeys,
|
|
2469
|
+
Yt as listDashboardInputScopeExceptedCardIds,
|
|
2470
|
+
Jt as listDashboardInputScopeExceptedSheetIds,
|
|
2395
2471
|
Me as listDashboardTabTargets,
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2472
|
+
Wr as listFilterInputValueTargets,
|
|
2473
|
+
wo as listStoredFilterDefinitions,
|
|
2474
|
+
Rr as mapDocumentSectionCards,
|
|
2475
|
+
xo as matchColumns,
|
|
2476
|
+
Yr as matrixCatalogSources,
|
|
2477
|
+
xa as matrixColumnKeys,
|
|
2478
|
+
Do as matrixColumnsSchema,
|
|
2479
|
+
hd as matrixDefinitionFields,
|
|
2480
|
+
fd as matrixDefinitionSources,
|
|
2481
|
+
To as matrixEditorCatalogFromFields,
|
|
2482
|
+
Xr as matrixExecutionSources,
|
|
2483
|
+
ko as measureRefSchema,
|
|
2484
|
+
we as mergeDashboardAuthoringSources,
|
|
2485
|
+
ld as mergeMatrixSorts,
|
|
2486
|
+
ma as metricCardQuerySchema,
|
|
2487
|
+
wa as moveMatrixLevel,
|
|
2488
|
+
$o as normalizeClickToFilterSettings,
|
|
2489
|
+
Fo as normalizeDashboardInputs,
|
|
2490
|
+
Ao as normalizeLegacyLinkedTargetOverrides,
|
|
2491
|
+
Ro as occurrenceKeys,
|
|
2492
|
+
Ft as outlineCalendar,
|
|
2493
|
+
gi as outlineDashboard,
|
|
2494
|
+
pe as outlineFilter,
|
|
2495
|
+
Rt as outlineFilters,
|
|
2496
|
+
pi as parseCardQueryRequest,
|
|
2497
|
+
ks as parseCardQueryRequestContext,
|
|
2498
|
+
fi as parseCardQueryRequestExtras,
|
|
2499
|
+
Eo as parseExecutionControlBindingsShallow,
|
|
2500
|
+
Ht as parseExecutionControlContext,
|
|
2501
|
+
Oo as parseExecutionControlContract,
|
|
2502
|
+
ca as planCardLabels,
|
|
2503
|
+
lt as planCardRequery,
|
|
2504
|
+
Bi as pluralDatasetLabel,
|
|
2505
|
+
Ga as preferDashboardAuthoringSourceMetadata,
|
|
2506
|
+
oi as preferredDashboardAuthoringSource,
|
|
2507
|
+
Jr as prepareLoadedDashboard,
|
|
2508
|
+
No as previewTemporalBucketAuthoringFormat,
|
|
2509
|
+
qo as proposedChangeSchema,
|
|
2510
|
+
Zr as pruneUnrelatedCalculatedFilters,
|
|
2511
|
+
ua as queryForm,
|
|
2435
2512
|
oe as readCardQuery,
|
|
2436
|
-
|
|
2513
|
+
fe as readCardSource,
|
|
2437
2514
|
de as readDashboardFilterModel,
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2515
|
+
Po as readExactDomainCalculatedFieldReference,
|
|
2516
|
+
Vi as readFilterReachResponse,
|
|
2517
|
+
ed as readFilterValueList,
|
|
2518
|
+
pd as readMatrixCardConfig,
|
|
2519
|
+
Mo as rebindDashboardOptionDependencyInputId,
|
|
2520
|
+
dt as rebuildsRole,
|
|
2521
|
+
Lo as reconcileMatrixSpecStructure,
|
|
2522
|
+
Bo as reconcileTemporalBucketAuthoringFormat,
|
|
2523
|
+
pa as recordsCardQuerySchema,
|
|
2524
|
+
Vo as refDataset,
|
|
2447
2525
|
ne as refKey,
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2526
|
+
ut as refName,
|
|
2527
|
+
Go as relationshipAddSchema,
|
|
2528
|
+
Uo as relationshipRouteTarget,
|
|
2529
|
+
jo as relativeToTimeWindow,
|
|
2530
|
+
Vt as remapClickToFilterReferences,
|
|
2531
|
+
zo as remapLinkedClickToFilterOverrides,
|
|
2532
|
+
Qo as requireNormalizedDashboardInputs,
|
|
2533
|
+
Ko as resolveBindingControlValue,
|
|
2534
|
+
Cr as resolveCanonicalDetailResultRawKey,
|
|
2535
|
+
Sr as resolveCanonicalResultOutputKey,
|
|
2536
|
+
vr as resolveCanonicalResultRawKey,
|
|
2537
|
+
Ua as resolveDashboardAuthoringSource,
|
|
2538
|
+
mi as resolveDashboardChanges,
|
|
2539
|
+
Ho as resolveDashboardEntitySource,
|
|
2540
|
+
Wo as resolveDashboardFilterAutomaticTarget,
|
|
2541
|
+
Yo as resolveDashboardFilterInheritedTarget,
|
|
2542
|
+
Xo as resolveDashboardOptionDependencies,
|
|
2543
|
+
Jo as resolveDashboardOptionPopulation,
|
|
2544
|
+
td as resolveDashboardSqlFilterTarget,
|
|
2545
|
+
Zo as resolveFieldSelectedSource,
|
|
2546
|
+
er as resolveGroupByFieldTarget,
|
|
2547
|
+
ad as resolveMatrixControlBindings,
|
|
2548
|
+
cd as resolveMatrixDefinition,
|
|
2549
|
+
tr as resolveMetricFieldTarget,
|
|
2550
|
+
ar as resolveScalarMappedValue,
|
|
2551
|
+
sr as resolveTemporalBucketAuthoringFormat,
|
|
2552
|
+
Kt as resolveTemporalResultOwner,
|
|
2553
|
+
Bt as respondsToSelectionsSchema,
|
|
2554
|
+
ir as retainMatrixConditionalFormatting,
|
|
2555
|
+
Ut as rewriteDashboardInputScopeIds,
|
|
2556
|
+
Fe as sameColumnKey,
|
|
2478
2557
|
Le as sameValue,
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2558
|
+
nr as selectDashboardOptionDependencyInputIds,
|
|
2559
|
+
or as selectionFieldFromExplorerField,
|
|
2560
|
+
rr as settableCardType,
|
|
2561
|
+
dr as sharedCardPreferences,
|
|
2562
|
+
fa as sqlCardQuerySchema,
|
|
2563
|
+
Ee as statedLabelsOf,
|
|
2564
|
+
lr as stripInstanceTargetsForLibrarySave,
|
|
2565
|
+
cr as structuralControlOverride,
|
|
2566
|
+
At as summarizeFilter,
|
|
2567
|
+
ur as supportsCanonicalDashboardTemporalResult,
|
|
2568
|
+
hr as timeWindowSchema,
|
|
2569
|
+
rt as toChartType,
|
|
2570
|
+
Oe as toPublicCardType,
|
|
2571
|
+
fr as toolbarFilterInputFields,
|
|
2572
|
+
pr as toolbarFilterScope,
|
|
2573
|
+
mr as transformComparisonDocument,
|
|
2574
|
+
va as updateMatrixConfig,
|
|
2575
|
+
sd as upgradeToStoredDashboard,
|
|
2576
|
+
gr as validateControlValue,
|
|
2577
|
+
Xa as validateDashboardAuthoringDatasetScope,
|
|
2578
|
+
Er as validateDashboardFilterValues,
|
|
2579
|
+
ns as validateDashboardPlan,
|
|
2580
|
+
zt as validateResolvedPrimaryDateFieldShape,
|
|
2581
|
+
br as withCardExcludedFromScope,
|
|
2582
|
+
Ir as withCardIncludedInScope,
|
|
2583
|
+
yr as withDashboardOptionDependencyOverride,
|
|
2584
|
+
na as withUnstatedScopeParts,
|
|
2585
|
+
Gt as withoutToolbarFilterReachFields
|
|
2507
2586
|
};
|