react-semaphor 0.1.586 → 0.1.587
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/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{assistant-chat-BU5gchFy.js → assistant-chat-pfJK-T0b.js} +5 -5
- package/dist/chunks/{bookmark-impact-ZPSGncK6.js → bookmark-impact-BSpGQL1M.js} +1 -1
- package/dist/chunks/{card-filter-builder-HELJWA4D.js → card-filter-builder-C8PbhHjq.js} +3 -3
- package/dist/chunks/{dashboard-BXP-ZxSY.js → dashboard-CVj1oMoW.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BGj42whr.js → dashboard-briefing-launcher-TqA58rKz.js} +6 -6
- package/dist/chunks/{dashboard-controls-zvbRp6D2.js → dashboard-controls-DQ8FsxAz.js} +7 -7
- package/dist/chunks/{dashboard-json-CykexgqL.js → dashboard-json-DM88pmk2.js} +1 -1
- package/dist/chunks/dates-5z3b9Loo.js +136 -0
- package/dist/chunks/{edit-dashboard-visual-C82JNxbt.js → edit-dashboard-visual-BpRnU_6G.js} +1946 -1920
- package/dist/chunks/{filter-reach-copy-ZERaFKsN.js → filter-reach-copy-0Xp97cLk.js} +31 -31
- package/dist/chunks/{index-otMIColV.js → index-D_QSeVKy.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-B-CoyS1x.js → report-preferences-dialog-CXKmWyLm.js} +7 -7
- package/dist/chunks/{resolve-dashboard-input-context-BTTdKXH0.js → resolve-dashboard-input-context-zEXuitoF.js} +2089 -2076
- package/dist/chunks/{saved-dashboard-context-B-rosN4W.js → saved-dashboard-context-Cll5LipJ.js} +2 -2
- package/dist/chunks/{semaphor-ready-indicator-Cy1n_04D.js → semaphor-ready-indicator-Bnj3H0Dm.js} +15160 -15091
- package/dist/chunks/{shelf-drop-preview-context-Bmz54WYm.js → shelf-drop-preview-context-B8rmn6BD.js} +2 -2
- package/dist/chunks/{stored-dashboard-rDJ8sw6J.js → stored-dashboard-CURqJgoa.js} +1 -1
- package/dist/chunks/{variable-draft-DvngkRMl.js → variable-draft-DIv-9y6Q.js} +2 -2
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +1202 -1191
- package/dist/index.js +11 -11
- package/dist/surfboard/index.js +1 -1
- package/dist/types/lib/types/explorer-types.d.ts +11 -4
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +10 -3
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +5 -2
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +5 -2
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/kpi-trend-rule.d.ts +74 -0
- package/package.json +1 -1
- package/dist/chunks/dates-CaqZtq01.js +0 -92
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
var _s = Object.defineProperty;
|
|
2
2
|
var Cs = (e, a, t) => a in e ? _s(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
3
3
|
var lt = (e, a, t) => Cs(e, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
-
import { _ as $s, $ as ws, a0 as xs, a1 as Ss, a2 as ks, a3 as qa, a4 as Ie, a5 as Ts, a6 as he, a7 as $e, a8 as la, a9 as ot, aa as Na, ab as Q, ac as
|
|
5
|
-
import { dF as Vr, bQ as
|
|
6
|
-
import { K as Eo, L as Wa, G as
|
|
7
|
-
import { ae as
|
|
8
|
-
import { L as
|
|
4
|
+
import { _ as $s, $ as ws, a0 as xs, a1 as Ss, a2 as ks, a3 as qa, a4 as Ie, a5 as Ts, a6 as he, a7 as $e, a8 as la, a9 as ot, aa as Na, ab as Q, ac as U, ad as Ee, ae as Rs, af as As, ag as Ft, ah as Fs, ai as Ds, aj as Os, ak as Es, al as qs, am as Ns, an as Pa, ao as Ps, ap as Ls, aq as Ms, ar as Bs, as as Vs, at as Ks, au as js, av as ca, aw as La, ax as ua, ay as we, az as be, aA as qe, aB as Ws, aC as Gs, aD as Us, o as Xe, aE as Qs, aF as Hs, aG as _t, aH as Ze, aI as zs, aJ as Ys, aK as Ma, aL as Dt, aM as Ct, aN as Js, aO as Xs, aP as Zs, aQ as ie, aR as Ba, aS as Va, aT as ct, aU as eo, aV as to, aW as fa, aX as $t, aY as ao, aZ as ma, a_ as so, a$ as ha, b0 as pa, b1 as et, b2 as ga, b3 as Fe, b4 as oo, b5 as He, m as no, b6 as Ka, b7 as io, b8 as ro, b9 as lo, ba as ja, a as co, bb as uo, bc as fo, bd as mo, be as ho, bf as po, bg as go, bh as bo, bi as yo, bj as vo, bk as Io, bl as _o, bm as ba, bn as Co, bo as $o, bp as wo, bq as xo, br as So, bs as ko, bt as To, bu as Ro, bv as Ao, bw as Fo, bx as Do, by as Oo } from "../chunks/resolve-dashboard-input-context-zEXuitoF.js";
|
|
5
|
+
import { dF as Vr, bQ as Kr, dh as jr, di as Wr, dx as Gr, dw as Ur, dr as Qr, eB as Hr, dy as zr, dz as Yr, d$ as Jr, cX as Xr, cY as Zr, cZ as ed, cU as td, cV as ad, cW as sd, cQ as od, cR as nd, cT as id, cS as rd, c_ as dd, dV as ld, dj as cd, cc as ud, e4 as fd, e5 as md, cb as hd, db as pd, dH as gd, cl as bd, eD as yd, c2 as vd, dY as Id, dK as _d, e6 as Cd, f2 as $d, fd as wd, f6 as xd, du as Sd, dv as kd, ci as Td, eN as Rd, eL as Ad, eM as Fd, bM as Dd, eZ as Od, dJ as Ed, co as qd, dQ as Nd, ch as Pd, fh as Ld, fi as Md, eq as Bd, dI as Vd, eQ as Kd, fm as jd, cF as Wd, f7 as Gd, dq as Ud, cj as Qd, ee as Hd, ef as zd, c$ as Yd, cG as Jd, dX as Xd, bG as Zd, e0 as el, eo as tl, dM as al, fr as sl, eR as ol, bH as nl, bP as il, e9 as rl, cA as dl, fk as ll, er as cl, dP as ul, ep as fl, d_ as ml, da as hl, d9 as pl, cg as gl, dW as bl, b_ as yl, c4 as vl, dU as Il, cJ as _l, cL as Cl, cx as $l, bE as wl, f8 as xl, fc as Sl, cp as kl, e3 as Tl, e1 as Rl, ek as Al, bI as Fl, es as Dl, e_ as Ol, dD as El, dE as ql, fn as Nl, fo as Pl, fq as Ll, cK as Ml, b$ as Bl, c0 as Vl, c1 as Kl, ck as jl, cm as Wl, fj as Gl, ey as Ul, de as Ql, f as Hl, cP as zl, c9 as Yl, cu as Jl, b as Xl, cM as Zl, df as ec, bS as tc, bT as ac, dO as sc, c8 as oc, eb as nc, cq as ic, bz as rc, cd as dc, ds as lc, bW as cc, dC as uc, c3 as fc, d5 as mc, eO as hc, fp as pc, bN as gc, d7 as bc, ec as yc, d8 as vc, eg as Ic, eG as _c, eF as Cc, dR as $c, cC as wc, ct as xc, cv as Sc, l as kc, cw as Tc, ew as Rc, dA as Ac, dN as Fc, bA as Dc, bB as Oc, bC as Ec, bJ as qc, f4 as Nc, e$ as Pc, dG as Lc, f0 as Mc, cz as Bc, ce as Vc, cI as Kc, dB as jc, ev as Wc, dc as Gc, dd as Uc, bR as Qc, fl as Hc, dL as zc, et as Yc, dg as Jc, eK as Xc, eI as Zc, J as eu, f3 as tu, c7 as au, f9 as su, fa as ou, dn as nu, cO as iu, bV as ru, e2 as du, dZ as lu, bD as cu, cD as uu, cE as fu, cf as mu, d1 as hu, bZ as pu, c5 as gu, c6 as bu, dk as yu, dl as vu, ca as Iu, bK as _u, bY as Cu, d3 as $u, eE as wu, eA as xu, fb as Su, d4 as ku, d2 as Tu, fe as Ru, bU as Au, eC as Fu, cB as Du, ez as Ou, cN as Eu, ed as qu, eP as Nu, dm as Pu, cy as Lu, dt as Mu, bF as Bu, bX as Vu, dS as Ku, eJ as ju, ea as Wu, cH as Gu, d6 as Uu, bO as Qu, dT as Hu, ff as zu, e8 as Yu, e7 as Ju, ex as Xu, eH as Zu, cn as ef, cs as tf, bL as af, f5 as sf, f1 as of, fg as nf, d0 as rf, eu as df, en as lf, dp as cf, em as uf, eT as ff, ej as mf, el as hf, cr as pf, eh as gf, ei as bf, eS as yf, eU as vf, eV as If, eW as _f, eX as Cf, eY as $f } from "../chunks/resolve-dashboard-input-context-zEXuitoF.js";
|
|
6
|
+
import { K as Eo, L as Wa, G as Ga, M as qo, N as No, O as Ot, P as Ua, Q as Qa, A as xe, R as Po, S as Lo, H as Mo, T as Bo } from "../chunks/bookmark-state-CL4WEpgB.js";
|
|
7
|
+
import { ae as xf, ay as Sf, Y as kf, Z as Tf, a8 as Rf, ac as Af, a9 as Ff, aa as Df, ab as Of, af as Ef, aw as qf, aq as Nf, D as Pf, au as Lf, F as Mf, a1 as Bf, I as Vf, ax as Kf, a4 as jf, a5 as Wf, as as Gf, ad as Uf, a2 as Qf, ao as Hf, at as zf, av as Yf, ap as Jf, ar as Xf, a0 as Zf, _ as em, ah as tm, am, W as sm, X as om, U as nm, a3 as im, an as rm, az as dm, ai as lm, ag as cm, aj as um, ak as fm, al as mm, a7 as hm, a6 as pm, $ as gm } from "../chunks/bookmark-state-CL4WEpgB.js";
|
|
8
|
+
import { L as ym, G as vm, H as Im, g as _m, F as Cm, q as $m, A as wm, D as xm, u as Sm, v as km, E as Tm, C as Rm, s as Am, t as Fm, p as Dm, B as Om, I as Em, w as qm, y as Nm, x as Pm, z as Lm } from "../chunks/stored-dashboard-CURqJgoa.js";
|
|
9
9
|
import { r as Vo, ac as ya } from "../chunks/pivot-result-contract-expectations-Bx_BCu-7.js";
|
|
10
|
-
import { aO as
|
|
11
|
-
import { f as
|
|
12
|
-
import { p as
|
|
13
|
-
import { r as Ha, D as Ia,
|
|
14
|
-
import { N as
|
|
10
|
+
import { aO as Bm, aN as Vm, aJ as Km, aM as jm, aP as Wm, aD as Gm } from "../chunks/pivot-result-contract-expectations-Bx_BCu-7.js";
|
|
11
|
+
import { f as Ko, w as jo, D as va, a as Wo } from "../chunks/metric-comparison-ZmurmEIs.js";
|
|
12
|
+
import { p as Go } from "../chunks/report-runtime-context-NlOXwyRB.js";
|
|
13
|
+
import { r as Ha, D as Ia, h as Uo, i as za, j as Qo, k as Ho, l as zo, f as wt, m as Yo, v as Jo } from "../chunks/filter-reach-copy-0Xp97cLk.js";
|
|
14
|
+
import { N as Qm, $ as Hm, S as zm, o as Ym, t as Jm, w as Xm, u as Zm, G as eh, C as th, n as ah, q as sh, J as oh, d as nh, a1 as ih, L as rh, M as dh, _ as lh, a0 as ch, E as uh, X as fh, F as mh, x as hh, y as ph, A as gh, p as bh, z as yh, R as vh, O as Ih, a2 as _h, Z as Ch, Y as $h, K as wh, H as xh, I as Sh, U as kh, T as Th, Q as Rh, V as Ah, P as Fh, s as Dh, W as Oh, B as Eh } from "../chunks/filter-reach-copy-0Xp97cLk.js";
|
|
15
15
|
import { a7 as Ya, r as Ja, aN as Xo, a_ as Ne, aL as Zo, aQ as en, aK as tn, aE as an, aM as sn, a5 as on } from "../chunks/validators-CJ8Jh0E8.js";
|
|
16
16
|
import "../chunks/schema-C9NPiIru.js";
|
|
17
|
-
import { i as Xa, C as
|
|
17
|
+
import { i as Xa, C as Ke, D as nn, e as rn, b as dn } from "../chunks/edit-9df1zOWe.js";
|
|
18
18
|
import "../chunks/matrix-operation-contract-BM5TveR3.js";
|
|
19
19
|
import { A as Le, B as ze, z as ln, f as cn, y as Et, t as Me, e as un } from "../chunks/analytics-base-schemas-BaIQrEzX.js";
|
|
20
20
|
import { A as _a, E as fn } from "../chunks/matrix-analytical-definition-DOVSFFuf.js";
|
|
21
21
|
import "zod";
|
|
22
22
|
import "../value-format-preferences/index.js";
|
|
23
|
-
import { C as
|
|
23
|
+
import { C as Nh, a as Ph, S as Lh } from "../chunks/pickers-DkqmtnTL.js";
|
|
24
24
|
import { r as mn } from "../chunks/index-CV_Kzou0.js";
|
|
25
25
|
import "../chunks/context-BTLBjQNh.js";
|
|
26
|
-
import { v as Ye, a as hn, i as Ca, o as ut, d as pn, b as gn, c as bn } from "../chunks/variable-draft-
|
|
27
|
-
import { S as
|
|
28
|
-
import {
|
|
29
|
-
import { b as
|
|
26
|
+
import { v as Ye, a as hn, i as Ca, o as ut, d as pn, b as gn, c as bn } from "../chunks/variable-draft-DIv-9y6Q.js";
|
|
27
|
+
import { S as Bh, f as Vh, g as Kh, e as jh, n as Wh } from "../chunks/variable-draft-DIv-9y6Q.js";
|
|
28
|
+
import { K as Uh, b as Qh, a as Hh, c as zh, d as Yh, e as Jh, r as Xh, f as Zh } from "../chunks/dates-5z3b9Loo.js";
|
|
29
|
+
import { b as tp, d as ap } from "../chunks/bookmark-impact-BSpGQL1M.js";
|
|
30
30
|
import { r as ye, b as yn, s as vn, a as In } from "../chunks/resolver-DG_tfEpt.js";
|
|
31
31
|
import { n as _n, r as Cn } from "../chunks/index-BVKzKl5d.js";
|
|
32
|
-
import { e as
|
|
32
|
+
import { e as op } from "../chunks/brand-BoUV0iHF.js";
|
|
33
33
|
const Sr = [
|
|
34
34
|
"cardType",
|
|
35
35
|
"sql",
|
|
@@ -67,13 +67,13 @@ function qt(e) {
|
|
|
67
67
|
function ve(e) {
|
|
68
68
|
return !e || typeof e != "object" || Array.isArray(e) ? {} : { ...e };
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function je(e) {
|
|
71
71
|
return typeof e == "string" ? e : "";
|
|
72
72
|
}
|
|
73
73
|
function $n(e, a = {}) {
|
|
74
74
|
const t = ve(e), s = qt(a), o = {};
|
|
75
75
|
if (t.calendarContext !== void 0) {
|
|
76
|
-
const i =
|
|
76
|
+
const i = Go(t.calendarContext);
|
|
77
77
|
if (!i.ok)
|
|
78
78
|
throw new ce(
|
|
79
79
|
`${s}calendarContext: ${i.issues.map((d) => d.message).join("; ")}`,
|
|
@@ -90,14 +90,14 @@ function $n(e, a = {}) {
|
|
|
90
90
|
n.issues
|
|
91
91
|
);
|
|
92
92
|
if (t.resolvedPrimaryDateField && (o.resolvedPrimaryDateField = t.resolvedPrimaryDateField), t.globalDateComparison !== void 0) {
|
|
93
|
-
const i =
|
|
93
|
+
const i = Ko(t.globalDateComparison);
|
|
94
94
|
if (!i.ok)
|
|
95
95
|
throw new ce(
|
|
96
96
|
`${s}Invalid globalDateComparison: ${i.errors.map((d) => `${d.path}: ${d.message}`).join("; ")}`,
|
|
97
97
|
"globalDateComparison",
|
|
98
98
|
i.errors
|
|
99
99
|
);
|
|
100
|
-
o.globalDateComparison =
|
|
100
|
+
o.globalDateComparison = jo(
|
|
101
101
|
t.globalDateComparison
|
|
102
102
|
);
|
|
103
103
|
}
|
|
@@ -136,30 +136,30 @@ function Tr(e, a = {}) {
|
|
|
136
136
|
return o;
|
|
137
137
|
}
|
|
138
138
|
function Rr(e, a = {}) {
|
|
139
|
-
const t = ve(e), s = qt(a), o = (
|
|
139
|
+
const t = ve(e), s = qt(a), o = (x) => new ce(`${s}${x} is required`, x), n = je(t.connection_id).trim();
|
|
140
140
|
if (!n) throw o("connection_id");
|
|
141
|
-
const i =
|
|
141
|
+
const i = je(t.cardType).trim();
|
|
142
142
|
if (!i) throw o("cardType");
|
|
143
143
|
const d = t.resultOwner;
|
|
144
144
|
if (d !== "config" && d !== "freeform" && d !== "none")
|
|
145
145
|
throw o("resultOwner");
|
|
146
|
-
const l = ve(t.cardConfig), c =
|
|
146
|
+
const l = ve(t.cardConfig), c = je(t.sql), h = je(t.python), p = !!a.configOptional || Object.keys(l).length > 0;
|
|
147
147
|
if (d === "config" && !p) throw o("cardConfig");
|
|
148
148
|
if (d === "freeform" && !c.trim()) throw o("sql");
|
|
149
|
-
const
|
|
149
|
+
const v = xs({
|
|
150
150
|
hasExecutableConfig: p,
|
|
151
151
|
sql: c,
|
|
152
152
|
normalizedPython: h
|
|
153
153
|
});
|
|
154
|
-
if (d !==
|
|
154
|
+
if (d !== v)
|
|
155
155
|
throw new ce(
|
|
156
|
-
`${s}resultOwner must match the normalized execution owner "${
|
|
156
|
+
`${s}resultOwner must match the normalized execution owner "${v}"`,
|
|
157
157
|
"resultOwner"
|
|
158
158
|
);
|
|
159
159
|
if (d === "none") throw o("cardConfig");
|
|
160
|
-
const
|
|
161
|
-
if (Object.keys(
|
|
162
|
-
const
|
|
160
|
+
const y = ve(t.cardDataSource);
|
|
161
|
+
if (Object.keys(y).length === 0) throw o("cardDataSource");
|
|
162
|
+
const S = Ss({
|
|
163
163
|
controlValues: t.controlValues,
|
|
164
164
|
controlDefinitions: t.controlDefinitions,
|
|
165
165
|
cardControlDefinitions: t.cardControlDefinitions,
|
|
@@ -172,12 +172,12 @@ function Rr(e, a = {}) {
|
|
|
172
172
|
python: h,
|
|
173
173
|
resultOwner: d,
|
|
174
174
|
cardConfig: l,
|
|
175
|
-
cardDataSource:
|
|
175
|
+
cardDataSource: y,
|
|
176
176
|
active_filters: Array.isArray(t.active_filters) ? t.active_filters : [],
|
|
177
|
-
controlValues:
|
|
178
|
-
controlDefinitions:
|
|
179
|
-
cardControlDefinitions:
|
|
180
|
-
controlBindings:
|
|
177
|
+
controlValues: S.controlValues,
|
|
178
|
+
controlDefinitions: S.controlDefinitions,
|
|
179
|
+
cardControlDefinitions: S.cardControlDefinitions,
|
|
180
|
+
controlBindings: S.controlBindings,
|
|
181
181
|
...$n(t, a),
|
|
182
182
|
...typeof t.sqlRowLimit == "number" && Number.isInteger(t.sqlRowLimit) && t.sqlRowLimit > 0 ? { sqlRowLimit: t.sqlRowLimit } : {}
|
|
183
183
|
};
|
|
@@ -193,12 +193,12 @@ function Ar(e) {
|
|
|
193
193
|
const h = n(["chart", "options", "borderRadius"]);
|
|
194
194
|
typeof h == "number" && (i.barCorners = De("barCorners", h, a));
|
|
195
195
|
for (const p of Za) {
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
const
|
|
201
|
-
|
|
196
|
+
const v = p === "light" ? ye(s, ["canvasTheme"]) : n(["canvasTheme"]), y = kn(v, a);
|
|
197
|
+
y !== void 0 && (i.canvas = { ...i.canvas, [p]: y });
|
|
198
|
+
const S = Sn(s, o, p);
|
|
199
|
+
if (S) {
|
|
200
|
+
const x = S.filter(Xa).map((E) => E.toLowerCase());
|
|
201
|
+
x.length < S.length && a.push({ field: "chartColors", kind: "dropped_colour", detail: `${p}: ${S.length - x.length} colours that aren't hex` }), x.length >= Ke.min && (i.chartColors = { ...i.chartColors, [p]: x.slice(0, Ke.max) }), x.length > Ke.max && a.push({ field: "chartColors", kind: "clamped", detail: `${p}: kept the first ${Ke.max} colours` });
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
return { style: xn(i, e.organizationAppearance, a), notes: a };
|
|
@@ -213,8 +213,8 @@ function xn(e, a, t) {
|
|
|
213
213
|
const h = wn.includes(n) && ye(Cn(a, l), i) !== void 0, p = JSON.stringify(ye(s.schemes[l], i)) === JSON.stringify(c);
|
|
214
214
|
if (!(!h && !p))
|
|
215
215
|
if ((d || l === "light") && t.push({ field: n, kind: h ? "brand_wins" : "equal_to_inherited", detail: d ? l : `${JSON.stringify(c)}` }), d) {
|
|
216
|
-
const
|
|
217
|
-
delete
|
|
216
|
+
const v = { ...o[n] };
|
|
217
|
+
delete v[l], Object.keys(v).length > 0 ? o[n] = v : delete o[n];
|
|
218
218
|
} else l === "light" && delete o[n];
|
|
219
219
|
}
|
|
220
220
|
}
|
|
@@ -292,11 +292,11 @@ function An(e, a, t = {}) {
|
|
|
292
292
|
}
|
|
293
293
|
for (const l of s.reachedCards({ inputId: a.id })) {
|
|
294
294
|
const c = $e(a, l.card, t), h = c.reach, p = () => {
|
|
295
|
-
const
|
|
295
|
+
const v = he(l.card);
|
|
296
296
|
return {
|
|
297
297
|
cardId: l.cardId,
|
|
298
298
|
title: l.card.title ?? "",
|
|
299
|
-
...(
|
|
299
|
+
...(v == null ? void 0 : v.kind) === "semantic" ? { datasetName: v.datasetName } : {}
|
|
300
300
|
};
|
|
301
301
|
};
|
|
302
302
|
switch (h) {
|
|
@@ -322,15 +322,15 @@ function An(e, a, t = {}) {
|
|
|
322
322
|
he(l.card) && i.notReached.push({ ...p(), ...c.reason ? { reason: c.reason } : {} });
|
|
323
323
|
break;
|
|
324
324
|
default: {
|
|
325
|
-
const
|
|
326
|
-
throw new Error(`Unhandled filter reach ${String(
|
|
325
|
+
const v = h;
|
|
326
|
+
throw new Error(`Unhandled filter reach ${String(v)}`);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
for (const l of s.reachedVariables({ inputId: a.id })) {
|
|
331
|
-
const c =
|
|
331
|
+
const c = Ga(e, l.variableId);
|
|
332
332
|
if ((c == null ? void 0 : c.kind) !== "variable") continue;
|
|
333
|
-
const h = $e(a, c.card, t), p = he(c.card),
|
|
333
|
+
const h = $e(a, c.card, t), p = he(c.card), v = { cardId: c.id, title: c.variable.name, ...(p == null ? void 0 : p.kind) === "semantic" ? { datasetName: p.datasetName } : {} };
|
|
334
334
|
switch (h.reach) {
|
|
335
335
|
case "bound":
|
|
336
336
|
case "automatic":
|
|
@@ -343,7 +343,7 @@ function An(e, a, t = {}) {
|
|
|
343
343
|
(i.blocked ?? (i.blocked = [])).push({ cardId: c.id, title: c.variable.name, reason: h.reach });
|
|
344
344
|
break;
|
|
345
345
|
case "relationship":
|
|
346
|
-
(i.relationshipPending ?? (i.relationshipPending = [])).push(
|
|
346
|
+
(i.relationshipPending ?? (i.relationshipPending = [])).push(v);
|
|
347
347
|
break;
|
|
348
348
|
case "sqlTemplate":
|
|
349
349
|
(i.sqlPending ?? (i.sqlPending = [])).push({ cardId: c.id, title: c.variable.name });
|
|
@@ -351,7 +351,7 @@ function An(e, a, t = {}) {
|
|
|
351
351
|
case "excluded":
|
|
352
352
|
break;
|
|
353
353
|
case "notApplicable":
|
|
354
|
-
i.notReached.push({ ...
|
|
354
|
+
i.notReached.push({ ...v, ...h.reason ? { reason: h.reason } : {} });
|
|
355
355
|
break;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
@@ -370,7 +370,7 @@ function Fn(e, a) {
|
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
372
|
if (t.kind !== "sheets") return;
|
|
373
|
-
const s = [...Ot(e).values()].filter((n) =>
|
|
373
|
+
const s = [...Ot(e).values()].filter((n) => Ua(a, n));
|
|
374
374
|
return {
|
|
375
375
|
sheetIds: s.filter((n) => n.sheetKind === "dashboard").map((n) => n.sheetId),
|
|
376
376
|
// Document sheets it names stay through a change of sheets (`withUnstatedScopeParts`).
|
|
@@ -381,13 +381,13 @@ function es(e, a) {
|
|
|
381
381
|
return e ?? { tz: "UTC", weekStart: 1, anchor: { iso: a ?? "1970-01-01T00:00:00.000Z" } };
|
|
382
382
|
}
|
|
383
383
|
function ts(e, a, t, s) {
|
|
384
|
-
var E,
|
|
385
|
-
const { input: o } = a, n = An(e, o, s), i = (
|
|
384
|
+
var E, C, k;
|
|
385
|
+
const { input: o } = a, n = An(e, o, s), i = (b, D) => ({
|
|
386
386
|
filterId: o.id,
|
|
387
387
|
label: o.label,
|
|
388
388
|
editable: !1,
|
|
389
389
|
kind: D,
|
|
390
|
-
notEditable: { reason:
|
|
390
|
+
notEditable: { reason: b, message: Rn[b] },
|
|
391
391
|
reaches: n.reaches,
|
|
392
392
|
excluded: n.excluded,
|
|
393
393
|
...n.blocked ? { blocked: n.blocked } : {},
|
|
@@ -395,16 +395,16 @@ function ts(e, a, t, s) {
|
|
|
395
395
|
...n.sqlPending ? { sqlPending: n.sqlPending } : {}
|
|
396
396
|
});
|
|
397
397
|
if (o.filter.kind === "global-date") return i("global_date", "global_date");
|
|
398
|
-
const d = ks(o.filter).filter((
|
|
398
|
+
const d = ks(o.filter).filter((b) => b.kind === "semantic");
|
|
399
399
|
if (d.length !== 1 || d[0].kind !== "semantic") return i("not_semantic", "field");
|
|
400
400
|
const l = Fn(e, o);
|
|
401
401
|
if (!l || a.origin !== "embeddedInput") return i("scope_not_expressible", "field");
|
|
402
|
-
const c = ((E = o.filter.fieldMeta) == null ? void 0 : E.name) ?? ((
|
|
402
|
+
const c = ((E = o.filter.fieldMeta) == null ? void 0 : E.name) ?? ((C = o.filter.column) == null ? void 0 : C.split(".").pop()) ?? "", h = Ha({
|
|
403
403
|
dashboard: e,
|
|
404
404
|
target: { kind: "dashboardInput", input: o, scope: {} },
|
|
405
405
|
calendar: es(t, void 0)
|
|
406
|
-
}).value, p = Ya(o.filter.dataType),
|
|
407
|
-
|
|
406
|
+
}).value, p = Ya(o.filter.dataType), v = p || (k = h == null ? void 0 : h.values) == null ? void 0 : k.filter((b) => ["string", "number", "boolean"].includes(typeof b)), y = Ja(h && "relativeMeta" in h ? h.relativeMeta : void 0), S = p ? y : void 0, x = S ? Xo(
|
|
407
|
+
S,
|
|
408
408
|
{ use: "filterDefault", columnHasTime: qa(o.filter) === "datetime" },
|
|
409
409
|
"defaultPeriod"
|
|
410
410
|
) : void 0;
|
|
@@ -416,9 +416,9 @@ function ts(e, a, t, s) {
|
|
|
416
416
|
datasetName: d[0].datasetName,
|
|
417
417
|
field: c,
|
|
418
418
|
selection: o.filter.type === "single" ? "single" : "multiple",
|
|
419
|
-
...
|
|
420
|
-
...
|
|
421
|
-
...
|
|
419
|
+
...v != null && v.length ? { defaultValues: v } : {},
|
|
420
|
+
...S ? { defaultPeriod: S } : {},
|
|
421
|
+
...x ? { defaultPeriodReadOnly: x } : {},
|
|
422
422
|
...p ? { datePicker: o.filter.dateSelectionMode === "day" ? "day" : o.filter.dateSelectionMode === "months" ? "month" : "range" } : {},
|
|
423
423
|
...l,
|
|
424
424
|
...n
|
|
@@ -470,7 +470,7 @@ function On(e, a, t) {
|
|
|
470
470
|
const n = ss(o.field, os(e)), i = n ? t[Nt(n)] : void 0;
|
|
471
471
|
return i ? ot(i, o.field.name, n.datasetName) : void 0;
|
|
472
472
|
}
|
|
473
|
-
const xt = ["orientation", "stack", "donut", "totals", "dataLabels", "legend", "axes", "comparisonDisplay", "inheritComparison", "
|
|
473
|
+
const xt = ["orientation", "stack", "donut", "totals", "dataLabels", "legend", "axes", "comparisonDisplay", "inheritComparison", "trend", "trendGrain", "seeRecords"], En = {
|
|
474
474
|
orientation: "orientation",
|
|
475
475
|
stack: "stacking",
|
|
476
476
|
donut: "donut hole",
|
|
@@ -480,7 +480,8 @@ const xt = ["orientation", "stack", "donut", "totals", "dataLabels", "legend", "
|
|
|
480
480
|
axes: "axes",
|
|
481
481
|
comparisonDisplay: "comparison display",
|
|
482
482
|
inheritComparison: "dashboard comparison",
|
|
483
|
-
|
|
483
|
+
trend: "trend under its value",
|
|
484
|
+
trendGrain: "trend grain",
|
|
484
485
|
seeRecords: "records to see"
|
|
485
486
|
}, qn = { x: "xAxisConfig", y: "yAxisConfig" }, gt = { x: "horizontal", y: "vertical" };
|
|
486
487
|
function Nn(e) {
|
|
@@ -492,69 +493,73 @@ function Pn(e, a, t) {
|
|
|
492
493
|
return Object.keys(s).length ? { op: "card.update", cardId: e.cardRef, ...s } : void 0;
|
|
493
494
|
}
|
|
494
495
|
function Ln(e, a, t, s, o) {
|
|
495
|
-
var
|
|
496
|
-
const n = xt.filter((
|
|
496
|
+
var y, S, x, E, C, k, b, D, w, N, _;
|
|
497
|
+
const n = xt.filter((I) => t[I] !== void 0);
|
|
497
498
|
if (!n.length) return {};
|
|
498
|
-
const i = xt.filter((
|
|
499
|
-
for (const
|
|
499
|
+
const i = xt.filter((I) => a.settings.has(I)), d = n.filter((I) => !a.settings.has(I));
|
|
500
|
+
for (const I of d)
|
|
500
501
|
o.push(
|
|
501
502
|
Q("setting_not_for_card", {
|
|
502
|
-
message: `${
|
|
503
|
-
path: `${s.path}.${
|
|
504
|
-
fix: i.length ? `Leave out ${
|
|
503
|
+
message: `${U(e.title)} is ${Nn(a)}, which has no ${En[I]}.`,
|
|
504
|
+
path: `${s.path}.${I}`,
|
|
505
|
+
fix: i.length ? `Leave out ${I}; this card takes ${i.join(", ")}.` : `Leave out ${I}.`,
|
|
505
506
|
allowed: i,
|
|
506
507
|
suggestedChange: Pn(s, t, d)
|
|
507
508
|
})
|
|
508
509
|
);
|
|
509
510
|
if (d.length) return {};
|
|
510
|
-
const l = {}, c = ((
|
|
511
|
+
const l = {}, c = ((y = Ee(e)) == null ? void 0 : y.properties) ?? {}, h = {
|
|
511
512
|
...c,
|
|
512
513
|
...t.orientation !== void 0 ? { orientation: t.orientation } : {},
|
|
513
514
|
...t.stack !== void 0 ? { stack: t.stack } : {},
|
|
514
515
|
...t.donut !== void 0 ? { donut: t.donut } : {}
|
|
515
516
|
};
|
|
516
|
-
["orientation", "stack", "donut"].some((
|
|
517
|
-
const p = l.variant ? As(e, l.variant) : e,
|
|
517
|
+
["orientation", "stack", "donut"].some((I) => h[I] !== c[I]) && (l.variant = Rs(a.type, h));
|
|
518
|
+
const p = l.variant ? As(e, l.variant) : e, v = Ft(p);
|
|
518
519
|
if (t.totals) {
|
|
519
|
-
const
|
|
520
|
-
|
|
520
|
+
const I = Fs(e, a, t.totals, ((S = v.totals) == null ? void 0 : S.row) ?? !1, s, o);
|
|
521
|
+
I && (l.totals = I);
|
|
521
522
|
}
|
|
522
523
|
if (t.dataLabels) {
|
|
523
|
-
const
|
|
524
|
-
t.dataLabels.show !== Ds(p) && (
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
const
|
|
528
|
-
|
|
524
|
+
const I = {};
|
|
525
|
+
t.dataLabels.show !== Ds(p) && (I.show = t.dataLabels.show);
|
|
526
|
+
const R = t.dataLabels.format;
|
|
527
|
+
if (R === null && ((x = v.dataLabels) != null && x.format) && (I.format = null), R) {
|
|
528
|
+
const P = Mn(e, a, R, `${s.path}.dataLabels.format`, o);
|
|
529
|
+
P && !Ne(P, (E = v.dataLabels) == null ? void 0 : E.format) && (I.format = P);
|
|
529
530
|
}
|
|
530
|
-
Object.keys(
|
|
531
|
+
Object.keys(I).length && (l.dataLabels = I);
|
|
531
532
|
}
|
|
532
533
|
if (t.legend) {
|
|
533
|
-
const
|
|
534
|
-
t.legend.show !== ((
|
|
534
|
+
const I = {};
|
|
535
|
+
t.legend.show !== ((C = v.legend) == null ? void 0 : C.show) && (I.show = t.legend.show), t.legend.position !== void 0 && t.legend.position !== ((k = v.legend) == null ? void 0 : k.position) && (I.position = t.legend.position), Object.keys(I).length && (l.legend = I);
|
|
535
536
|
}
|
|
536
537
|
if (t.axes) {
|
|
537
|
-
const
|
|
538
|
-
for (const
|
|
539
|
-
const
|
|
540
|
-
if (!
|
|
541
|
-
const
|
|
542
|
-
|
|
538
|
+
const I = Os(p.type, p.preferences), R = {};
|
|
539
|
+
for (const P of ["x", "y"]) {
|
|
540
|
+
const V = t.axes[P];
|
|
541
|
+
if (!V) continue;
|
|
542
|
+
const K = Bn(e, P, V, ((b = v.axes) == null ? void 0 : b[P]) ?? {}, P === I, `${s.path}.axes.${P}`, o);
|
|
543
|
+
K && (R[qn[P]] = K);
|
|
543
544
|
}
|
|
544
|
-
Object.keys(
|
|
545
|
+
Object.keys(R).length && (l.axes = R);
|
|
545
546
|
}
|
|
546
547
|
if (t.comparisonDisplay) {
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
548
|
+
const I = (D = e.preferences) == null ? void 0 : D.comparisonPresentation, R = {}, { show: P, mode: V, precision: K } = t.comparisonDisplay;
|
|
549
|
+
P !== void 0 && P !== ((I == null ? void 0 : I.showComparison) ?? !0) && (R.show = P), V !== void 0 && V !== ((I == null ? void 0 : I.displayMode) ?? "difference") && (R.mode = V), K !== void 0 && K !== ((I == null ? void 0 : I.precision) ?? null) && (R.precision = K), Object.keys(R).length && (l.comparisonDisplay = R);
|
|
550
|
+
}
|
|
551
|
+
if (t.inheritComparison !== void 0 && t.inheritComparison !== (((w = e.preferences) == null ? void 0 : w.inheritGlobalComparison) !== !1) && (l.inheritComparison = t.inheritComparison), t.seeRecords !== void 0 && t.seeRecords !== (e.seeRecords !== !1) && (l.seeRecords = t.seeRecords), t.trend !== void 0 && t.trend !== (((N = e.config) == null ? void 0 : N.kpiBand) === "trend") && (l.trend = t.trend), t.trendGrain !== void 0) {
|
|
552
|
+
const I = Es(e.config);
|
|
553
|
+
I ? o.push(
|
|
554
|
+
Q("value_invalid", {
|
|
555
|
+
message: `${U(e.title)} draws its trend by its Trend By${I.granularity ? `, by ${I.granularity}` : ""}, so it takes no grain of its own.`,
|
|
556
|
+
path: `${s.path}.trendGrain`,
|
|
557
|
+
fix: "Change the Trend By's timeGrain in its query, or remove the Trend By to set a grain here.",
|
|
558
|
+
allowed: []
|
|
559
|
+
})
|
|
560
|
+
) : t.trendGrain !== (((_ = e.config) == null ? void 0 : _.kpiTrendGrain) ?? "automatic") && (l.trendGrain = t.trendGrain === "automatic" ? null : t.trendGrain);
|
|
561
|
+
}
|
|
562
|
+
return l;
|
|
558
563
|
}
|
|
559
564
|
function Mn(e, a, t, s, o) {
|
|
560
565
|
const n = String(t.type), i = Ns("cartesian", "number"), d = Le(n), l = d == null ? void 0 : d.safeParse(t);
|
|
@@ -562,7 +567,7 @@ function Mn(e, a, t, s, o) {
|
|
|
562
567
|
const h = l && !l.success ? l.error.issues[0] : void 0;
|
|
563
568
|
o.push(
|
|
564
569
|
Q("format_invalid", {
|
|
565
|
-
message: i.includes(n) ? `That format for the values on ${
|
|
570
|
+
message: i.includes(n) ? `That format for the values on ${U(e.title)} isn't valid: ${(h == null ? void 0 : h.message) ?? "invalid"}.` : `The values on ${U(e.title)} are numbers, so they can't take a ${n.replace("_", " ")} format.`,
|
|
566
571
|
path: s,
|
|
567
572
|
fix: "Send a whole number, currency, percent, scientific or duration format.",
|
|
568
573
|
allowed: i.includes(n) ? ze(n) : [...i]
|
|
@@ -572,7 +577,7 @@ function Mn(e, a, t, s, o) {
|
|
|
572
577
|
}
|
|
573
578
|
const c = Pa({ surface: a.type === "pie" ? "pie" : "cartesian", value: "number", rawValueKinds: [] }, l.data);
|
|
574
579
|
if (!c.ok) {
|
|
575
|
-
o.push(Q("format_invalid", { message: `${
|
|
580
|
+
o.push(Q("format_invalid", { message: `${U(e.title)} can't draw that format on its values: ${c.reason}.`, path: s }));
|
|
576
581
|
return;
|
|
577
582
|
}
|
|
578
583
|
return l.data;
|
|
@@ -585,7 +590,7 @@ function Bn(e, a, t, s, o, n, i) {
|
|
|
585
590
|
const c = gt[a === "x" ? "y" : "x"];
|
|
586
591
|
i.push(
|
|
587
592
|
Q("setting_not_for_card", {
|
|
588
|
-
message: `${
|
|
593
|
+
message: `${U(e.title)}'s ${gt[a]} axis lists categories; set a range on its ${c} axis.`,
|
|
589
594
|
path: `${n}.${l[0]}`,
|
|
590
595
|
allowed: ["title"]
|
|
591
596
|
})
|
|
@@ -594,20 +599,20 @@ function Bn(e, a, t, s, o, n, i) {
|
|
|
594
599
|
}
|
|
595
600
|
if (o) {
|
|
596
601
|
for (const p of ["min", "max"]) {
|
|
597
|
-
const
|
|
598
|
-
if (
|
|
599
|
-
if (
|
|
602
|
+
const v = t[p];
|
|
603
|
+
if (v !== void 0) {
|
|
604
|
+
if (v !== null && !Number.isFinite(v)) {
|
|
600
605
|
i.push(Q("value_invalid", { message: `An axis ${p} must be a number.`, path: `${n}.${p}` }));
|
|
601
606
|
return;
|
|
602
607
|
}
|
|
603
|
-
(
|
|
608
|
+
(v ?? void 0) !== s[p] && (d[p] = v);
|
|
604
609
|
}
|
|
605
610
|
}
|
|
606
611
|
const c = t.min !== void 0 ? t.min : s.min, h = t.max !== void 0 ? t.max : s.max;
|
|
607
612
|
if (typeof c == "number" && typeof h == "number" && c > h) {
|
|
608
613
|
i.push(
|
|
609
614
|
Q("value_invalid", {
|
|
610
|
-
message: `The ${gt[a]} axis of ${
|
|
615
|
+
message: `The ${gt[a]} axis of ${U(e.title)} can't start at ${c} and end at ${h}.`,
|
|
611
616
|
path: n,
|
|
612
617
|
fix: "Send a min no greater than the max."
|
|
613
618
|
})
|
|
@@ -620,7 +625,7 @@ function Bn(e, a, t, s, o, n, i) {
|
|
|
620
625
|
function $a(e, a, t, s, o) {
|
|
621
626
|
const n = o === "date" && s.role === "dimension";
|
|
622
627
|
return Q("setting_not_for_card", {
|
|
623
|
-
message: o === "text" ? `${a} on ${
|
|
628
|
+
message: o === "text" ? `${a} on ${U(e.title)} shows its text as it is; text formats apply on a Matrix only.` : o === "category" ? `${a} labels the categories of ${U(e.title)}, which a chart shows as the query returns them; format it on a table or a Matrix.` : `${U(e.title)} shows ${a}, ${is(s)}, without a format of its own; this card type doesn't apply one.`,
|
|
624
629
|
path: t,
|
|
625
630
|
...n ? { fix: `Group ${a} by day, week, month, quarter or year to format its dates.` } : {}
|
|
626
631
|
});
|
|
@@ -640,7 +645,7 @@ function Vn(e, a, t) {
|
|
|
640
645
|
function We(e, a, t) {
|
|
641
646
|
return { op: "card.update", cardId: e.cardRef, columns: { [a]: { format: t } } };
|
|
642
647
|
}
|
|
643
|
-
function
|
|
648
|
+
function Kn(e, a, t, s, o, n, i) {
|
|
644
649
|
var c;
|
|
645
650
|
const d = o.label;
|
|
646
651
|
if (d === void 0 || d === t.label) return;
|
|
@@ -648,7 +653,7 @@ function jn(e, a, t, s, o, n, i) {
|
|
|
648
653
|
if (!a.settings.has("columns.label") || !t.labelKey) {
|
|
649
654
|
i.push(
|
|
650
655
|
Q("setting_not_for_card", {
|
|
651
|
-
message: a.sql ? `${
|
|
656
|
+
message: a.sql ? `${U(e.title)}'s column ${s} takes its header from the query; rename it in the SQL.` : `${s} on ${U(e.title)} takes no header of its own.`,
|
|
652
657
|
path: l,
|
|
653
658
|
allowed: ["hidden", "width", "format"].filter((h) => h !== "hidden" || a.settings.has("columns.hidden")),
|
|
654
659
|
suggestedChange: St(n, s, o, "label")
|
|
@@ -666,85 +671,85 @@ function jn(e, a, t, s, o, n, i) {
|
|
|
666
671
|
}
|
|
667
672
|
return { key: t.labelKey, label: d };
|
|
668
673
|
}
|
|
669
|
-
function
|
|
670
|
-
var
|
|
674
|
+
function jn(e, a, t, s, o, n, i) {
|
|
675
|
+
var _, I;
|
|
671
676
|
const d = `${Se(n.path, s)}.format`;
|
|
672
677
|
if (!a.settings.has("columns.format")) {
|
|
673
|
-
i.push(Q("setting_not_for_card", { message: `${
|
|
678
|
+
i.push(Q("setting_not_for_card", { message: `${U(e.title)} takes no column formats.`, path: d }));
|
|
674
679
|
return;
|
|
675
680
|
}
|
|
676
|
-
const l = t.ref, c = ((
|
|
681
|
+
const l = t.ref, c = ((_ = n.modelFormats) == null ? void 0 : _.status) === "read" ? n.modelFormats.formats : void 0, h = l.kind === "matrixLevel" ? c == null ? void 0 : c[l.levelId] : l.kind === "matrixMeasure" ? c == null ? void 0 : c[l.measureId] : void 0, p = Vo({
|
|
677
682
|
card: e,
|
|
678
683
|
column: l,
|
|
679
684
|
...c ? { modelFormats: c } : {},
|
|
680
685
|
...h ? { catalogFormat: h } : {}
|
|
681
|
-
}),
|
|
682
|
-
if (o === null) return
|
|
683
|
-
if (
|
|
684
|
-
const
|
|
685
|
-
if (
|
|
686
|
-
i.push($a(e, s, d, t,
|
|
686
|
+
}), v = p.source === "override" ? p.format : void 0;
|
|
687
|
+
if (o === null) return v ? null : void 0;
|
|
688
|
+
if (v && Ne(o, v)) return;
|
|
689
|
+
const y = Ks(e, a, t, n.sqlResultColumns), S = y.value, x = js(y);
|
|
690
|
+
if (x.length === 0) {
|
|
691
|
+
i.push($a(e, s, d, t, S));
|
|
687
692
|
return;
|
|
688
693
|
}
|
|
689
694
|
const E = !("type" in o) || o.type === void 0;
|
|
690
695
|
if (E && !p.format) {
|
|
691
|
-
const
|
|
696
|
+
const R = x[0];
|
|
692
697
|
i.push(
|
|
693
698
|
Q("format_invalid", {
|
|
694
699
|
// Unavailable is not "none": say which, so the agent knows the column may have a model format (ledger P2-20).
|
|
695
|
-
message: ((
|
|
700
|
+
message: ((I = n.modelFormats) == null ? void 0 : I.status) === "unavailable" ? `${s} on ${U(e.title)} may follow its model's format, which couldn't be read; state the whole format with its type.` : `${s} on ${U(e.title)} has no format to change; state the whole format with its type.`,
|
|
696
701
|
path: d,
|
|
697
702
|
fix: "Add `type` to the format.",
|
|
698
|
-
allowed: ze(
|
|
699
|
-
suggestedChange: We(n, s, { type:
|
|
703
|
+
allowed: ze(R),
|
|
704
|
+
suggestedChange: We(n, s, { type: R, ...o })
|
|
700
705
|
})
|
|
701
706
|
);
|
|
702
707
|
return;
|
|
703
708
|
}
|
|
704
|
-
const
|
|
705
|
-
if (!
|
|
709
|
+
const C = E ? { ...p.format, ...o } : o, k = String(C.type);
|
|
710
|
+
if (!x.includes(k)) {
|
|
706
711
|
i.push(
|
|
707
|
-
|
|
708
|
-
message:
|
|
712
|
+
k === "string" ? $a(e, s, `${d}.type`, t, "text") : Q("format_invalid", {
|
|
713
|
+
message: S === "result" ? `${s} on ${U(e.title)} comes straight from the query, so it can't take a ${k.replace("_", " ")} format.` : `${s} on ${U(e.title)} is ${is(t)}, so it can't take a ${k.replace("_", " ")} format.`,
|
|
709
714
|
path: `${d}.type`,
|
|
710
|
-
allowed: [...
|
|
715
|
+
allowed: [...x]
|
|
711
716
|
})
|
|
712
717
|
);
|
|
713
718
|
return;
|
|
714
719
|
}
|
|
715
|
-
const
|
|
716
|
-
if (!
|
|
717
|
-
const
|
|
720
|
+
const b = Le(k), D = b == null ? void 0 : b.safeParse(C);
|
|
721
|
+
if (!b || !(D != null && D.success)) {
|
|
722
|
+
const R = D && !D.success ? D.error.issues[0] : void 0;
|
|
718
723
|
i.push(
|
|
719
724
|
Q("format_invalid", {
|
|
720
|
-
message:
|
|
725
|
+
message: b ? (R == null ? void 0 : R.code) === "unrecognized_keys" ? `A ${k} format has no ${R.keys.join(", ")}.` : `That format for ${s} isn't valid: ${(R == null ? void 0 : R.message) ?? "invalid"}.` : `${JSON.stringify(k)} isn't a format type.`,
|
|
721
726
|
path: d,
|
|
722
|
-
fix: Qn(
|
|
723
|
-
allowed:
|
|
727
|
+
fix: Qn(k),
|
|
728
|
+
allowed: b ? ze(k) : [...ln],
|
|
724
729
|
...p.format ? { suggestedChange: We(n, s, p.format) } : {}
|
|
725
730
|
})
|
|
726
731
|
);
|
|
727
732
|
return;
|
|
728
733
|
}
|
|
729
|
-
const
|
|
730
|
-
if (
|
|
731
|
-
const
|
|
734
|
+
const w = D.data;
|
|
735
|
+
if (w.type === "temporal_bucket" && t.granularity && !ya(w, t.granularity).ok) {
|
|
736
|
+
const P = cn.filter(
|
|
732
737
|
(V) => ya({ presentation: { mode: "preset", preset: V } }, t.granularity).ok
|
|
733
738
|
);
|
|
734
739
|
i.push(
|
|
735
740
|
Q("date_finer_than_grain", {
|
|
736
|
-
message: `${s} on ${
|
|
741
|
+
message: `${s} on ${U(e.title)} is grouped by ${t.granularity}, which that date format doesn't fit.`,
|
|
737
742
|
path: d,
|
|
738
|
-
allowed:
|
|
739
|
-
suggestedChange: We(n, s, { type: "temporal_bucket", presentation: { mode: "preset", preset:
|
|
743
|
+
allowed: P,
|
|
744
|
+
suggestedChange: We(n, s, { type: "temporal_bucket", presentation: { mode: "preset", preset: P[0] ?? "short" } })
|
|
740
745
|
})
|
|
741
746
|
);
|
|
742
747
|
return;
|
|
743
748
|
}
|
|
744
|
-
if (
|
|
745
|
-
const
|
|
749
|
+
if (w.type === "date") {
|
|
750
|
+
const R = o, P = p.format ?? {}, V = Object.keys(R).filter((K) => !ca.includes(K) && !Ne(R[K], P[K]));
|
|
746
751
|
if (V.length) {
|
|
747
|
-
const K = Object.fromEntries(Object.entries(
|
|
752
|
+
const K = Object.fromEntries(Object.entries(w).filter(([B]) => !V.includes(B)));
|
|
748
753
|
i.push(
|
|
749
754
|
Q("format_invalid", {
|
|
750
755
|
message: `A date format set here takes a pattern or a preset; it doesn't set ${V.join(", ")}.`,
|
|
@@ -757,29 +762,29 @@ function Kn(e, a, t, s, o, n, i) {
|
|
|
757
762
|
return;
|
|
758
763
|
}
|
|
759
764
|
}
|
|
760
|
-
const N = Pa(
|
|
765
|
+
const N = Pa(y, w);
|
|
761
766
|
if (!N.ok) {
|
|
762
767
|
i.push(
|
|
763
768
|
Q("format_invalid", {
|
|
764
|
-
message: `${
|
|
769
|
+
message: `${U(e.title)} can't draw that format on ${s}: ${N.reason}.`,
|
|
765
770
|
path: d,
|
|
766
771
|
fix: "Change the format to one the column can show.",
|
|
767
|
-
allowed: ze(
|
|
772
|
+
allowed: ze(k)
|
|
768
773
|
})
|
|
769
774
|
);
|
|
770
775
|
return;
|
|
771
776
|
}
|
|
772
|
-
return
|
|
777
|
+
return v && Ne(v, w) ? void 0 : w;
|
|
773
778
|
}
|
|
774
779
|
function Wn(e, a, t, s, o, n, i) {
|
|
775
|
-
var
|
|
780
|
+
var x, E;
|
|
776
781
|
const d = o.polarity;
|
|
777
782
|
if (d === void 0) return;
|
|
778
783
|
const l = `${Se(n.path, s)}.polarity`, c = t.ref;
|
|
779
784
|
if (!(a.settings.has("columns.polarity") && (c.kind === "sqlKpiValue" || c.kind === "field" && t.role === "measure"))) {
|
|
780
785
|
i.push(
|
|
781
786
|
Q("setting_not_for_card", {
|
|
782
|
-
message: t.role === "measure" || t.role === "value" ? `${
|
|
787
|
+
message: t.role === "measure" || t.role === "value" ? `${U(e.title)} shows no comparison, so ${s} has no favorable direction.` : `${s} on ${U(e.title)} isn't a measure, so it has no favorable direction.`,
|
|
783
788
|
path: l,
|
|
784
789
|
fix: "Leave out polarity.",
|
|
785
790
|
suggestedChange: St(n, s, o, "polarity")
|
|
@@ -787,98 +792,98 @@ function Wn(e, a, t, s, o, n, i) {
|
|
|
787
792
|
);
|
|
788
793
|
return;
|
|
789
794
|
}
|
|
790
|
-
const p = c.kind === "field" ? (E = (
|
|
791
|
-
if (d === null) return
|
|
792
|
-
if (
|
|
795
|
+
const p = c.kind === "field" ? (E = (x = e.config) == null ? void 0 : x.metricColumns) == null ? void 0 : E.find((C) => C.id === c.fieldId) : void 0, v = c.kind === "sqlKpiValue" ? La(e) : void 0, y = c.kind === "sqlKpiValue" ? (v == null ? void 0 : v.source) === "sql" && v.polarity !== va ? v.polarity : void 0 : p == null ? void 0 : p.comparisonPolarity, S = p == null ? void 0 : p.semanticComparisonPolarity;
|
|
796
|
+
if (d === null) return y ? null : void 0;
|
|
797
|
+
if (S && d !== S) {
|
|
793
798
|
i.push(
|
|
794
799
|
Q("polarity_set_by_model", {
|
|
795
|
-
message: `The model says ${s} is ${
|
|
800
|
+
message: `The model says ${s} is ${S.replace(/_/g, " ")}; a card can't say otherwise.`,
|
|
796
801
|
path: l,
|
|
797
802
|
fix: "Change it in the model, or leave polarity out.",
|
|
798
|
-
allowed: [
|
|
803
|
+
allowed: [S],
|
|
799
804
|
suggestedChange: St(n, s, o, "polarity")
|
|
800
805
|
})
|
|
801
806
|
);
|
|
802
807
|
return;
|
|
803
808
|
}
|
|
804
|
-
return d === (
|
|
809
|
+
return d === (S ?? y ?? va) ? void 0 : d;
|
|
805
810
|
}
|
|
806
|
-
function
|
|
807
|
-
var h, p,
|
|
811
|
+
function Gn(e, a, t, s, o, n, i, d) {
|
|
812
|
+
var h, p, v;
|
|
808
813
|
if (o.hidden === void 0 && o.width === void 0) return {};
|
|
809
814
|
const l = Se(i.path, s);
|
|
810
815
|
if (!a.settings.has("columns.hidden") || t.resultKey === void 0) {
|
|
811
|
-
const
|
|
816
|
+
const y = a.pivoted && t.role === "measure";
|
|
812
817
|
return d.push(
|
|
813
818
|
Q("setting_not_for_card", {
|
|
814
|
-
message:
|
|
819
|
+
message: y ? `${s} on ${U(e.title)} has a column for each pivot value; hide or size them in the editor.` : `${U(e.title)} has no hidden columns or column widths; those are for tables.`,
|
|
815
820
|
path: `${l}.${o.hidden !== void 0 ? "hidden" : "width"}`,
|
|
816
|
-
allowed:
|
|
821
|
+
allowed: y ? ["label", "format"] : ["label", "format"].filter((S) => a.settings.has(`columns.${S}`)),
|
|
817
822
|
suggestedChange: Vn(i, s, o)
|
|
818
823
|
})
|
|
819
824
|
), {};
|
|
820
825
|
}
|
|
821
826
|
const c = {};
|
|
822
827
|
if (o.hidden !== void 0 && o.hidden !== ((n == null ? void 0 : n.hidden) === !0) && (c.hidden = o.hidden), o.width !== void 0 && o.width !== ((n == null ? void 0 : n.width) ?? null)) {
|
|
823
|
-
const { minSize:
|
|
824
|
-
o.width !== null && (!Number.isFinite(o.width) || o.width <
|
|
828
|
+
const { minSize: y, maxSize: S } = Vs((v = (p = (h = e.preferences) == null ? void 0 : h.tablePrefs) == null ? void 0 : p.columnSettingsMap) == null ? void 0 : v[t.resultKey]);
|
|
829
|
+
o.width !== null && (!Number.isFinite(o.width) || o.width < y || o.width > S) ? d.push(
|
|
825
830
|
Q("value_invalid", {
|
|
826
|
-
message: `${s} on ${
|
|
831
|
+
message: `${s} on ${U(e.title)} can be ${y} to ${S} pixels wide.`,
|
|
827
832
|
path: `${l}.width`,
|
|
828
|
-
fix: `Send a width from ${
|
|
833
|
+
fix: `Send a width from ${y} to ${S} pixels, or null for automatic.`
|
|
829
834
|
})
|
|
830
835
|
) : c.width = o.width;
|
|
831
836
|
}
|
|
832
837
|
return c;
|
|
833
838
|
}
|
|
834
|
-
function
|
|
835
|
-
var E,
|
|
836
|
-
const { columns: s = {}, ...o } = a.settings ?? {}, n = [], i = xt.some((D) => o[D] !== void 0), d = !!((
|
|
839
|
+
function Un(e, a, t) {
|
|
840
|
+
var E, C, k, b;
|
|
841
|
+
const { columns: s = {}, ...o } = a.settings ?? {}, n = [], i = xt.some((D) => o[D] !== void 0), d = !!((C = (E = a.highlights) == null ? void 0 : E.add) != null && C.length || (b = (k = a.highlights) == null ? void 0 : k.remove) != null && b.length);
|
|
837
842
|
if (!Object.keys(s).length && !i && !d) return { ok: !0, labels: [], settings: null, warnings: [] };
|
|
838
843
|
const l = Ps(e);
|
|
839
844
|
if (!l)
|
|
840
845
|
return {
|
|
841
846
|
ok: !1,
|
|
842
|
-
problems: [Q("setting_not_for_card", { message: `${
|
|
847
|
+
problems: [Q("setting_not_for_card", { message: `${U(e.title)} takes no card settings through this tool.`, path: t.path })]
|
|
843
848
|
};
|
|
844
|
-
const c = Ln(e, l, o, t, n), h = Ls(e, l, t.sqlResultColumns), p = d ? Ms(e, l, h, a.highlights, t, n) : void 0,
|
|
845
|
-
for (const [D,
|
|
846
|
-
const N = Bs(h, D, { path: Se(t.path, D), cardTitle:
|
|
849
|
+
const c = Ln(e, l, o, t, n), h = Ls(e, l, t.sqlResultColumns), p = d ? Ms(e, l, h, a.highlights, t, n) : void 0, v = Ft(e), y = [], S = [];
|
|
850
|
+
for (const [D, w] of Object.entries(s)) {
|
|
851
|
+
const N = Bs(h, D, { path: Se(t.path, D), cardTitle: U(e.title) });
|
|
847
852
|
if (!N.ok) {
|
|
848
853
|
n.push(N.problem);
|
|
849
854
|
continue;
|
|
850
855
|
}
|
|
851
|
-
const
|
|
852
|
-
if (
|
|
856
|
+
const _ = N.column;
|
|
857
|
+
if (_.sqlName === "inferred") {
|
|
853
858
|
n.push(
|
|
854
859
|
Q("columns_unavailable", {
|
|
855
|
-
message: `${
|
|
860
|
+
message: `${U(e.title)}'s columns weren't read from its query, so ${D} can't be checked.`,
|
|
856
861
|
path: Se(t.path, D),
|
|
857
862
|
fix: "Check that the card runs and returns rows, then propose again."
|
|
858
863
|
})
|
|
859
864
|
);
|
|
860
865
|
continue;
|
|
861
866
|
}
|
|
862
|
-
const
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
column:
|
|
866
|
-
...
|
|
867
|
-
...
|
|
867
|
+
const I = Kn(e, l, _, D, w, t, n);
|
|
868
|
+
I && y.push(I);
|
|
869
|
+
const R = Gn(e, l, _, D, w, v.columns[_.name], t, n), P = w.format !== void 0 ? jn(e, l, _, D, w.format, t, n) : void 0, V = Wn(e, l, _, D, w, t, n), K = {
|
|
870
|
+
column: _.ref,
|
|
871
|
+
...R,
|
|
872
|
+
...P !== void 0 ? { format: P } : {},
|
|
868
873
|
...V !== void 0 ? { polarity: V } : {}
|
|
869
874
|
};
|
|
870
|
-
Object.keys(K).length > 1 &&
|
|
875
|
+
Object.keys(K).length > 1 && S.push(K);
|
|
871
876
|
}
|
|
872
877
|
if (n.length) return { ok: !1, problems: n };
|
|
873
|
-
const
|
|
874
|
-
return { ok: !0, labels:
|
|
878
|
+
const x = { ...c, ...S.length ? { columns: S } : {}, ...p ? { highlights: p } : {} };
|
|
879
|
+
return { ok: !0, labels: y, settings: Object.keys(x).length ? x : null, warnings: [] };
|
|
875
880
|
}
|
|
876
881
|
function Qn(e) {
|
|
877
882
|
const a = Le(e), t = a && a === Le("number") ? ua.number : e === "temporal_bucket" || e === "date" ? ua[e] : void 0;
|
|
878
883
|
return t ? `Send a stored format: ${t}.` : "Send the format in the stored shape the outline shows.";
|
|
879
884
|
}
|
|
880
885
|
function Hn(e, a, t, s, o) {
|
|
881
|
-
var
|
|
886
|
+
var C, k, b, D, w, N;
|
|
882
887
|
const n = we(e, { sql: !0, calculations: !1 });
|
|
883
888
|
if (!n.editable) return [n.message];
|
|
884
889
|
const i = n.query, d = a;
|
|
@@ -892,43 +897,43 @@ function Hn(e, a, t, s, o) {
|
|
|
892
897
|
config: s.config
|
|
893
898
|
}, { sql: !0, calculations: !1 }) : void 0;
|
|
894
899
|
if (l && !l.editable) return ["the compiled query"];
|
|
895
|
-
const c = l != null && l.editable ? l.query : void 0, h = String(d.datasetName ?? ""), p = [],
|
|
896
|
-
const
|
|
897
|
-
(
|
|
900
|
+
const c = l != null && l.editable ? l.query : void 0, h = String(d.datasetName ?? ""), p = [], v = (_) => be(_, h), y = (_, I, R) => {
|
|
901
|
+
const P = I ?? [], V = R ?? [];
|
|
902
|
+
(P.length !== V.length || P.some((K, B) => v(K) !== v(V[B]))) && p.push(_);
|
|
898
903
|
};
|
|
899
|
-
for (const
|
|
900
|
-
if (
|
|
901
|
-
const
|
|
902
|
-
|
|
904
|
+
for (const _ of ["domainId", "datasetName"]) d[_] !== i[_] && p.push(_);
|
|
905
|
+
if (y("measures", d.measures, i.measures), y("columns", d.columns, i.columns), t || n.matrix) {
|
|
906
|
+
const _ = (R) => new Set(((R == null ? void 0 : R.columns) ?? []).map(v)), I = (R, P) => (R ?? []).filter((V) => !_(P).has(v(V)));
|
|
907
|
+
y("dimensions", I(d.dimensions, t), I(i.dimensions, n.matrix)), y("matrix.columns", t == null ? void 0 : t.columns, (C = n.matrix) == null ? void 0 : C.columns);
|
|
903
908
|
} else
|
|
904
|
-
|
|
905
|
-
const
|
|
906
|
-
|
|
907
|
-
const E = (
|
|
908
|
-
(d.measures ?? []).forEach((
|
|
909
|
-
const
|
|
910
|
-
|
|
909
|
+
y("dimensions", d.dimensions, i.dimensions);
|
|
910
|
+
const S = d.timeWindow !== void 0 && !d.timeGrain, x = S && i.timeWindow === void 0 ? void 0 : S && d.dateField === void 0 ? c == null ? void 0 : c.dateField : d.dateField;
|
|
911
|
+
x !== void 0 && (i.dateField === void 0 || v(x) !== v(i.dateField)) && p.push("dateField"), d.timeGrain !== void 0 && d.timeGrain !== i.timeGrain && p.push("timeGrain");
|
|
912
|
+
const E = (k = e.config) != null && k.matrix ? e.config.matrix.spec.measures.map((_) => _.kind === "aggregate" ? { aggregate: _.aggregate } : {}) : ((b = e.config) == null ? void 0 : b.metricColumns) ?? [];
|
|
913
|
+
(d.measures ?? []).forEach((_, I) => {
|
|
914
|
+
const R = _ && typeof _ == "object" ? _.aggregate : void 0;
|
|
915
|
+
R && _a(E[I] ?? {}) !== R && p.push(`the aggregate of measures[${I}]`);
|
|
911
916
|
});
|
|
912
|
-
for (const { key:
|
|
913
|
-
Ws(e,
|
|
917
|
+
for (const { key: _, label: I } of qe(a))
|
|
918
|
+
Ws(e, _) !== I && p.push(`the label "${I}"`);
|
|
914
919
|
if (!o || o.aspects.includes("filters")) {
|
|
915
|
-
const
|
|
916
|
-
let
|
|
917
|
-
const
|
|
920
|
+
const _ = d.filters ?? [];
|
|
921
|
+
let I = i.filters ?? [];
|
|
922
|
+
const R = d.timeWindow, P = i.timeWindow, V = (K, B) => {
|
|
918
923
|
const se = (oe) => JSON.stringify((oe ?? []).map(String));
|
|
919
|
-
return
|
|
924
|
+
return v(K.field) === v(B.field) && K.operator === B.operator && (K.scope ?? "row") === (B.scope ?? "row") && (typeof K.field == "object" ? K.field.aggregate : void 0) === (typeof B.field == "object" ? B.field.aggregate : void 0) && (K.values === void 0 || se(K.values) === se(B.values));
|
|
920
925
|
};
|
|
921
|
-
if (
|
|
926
|
+
if (R && !P) {
|
|
922
927
|
const K = ((c == null ? void 0 : c.filters) ?? []).filter(
|
|
923
|
-
(B) => !(c != null && c.timeWindow) && !
|
|
928
|
+
(B) => !(c != null && c.timeWindow) && !_.some((se) => V(se, B))
|
|
924
929
|
);
|
|
925
|
-
(!K.length || K.some((B) => !
|
|
926
|
-
} else
|
|
927
|
-
(
|
|
930
|
+
(!K.length || K.some((B) => !I.some((se) => V(B, se)))) && p.push("timeWindow"), I = I.filter((B) => !K.some((se) => V(se, B)));
|
|
931
|
+
} else R ? Zo(d.timeWindow, i.timeWindow) || p.push("timeWindow") : P && p.push("timeWindow");
|
|
932
|
+
(_.length !== I.length || _.some((K, B) => !V(K, I[B]))) && p.push("filters");
|
|
928
933
|
}
|
|
929
934
|
if (d.orderBy !== void 0) {
|
|
930
|
-
const
|
|
931
|
-
(!
|
|
935
|
+
const _ = d.orderBy, I = (w = (D = e.config) == null ? void 0 : D.sortByColumns) == null ? void 0 : w[0], R = I && Gs(e.config ?? {}, I), P = _.field && typeof _.field == "object" ? _.field.aggregate : void 0;
|
|
936
|
+
(!I || !R || I.direction !== _.direction || v(_.field) !== Us(R.name, Na(R)) || P !== void 0 && _a(R) !== P) && p.push("orderBy");
|
|
932
937
|
}
|
|
933
938
|
return d.limit !== void 0 && ((N = e.config) == null ? void 0 : N.rowLimit) !== d.limit && p.push("limit"), p;
|
|
934
939
|
}
|
|
@@ -978,7 +983,7 @@ function cs(e, a) {
|
|
|
978
983
|
}));
|
|
979
984
|
}
|
|
980
985
|
async function wa(e, a, t) {
|
|
981
|
-
var
|
|
986
|
+
var b, D;
|
|
982
987
|
const { problem: s, need: o, services: n } = t, { path: i, query: d } = e, l = ds(e.get), c = {
|
|
983
988
|
id: e.id,
|
|
984
989
|
name: e.name,
|
|
@@ -994,7 +999,7 @@ async function wa(e, a, t) {
|
|
|
994
999
|
message: "A SQL variable takes the only row or the first row of its result.",
|
|
995
1000
|
path: `${i}.get`,
|
|
996
1001
|
fix: 'Send get: "only" or "first", or write the aggregate or the list in the SQL itself.'
|
|
997
|
-
}),
|
|
1002
|
+
}), k(Ye({ ...c, mode: "sql", connectionId: d.connectionId, sql: d.sql, get: l.kind }, a));
|
|
998
1003
|
const h = await n.loadCardSource({ domainId: d.domainId, datasetName: d.datasetName });
|
|
999
1004
|
h != null && h.dataSource || s({
|
|
1000
1005
|
code: "variable_source_unreachable",
|
|
@@ -1003,82 +1008,82 @@ async function wa(e, a, t) {
|
|
|
1003
1008
|
fix: "List the domain's datasets with semaphor_list_datasets and name one of them."
|
|
1004
1009
|
});
|
|
1005
1010
|
const p = h.fields;
|
|
1006
|
-
for (const
|
|
1007
|
-
const
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1011
|
+
for (const w of Ma({ ...d, measures: d.measures ?? [] })) s({ ...w, path: `${i}.${w.path}` });
|
|
1012
|
+
const v = (w, N) => {
|
|
1013
|
+
const _ = Ct(w), I = Js(w, d.datasetName);
|
|
1014
|
+
I.toLowerCase() !== d.datasetName.toLowerCase() && s({
|
|
1010
1015
|
code: "field_not_found",
|
|
1011
|
-
message: `A variable reads one dataset: "${
|
|
1016
|
+
message: `A variable reads one dataset: "${_}" names ${I}, not ${d.datasetName}.`,
|
|
1012
1017
|
path: N,
|
|
1013
|
-
fix: `Name a field of ${d.datasetName}, or set datasetName to ${
|
|
1018
|
+
fix: `Name a field of ${d.datasetName}, or set datasetName to ${I} and read its field.`
|
|
1014
1019
|
});
|
|
1015
|
-
const
|
|
1016
|
-
return
|
|
1020
|
+
const R = ot(p, _, d.datasetName);
|
|
1021
|
+
return R || s({
|
|
1017
1022
|
code: "field_not_found",
|
|
1018
|
-
message: `"${
|
|
1023
|
+
message: `"${_}" isn't a field of ${d.datasetName}.`,
|
|
1019
1024
|
path: N,
|
|
1020
1025
|
fix: "Use one of details.available, or read semaphor_get_dataset_schema.",
|
|
1021
|
-
details: { available: p.slice(0, 20).map((
|
|
1022
|
-
}),
|
|
1023
|
-
},
|
|
1026
|
+
details: { available: p.slice(0, 20).map((P) => P.name) }
|
|
1027
|
+
}), R;
|
|
1028
|
+
}, y = d.measures ?? [], S = d.dimensions ?? [], x = {
|
|
1024
1029
|
...c,
|
|
1025
1030
|
mode: "data",
|
|
1026
1031
|
dataSource: h.dataSource,
|
|
1027
1032
|
connectionId: h.connectionId,
|
|
1028
1033
|
get: "only",
|
|
1029
|
-
...(
|
|
1034
|
+
...(b = d.filters) != null && b.length ? { conditions: await Jn(d, n, i, t.refuseAll) } : {}
|
|
1030
1035
|
};
|
|
1031
1036
|
if (l.kind === "aggregate") {
|
|
1032
|
-
(
|
|
1037
|
+
(y.length !== 1 || S.length) && s({
|
|
1033
1038
|
code: "invalid_change",
|
|
1034
1039
|
message: "An aggregate reads one measure and no dimension.",
|
|
1035
1040
|
path: `${i}.query`,
|
|
1036
1041
|
fix: `Send measures: [{ name, aggregate }] alone; for one field's value use get: "only", "first" or "list" with dimensions: [field].`
|
|
1037
1042
|
}), d.orderBy && s({ code: "invalid_change", message: "An aggregate is one value, so it has no order.", path: `${i}.query.orderBy`, fix: "Leave out orderBy." });
|
|
1038
|
-
const
|
|
1039
|
-
if (!Ca(
|
|
1040
|
-
const
|
|
1043
|
+
const w = v(y[0], `${i}.query.measures[0]`), N = typeof y[0] == "string" ? void 0 : y[0].aggregate, _ = hn(w).filter((P) => Ca(P.value)), I = N ?? (ut(w) ? "calculation" : pn(w));
|
|
1044
|
+
if (!Ca(I) || !_.some((P) => P.value === I)) {
|
|
1045
|
+
const P = _.map((V) => V.value);
|
|
1041
1046
|
s({
|
|
1042
1047
|
code: "invalid_change",
|
|
1043
|
-
message: N ? `${N} isn't an aggregate ${
|
|
1048
|
+
message: N ? `${N} isn't an aggregate ${w.label || w.name} takes.` : `${w.label || w.name} needs its aggregate.`,
|
|
1044
1049
|
path: `${i}.query.measures[0]`,
|
|
1045
|
-
fix: ut(
|
|
1046
|
-
allowed:
|
|
1050
|
+
fix: ut(w) ? `${w.label || w.name} aggregates itself: send it without an aggregate.` : `Send { name: "${w.name}", aggregate } with one of: ${P.join(", ")}.`,
|
|
1051
|
+
allowed: P
|
|
1047
1052
|
});
|
|
1048
1053
|
}
|
|
1049
|
-
const
|
|
1050
|
-
return
|
|
1054
|
+
const R = Yn(y[0], { ...x, field: w, get: I }, `${i}.query.measures[0].comparison`, s);
|
|
1055
|
+
return k(Ye({ ...x, field: w, get: I, ...R ? { comparison: R } : {} }, a));
|
|
1051
1056
|
}
|
|
1052
|
-
(
|
|
1057
|
+
(S.length !== 1 || y.length) && s({
|
|
1053
1058
|
code: "invalid_change",
|
|
1054
1059
|
message: `The ${l.kind === "only" ? "only value" : l.kind === "first" ? "first value" : "list"} reads one dimension; a measure's one value is get: "aggregate".`,
|
|
1055
1060
|
path: `${i}.query`,
|
|
1056
1061
|
fix: "Send dimensions: [field] and no measures; order the first value or the list with orderBy."
|
|
1057
1062
|
});
|
|
1058
|
-
const E =
|
|
1063
|
+
const E = v(S[0], `${i}.query.dimensions[0]`);
|
|
1059
1064
|
ut(E) && s({
|
|
1060
1065
|
code: "invalid_change",
|
|
1061
1066
|
message: `${E.label || E.name} is an aggregate calculation, so it has one value, not rows.`,
|
|
1062
1067
|
path: `${i}.query.dimensions[0]`,
|
|
1063
1068
|
fix: `Send get: "aggregate" with measures: ["${E.name}"].`
|
|
1064
1069
|
}), l.kind === "only" && d.orderBy && s({ code: "invalid_change", message: "The only value has no order: it shows when exactly one row matches.", path: `${i}.query.orderBy`, fix: 'Leave out orderBy, or send get: "first" to take the first by this order.' });
|
|
1065
|
-
let
|
|
1070
|
+
let C;
|
|
1066
1071
|
if (d.orderBy && l.kind !== "only") {
|
|
1067
|
-
const
|
|
1068
|
-
typeof
|
|
1072
|
+
const w = d.orderBy.field;
|
|
1073
|
+
typeof w != "string" && w.aggregate && s({
|
|
1069
1074
|
code: "invalid_change",
|
|
1070
1075
|
message: "The order names a field, not an aggregate: the first value is ordered by the latest (desc) or earliest (asc) of that field per value.",
|
|
1071
1076
|
path: `${i}.query.orderBy.field`,
|
|
1072
1077
|
fix: 'Send orderBy: { field: "<field>", direction }.'
|
|
1073
|
-
}),
|
|
1078
|
+
}), C = v(w, `${i}.query.orderBy.field`);
|
|
1074
1079
|
}
|
|
1075
|
-
return
|
|
1080
|
+
return k(
|
|
1076
1081
|
Ye(
|
|
1077
1082
|
{
|
|
1078
|
-
...
|
|
1083
|
+
...x,
|
|
1079
1084
|
field: E,
|
|
1080
1085
|
get: l.kind,
|
|
1081
|
-
...
|
|
1086
|
+
...C ? { sortField: C } : {},
|
|
1082
1087
|
sortDirection: ((D = d.orderBy) == null ? void 0 : D.direction) ?? "asc",
|
|
1083
1088
|
...l.kind === "list" && l.limit ? { listLimit: l.limit } : {},
|
|
1084
1089
|
...l.kind === "list" && l.separator !== void 0 ? { listSeparator: l.separator } : {}
|
|
@@ -1086,9 +1091,9 @@ async function wa(e, a, t) {
|
|
|
1086
1091
|
a
|
|
1087
1092
|
)
|
|
1088
1093
|
);
|
|
1089
|
-
function
|
|
1090
|
-
const N = {
|
|
1091
|
-
return
|
|
1094
|
+
function k(w) {
|
|
1095
|
+
const N = { ...w, name: e.name }, _ = Dt(N, a);
|
|
1096
|
+
return _.length && t.refuseAll(cs(_, i)), N;
|
|
1092
1097
|
}
|
|
1093
1098
|
}
|
|
1094
1099
|
function Yn(e, a, t, s) {
|
|
@@ -1156,47 +1161,47 @@ function ei(e, a, t, s, o) {
|
|
|
1156
1161
|
const i = t.document, d = e.target;
|
|
1157
1162
|
let l, c;
|
|
1158
1163
|
if ("sectionId" in d) {
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1164
|
+
const x = i.sections.find((E) => E.id === d.sectionId);
|
|
1165
|
+
x || n({ code: "invalid_change", message: `No section ${d.sectionId} on "${t.title}".`, path: `${s}.target.sectionId`, fix: "Use a section id from the outline's textSections." }), x.type !== "text" && n({ code: "invalid_change", message: `Section ${d.sectionId} is a ${x.type} section, not text.`, path: `${s}.target.sectionId`, fix: "Name one of the outline's textSections." }), l = x.content, c = x.style;
|
|
1161
1166
|
} else {
|
|
1162
|
-
const { region:
|
|
1163
|
-
Ia[
|
|
1167
|
+
const { region: x, role: E } = d;
|
|
1168
|
+
Ia[x].includes(E) || n({
|
|
1164
1169
|
code: "invalid_change",
|
|
1165
|
-
message: `The ${
|
|
1170
|
+
message: `The ${x} has ${x === "header" ? "a title and a metadata line" : "a note and a page info line"}, not a ${E} line.`,
|
|
1166
1171
|
path: `${s}.target.role`,
|
|
1167
|
-
fix: `Send role: ${Ia[
|
|
1172
|
+
fix: `Send role: ${Ia[x].map((k) => `"${k}"`).join(" or ")}.`
|
|
1168
1173
|
}), e.style !== void 0 && !Qs(E) && n({
|
|
1169
1174
|
code: "invalid_change",
|
|
1170
1175
|
message: `The footer's ${E === "pageInfo" ? "page info" : E} line has no size or alignment; only the header's title and metadata lines and text sections do.`,
|
|
1171
1176
|
path: `${s}.style`,
|
|
1172
1177
|
fix: "Leave style out for a footer line."
|
|
1173
1178
|
});
|
|
1174
|
-
const
|
|
1175
|
-
l = (
|
|
1179
|
+
const C = i[x] ? Uo(i[x].blocks, E) : void 0;
|
|
1180
|
+
l = (C == null ? void 0 : C.content) ?? [], c = C == null ? void 0 : C.style;
|
|
1176
1181
|
}
|
|
1177
|
-
const h = e.style !== void 0 ? Hs(e.style) : void 0, p = !h || Object.entries(h).every(([
|
|
1178
|
-
let
|
|
1182
|
+
const h = e.style !== void 0 ? Hs(e.style) : void 0, p = !h || Object.entries(h).every(([x, E]) => (c == null ? void 0 : c[x]) === E);
|
|
1183
|
+
let v;
|
|
1179
1184
|
if (e.text !== void 0) {
|
|
1180
|
-
const
|
|
1181
|
-
if (JSON.stringify(zs(e.text)) !==
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1184
|
-
const
|
|
1185
|
-
JSON.stringify(Ze(
|
|
1185
|
+
const x = { kind: "document", sheetId: t.id }, E = { catalog: _t({ dashboard: a, place: x }), inputs: a.inputs, variables: a.variables }, C = JSON.stringify(Ze(l, E));
|
|
1186
|
+
if (JSON.stringify(zs(e.text)) !== C) {
|
|
1187
|
+
const k = Ys(e.text, l, { dashboard: a, place: x, path: `${s}.text`, links: !0 });
|
|
1188
|
+
k.ok || o.refuseAll(k.problems);
|
|
1189
|
+
const b = k.content;
|
|
1190
|
+
JSON.stringify(Ze(b, E)) !== C && (v = b);
|
|
1186
1191
|
}
|
|
1187
1192
|
}
|
|
1188
|
-
const
|
|
1189
|
-
...
|
|
1193
|
+
const y = {
|
|
1194
|
+
...v !== void 0 ? { content: v } : {},
|
|
1190
1195
|
...h !== void 0 && !p ? { style: h } : {}
|
|
1191
1196
|
};
|
|
1192
|
-
return { edit: "sectionId" in d ? { type: "updateText", sectionId: d.sectionId, ...
|
|
1197
|
+
return { edit: "sectionId" in d ? { type: "updateText", sectionId: d.sectionId, ...y } : { type: "updateRegionText", region: d.region, role: d.role, ...y }, unchanged: v === void 0 && p };
|
|
1193
1198
|
}
|
|
1194
1199
|
class me extends Error {
|
|
1195
1200
|
}
|
|
1196
1201
|
const xa = "A text card takes title, description and text.", bt = (e) => e.cards.some((a) => {
|
|
1197
1202
|
var t, s;
|
|
1198
1203
|
return ((t = a.customCardPreferences) == null ? void 0 : t.visualType) === "multiple" || !!((s = a.customCardPreferences) != null && s.dataInputCardIds);
|
|
1199
|
-
}), Tt = (e) => (e ?? "").trim().toLowerCase(), tt = oo, Sa = { measures: lo, records: ro, sql: io },
|
|
1204
|
+
}), Tt = (e) => (e ?? "").trim().toLowerCase(), tt = oo, Sa = { measures: lo, records: ro, sql: io }, Ge = {
|
|
1200
1205
|
measures: "a measures query (measures, with optional dimensions)",
|
|
1201
1206
|
records: "a records query (columns)",
|
|
1202
1207
|
sql: "a SQL query"
|
|
@@ -1209,88 +1214,88 @@ async function Fr(e, a, t) {
|
|
|
1209
1214
|
return fs(e, a, t, { limit: ti });
|
|
1210
1215
|
}
|
|
1211
1216
|
async function fs(e, a, t, s) {
|
|
1212
|
-
var
|
|
1213
|
-
const o = [], n = [], i = [], d = [], l = /* @__PURE__ */ new Set(), c = [], h = /* @__PURE__ */ new Map(), p = { calendar: t.calendar },
|
|
1214
|
-
let
|
|
1215
|
-
const { limit:
|
|
1216
|
-
if (a.length >
|
|
1217
|
+
var Ut, Qt, Ht, zt, Yt, Jt, Xt, Zt, ea, ta, aa, sa, oa, na, ia, ra;
|
|
1218
|
+
const o = [], n = [], i = [], d = [], l = /* @__PURE__ */ new Set(), c = [], h = /* @__PURE__ */ new Map(), p = { calendar: t.calendar }, v = t.relationshipReach ? { relationshipReach: t.relationshipReach } : {};
|
|
1219
|
+
let y = e, S, x = 0, E = 0;
|
|
1220
|
+
const { limit: C } = s;
|
|
1221
|
+
if (a.length > C.max)
|
|
1217
1222
|
return {
|
|
1218
1223
|
ok: !1,
|
|
1219
1224
|
problems: [
|
|
1220
1225
|
{
|
|
1221
1226
|
code: "too_many_changes",
|
|
1222
|
-
message: `${
|
|
1227
|
+
message: `${C.what} takes at most ${C.max} changes; this one has ${a.length}.`,
|
|
1223
1228
|
path: "changes",
|
|
1224
|
-
fix:
|
|
1229
|
+
fix: C.fix
|
|
1225
1230
|
}
|
|
1226
1231
|
]
|
|
1227
1232
|
};
|
|
1228
|
-
const
|
|
1233
|
+
const k = [];
|
|
1229
1234
|
if (a.forEach((m, r) => {
|
|
1230
1235
|
const f = Zs.safeParse(m);
|
|
1231
1236
|
if (f.success) {
|
|
1232
|
-
|
|
1237
|
+
k.push(f.data);
|
|
1233
1238
|
return;
|
|
1234
1239
|
}
|
|
1235
1240
|
for (const u of f.error.issues) {
|
|
1236
|
-
const
|
|
1241
|
+
const g = en(u.message);
|
|
1237
1242
|
o.push({
|
|
1238
1243
|
code: "invalid_change",
|
|
1239
|
-
message: (
|
|
1244
|
+
message: (g == null ? void 0 : g.message) ?? u.message,
|
|
1240
1245
|
path: us(`changes[${r}]`, u),
|
|
1241
|
-
fix: (
|
|
1246
|
+
fix: (g == null ? void 0 : g.fix) ?? "Send the change in the shape the tool schema gives."
|
|
1242
1247
|
});
|
|
1243
1248
|
}
|
|
1244
1249
|
}), o.length) return { ok: !1, problems: o };
|
|
1245
|
-
const
|
|
1250
|
+
const b = (m) => {
|
|
1246
1251
|
throw o.push(m), new me();
|
|
1247
1252
|
}, D = (m) => {
|
|
1248
|
-
t.capabilities.sql ||
|
|
1253
|
+
t.capabilities.sql || b({
|
|
1249
1254
|
code: "capability_required",
|
|
1250
1255
|
message: "This change creates, reads or changes a SQL card or variable, which needs SQL access.",
|
|
1251
1256
|
path: m,
|
|
1252
1257
|
fix: "Use a measures or records query (a semantic dataset for a variable), or ask an administrator for SQL access."
|
|
1253
1258
|
}), l.add("sql");
|
|
1254
|
-
},
|
|
1255
|
-
const f = wt(
|
|
1256
|
-
f.ok ? (
|
|
1259
|
+
}, w = (m, r) => {
|
|
1260
|
+
const f = wt(y, [m], p);
|
|
1261
|
+
f.ok ? (y = f.dashboard, i.push(m)) : b({ code: "invalid_change", message: f.failedAt.message, path: r, ...f.failedAt.fix ? { fix: f.failedAt.fix } : {} });
|
|
1257
1262
|
}, N = async (m) => {
|
|
1258
1263
|
var X, Y, j, ne, fe;
|
|
1259
|
-
const { cardId: r, index: f, path: u } = m, { settings:
|
|
1260
|
-
if (!O && !A && !F && !((Y =
|
|
1261
|
-
const
|
|
1262
|
-
if (
|
|
1263
|
-
for (const H of Dn(
|
|
1264
|
+
const { cardId: r, index: f, path: u } = m, { settings: g = {}, highlights: $ } = m.request, O = g.columns && Object.keys(g.columns).length ? g.columns : void 0, A = Object.entries(g).some(([H, de]) => H !== "columns" && de !== void 0), F = !!((X = $ == null ? void 0 : $.add) != null && X.length);
|
|
1265
|
+
if (!O && !A && !F && !((Y = $ == null ? void 0 : $.remove) != null && Y.length)) return null;
|
|
1266
|
+
const T = ie(y, r).card, L = Object.values(O ?? {}).some((H) => H.label === null), q = Object.values(O ?? {}).some((H) => H.format !== void 0 && H.format !== null), M = {};
|
|
1267
|
+
if (L && !((j = T.sql) != null && j.trim()))
|
|
1268
|
+
for (const H of Dn(T)) {
|
|
1264
1269
|
const de = await t.loadCardSource(H);
|
|
1265
1270
|
de && (M[Nt(H)] = de.fields);
|
|
1266
1271
|
}
|
|
1267
|
-
let
|
|
1268
|
-
if (q && !((ne =
|
|
1269
|
-
const H = t.readModelFormats ? await t.readModelFormats({ card:
|
|
1270
|
-
|
|
1272
|
+
let G;
|
|
1273
|
+
if (q && !((ne = T.sql) != null && ne.trim())) {
|
|
1274
|
+
const H = t.readModelFormats ? await t.readModelFormats({ card: T }) : null;
|
|
1275
|
+
G = H ? { status: "read", formats: H } : { status: "unavailable" };
|
|
1271
1276
|
}
|
|
1272
1277
|
let z;
|
|
1273
|
-
if ((O || F) && ((fe =
|
|
1274
|
-
const H = t.readSqlResultColumns ? await t.readSqlResultColumns({ cardId: r, dashboard:
|
|
1275
|
-
H ||
|
|
1278
|
+
if ((O || F) && ((fe = T.sql) != null && fe.trim()) && T.type !== "kpi") {
|
|
1279
|
+
const H = t.readSqlResultColumns ? await t.readSqlResultColumns({ cardId: r, dashboard: y }) : null;
|
|
1280
|
+
H || b({
|
|
1276
1281
|
code: "columns_unavailable",
|
|
1277
|
-
message: O ? `"${
|
|
1282
|
+
message: O ? `"${T.title || "Untitled"}" couldn't be run to read its columns, so their names can't be checked.` : `"${T.title || "Untitled"}" couldn't be run to read its columns, so the highlight's column can't be checked.`,
|
|
1278
1283
|
path: O ? `${u}.columns` : `${u}.column`,
|
|
1279
1284
|
fix: "Check that the card runs and returns rows, then propose again."
|
|
1280
1285
|
}), z = H;
|
|
1281
1286
|
}
|
|
1282
|
-
const W =
|
|
1283
|
-
|
|
1287
|
+
const W = Un(
|
|
1288
|
+
T,
|
|
1284
1289
|
{
|
|
1285
|
-
settings: { ...
|
|
1286
|
-
|
|
1290
|
+
settings: { ...g, ...O ? { columns: O } : { columns: void 0 } },
|
|
1291
|
+
...$ ? { highlights: $ } : {}
|
|
1287
1292
|
},
|
|
1288
1293
|
{
|
|
1289
1294
|
path: u,
|
|
1290
1295
|
cardRef: m.cardRef,
|
|
1291
1296
|
catalogs: M,
|
|
1292
1297
|
newId: t.newId,
|
|
1293
|
-
...
|
|
1298
|
+
...G ? { modelFormats: G } : {},
|
|
1294
1299
|
...z ? { sqlResultColumns: z } : {}
|
|
1295
1300
|
}
|
|
1296
1301
|
);
|
|
@@ -1298,20 +1303,20 @@ async function fs(e, a, t, s) {
|
|
|
1298
1303
|
throw o.push(...W.problems), new me();
|
|
1299
1304
|
for (const H of W.labels) {
|
|
1300
1305
|
const de = m.queryLabels.find((Ae) => He(Ae.key, H.key) && Ae.label !== H.label);
|
|
1301
|
-
de &&
|
|
1306
|
+
de && b({
|
|
1302
1307
|
code: "value_invalid",
|
|
1303
|
-
message: `Two labels are stated for one column of "${
|
|
1308
|
+
message: `Two labels are stated for one column of "${T.title || "Untitled"}": "${de.label}" in the query and "${H.label}" in columns.`,
|
|
1304
1309
|
path: `${u}.columns`,
|
|
1305
1310
|
fix: "State the label once."
|
|
1306
1311
|
});
|
|
1307
1312
|
}
|
|
1308
|
-
return n.push(...W.warnings), W.labels.length && pa(
|
|
1309
|
-
},
|
|
1310
|
-
var
|
|
1311
|
-
const f = ie(
|
|
1312
|
-
f ||
|
|
1313
|
+
return n.push(...W.warnings), W.labels.length && pa(T, W.labels).changed.length && w({ op: "card.update", cardId: r, update: { kind: "relabel", labels: W.labels }, changeIndex: f }, `${u}.columns`), W.settings && w({ op: "card.update", cardId: r, update: { kind: "settings", settings: W.settings }, changeIndex: f }, O ? `${u}.columns` : u), W.settings;
|
|
1314
|
+
}, _ = (m, r) => {
|
|
1315
|
+
var g;
|
|
1316
|
+
const f = ie(y, m);
|
|
1317
|
+
f || b({ code: "card_not_editable", message: "Cards in Document sections are changed in the editor.", path: `${r}.cardId`, fix: "Tell the user to change it in the editor.", details: { reason: "document_section" } });
|
|
1313
1318
|
const u = we(f.card, { sql: !0 });
|
|
1314
|
-
return ((
|
|
1319
|
+
return ((g = u.source) == null ? void 0 : g.kind) === "sql" && D(`${r}.cardId`), u.editable || b({
|
|
1315
1320
|
code: "card_not_editable",
|
|
1316
1321
|
message: u.message,
|
|
1317
1322
|
path: `${r}.cardId`,
|
|
@@ -1323,23 +1328,23 @@ async function fs(e, a, t, s) {
|
|
|
1323
1328
|
path: r,
|
|
1324
1329
|
details: { cardIds: [m] }
|
|
1325
1330
|
}), { card: f.card, read: u };
|
|
1326
|
-
},
|
|
1327
|
-
var
|
|
1328
|
-
const u =
|
|
1329
|
-
return r.map(({ index:
|
|
1331
|
+
}, I = /* @__PURE__ */ new Map(), R = (m, r, f) => {
|
|
1332
|
+
var g;
|
|
1333
|
+
const u = ja("metric", ((g = m.config) == null ? void 0 : g.metricColumns) ?? []);
|
|
1334
|
+
return r.map(({ index: $, calculations: O }) => ({
|
|
1330
1335
|
...O,
|
|
1331
|
-
measure: u[
|
|
1332
|
-
path: `${f}.query.measures[${
|
|
1336
|
+
measure: u[$] ?? { role: "metric", field: "", ordinal: $ },
|
|
1337
|
+
path: `${f}.query.measures[${$}]`
|
|
1333
1338
|
}));
|
|
1334
|
-
},
|
|
1335
|
-
const r = ie(
|
|
1339
|
+
}, P = async (m) => {
|
|
1340
|
+
const r = ie(y, m.cardId).card, f = R(r, m.stated, m.path), u = f.some((O) => {
|
|
1336
1341
|
var A, F;
|
|
1337
1342
|
return ((A = O.comparison) == null ? void 0 : A.kind) === "previous_period" || ((F = O.comparison) == null ? void 0 : F.kind) === "previous_year";
|
|
1338
|
-
}),
|
|
1339
|
-
if (
|
|
1340
|
-
throw o.push(
|
|
1341
|
-
return n.push(
|
|
1342
|
-
{ op: "card.update", cardId: m.cardId, update: { kind: "calculations", calculations:
|
|
1343
|
+
}), g = u && t.readComparisonDates ? await t.readComparisonDates({ card: r, dashboard: y }) : ka(r), $ = fa({ card: r, stated: f, context: { path: m.path, cardRef: m.cardRef, dates: g } });
|
|
1344
|
+
if (!$.ok)
|
|
1345
|
+
throw o.push(...$.problems), new me();
|
|
1346
|
+
return n.push(...$.warnings), u && I.set(m.cardId, m.path), $.update ? (w(
|
|
1347
|
+
{ op: "card.update", cardId: m.cardId, update: { kind: "calculations", calculations: $.update }, changeIndex: m.index },
|
|
1343
1348
|
`${m.path}.query`
|
|
1344
1349
|
), !0) : !1;
|
|
1345
1350
|
}, V = (m) => ({
|
|
@@ -1353,63 +1358,64 @@ async function fs(e, a, t, s) {
|
|
|
1353
1358
|
axes: m.axes,
|
|
1354
1359
|
comparisonDisplay: m.comparisonDisplay,
|
|
1355
1360
|
inheritComparison: m.inheritComparison,
|
|
1356
|
-
|
|
1361
|
+
trend: m.trend,
|
|
1362
|
+
trendGrain: m.trendGrain,
|
|
1357
1363
|
seeRecords: m.seeRecords
|
|
1358
|
-
}), K = (m) => Object.entries(V(m)).filter(([, r]) => r !== void 0).map(([r]) => r), B = (m) => (o.push(...m.slice(0, -1)),
|
|
1359
|
-
const { card:
|
|
1360
|
-
|
|
1364
|
+
}), K = (m) => Object.entries(V(m)).filter(([, r]) => r !== void 0).map(([r]) => r), B = (m) => (o.push(...m.slice(0, -1)), b(m[m.length - 1])), se = (m, r, f, u) => {
|
|
1365
|
+
const { card: g } = r, $ = [...m.type ? ["type"] : [], ...m.query ? ["query"] : [], ...m.matrix ? ["matrix"] : [], ...K(m)];
|
|
1366
|
+
$.length && b({
|
|
1361
1367
|
code: "invalid_change",
|
|
1362
|
-
message: `"${
|
|
1368
|
+
message: `"${g.title}" is a text card, so it takes no ${et($)}.`,
|
|
1363
1369
|
path: u,
|
|
1364
1370
|
fix: "Change a card to or from text in the editor, or add a new card and remove this one."
|
|
1365
1371
|
});
|
|
1366
|
-
const O =
|
|
1367
|
-
O.editable ||
|
|
1372
|
+
const O = Ka(g, { inputs: y.inputs, variables: y.variables });
|
|
1373
|
+
O.editable || b({ code: "card_not_editable", message: O.message, path: `${u}.cardId`, fix: "Tell the user to change it in the editor.", details: { reason: "text" } });
|
|
1368
1374
|
const A = O.editable && (O.form === "legacy_html" || O.form === "legacy_runs");
|
|
1369
|
-
A && m.description !== void 0 && m.text === void 0 &&
|
|
1375
|
+
A && m.description !== void 0 && m.text === void 0 && b({
|
|
1370
1376
|
code: "invalid_change",
|
|
1371
|
-
message: `"${
|
|
1377
|
+
message: `"${g.title}" keeps its words in its description, so a description change would replace them.`,
|
|
1372
1378
|
path: `${u}.description`,
|
|
1373
1379
|
fix: "Send the words in text with it: they are stored as rich text, and the description becomes the subtitle."
|
|
1374
|
-
}), d.push({ ref: m.cardId, kind: "card", id:
|
|
1375
|
-
let F = !1,
|
|
1380
|
+
}), d.push({ ref: m.cardId, kind: "card", id: g.id, title: m.title ?? g.title ?? "", changeIndex: f });
|
|
1381
|
+
let F = !1, T = !1;
|
|
1376
1382
|
if (m.text !== void 0) {
|
|
1377
1383
|
const M = ga({
|
|
1378
1384
|
text: m.text,
|
|
1379
|
-
card:
|
|
1385
|
+
card: g,
|
|
1380
1386
|
// Any variable the catalog offers where the card sits (DV-D13).
|
|
1381
|
-
context: { dashboard:
|
|
1387
|
+
context: { dashboard: y, place: { kind: "sheet", sheetId: r.sheet.id, cardId: g.id } },
|
|
1382
1388
|
path: `${u}.text`,
|
|
1383
1389
|
storeAsRichText: A && m.description !== void 0
|
|
1384
1390
|
});
|
|
1385
|
-
M.ok || B(M.problems), M.ok && !M.unchanged && (
|
|
1391
|
+
M.ok || B(M.problems), M.ok && !M.unchanged && (w({ op: "card.update", cardId: g.id, update: { kind: "text", richContent: M.richContent, clearsLegacy: M.clearsLegacy }, changeIndex: f }, u), F = !0, T = M.clearsLegacy);
|
|
1386
1392
|
}
|
|
1387
|
-
const
|
|
1388
|
-
(
|
|
1393
|
+
const L = m.title !== void 0 && m.title !== g.title, q = m.description !== void 0 && (A ? T : (m.description ?? void 0) !== (g.description ?? void 0));
|
|
1394
|
+
(L || q) && (w(
|
|
1389
1395
|
{
|
|
1390
1396
|
op: "card.update",
|
|
1391
|
-
cardId:
|
|
1392
|
-
update: { kind: "rename", ...
|
|
1397
|
+
cardId: g.id,
|
|
1398
|
+
update: { kind: "rename", ...L ? { title: m.title } : {}, ...q ? { description: m.description } : {} },
|
|
1393
1399
|
changeIndex: f
|
|
1394
1400
|
},
|
|
1395
1401
|
u
|
|
1396
1402
|
), F = !0), F && r.frame.visualId && n.push({
|
|
1397
1403
|
code: "detaches_linked_visual",
|
|
1398
|
-
message: `"${
|
|
1404
|
+
message: `"${g.title}" will stop following its library visual and become local to this dashboard.`,
|
|
1399
1405
|
path: u,
|
|
1400
|
-
details: { cardIds: [
|
|
1406
|
+
details: { cardIds: [g.id] }
|
|
1401
1407
|
});
|
|
1402
1408
|
}, oe = (m, r) => {
|
|
1403
1409
|
if (m.startsWith("$")) {
|
|
1404
1410
|
const f = h.get(m);
|
|
1405
|
-
return (!f || f.kind !== "card") &&
|
|
1411
|
+
return (!f || f.kind !== "card") && b({
|
|
1406
1412
|
code: "handle_unknown",
|
|
1407
1413
|
message: `${m} isn't a card handle defined earlier in this list.`,
|
|
1408
1414
|
path: r,
|
|
1409
1415
|
fix: "Define the handle with an earlier card.add, or use the card id from the outline."
|
|
1410
1416
|
}), f.id;
|
|
1411
1417
|
}
|
|
1412
|
-
return xe(
|
|
1418
|
+
return xe(y).some((f) => f.cardId === m) || b({
|
|
1413
1419
|
code: "card_not_found",
|
|
1414
1420
|
message: `There's no card ${m} on this dashboard.`,
|
|
1415
1421
|
path: r,
|
|
@@ -1418,197 +1424,197 @@ async function fs(e, a, t, s) {
|
|
|
1418
1424
|
}, te = (m, r) => {
|
|
1419
1425
|
if (m.startsWith("$")) {
|
|
1420
1426
|
const u = h.get(m);
|
|
1421
|
-
return (!u || u.kind !== "filter") &&
|
|
1427
|
+
return (!u || u.kind !== "filter") && b({
|
|
1422
1428
|
code: "handle_unknown",
|
|
1423
1429
|
message: `${m} isn't a filter handle defined earlier in this list.`,
|
|
1424
1430
|
path: r,
|
|
1425
1431
|
fix: "Define the handle with an earlier filter.add, or use the filter id from the outline."
|
|
1426
1432
|
}), u.id;
|
|
1427
1433
|
}
|
|
1428
|
-
return (Array.isArray(
|
|
1434
|
+
return (Array.isArray(y.inputs) ? y.inputs : []).some((u) => u.id === m && u.kind === "filter") || b({
|
|
1429
1435
|
code: "filter_not_found",
|
|
1430
1436
|
message: `There's no filter ${m} on this dashboard.`,
|
|
1431
1437
|
path: r,
|
|
1432
1438
|
fix: "Read the outline again and use its filter ids."
|
|
1433
1439
|
}), m;
|
|
1434
1440
|
}, Bt = (m, r) => {
|
|
1435
|
-
const f = m.startsWith("$") ? void 0 : Je(
|
|
1441
|
+
const f = m.startsWith("$") ? void 0 : Je(y, m);
|
|
1436
1442
|
return f ? f.id : oe(m, r);
|
|
1437
|
-
}, Te = { services: t, problem:
|
|
1443
|
+
}, Te = { services: t, problem: b, refuseAll: B, need: D }, nt = () => (y.sheets ?? []).filter((m) => !Xe(m)), Be = () => nt().map((m) => ({ sheetId: m.id, title: m.title ?? "" })), it = (m, r, f) => {
|
|
1438
1444
|
let u = m;
|
|
1439
1445
|
if (m.startsWith("$")) {
|
|
1440
|
-
const
|
|
1441
|
-
(
|
|
1446
|
+
const $ = h.get(m);
|
|
1447
|
+
(!$ || $.kind !== "sheet") && b({
|
|
1442
1448
|
code: "handle_unknown",
|
|
1443
1449
|
message: `${m} isn't a sheet handle defined earlier in this list.`,
|
|
1444
1450
|
path: r,
|
|
1445
1451
|
fix: "Define the handle with an earlier sheet.add, or use the sheet id from the outline."
|
|
1446
|
-
}), u =
|
|
1452
|
+
}), u = $.id;
|
|
1447
1453
|
}
|
|
1448
|
-
const
|
|
1449
|
-
return
|
|
1450
|
-
}, Re = (m, r) => it(m, r, { grid: !0 }), Vt = (m, r) => m.map((f, u) => Re(f, `${r}.sheetIds[${u}]`).id),
|
|
1454
|
+
const g = (y.sheets ?? []).find(($) => $.id === u);
|
|
1455
|
+
return g || b({ code: "sheet_not_found", message: `There's no sheet ${u} on this dashboard.`, path: r, fix: "Read the outline again and use its sheet ids.", details: { sheets: Be() } }), f.grid && Xe(g) && b({ code: "sheet_not_a_grid", message: `"${g.title}" is a Document sheet.`, path: r, fix: "Add the card to a grid sheet; Document sheets are changed in the editor.", details: { sheets: Be() } }), g;
|
|
1456
|
+
}, Re = (m, r) => it(m, r, { grid: !0 }), Vt = (m, r) => m.map((f, u) => Re(f, `${r}.sheetIds[${u}]`).id), Kt = (m, r, f, u) => {
|
|
1451
1457
|
var A;
|
|
1452
|
-
for (const F of Ma(r, f))
|
|
1453
|
-
const
|
|
1454
|
-
if (O && typeof O != "string" && O.label && !r.timeGrain &&
|
|
1458
|
+
for (const F of Ma(r, f)) b({ ...F, path: `${u}.${F.path}` });
|
|
1459
|
+
const g = Fe[m], $ = tt(r), O = r.dateField;
|
|
1460
|
+
if (O && typeof O != "string" && O.label && !r.timeGrain && b({
|
|
1455
1461
|
code: "invalid_change",
|
|
1456
1462
|
message: "A label names a column, and the date field is a column only when the card groups by it.",
|
|
1457
1463
|
path: `${u}.query.dateField.label`,
|
|
1458
1464
|
fix: "Send timeGrain to group by the date, or leave the label out."
|
|
1459
|
-
}), !
|
|
1460
|
-
const F = Object.keys(Fe).filter((
|
|
1461
|
-
|
|
1465
|
+
}), !g.forms.includes($)) {
|
|
1466
|
+
const F = Object.keys(Fe).filter((T) => Fe[T].forms.includes($));
|
|
1467
|
+
b({
|
|
1462
1468
|
code: "type_not_supported",
|
|
1463
|
-
message: `A ${m.replace(/_/g, " ")} card takes ${
|
|
1469
|
+
message: `A ${m.replace(/_/g, " ")} card takes ${g.forms.map((T) => Ge[T]).join(" or ")}, not ${Ge[$]}.`,
|
|
1464
1470
|
path: `${u}.query`,
|
|
1465
|
-
fix: `Send ${
|
|
1471
|
+
fix: `Send ${g.forms.map((T) => Ge[T]).join(" or ")}, or use a type this query fits: ${F.join(", ")}.`
|
|
1466
1472
|
});
|
|
1467
1473
|
}
|
|
1468
|
-
if (
|
|
1469
|
-
const F = r,
|
|
1470
|
-
|
|
1474
|
+
if ($ === "measures") {
|
|
1475
|
+
const F = r, T = F.measures.length;
|
|
1476
|
+
g.measures && (T < g.measures.min || g.measures.max !== void 0 && T > g.measures.max) && b({
|
|
1471
1477
|
code: "type_not_supported",
|
|
1472
|
-
message: `A ${m.replace(/_/g, " ")} card shows exactly ${
|
|
1478
|
+
message: `A ${m.replace(/_/g, " ")} card shows exactly ${g.measures.max} measure.`,
|
|
1473
1479
|
path: `${u}.query.measures`,
|
|
1474
1480
|
fix: "Send one measure, or use a table or chart for several."
|
|
1475
|
-
}), !
|
|
1481
|
+
}), !g.dimensions && ((A = F.dimensions) != null && A.length) && b({
|
|
1476
1482
|
code: "type_not_supported",
|
|
1477
1483
|
message: `A ${m.replace(/_/g, " ")} card shows one number, so it has no dimensions.`,
|
|
1478
1484
|
path: `${u}.query.dimensions`,
|
|
1479
1485
|
fix: "Remove the dimensions, or use a table or chart."
|
|
1480
|
-
}), m === "matrix" && (F.orderBy || F.limit) &&
|
|
1486
|
+
}), m === "matrix" && (F.orderBy || F.limit) && b({
|
|
1481
1487
|
code: "type_not_supported",
|
|
1482
1488
|
message: "A Matrix's sorting and top N are set in the editor.",
|
|
1483
1489
|
path: `${u}.query`,
|
|
1484
1490
|
fix: "Leave out orderBy and limit for a Matrix."
|
|
1485
1491
|
});
|
|
1486
1492
|
}
|
|
1487
|
-
if (
|
|
1493
|
+
if (g.matrixColumns && !f && b({
|
|
1488
1494
|
code: "type_not_supported",
|
|
1489
1495
|
message: "A Matrix needs matrix.columns: the query fields that run across the top.",
|
|
1490
1496
|
path: `${u}.matrix`,
|
|
1491
1497
|
fix: "Send matrix: { columns: [...] } naming dimensions or the date field of the query (an empty list puts nothing across the top)."
|
|
1492
|
-
}), !
|
|
1493
|
-
const F = r,
|
|
1494
|
-
|
|
1498
|
+
}), !g.matrixColumns && f && b({ code: "type_not_supported", message: "matrix.columns is only for Matrix cards.", path: `${u}.matrix`, fix: 'Leave out matrix, or use type "matrix".' }), f && $ === "measures") {
|
|
1499
|
+
const F = r, T = F.datasetName, L = [...F.dimensions ?? [], ...F.timeGrain && F.dateField ? [F.dateField] : []];
|
|
1500
|
+
L.length && f.columns.length >= L.length && L.every((M) => f.columns.some((G) => be(G, T) === be(M, T))) && b({
|
|
1495
1501
|
code: "type_not_supported",
|
|
1496
1502
|
message: "A Matrix needs at least one field down the side.",
|
|
1497
1503
|
path: `${u}.matrix.columns`,
|
|
1498
1504
|
fix: "Leave one dimension or the date field out of matrix.columns."
|
|
1499
1505
|
});
|
|
1500
|
-
const q = new Set([...F.dimensions ?? [], ...F.dateField ? [F.dateField] : []].map((M) => be(M,
|
|
1501
|
-
f.columns.forEach((M,
|
|
1502
|
-
q.has(be(M,
|
|
1506
|
+
const q = new Set([...F.dimensions ?? [], ...F.dateField ? [F.dateField] : []].map((M) => be(M, T)));
|
|
1507
|
+
f.columns.forEach((M, G) => {
|
|
1508
|
+
q.has(be(M, T)) || b({
|
|
1503
1509
|
code: "type_not_supported",
|
|
1504
1510
|
message: `"${Ct(M)}" isn't one of the query's dimensions or its date field.`,
|
|
1505
|
-
path: `${u}.matrix.columns[${
|
|
1511
|
+
path: `${u}.matrix.columns[${G}]`,
|
|
1506
1512
|
fix: "Name dimensions or the date field of the query in matrix.columns."
|
|
1507
1513
|
});
|
|
1508
1514
|
});
|
|
1509
1515
|
}
|
|
1510
|
-
},
|
|
1516
|
+
}, jt = (m, r) => b({
|
|
1511
1517
|
code: m.code === "query_not_kept" ? "card_not_editable" : "invalid_change",
|
|
1512
1518
|
message: m.message,
|
|
1513
1519
|
path: `${r}.query`,
|
|
1514
1520
|
fix: m.code === "query_not_kept" ? "Tell the user to make this change in the editor." : "Read the outline again and propose again.",
|
|
1515
1521
|
details: { reason: "not_expressible", ..."parts" in m ? { parts: m.parts } : {} }
|
|
1516
|
-
}), Wt = (m, r, f, u,
|
|
1517
|
-
const A = Hn(m, r, f,
|
|
1522
|
+
}), Wt = (m, r, f, u, g, $, O) => {
|
|
1523
|
+
const A = Hn(m, r, f, $, O);
|
|
1518
1524
|
if (!A.length) return;
|
|
1519
1525
|
const F = r;
|
|
1520
1526
|
if (A.length === 1 && A[0] === "dateField" && F.dateField && !F.timeGrain && !F.timeWindow) {
|
|
1521
|
-
|
|
1527
|
+
b({
|
|
1522
1528
|
code: "value_invalid",
|
|
1523
|
-
message: `A dateField on its own doesn't change "${
|
|
1529
|
+
message: `A dateField on its own doesn't change "${g}": it needs timeGrain to group by the date (a KPI's Trend By) or a timeWindow to filter by it.`,
|
|
1524
1530
|
path: `${u}.query.dateField`,
|
|
1525
1531
|
fix: 'Add timeGrain (for example "month") or a timeWindow, or leave out dateField.'
|
|
1526
1532
|
});
|
|
1527
1533
|
return;
|
|
1528
1534
|
}
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1535
|
+
const T = A.join(", ");
|
|
1536
|
+
b({
|
|
1531
1537
|
code: "card_not_editable",
|
|
1532
|
-
message: O ? `As changed, "${
|
|
1538
|
+
message: O ? `As changed, "${g}" wouldn't hold ${T} as asked, so make this change in the editor.` : `"${g}" can't be built holding ${T} as asked.`,
|
|
1533
1539
|
path: `${u}.query`,
|
|
1534
|
-
fix: O ? "Tell the user to make this change in the editor." : `Leave out ${
|
|
1535
|
-
details: { reason: "not_expressible", detail: `doesn't hold: ${
|
|
1540
|
+
fix: O ? "Tell the user to make this change in the editor." : `Leave out ${T}; the rest of the card can be added.`,
|
|
1541
|
+
details: { reason: "not_expressible", detail: `doesn't hold: ${T}` }
|
|
1536
1542
|
});
|
|
1537
|
-
},
|
|
1538
|
-
const
|
|
1543
|
+
}, Gt = async (m, r, f, u, g = !1) => {
|
|
1544
|
+
const $ = ct(m);
|
|
1539
1545
|
if ("sql" in r)
|
|
1540
|
-
return D(`${u}.query`), { type:
|
|
1541
|
-
const O =
|
|
1546
|
+
return D(`${u}.query`), { type: $, source: { kind: "sql", connectionId: r.connectionId, sql: r.sql } };
|
|
1547
|
+
const O = $ === "matrixTable" || $ === "detailTable" ? "table" : $, A = await t.compileCardQuery({ query: r, chartType: O });
|
|
1542
1548
|
if (!A.ok)
|
|
1543
1549
|
throw o.push(...A.problems.map((q) => ({ ...q, path: q.path ? `${u}.query.${q.path}` : `${u}.query` }))), new me();
|
|
1544
1550
|
n.push(...A.warnings.map((q) => ({ ...q, path: q.path ?? `${u}.query` })));
|
|
1545
|
-
const F = !
|
|
1546
|
-
F && "timeWindow" in r && r.timeWindow && hs(r.timeWindow, { use: "cardFilter", columnHasTime: uo(F) }, `${u}.query.timeWindow`,
|
|
1547
|
-
let
|
|
1548
|
-
const
|
|
1549
|
-
if (
|
|
1550
|
-
const q = fo(mo("table", "detailTable",
|
|
1551
|
-
|
|
1551
|
+
const F = !g && "timeWindow" in r && r.timeWindow ? ci(A.part.config) : void 0;
|
|
1552
|
+
F && "timeWindow" in r && r.timeWindow && hs(r.timeWindow, { use: "cardFilter", columnHasTime: uo(F) }, `${u}.query.timeWindow`, b);
|
|
1553
|
+
let T = { ...A.part, type: $ };
|
|
1554
|
+
const L = T.config ?? {};
|
|
1555
|
+
if ($ === "detailTable") {
|
|
1556
|
+
const q = fo(mo("table", "detailTable", L)) ?? {};
|
|
1557
|
+
T = { ...T, config: si(q) };
|
|
1552
1558
|
}
|
|
1553
|
-
return
|
|
1554
|
-
}, vs = async (m, r, f, u,
|
|
1559
|
+
return $ === "matrixTable" && (T = await vs(T, L, r, f, u)), oi(T, qe(r));
|
|
1560
|
+
}, vs = async (m, r, f, u, g) => {
|
|
1555
1561
|
var q;
|
|
1556
|
-
const
|
|
1557
|
-
if (
|
|
1558
|
-
const O = { id: "scratch", title: "", type: "table", dataSource: m.source.dataSource, config: r }, A = po(O, "matrixTable", { catalog:
|
|
1559
|
-
(A.status !== "changed" || A.leftOut.length || !F) &&
|
|
1562
|
+
const $ = await t.loadCardSource({ domainId: f.domainId, datasetName: f.datasetName });
|
|
1563
|
+
if ($ || b({ code: "field_not_found", message: `The dataset "${f.datasetName}" isn't available.`, path: `${g}.query.datasetName`, fix: "Find datasets with semaphor_list_datasets." }), m.source.kind !== "semantic") throw new me();
|
|
1564
|
+
const O = { id: "scratch", title: "", type: "table", dataSource: m.source.dataSource, config: r }, A = po(O, "matrixTable", { catalog: $.fields, createId: t.newId }), F = A.status === "changed" ? (q = A.card.config) == null ? void 0 : q.matrix : void 0;
|
|
1565
|
+
(A.status !== "changed" || A.leftOut.length || !F) && b({
|
|
1560
1566
|
code: "type_not_supported",
|
|
1561
1567
|
message: A.status === "changed" && A.leftOut.length ? `These fields can't run in a Matrix: ${A.leftOut.join(", ")}.` : "This query can't be shown as a Matrix.",
|
|
1562
|
-
path: `${
|
|
1568
|
+
path: `${g}.query`,
|
|
1563
1569
|
fix: "Use plain dataset fields for a Matrix, or use a table."
|
|
1564
1570
|
});
|
|
1565
|
-
let
|
|
1566
|
-
const
|
|
1567
|
-
for (const [M,
|
|
1568
|
-
const z = [...
|
|
1569
|
-
(W) => go(W.field) === be(
|
|
1571
|
+
let T = F;
|
|
1572
|
+
const L = f.datasetName;
|
|
1573
|
+
for (const [M, G] of u.columns.entries()) {
|
|
1574
|
+
const z = [...T.spec.rows, ...T.spec.columns].find(
|
|
1575
|
+
(W) => go(W.field) === be(G, L)
|
|
1570
1576
|
);
|
|
1571
|
-
z ||
|
|
1577
|
+
z || b({ code: "type_not_supported", message: `"${Ct(G)}" isn't a level of this Matrix.`, path: `${g}.matrix.columns[${M}]`, fix: "Name dimensions or the date field of the query in matrix.columns." }), T = bo(T, yo(T.spec, z.id, "columns")).config;
|
|
1572
1578
|
}
|
|
1573
|
-
return { ...m, config: { matrix:
|
|
1579
|
+
return { ...m, config: { matrix: T } };
|
|
1574
1580
|
}, rt = /* @__PURE__ */ new Map(), dt = /* @__PURE__ */ new Map();
|
|
1575
|
-
for (const [m, r] of
|
|
1581
|
+
for (const [m, r] of k.entries()) {
|
|
1576
1582
|
const f = `changes[${m}]`;
|
|
1577
1583
|
try {
|
|
1578
1584
|
switch (r.op) {
|
|
1579
1585
|
case "card.add": {
|
|
1580
1586
|
const u = r.position && typeof r.position == "object" ? (() => {
|
|
1581
|
-
const Y = oe(r.position.after, `${f}.position.after`), j = xe(
|
|
1587
|
+
const Y = oe(r.position.after, `${f}.position.after`), j = xe(y).find(
|
|
1582
1588
|
(ne) => ne.cardId === Y && ne.kind === "frameCard"
|
|
1583
1589
|
);
|
|
1584
|
-
return !j || j.kind !== "frameCard" ?
|
|
1590
|
+
return !j || j.kind !== "frameCard" ? b({
|
|
1585
1591
|
code: "card_not_found",
|
|
1586
1592
|
message: `${r.position.after} isn't a card on a grid sheet.`,
|
|
1587
1593
|
path: `${f}.position.after`,
|
|
1588
1594
|
fix: "Use a cardId from semaphor_get_dashboard_details on the same sheet, or a handle from this proposal."
|
|
1589
|
-
}) : (r.sheetId && Re(r.sheetId, `${f}.sheetId`).id !== j.sheetId &&
|
|
1595
|
+
}) : (r.sheetId && Re(r.sheetId, `${f}.sheetId`).id !== j.sheetId && b({
|
|
1590
1596
|
code: "invalid_change",
|
|
1591
1597
|
message: `position.after names a card on another sheet than ${r.sheetId}.`,
|
|
1592
1598
|
path: `${f}.position.after`,
|
|
1593
1599
|
fix: "Leave out sheetId, or name the card's sheet."
|
|
1594
1600
|
}), { sheetId: j.sheetId, frameId: j.frameId });
|
|
1595
|
-
})() : void 0,
|
|
1601
|
+
})() : void 0, g = u ? Re(u.sheetId, `${f}.position.after`) : r.sheetId ? Re(r.sheetId, `${f}.sheetId`) : (() => {
|
|
1596
1602
|
const Y = nt();
|
|
1597
|
-
return Y.length !== 1 &&
|
|
1603
|
+
return Y.length !== 1 && b({
|
|
1598
1604
|
code: Y.length ? "sheet_required" : "sheet_not_a_grid",
|
|
1599
1605
|
message: Y.length ? "This dashboard has several grid sheets; say which one gets the card." : "This dashboard has no grid sheet to add a card to.",
|
|
1600
1606
|
path: `${f}.sheetId`,
|
|
1601
1607
|
fix: Y.length ? "Send sheetId: one of details.sheets." : "Add a sheet with sheet.add earlier in this list.",
|
|
1602
1608
|
details: { sheets: Be() }
|
|
1603
1609
|
}), Y[0];
|
|
1604
|
-
})(),
|
|
1605
|
-
const j = r.handle ?? `$card_${++
|
|
1606
|
-
return h.has(j) &&
|
|
1610
|
+
})(), $ = u ? { after: u.frameId } : typeof r.position == "string" ? r.position : void 0, O = $ || r.width ? { ...$ ? { position: $ } : {}, ...r.width ? { width: r.width } : {} } : void 0, A = (Y) => {
|
|
1611
|
+
const j = r.handle ?? `$card_${++x}`;
|
|
1612
|
+
return h.has(j) && b({ code: "invalid_change", message: `The handle ${j} is defined twice.`, path: `${f}.handle`, fix: "Give each new card, filter or sheet its own handle." }), h.set(j, { kind: "card", id: Y.id, title: r.title }), d.push({ ref: j, kind: "card", id: Y.id, title: r.title, changeIndex: m }), j;
|
|
1607
1613
|
};
|
|
1608
1614
|
if (r.type === "text") {
|
|
1609
1615
|
const Y = [...r.query ? ["query"] : [], ...r.matrix ? ["matrix"] : [], ...K(r)];
|
|
1610
|
-
Y.length &&
|
|
1611
|
-
const j = ga({ text: r.text, context: { dashboard:
|
|
1616
|
+
Y.length && b({ code: "invalid_change", message: `A text card takes no ${et(Y)}.`, path: f, fix: xa }), r.text === void 0 && b({ code: "invalid_change", message: "A text card needs its words in text.", path: `${f}.text`, fix: xa });
|
|
1617
|
+
const j = ga({ text: r.text, context: { dashboard: y, place: { kind: "sheet", sheetId: g.id } }, path: `${f}.text` });
|
|
1612
1618
|
j.ok || B(j.problems);
|
|
1613
1619
|
const ne = Ho({
|
|
1614
1620
|
id: t.newId(),
|
|
@@ -1616,84 +1622,84 @@ async function fs(e, a, t, s) {
|
|
|
1616
1622
|
...r.description ? { description: r.description } : {},
|
|
1617
1623
|
richContent: j.ok && !j.unchanged ? j.richContent : { version: 1, blocks: [{ type: "paragraph", children: [] }] }
|
|
1618
1624
|
});
|
|
1619
|
-
|
|
1625
|
+
w({ op: "card.add", sheetId: g.id, frame: { id: t.newId(), cards: [ne], activeCardId: ne.id }, ...O ? { placement: O } : {}, changeIndex: m }, f), A(ne);
|
|
1620
1626
|
break;
|
|
1621
1627
|
}
|
|
1622
|
-
(r.text !== void 0 || !r.query) &&
|
|
1628
|
+
(r.text !== void 0 || !r.query) && b({
|
|
1623
1629
|
code: "invalid_change",
|
|
1624
1630
|
message: r.text !== void 0 ? `A ${r.type} card takes a query, not text.` : `A ${r.type} card needs a query.`,
|
|
1625
1631
|
path: r.text !== void 0 ? `${f}.text` : `${f}.query`,
|
|
1626
1632
|
fix: "Send query; text is for type text."
|
|
1627
1633
|
});
|
|
1628
|
-
const F = yt(r.query),
|
|
1629
|
-
|
|
1630
|
-
const q = await
|
|
1634
|
+
const F = yt(r.query), T = F.query, L = r.type;
|
|
1635
|
+
Kt(L, T, r.matrix, f);
|
|
1636
|
+
const q = await Gt(L, T, r.matrix, f), M = {
|
|
1631
1637
|
...zo({ id: t.newId(), title: r.title, ...r.description ? { description: r.description } : {} }),
|
|
1632
1638
|
type: q.type
|
|
1633
|
-
},
|
|
1634
|
-
|
|
1635
|
-
const z =
|
|
1636
|
-
Wt(z,
|
|
1639
|
+
}, G = ha(M, q);
|
|
1640
|
+
G.ok || b({ code: "invalid_change", message: G.message, path: f });
|
|
1641
|
+
const z = G.ok ? G.card : M;
|
|
1642
|
+
Wt(z, T, r.matrix, f, r.title, q);
|
|
1637
1643
|
const W = { id: t.newId(), cards: [z], activeCardId: z.id };
|
|
1638
|
-
|
|
1644
|
+
w({ op: "card.add", sheetId: g.id, frame: W, ...O ? { placement: O } : {}, changeIndex: m }, f);
|
|
1639
1645
|
const X = A(z);
|
|
1640
|
-
c.push(z.id), await
|
|
1646
|
+
c.push(z.id), await P({ cardId: z.id, cardRef: X, stated: F.calculations, index: m, path: f }), await N({
|
|
1641
1647
|
cardId: z.id,
|
|
1642
1648
|
cardRef: X,
|
|
1643
1649
|
request: { settings: V(r) },
|
|
1644
|
-
queryLabels: "sql" in
|
|
1650
|
+
queryLabels: "sql" in T ? [] : qe(T),
|
|
1645
1651
|
index: m,
|
|
1646
1652
|
path: f
|
|
1647
1653
|
});
|
|
1648
1654
|
break;
|
|
1649
1655
|
}
|
|
1650
1656
|
case "card.update": {
|
|
1651
|
-
const u = oe(r.cardId, `${f}.cardId`),
|
|
1652
|
-
if ((
|
|
1653
|
-
se(r,
|
|
1657
|
+
const u = oe(r.cardId, `${f}.cardId`), g = ie(y, u);
|
|
1658
|
+
if ((g == null ? void 0 : g.card.type) === "text") {
|
|
1659
|
+
se(r, g, m, f);
|
|
1654
1660
|
break;
|
|
1655
1661
|
}
|
|
1656
|
-
r.text !== void 0 &&
|
|
1657
|
-
const { card:
|
|
1662
|
+
r.text !== void 0 && b({ code: "invalid_change", message: `"${(g == null ? void 0 : g.card.title) ?? u}" isn't a text card, so it takes no text.`, path: `${f}.text`, fix: "Change its query; text is for text cards." });
|
|
1663
|
+
const { card: $, read: O } = _(u, f);
|
|
1658
1664
|
let A = !1, F = [];
|
|
1659
|
-
const
|
|
1660
|
-
if (
|
|
1661
|
-
const q = O.editable ? O.source : void 0, M = eo(
|
|
1662
|
-
...
|
|
1663
|
-
...M && !
|
|
1665
|
+
const T = r.type && r.type !== ((Ut = Ee($)) == null ? void 0 : Ut.type) ? ct(r.type) : void 0;
|
|
1666
|
+
if (T && T !== $.type) {
|
|
1667
|
+
const q = O.editable ? O.source : void 0, M = eo($, T), G = M && q && q.kind === "semantic" ? (Qt = await t.loadCardSource({ domainId: q.domainId, datasetName: q.datasetName })) == null ? void 0 : Qt.fields : void 0, z = [], W = to($, T, {
|
|
1668
|
+
...G ? { catalog: G } : {},
|
|
1669
|
+
...M && !G ? { catalogLoading: !0 } : {},
|
|
1664
1670
|
createId: () => {
|
|
1665
1671
|
const X = t.newId();
|
|
1666
1672
|
return z.push(X), X;
|
|
1667
1673
|
}
|
|
1668
1674
|
});
|
|
1669
|
-
if (W.status === "refused" &&
|
|
1675
|
+
if (W.status === "refused" && b({ code: "type_not_supported", message: "The card's dataset fields couldn't be loaded for a change to or from a Matrix.", path: `${f}.type`, fix: "Send a complete query with the type change." }), W.status === "changed") {
|
|
1670
1676
|
const X = [...W.leftOut, ...W.droppedPreferences];
|
|
1671
1677
|
X.length && n.push({
|
|
1672
1678
|
code: "type_change_drops",
|
|
1673
|
-
message: `Changing "${
|
|
1679
|
+
message: `Changing "${$.title}" to ${r.type.replace(/_/g, " ")} leaves out ${X.join(", ")}.`,
|
|
1674
1680
|
path: `${f}.type`,
|
|
1675
1681
|
details: { dropped: X }
|
|
1676
|
-
}),
|
|
1677
|
-
{ op: "card.update", cardId: u, update: { kind: "retype", type:
|
|
1682
|
+
}), w(
|
|
1683
|
+
{ op: "card.update", cardId: u, update: { kind: "retype", type: T, ...G ? { catalog: G } : {}, newIds: z }, changeIndex: m },
|
|
1678
1684
|
`${f}.type`
|
|
1679
1685
|
), A = !0;
|
|
1680
1686
|
}
|
|
1681
1687
|
}
|
|
1682
|
-
const
|
|
1688
|
+
const L = r.query ? yt(r.query) : void 0;
|
|
1683
1689
|
if (r.query || r.matrix) {
|
|
1684
|
-
const q = ie(
|
|
1685
|
-
if (le.code === "query_form_mismatch" && (
|
|
1686
|
-
const pe =
|
|
1690
|
+
const q = ie(y, u).card, M = we(q, { sql: !0, calculations: !1 }), G = M.editable ? yt(M.query).query : void 0, z = G, W = di(z, (L == null ? void 0 : L.query) ?? {}, `${f}.query`, (le) => {
|
|
1691
|
+
if (le.code === "query_form_mismatch" && (L != null && L.calculations.length)) {
|
|
1692
|
+
const pe = R(q, L.calculations, f), Ce = fa({ card: q, stated: pe, context: { path: f, cardRef: r.cardId, dates: ka(q) } });
|
|
1687
1693
|
if (!Ce.ok)
|
|
1688
1694
|
throw o.push(...Ce.problems), new me();
|
|
1689
1695
|
}
|
|
1690
|
-
return
|
|
1696
|
+
return b(le);
|
|
1691
1697
|
});
|
|
1692
|
-
F = ri((
|
|
1698
|
+
F = ri((L == null ? void 0 : L.query) ?? {}, W);
|
|
1693
1699
|
const X = ((Ht = Ee(q)) == null ? void 0 : Ht.type) ?? $t(q.type), Y = r.matrix ?? (M.editable ? M.matrix : void 0);
|
|
1694
|
-
|
|
1695
|
-
const j = M.editable &&
|
|
1696
|
-
H &&
|
|
1700
|
+
Kt(X, W, Y, f);
|
|
1701
|
+
const j = M.editable && G ? ao(G, W, M.matrix, Y) : void 0, ne = !j || j.aspects.length > 0, fe = j && !("sql" in W) ? qe(W).filter((le) => !ma(j, le.key.role)) : [], H = so(q, j, fe.map((le) => le.key.role));
|
|
1702
|
+
H && jt(H, f);
|
|
1697
1703
|
let de = W;
|
|
1698
1704
|
if (j && !("sql" in W) && W.orderBy && !j.aspects.includes("order") && ["metric", "group_by", "detail"].some((le) => ma(j, le))) {
|
|
1699
1705
|
const { orderBy: le, ...pe } = W;
|
|
@@ -1701,10 +1707,10 @@ async function fs(e, a, t, s) {
|
|
|
1701
1707
|
}
|
|
1702
1708
|
let Ae;
|
|
1703
1709
|
if (ne) {
|
|
1704
|
-
const le = !!(z && ms(z, (
|
|
1710
|
+
const le = !!(z && ms(z, (L == null ? void 0 : L.query) ?? {}) && (j != null && j.keptWindow)), pe = await Gt(X, de, Y, f, le), Ce = pe.type === ct(X) ? { ...pe, type: q.type } : pe;
|
|
1705
1711
|
Ae = Ce;
|
|
1706
1712
|
const da = j ? { ...Ce, change: j } : Ce, ge = ha(q, da);
|
|
1707
|
-
if (ge.ok ||
|
|
1713
|
+
if (ge.ok || jt(ge, f), ge.ok && ge.droppedBindings.length && n.push({
|
|
1708
1714
|
code: "control_binding_dropped",
|
|
1709
1715
|
message: `"${q.title}" loses the controls bound to the levels or measures this change removes; they stop changing this card.`,
|
|
1710
1716
|
path: `${f}.query`,
|
|
@@ -1719,11 +1725,11 @@ async function fs(e, a, t, s) {
|
|
|
1719
1725
|
fix: "State a new label on the field ref if the old one no longer fits.",
|
|
1720
1726
|
details: { columns: [{ label: Ve.label, field: Ve.field }] }
|
|
1721
1727
|
});
|
|
1722
|
-
|
|
1728
|
+
w({ op: "card.update", cardId: u, update: { kind: "requery", query: da }, changeIndex: m }, `${f}.query`), A = !0;
|
|
1723
1729
|
}
|
|
1724
|
-
fe.length && pa(ie(
|
|
1730
|
+
fe.length && pa(ie(y, u).card, fe).changed.length && w({ op: "card.update", cardId: u, update: { kind: "relabel", labels: fe }, changeIndex: m }, `${f}.query`), (ne || fe.length) && Wt(ie(y, u).card, de, Y, f, q.title ?? "", Ae, j);
|
|
1725
1731
|
}
|
|
1726
|
-
(r.query ||
|
|
1732
|
+
(r.query || T) && await P({ cardId: u, cardRef: r.cardId, stated: (L == null ? void 0 : L.calculations) ?? [], index: m, path: f }) && (A = !0), (r.title !== void 0 || r.description !== void 0) && w(
|
|
1727
1733
|
{
|
|
1728
1734
|
op: "card.update",
|
|
1729
1735
|
cardId: u,
|
|
@@ -1742,180 +1748,180 @@ async function fs(e, a, t, s) {
|
|
|
1742
1748
|
queryLabels: F,
|
|
1743
1749
|
index: m,
|
|
1744
1750
|
path: f
|
|
1745
|
-
}), A && !c.includes(u) && c.push(u), d.push({ ref: r.cardId, kind: "card", id: u, title:
|
|
1751
|
+
}), A && !c.includes(u) && c.push(u), d.push({ ref: r.cardId, kind: "card", id: u, title: $.title ?? "", changeIndex: m });
|
|
1746
1752
|
break;
|
|
1747
1753
|
}
|
|
1748
1754
|
case "card.remove": {
|
|
1749
|
-
const u = oe(r.cardId, `${f}.cardId`),
|
|
1750
|
-
|
|
1755
|
+
const u = oe(r.cardId, `${f}.cardId`), g = ie(y, u);
|
|
1756
|
+
g || b({ code: "card_not_editable", message: "Cards in Document sections are removed in the editor.", path: `${f}.cardId`, fix: "Tell the user to remove it in the editor.", details: { reason: "document_section" } }), bt(g.frame) && g.frame.cards.length > 1 && b({ code: "card_not_editable", message: "This card is an input of a custom visual; remove it in the editor.", path: `${f}.cardId`, fix: "Tell the user to remove it in the editor.", details: { reason: "custom" } }), g.frame.visualId && g.frame.cards.length > 1 && n.push({
|
|
1751
1757
|
code: "detaches_linked_visual",
|
|
1752
|
-
message: `Removing "${
|
|
1758
|
+
message: `Removing "${g.card.title}" makes the rest of its tile local to this dashboard; it stops following its library visual.`,
|
|
1753
1759
|
path: f,
|
|
1754
|
-
details: { cardIds:
|
|
1755
|
-
}),
|
|
1760
|
+
details: { cardIds: g.frame.cards.filter(($) => $.id !== u).map(($) => $.id) }
|
|
1761
|
+
}), w({ op: "card.remove", cardId: u, changeIndex: m }, f), d.push({ ref: r.cardId, kind: "card", id: u, title: g.card.title ?? "", changeIndex: m });
|
|
1756
1762
|
break;
|
|
1757
1763
|
}
|
|
1758
1764
|
case "filter.add": {
|
|
1759
1765
|
const u = await t.loadCardSource({ domainId: r.domainId, datasetName: r.datasetName });
|
|
1760
|
-
u ||
|
|
1761
|
-
const
|
|
1762
|
-
|
|
1766
|
+
u || b({ code: "field_not_found", message: `The dataset "${r.datasetName}" isn't available in this domain.`, path: `${f}.datasetName`, fix: "Find datasets with semaphor_list_datasets." });
|
|
1767
|
+
const g = ot(u.fields, r.field, r.datasetName);
|
|
1768
|
+
g || b({
|
|
1763
1769
|
code: "field_not_found",
|
|
1764
1770
|
message: `"${r.field}" isn't a field of ${r.datasetName}.`,
|
|
1765
1771
|
path: `${f}.field`,
|
|
1766
1772
|
fix: "Use one of details.available, or read semaphor_get_dataset_schema.",
|
|
1767
|
-
details: { available: u.fields.slice(0, 20).map((
|
|
1773
|
+
details: { available: u.fields.slice(0, 20).map((L) => L.name) }
|
|
1768
1774
|
});
|
|
1769
|
-
const
|
|
1770
|
-
field:
|
|
1775
|
+
const $ = r.sheetIds ? Vt(r.sheetIds, f) : void 0, O = Ta($), A = Qo({
|
|
1776
|
+
field: g,
|
|
1771
1777
|
dataSource: u.dataSource,
|
|
1772
1778
|
connectionId: u.connectionId,
|
|
1773
1779
|
connectionType: u.connectionType,
|
|
1774
1780
|
scope: O,
|
|
1775
|
-
dashboard:
|
|
1781
|
+
dashboard: y,
|
|
1776
1782
|
createId: t.newId,
|
|
1777
1783
|
label: r.label
|
|
1778
1784
|
}), F = { ...A.filter };
|
|
1779
|
-
F.dateSelectionMode || (F.type = r.selection ?? "multiple"), r.defaultValues && (F.defaultValues = r.defaultValues), r.defaultPeriod && (F.defaultDateFilter = Ra(r.defaultPeriod,
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1785
|
+
F.dateSelectionMode || (F.type = r.selection ?? "multiple"), r.defaultValues && (F.defaultValues = r.defaultValues), r.defaultPeriod && (F.defaultDateFilter = Ra(r.defaultPeriod, g, `${f}.defaultPeriod`, b)), w({ op: "filter.add", input: { ...A, filter: F }, changeIndex: m }, f), rt.set(A.id, { sheetIds: $ ?? "all", changeIndex: m }), (r.defaultValues !== void 0 || r.defaultPeriod !== void 0) && dt.set(A.id, { values: r.defaultValues, period: r.defaultPeriod, changeIndex: m });
|
|
1786
|
+
const T = r.handle;
|
|
1787
|
+
T && (h.has(T) && b({ code: "invalid_change", message: `The handle ${T} is defined twice.`, path: `${f}.handle`, fix: "Give each new card, filter or sheet its own handle." }), h.set(T, { kind: "filter", id: A.id, title: r.label })), d.push({ ref: T ?? A.id, kind: "filter", id: A.id, title: r.label, changeIndex: m });
|
|
1782
1788
|
break;
|
|
1783
1789
|
}
|
|
1784
1790
|
case "filter.update": {
|
|
1785
|
-
const u = te(r.filterId, `${f}.filterId`),
|
|
1786
|
-
|
|
1791
|
+
const u = te(r.filterId, `${f}.filterId`), g = Pe(y, u, void 0, v);
|
|
1792
|
+
g != null && g.editable || b({
|
|
1787
1793
|
code: "filter_not_editable",
|
|
1788
|
-
message:
|
|
1794
|
+
message: g && !g.editable ? g.notEditable.message : "This filter can't be changed through the MCP.",
|
|
1789
1795
|
path: `${f}.filterId`,
|
|
1790
1796
|
fix: "Tell the user to change it in the editor; removing or excluding it works."
|
|
1791
1797
|
});
|
|
1792
|
-
const
|
|
1793
|
-
if ((
|
|
1794
|
-
const O = {
|
|
1798
|
+
const $ = (y.inputs ?? []).find((L) => L.id === u);
|
|
1799
|
+
if (($ == null ? void 0 : $.kind) !== "filter" || !$.filter) throw new me();
|
|
1800
|
+
const O = { ...$.filter };
|
|
1795
1801
|
let A = !1;
|
|
1796
1802
|
r.selection && (O.type = r.selection), r.defaultValues !== void 0 && (A = !0, r.defaultValues === null ? delete O.defaultValues : O.defaultValues = r.defaultValues), r.defaultPeriod !== void 0 && (A = !0, r.defaultPeriod === null ? delete O.defaultDateFilter : O.defaultDateFilter = Ra(
|
|
1797
1803
|
r.defaultPeriod,
|
|
1798
1804
|
{ dataType: O.dataType },
|
|
1799
1805
|
`${f}.defaultPeriod`,
|
|
1800
|
-
|
|
1806
|
+
b
|
|
1801
1807
|
));
|
|
1802
|
-
const F = r.sheetIds === void 0 ? void 0 : r.sheetIds ? Vt(r.sheetIds, f) : "all",
|
|
1808
|
+
const F = r.sheetIds === void 0 ? void 0 : r.sheetIds ? Vt(r.sheetIds, f) : "all", T = {
|
|
1803
1809
|
...r.label !== void 0 ? { label: r.label } : {},
|
|
1804
1810
|
...r.selection !== void 0 || A ? { definition: O } : {},
|
|
1805
1811
|
// A change of sheets states the sheets; what else the scope says (the cards it leaves out,
|
|
1806
1812
|
// whether it covers Document sheets) stays.
|
|
1807
1813
|
...F ? { scope: Po(
|
|
1808
|
-
|
|
1814
|
+
$.scope,
|
|
1809
1815
|
Ta(F === "all" ? void 0 : F),
|
|
1810
|
-
new Set([...Ot(
|
|
1816
|
+
new Set([...Ot(y).values()].filter((L) => L.sheetKind === "document").map((L) => L.sheetId))
|
|
1811
1817
|
) } : {},
|
|
1812
1818
|
...A ? { values: { defaultChanged: !0, target: {} } } : {}
|
|
1813
1819
|
};
|
|
1814
|
-
|
|
1820
|
+
w({ op: "filter.update", filterId: u, settings: T, changeIndex: m }, f), F && rt.set(u, { sheetIds: F, changeIndex: m }), A && dt.set(u, { values: r.defaultValues, period: r.defaultPeriod, changeIndex: m }), d.push({ ref: r.filterId, kind: "filter", id: u, title: $.label, changeIndex: m });
|
|
1815
1821
|
break;
|
|
1816
1822
|
}
|
|
1817
1823
|
case "filter.remove": {
|
|
1818
|
-
const u = te(r.filterId, `${f}.filterId`),
|
|
1819
|
-
|
|
1824
|
+
const u = te(r.filterId, `${f}.filterId`), g = ((zt = (y.inputs ?? []).find(($) => $.id === u)) == null ? void 0 : zt.label) ?? "";
|
|
1825
|
+
w({ op: "filter.remove", filterId: u, changeIndex: m }, f), d.push({ ref: r.filterId, kind: "filter", id: u, title: g, changeIndex: m });
|
|
1820
1826
|
break;
|
|
1821
1827
|
}
|
|
1822
1828
|
case "filter.bind": {
|
|
1823
|
-
const u = te(r.filterId, `${f}.filterId`),
|
|
1824
|
-
|
|
1829
|
+
const u = te(r.filterId, `${f}.filterId`), g = Pe(y, u, void 0, v);
|
|
1830
|
+
g != null && g.editable || b({
|
|
1825
1831
|
code: "filter_not_editable",
|
|
1826
|
-
message:
|
|
1832
|
+
message: g && !g.editable ? g.notEditable.message : "This filter can't be changed through the MCP.",
|
|
1827
1833
|
path: `${f}.filterId`,
|
|
1828
1834
|
fix: "Tell the user to change it in the editor; removing or excluding it works."
|
|
1829
1835
|
});
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1836
|
+
const $ = Bt(r.cardId, `${f}.cardId`), O = Ga(y, $).card, A = Ie(y).findFilterInput({ inputId: u }), F = A && $e(A.input, O, v).reach === "relationshipApplied", T = await ui(O, r.field, t, `${f}.field`, b, F ? g.label : void 0);
|
|
1837
|
+
w({ op: "filter.bind", filterId: u, cardId: $, binding: { kind: "bound", cardId: $, bindingId: t.newId(), target: T }, changeIndex: m }, f), d.push({ ref: r.filterId, kind: "filter", id: u, title: g.label, changeIndex: m });
|
|
1832
1838
|
break;
|
|
1833
1839
|
}
|
|
1834
1840
|
case "layout.arrange": {
|
|
1835
1841
|
const u = r.sheetId ? Re(r.sheetId, `${f}.sheetId`) : (() => {
|
|
1836
|
-
const
|
|
1837
|
-
return
|
|
1838
|
-
code:
|
|
1839
|
-
message:
|
|
1842
|
+
const g = nt();
|
|
1843
|
+
return g.length !== 1 && b({
|
|
1844
|
+
code: g.length ? "sheet_required" : "sheet_not_a_grid",
|
|
1845
|
+
message: g.length ? "This dashboard has several grid sheets; say which one to arrange." : "This dashboard has no grid sheet to arrange.",
|
|
1840
1846
|
path: `${f}.sheetId`,
|
|
1841
|
-
fix:
|
|
1847
|
+
fix: g.length ? "Send sheetId: one of details.sheets." : "Add a sheet with sheet.add earlier in this list.",
|
|
1842
1848
|
details: { sheets: Be() }
|
|
1843
|
-
}),
|
|
1849
|
+
}), g[0];
|
|
1844
1850
|
})();
|
|
1845
|
-
|
|
1851
|
+
w({ op: "layout.arrange", sheetId: u.id, ...r.keepOrder ? { keepOrder: !0 } : {}, changeIndex: m }, f);
|
|
1846
1852
|
break;
|
|
1847
1853
|
}
|
|
1848
1854
|
case "layout.tabs": {
|
|
1849
|
-
const u = r.cardIds.map((q, M) => oe(q, `${f}.cardIds[${M}]`)),
|
|
1850
|
-
new Set(u).size !== u.length &&
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1853
|
-
const A =
|
|
1855
|
+
const u = r.cardIds.map((q, M) => oe(q, `${f}.cardIds[${M}]`)), g = (q, M, G = `${f}.cardIds`) => b({ code: "layout_invalid", message: q, path: G, fix: M });
|
|
1856
|
+
new Set(u).size !== u.length && g("Each card is named once in tabs.", "Name two or more different cards, each once.");
|
|
1857
|
+
const $ = u.map((q, M) => ie(y, q) ?? g("A Document section's card can't be a tab.", "Name cards on a grid sheet.", `${f}.cardIds[${M}]`)), O = $[0].sheet;
|
|
1858
|
+
$.some((q) => q.sheet.id !== O.id) && g("Tabs are cards on one sheet.", "Name cards on one sheet; a card moves to another sheet in the editor."), $.some((q) => bt(q.frame) && q.frame.cards.length > 1) && g("A custom visual's inputs stay in its spot.", "Name cards that aren't a custom visual's inputs, or arrange them in the editor.");
|
|
1859
|
+
const A = $[0].frame, F = $[0].card;
|
|
1854
1860
|
d.push({ ref: r.cardIds[0], kind: "card", id: F.id, title: F.title ?? "", changeIndex: m });
|
|
1855
|
-
const
|
|
1856
|
-
if (u.every((q, M) =>
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1861
|
+
const T = Ba(A);
|
|
1862
|
+
if (u.every((q, M) => T[M] === q)) break;
|
|
1863
|
+
const L = [...new Map($.map((q) => [q.frame.id, q.frame])).values()].filter((q) => q.visualId);
|
|
1864
|
+
L.length && n.push({
|
|
1859
1865
|
code: "detaches_linked_visual",
|
|
1860
1866
|
message: "Moving these cards makes the tiles they leave or join local to this dashboard; they stop following their library visuals.",
|
|
1861
1867
|
path: f,
|
|
1862
|
-
details: { cardIds:
|
|
1863
|
-
}), F.type === "kpi" &&
|
|
1868
|
+
details: { cardIds: L.flatMap((q) => q.cards.map((M) => M.id)) }
|
|
1869
|
+
}), F.type === "kpi" && $.slice(1).some((q) => q.card.type === "text") && n.push({
|
|
1864
1870
|
code: "tabs_show_as_kpi_info",
|
|
1865
1871
|
message: `A text card in ${Va(F.title)}'s spot shows as the KPI's info, not as a tab.`,
|
|
1866
1872
|
path: f,
|
|
1867
1873
|
fix: "Put another card first if the text should be a tab of its own."
|
|
1868
|
-
}),
|
|
1874
|
+
}), w({ op: "layout.tabs", sheetId: O.id, cardIds: u, changeIndex: m }, f);
|
|
1869
1875
|
break;
|
|
1870
1876
|
}
|
|
1871
1877
|
case "layout.untab": {
|
|
1872
|
-
const u = oe(r.cardId, `${f}.cardId`),
|
|
1873
|
-
if (
|
|
1874
|
-
|
|
1878
|
+
const u = oe(r.cardId, `${f}.cardId`), g = ie(y, u);
|
|
1879
|
+
if (g || b({ code: "layout_invalid", message: "A Document section's card has no spot of its own.", path: `${f}.cardId`, fix: "Name a card on a grid sheet." }), bt(g.frame) && g.frame.cards.length > 1 && b({ code: "layout_invalid", message: "A custom visual's inputs stay in its spot.", path: `${f}.cardId`, fix: "Arrange a custom visual in the editor." }), d.push({ ref: r.cardId, kind: "card", id: u, title: g.card.title ?? "", changeIndex: m }), g.frame.cards.length < 2) break;
|
|
1880
|
+
g.frame.visualId && n.push({
|
|
1875
1881
|
code: "detaches_linked_visual",
|
|
1876
|
-
message: `Taking "${
|
|
1882
|
+
message: `Taking "${g.card.title}" out of its tabs makes them local to this dashboard; they stop following their library visual.`,
|
|
1877
1883
|
path: f,
|
|
1878
|
-
details: { cardIds:
|
|
1879
|
-
}),
|
|
1884
|
+
details: { cardIds: g.frame.cards.map(($) => $.id) }
|
|
1885
|
+
}), w({ op: "layout.untab", cardId: u, newFrameId: t.newId(), changeIndex: m }, f);
|
|
1880
1886
|
break;
|
|
1881
1887
|
}
|
|
1882
1888
|
case "filter.exclude": {
|
|
1883
|
-
const u = te(r.filterId, `${f}.filterId`),
|
|
1884
|
-
|
|
1889
|
+
const u = te(r.filterId, `${f}.filterId`), g = Bt(r.cardId, `${f}.cardId`), $ = ((Yt = (y.inputs ?? []).find((O) => O.id === u)) == null ? void 0 : Yt.label) ?? "";
|
|
1890
|
+
w({ op: "filter.exclude", filterId: u, cardId: g, changeIndex: m }, f), d.push({ ref: r.filterId, kind: "filter", id: u, title: $, changeIndex: m });
|
|
1885
1891
|
break;
|
|
1886
1892
|
}
|
|
1887
1893
|
case "highlight.add":
|
|
1888
1894
|
case "highlight.remove": {
|
|
1889
|
-
const u = oe(r.cardId, `${f}.cardId`), { card:
|
|
1895
|
+
const u = oe(r.cardId, `${f}.cardId`), { card: g } = _(u, f), { op: $, cardId: O, ...A } = r, F = await N({
|
|
1890
1896
|
cardId: u,
|
|
1891
1897
|
cardRef: r.cardId,
|
|
1892
1898
|
request: { highlights: r.op === "highlight.add" ? { add: [A] } : { remove: [r.ruleId] } },
|
|
1893
1899
|
queryLabels: [],
|
|
1894
1900
|
index: m,
|
|
1895
1901
|
path: f
|
|
1896
|
-
}),
|
|
1897
|
-
d.push({ ref: r.cardId, kind: "card", id: u, title:
|
|
1902
|
+
}), T = (Xt = (Jt = F == null ? void 0 : F.highlights) == null ? void 0 : Jt.add) == null ? void 0 : Xt[0];
|
|
1903
|
+
d.push({ ref: r.cardId, kind: "card", id: u, title: g.title ?? "", changeIndex: m, ...T ? { ruleId: T.id } : {} });
|
|
1898
1904
|
break;
|
|
1899
1905
|
}
|
|
1900
1906
|
case "sheet.add": {
|
|
1901
1907
|
const u = t.newId();
|
|
1902
|
-
|
|
1903
|
-
const
|
|
1904
|
-
h.has(
|
|
1908
|
+
w({ op: "sheet.add", sheet: { id: u, title: r.title }, changeIndex: m }, f);
|
|
1909
|
+
const g = r.handle ?? `$sheet_${++E}`;
|
|
1910
|
+
h.has(g) && b({ code: "invalid_change", message: `The handle ${g} is defined twice.`, path: `${f}.handle`, fix: "Give each new card, filter or sheet its own handle." }), h.set(g, { kind: "sheet", id: u, title: r.title }), d.push({ ref: g, kind: "sheet", id: u, title: r.title, changeIndex: m });
|
|
1905
1911
|
break;
|
|
1906
1912
|
}
|
|
1907
1913
|
case "sheet.update": {
|
|
1908
1914
|
const u = it(r.sheetId, `${f}.sheetId`, { grid: !1 });
|
|
1909
|
-
(u.title ?? "") !== r.title &&
|
|
1915
|
+
(u.title ?? "") !== r.title && w({ op: "sheet.update", sheetId: u.id, title: r.title, changeIndex: m }, f), d.push({ ref: r.sheetId, kind: "sheet", id: u.id, title: r.title, changeIndex: m });
|
|
1910
1916
|
break;
|
|
1911
1917
|
}
|
|
1912
1918
|
case "dashboard.update": {
|
|
1913
|
-
const u = r.title !== void 0 && r.title !==
|
|
1914
|
-
(u !== void 0 ||
|
|
1919
|
+
const u = r.title !== void 0 && r.title !== y.title ? r.title : void 0, g = r.description === null ? y.description ? null : void 0 : r.description !== y.description ? r.description : void 0;
|
|
1920
|
+
(u !== void 0 || g !== void 0) && w(
|
|
1915
1921
|
{
|
|
1916
1922
|
op: "dashboard.update",
|
|
1917
1923
|
...u !== void 0 ? { title: u } : {},
|
|
1918
|
-
...
|
|
1924
|
+
...g !== void 0 ? { description: g } : {},
|
|
1919
1925
|
changeIndex: m
|
|
1920
1926
|
},
|
|
1921
1927
|
f
|
|
@@ -1923,19 +1929,19 @@ async function fs(e, a, t, s) {
|
|
|
1923
1929
|
break;
|
|
1924
1930
|
}
|
|
1925
1931
|
case "dashboard.style": {
|
|
1926
|
-
const { op: u, ...
|
|
1927
|
-
|
|
1928
|
-
const { style:
|
|
1932
|
+
const { op: u, ...g } = r;
|
|
1933
|
+
S ?? (S = t.readOrganizationAppearance ? t.readOrganizationAppearance() : Promise.resolve(null));
|
|
1934
|
+
const { style: $, organizationAppearance: O } = za(y, await S), A = rn({ style: $, edit: g, layers: { organizationAppearance: O } });
|
|
1929
1935
|
if (A.ok)
|
|
1930
|
-
A.sentences.length &&
|
|
1936
|
+
A.sentences.length && w({ op: "dashboard.style", style: A.style, sentences: A.sentences, changeIndex: m }, f);
|
|
1931
1937
|
else {
|
|
1932
1938
|
const { refusal: F } = A;
|
|
1933
|
-
|
|
1939
|
+
b({ code: F.code, message: F.message, path: F.field === "edit" ? f : `${f}.${F.field}`, fix: F.fix });
|
|
1934
1940
|
}
|
|
1935
1941
|
break;
|
|
1936
1942
|
}
|
|
1937
1943
|
case "variable.add": {
|
|
1938
|
-
Je(
|
|
1944
|
+
Je(y, r.name) && b({ code: "variable_name_taken", message: `A variable named ${r.name} is already on this dashboard.`, path: `${f}.name`, fix: "Choose another name, or change it with variable.update." });
|
|
1939
1945
|
const u = await wa(
|
|
1940
1946
|
{
|
|
1941
1947
|
id: t.newId(),
|
|
@@ -1947,24 +1953,24 @@ async function fs(e, a, t, s) {
|
|
|
1947
1953
|
...r.emptyText ? { emptyText: r.emptyText } : {},
|
|
1948
1954
|
path: f
|
|
1949
1955
|
},
|
|
1950
|
-
|
|
1956
|
+
y,
|
|
1951
1957
|
Te
|
|
1952
1958
|
);
|
|
1953
|
-
|
|
1959
|
+
w({ op: "variable.add", variable: u, changeIndex: m }, f), d.push({ ref: r.name, kind: "variable", id: u.id, title: u.name, changeIndex: m });
|
|
1954
1960
|
break;
|
|
1955
1961
|
}
|
|
1956
1962
|
case "variable.update": {
|
|
1957
|
-
const u = zn(
|
|
1963
|
+
const u = zn(y, r.name, `${f}.name`, Te), g = r.rename ?? u.name, $ = {
|
|
1958
1964
|
...r.rename !== void 0 ? { name: r.rename } : {},
|
|
1959
1965
|
...r.label !== void 0 ? { label: r.label } : {},
|
|
1960
1966
|
...r.presentation !== void 0 ? { presentation: r.presentation } : {},
|
|
1961
1967
|
...r.emptyText !== void 0 ? { emptyText: r.emptyText } : {}
|
|
1962
|
-
}, O = { ...
|
|
1968
|
+
}, O = { ...y, variables: (y.variables ?? []).filter((T) => T.id !== u.id) };
|
|
1963
1969
|
if (r.query) {
|
|
1964
|
-
const
|
|
1970
|
+
const T = await wa(
|
|
1965
1971
|
{
|
|
1966
1972
|
id: u.id,
|
|
1967
|
-
name:
|
|
1973
|
+
name: g,
|
|
1968
1974
|
label: r.label === null ? void 0 : r.label ?? u.label,
|
|
1969
1975
|
query: r.query,
|
|
1970
1976
|
get: r.get ?? u.get,
|
|
@@ -1975,33 +1981,33 @@ async function fs(e, a, t, s) {
|
|
|
1975
1981
|
O,
|
|
1976
1982
|
Te
|
|
1977
1983
|
);
|
|
1978
|
-
|
|
1984
|
+
$.query = T.query, $.get = T.get;
|
|
1979
1985
|
} else if (r.get !== void 0) {
|
|
1980
|
-
const
|
|
1981
|
-
|
|
1986
|
+
const T = Xn(u, r.get, O, Te, f);
|
|
1987
|
+
$.query = T.query, $.get = T.get;
|
|
1982
1988
|
}
|
|
1983
|
-
Object.keys(
|
|
1984
|
-
const A = { ...u, ...Object.fromEntries(Object.entries(
|
|
1985
|
-
F.length && B(cs(F, f)),
|
|
1989
|
+
Object.keys($).length || b({ code: "invalid_change", message: `variable.update on ${u.name} changes nothing.`, path: f, fix: "Send rename, label, query, get, presentation or emptyText." });
|
|
1990
|
+
const A = { ...u, ...Object.fromEntries(Object.entries($).map(([T, L]) => [T, L ?? void 0])), id: u.id }, F = Dt(A, { ...O, variables: [...O.variables, A] });
|
|
1991
|
+
F.length && B(cs(F, f)), w({ op: "variable.update", variableId: u.id, patch: $, changeIndex: m }, f), d.push({ ref: r.name, kind: "variable", id: u.id, title: g, changeIndex: m });
|
|
1986
1992
|
break;
|
|
1987
1993
|
}
|
|
1988
1994
|
case "variable.remove": {
|
|
1989
|
-
const u = Je(
|
|
1990
|
-
u ||
|
|
1991
|
-
const
|
|
1992
|
-
|
|
1995
|
+
const u = Je(y, r.name);
|
|
1996
|
+
u || b(ls(y, r.name, `${f}.name`));
|
|
1997
|
+
const g = u, $ = Zn(y, g.id);
|
|
1998
|
+
$.places.length && b({
|
|
1993
1999
|
code: "variable_in_use",
|
|
1994
|
-
message: `${
|
|
2000
|
+
message: `${g.name} is shown in ${$.words}.`,
|
|
1995
2001
|
path: `${f}.name`,
|
|
1996
2002
|
fix: "Remove its chips first (card.update with text, or document.text.update), or ask the user whether the chips should read as missing.",
|
|
1997
|
-
details: { places:
|
|
1998
|
-
}),
|
|
2003
|
+
details: { places: $.places }
|
|
2004
|
+
}), w({ op: "variable.remove", variableId: g.id, changeIndex: m }, f), d.push({ ref: r.name, kind: "variable", id: g.id, title: g.name, changeIndex: m });
|
|
1999
2005
|
break;
|
|
2000
2006
|
}
|
|
2001
2007
|
case "document.text.update": {
|
|
2002
|
-
const u = it(r.sheetId, `${f}.sheetId`, { grid: !1 }), { edit:
|
|
2003
|
-
if (d.push({ ref: r.sheetId, kind: "sheet", id: u.id, title: u.title ?? "", changeIndex: m }),
|
|
2004
|
-
|
|
2008
|
+
const u = it(r.sheetId, `${f}.sheetId`, { grid: !1 }), { edit: g, unchanged: $ } = ei(r, y, u, f, Te);
|
|
2009
|
+
if (d.push({ ref: r.sheetId, kind: "sheet", id: u.id, title: u.title ?? "", changeIndex: m }), $) break;
|
|
2010
|
+
w({ op: "document.text", sheetId: u.id, edit: g, changeIndex: m }, f);
|
|
2005
2011
|
break;
|
|
2006
2012
|
}
|
|
2007
2013
|
default: {
|
|
@@ -2014,7 +2020,7 @@ async function fs(e, a, t, s) {
|
|
|
2014
2020
|
}
|
|
2015
2021
|
}
|
|
2016
2022
|
if (o.length) return { ok: !1, problems: o };
|
|
2017
|
-
const ae = wt(e, i, { ...p, ...
|
|
2023
|
+
const ae = wt(e, i, { ...p, ...v });
|
|
2018
2024
|
if (!ae.ok)
|
|
2019
2025
|
return {
|
|
2020
2026
|
ok: !1,
|
|
@@ -2030,43 +2036,43 @@ async function fs(e, a, t, s) {
|
|
|
2030
2036
|
for (const m of c) {
|
|
2031
2037
|
const r = ie(ae.dashboard, m);
|
|
2032
2038
|
if (!r) continue;
|
|
2033
|
-
const f = ((ea = i.find((O) => Pt(O) === m)) == null ? void 0 : ea.changeIndex) ?? 0, u = we(r.card, { sql: !0 }),
|
|
2034
|
-
u.editable && ("sql" in u.query ? !!u.query.sql : "measures" in u.query ? u.query.measures.length > 0 : u.query.columns.length > 0) && ((aa = Fe[
|
|
2039
|
+
const f = ((ea = i.find((O) => Pt(O) === m)) == null ? void 0 : ea.changeIndex) ?? 0, u = we(r.card, { sql: !0 }), g = ((ta = Ee(r.card)) == null ? void 0 : ta.type) ?? $t(r.card.type);
|
|
2040
|
+
u.editable && ("sql" in u.query ? !!u.query.sql : "measures" in u.query ? u.query.measures.length > 0 : u.query.columns.length > 0) && ((aa = Fe[g]) == null ? void 0 : aa.forms.includes(tt(u.query))) || o.push({
|
|
2035
2041
|
code: "type_not_supported",
|
|
2036
|
-
message: `As changed, "${r.card.title}" would have no query a ${
|
|
2042
|
+
message: `As changed, "${r.card.title}" would have no query a ${g.replace(/_/g, " ")} can run.`,
|
|
2037
2043
|
path: `changes[${f}]`,
|
|
2038
|
-
fix: `Send a complete query with the type change: ${((sa = Fe[
|
|
2044
|
+
fix: `Send a complete query with the type change: ${((sa = Fe[g]) == null ? void 0 : sa.forms.map((O) => Ge[O]).join(" or ")) ?? "a measures query"}.`
|
|
2039
2045
|
});
|
|
2040
2046
|
}
|
|
2041
|
-
if (o.push(...ni(e, ae.dashboard, i, rt,
|
|
2047
|
+
if (o.push(...ni(e, ae.dashboard, i, rt, v)), o.push(...ii(ae.dashboard, dt, t.calendar)), o.length) return { ok: !1, problems: o };
|
|
2042
2048
|
for (const m of i) {
|
|
2043
2049
|
if (m.op !== "filter.add" && !(m.op === "filter.update" && m.settings.scope)) continue;
|
|
2044
|
-
const r = m.op === "filter.add" ? m.input.id : m.filterId, f = Pe(ae.dashboard, r, void 0,
|
|
2050
|
+
const r = m.op === "filter.add" ? m.input.id : m.filterId, f = Pe(ae.dashboard, r, void 0, v);
|
|
2045
2051
|
if (!(f != null && f.editable)) continue;
|
|
2046
2052
|
const u = async (A) => {
|
|
2047
2053
|
const F = [];
|
|
2048
|
-
for (const
|
|
2049
|
-
const
|
|
2054
|
+
for (const T of A) {
|
|
2055
|
+
const L = T.datasetName ? await t.findRelationshipFields({
|
|
2050
2056
|
domainId: f.domainId,
|
|
2051
2057
|
fromDataset: f.datasetName,
|
|
2052
2058
|
field: f.field,
|
|
2053
|
-
toDataset:
|
|
2059
|
+
toDataset: T.datasetName
|
|
2054
2060
|
}) : [];
|
|
2055
|
-
F.push({ ...
|
|
2061
|
+
F.push({ ...T, suggestedFields: L });
|
|
2056
2062
|
}
|
|
2057
2063
|
return F;
|
|
2058
|
-
},
|
|
2059
|
-
if (
|
|
2064
|
+
}, g = (A) => A.map((F) => `"${F.title}"`).join(", "), $ = f.notReached.filter((A) => A.reason === "sql_no_filter_reference"), O = f.notReached.filter((A) => A.reason !== "sql_no_filter_reference");
|
|
2065
|
+
if ($.length && n.push({
|
|
2060
2066
|
code: "filter_not_reaching_cards",
|
|
2061
|
-
message: `"${f.label}" doesn't reach ${
|
|
2067
|
+
message: `"${f.label}" doesn't reach ${$.length} SQL card${$.length === 1 ? "" : "s"} whose SQL doesn't use dashboard filters: ${g($)}.`,
|
|
2062
2068
|
path: `changes[${m.changeIndex ?? 0}]`,
|
|
2063
2069
|
fix: "To filter a SQL card, add {{ filters | where }} to its SQL (or {{ filters | and }} after an existing WHERE) with card.update, or leave it unfiltered.",
|
|
2064
|
-
details: { cards:
|
|
2070
|
+
details: { cards: $ }
|
|
2065
2071
|
}), O.length) {
|
|
2066
2072
|
const A = await u(O);
|
|
2067
2073
|
n.push({
|
|
2068
2074
|
code: "filter_not_reaching_cards",
|
|
2069
|
-
message: `"${f.label}" doesn't reach ${A.length} card${A.length === 1 ? "" : "s"} on its sheets: ${
|
|
2075
|
+
message: `"${f.label}" doesn't reach ${A.length} card${A.length === 1 ? "" : "s"} on its sheets: ${g(A)}.`,
|
|
2070
2076
|
path: `changes[${m.changeIndex ?? 0}]`,
|
|
2071
2077
|
fix: "Add filter.bind with one of the suggested fields to reach a card, or leave it unfiltered.",
|
|
2072
2078
|
details: { cards: A }
|
|
@@ -2074,7 +2080,7 @@ async function fs(e, a, t, s) {
|
|
|
2074
2080
|
}
|
|
2075
2081
|
if ((oa = f.sqlPending) != null && oa.length && n.push({
|
|
2076
2082
|
code: "filter_reach_through_sql",
|
|
2077
|
-
message: `"${f.label}" may reach ${f.sqlPending.length} SQL card${f.sqlPending.length === 1 ? "" : "s"} as ${f.sqlPending.length === 1 ? "its" : "their"} SQL decides: ${
|
|
2083
|
+
message: `"${f.label}" may reach ${f.sqlPending.length} SQL card${f.sqlPending.length === 1 ? "" : "s"} as ${f.sqlPending.length === 1 ? "its" : "their"} SQL decides: ${g(f.sqlPending)}.`,
|
|
2078
2084
|
path: `changes[${m.changeIndex ?? 0}]`,
|
|
2079
2085
|
fix: "Read the card's SQL to tell the user whether it uses this filter.",
|
|
2080
2086
|
details: { cards: f.sqlPending }
|
|
@@ -2082,7 +2088,7 @@ async function fs(e, a, t, s) {
|
|
|
2082
2088
|
const A = await u(f.relationshipPending);
|
|
2083
2089
|
n.push({
|
|
2084
2090
|
code: "filter_reach_through_relationships",
|
|
2085
|
-
message: `"${f.label}" may reach ${A.length} card${A.length === 1 ? "" : "s"} on its sheets through the domain's relationships: ${
|
|
2091
|
+
message: `"${f.label}" may reach ${A.length} card${A.length === 1 ? "" : "s"} on its sheets through the domain's relationships: ${g(A)}. Whether it applies is decided when each card runs.`,
|
|
2086
2092
|
path: `changes[${m.changeIndex ?? 0}]`,
|
|
2087
2093
|
fix: "Add filter.bind with one of the suggested fields to make it certain, or leave it to the relationships.",
|
|
2088
2094
|
details: { cards: A }
|
|
@@ -2090,7 +2096,7 @@ async function fs(e, a, t, s) {
|
|
|
2090
2096
|
}
|
|
2091
2097
|
}
|
|
2092
2098
|
if (t.readComparisonDates)
|
|
2093
|
-
for (const [m, r] of
|
|
2099
|
+
for (const [m, r] of I) {
|
|
2094
2100
|
const f = (ia = ie(ae.dashboard, m)) == null ? void 0 : ia.card;
|
|
2095
2101
|
if (!f) continue;
|
|
2096
2102
|
const u = await t.readComparisonDates({ card: f, dashboard: ae.dashboard });
|
|
@@ -2101,7 +2107,7 @@ async function fs(e, a, t, s) {
|
|
|
2101
2107
|
fix: "Add a timeWindow on that date, or a dashboard date filter that reaches the card."
|
|
2102
2108
|
});
|
|
2103
2109
|
}
|
|
2104
|
-
const Is = ai(ae.dashboard, i, ae.descriptions,
|
|
2110
|
+
const Is = ai(ae.dashboard, i, ae.descriptions, v);
|
|
2105
2111
|
return {
|
|
2106
2112
|
ok: !0,
|
|
2107
2113
|
operations: i,
|
|
@@ -2124,23 +2130,23 @@ function ai(e, a, t, s) {
|
|
|
2124
2130
|
for (const l of o) {
|
|
2125
2131
|
const c = Pt(l);
|
|
2126
2132
|
if (!c || l.changeIndex === void 0) continue;
|
|
2127
|
-
const h = n.filter((
|
|
2128
|
-
(
|
|
2129
|
-
var
|
|
2130
|
-
return "notReached" in
|
|
2133
|
+
const h = n.filter((C) => C.reaches.includes(c)).map((C) => C.label), p = (C) => n.filter(
|
|
2134
|
+
(k) => {
|
|
2135
|
+
var b;
|
|
2136
|
+
return "notReached" in k && ((b = k.notReached) == null ? void 0 : b.some((D) => D.cardId === c && D.reason === "sql_no_filter_reference" === C));
|
|
2131
2137
|
}
|
|
2132
|
-
).map((
|
|
2133
|
-
var
|
|
2134
|
-
return (
|
|
2135
|
-
}).map((
|
|
2136
|
-
var
|
|
2137
|
-
return (
|
|
2138
|
-
}).map((
|
|
2138
|
+
).map((k) => k.label), v = p(!1), y = p(!0), S = n.filter((C) => {
|
|
2139
|
+
var k;
|
|
2140
|
+
return (k = C.relationshipPending) == null ? void 0 : k.some((b) => b.cardId === c);
|
|
2141
|
+
}).map((C) => C.label), x = n.filter((C) => {
|
|
2142
|
+
var k;
|
|
2143
|
+
return (k = C.sqlPending) == null ? void 0 : k.some((b) => b.cardId === c);
|
|
2144
|
+
}).map((C) => C.label), E = [
|
|
2139
2145
|
...h.length ? [`The dashboard's ${i(h)} filter${h.length === 1 ? " applies" : "s apply"} to it.`] : [],
|
|
2140
|
-
...
|
|
2141
|
-
...
|
|
2142
|
-
...
|
|
2143
|
-
...
|
|
2146
|
+
...v.length ? [`${i(v)} ${v.length === 1 ? "doesn't" : "don't"} reach it.`] : [],
|
|
2147
|
+
...y.length ? [`${i(y)} ${y.length === 1 ? "doesn't" : "don't"} reach it: its SQL doesn't use dashboard filters.`] : [],
|
|
2148
|
+
...S.length ? [`${i(S)} may reach it through the domain's relationships.`] : [],
|
|
2149
|
+
...x.length ? [`${i(x)} may apply through its SQL.`] : []
|
|
2144
2150
|
];
|
|
2145
2151
|
E.length && d.set(l.changeIndex, E.join(" "));
|
|
2146
2152
|
}
|
|
@@ -2166,13 +2172,13 @@ function oi(e, a) {
|
|
|
2166
2172
|
const n = t.matrix, i = vo(n), d = [...n.spec.rows, ...n.spec.columns], l = { ...n.presentation.levelLabels }, c = { ...n.presentation.measureLabels };
|
|
2167
2173
|
for (const { key: h, label: p } of a) {
|
|
2168
2174
|
if (h.role === "metric") {
|
|
2169
|
-
const
|
|
2170
|
-
if (
|
|
2171
|
-
c[n.spec.measures[
|
|
2175
|
+
const v = i.measures.findIndex((y) => He(y, h));
|
|
2176
|
+
if (v < 0) continue;
|
|
2177
|
+
c[n.spec.measures[v].id] = p;
|
|
2172
2178
|
} else {
|
|
2173
|
-
const
|
|
2174
|
-
if (
|
|
2175
|
-
l[d[
|
|
2179
|
+
const v = i.levels.findIndex((y) => He(y, h));
|
|
2180
|
+
if (v < 0) continue;
|
|
2181
|
+
l[d[v].id] = p;
|
|
2176
2182
|
}
|
|
2177
2183
|
s.push(h);
|
|
2178
2184
|
}
|
|
@@ -2180,63 +2186,63 @@ function oi(e, a) {
|
|
|
2180
2186
|
}
|
|
2181
2187
|
const o = { metric: "metricColumns", group_by: "groupByColumns", detail: "detailColumns" };
|
|
2182
2188
|
for (const { key: n, label: i } of a) {
|
|
2183
|
-
const d = [...t[o[n.role]] ?? []], l =
|
|
2189
|
+
const d = [...t[o[n.role]] ?? []], l = ja(n.role, d).findIndex((c) => He(c, n));
|
|
2184
2190
|
l < 0 || (d[l] = fn(d[l], i), t[o[n.role]] = d, s.push(n));
|
|
2185
2191
|
}
|
|
2186
2192
|
return { ...e, config: t, statedLabels: s };
|
|
2187
2193
|
}
|
|
2188
2194
|
function ni(e, a, t, s, o) {
|
|
2189
2195
|
var E;
|
|
2190
|
-
const n = [], i = new Map(xe(a).map((
|
|
2191
|
-
var
|
|
2192
|
-
return ((
|
|
2193
|
-
}, h = (
|
|
2194
|
-
var
|
|
2195
|
-
return ((
|
|
2196
|
-
}, p = (
|
|
2197
|
-
const
|
|
2196
|
+
const n = [], i = new Map(xe(a).map((C) => [C.cardId, C])), d = Ot(a), l = Ie(a), c = (C) => {
|
|
2197
|
+
var k, b;
|
|
2198
|
+
return ((b = (k = a.sheets) == null ? void 0 : k.find((D) => D.id === C)) == null ? void 0 : b.title) ?? C;
|
|
2199
|
+
}, h = (C, k) => {
|
|
2200
|
+
var b;
|
|
2201
|
+
return ((b = [...t].reverse().find((D) => Pt(D) === k || "filterId" in D && D.filterId === C)) == null ? void 0 : b.changeIndex) ?? 0;
|
|
2202
|
+
}, p = (C, k) => {
|
|
2203
|
+
const b = l.findFilterInput({ inputId: C }).input, D = i.get(k), w = `"${D.card.title ?? ""}"`, N = `"${b.label}"`;
|
|
2198
2204
|
if (D.kind === "documentSectionCard")
|
|
2199
2205
|
return {
|
|
2200
2206
|
reason: "document_section",
|
|
2201
|
-
message: `${
|
|
2207
|
+
message: `${w} is in a Document section, which takes only the filters its Document sheet shows.`,
|
|
2202
2208
|
fix: "Tell the user to change where the filter shows in the editor."
|
|
2203
2209
|
};
|
|
2204
|
-
const
|
|
2205
|
-
if (
|
|
2210
|
+
const _ = d.get(D.sheetId);
|
|
2211
|
+
if (_ && !Ua(b, _))
|
|
2206
2212
|
return {
|
|
2207
2213
|
reason: "outside_sheets",
|
|
2208
|
-
message: `${N} isn't shown on "${c(D.sheetId)}", so it can't filter ${
|
|
2214
|
+
message: `${N} isn't shown on "${c(D.sheetId)}", so it can't filter ${w}.`,
|
|
2209
2215
|
fix: "Show it on that sheet first with filter.update sheetIds (null for every sheet), in the same proposal."
|
|
2210
2216
|
};
|
|
2211
|
-
const
|
|
2212
|
-
switch (
|
|
2217
|
+
const I = Io(b, D.card);
|
|
2218
|
+
switch (I.status) {
|
|
2213
2219
|
case "incompatible":
|
|
2214
|
-
return { reason: "incompatible_field", message: `${
|
|
2220
|
+
return { reason: "incompatible_field", message: `${w} can't take ${N}'s values on that field: their types differ.`, fix: "Bind a field of the same type (filter.bind)." };
|
|
2215
2221
|
case "stale":
|
|
2216
2222
|
return {
|
|
2217
2223
|
reason: "field_not_on_card",
|
|
2218
|
-
message: `${
|
|
2224
|
+
message: `${w} doesn't have the field ${N} is bound to.`,
|
|
2219
2225
|
fix: "Bind a field the card has (filter.bind), or exclude the card (filter.exclude), in the same proposal."
|
|
2220
2226
|
};
|
|
2221
2227
|
case "ambiguous":
|
|
2222
2228
|
return {
|
|
2223
2229
|
reason: "ambiguous_field",
|
|
2224
|
-
message: `${
|
|
2230
|
+
message: `${w} has more than one field ${N} could filter.`,
|
|
2225
2231
|
fix: "Bind the field it should use (filter.bind), or exclude the card (filter.exclude), in the same proposal."
|
|
2226
2232
|
};
|
|
2227
2233
|
case "relationship": {
|
|
2228
|
-
const
|
|
2229
|
-
return
|
|
2234
|
+
const R = $e(b, D.card, o);
|
|
2235
|
+
return R.reach === "blocked" ? {
|
|
2230
2236
|
reason: "relationship_route_changed",
|
|
2231
|
-
message: `The relationships ${
|
|
2237
|
+
message: `The relationships ${w} used for ${N} changed in the domain.`,
|
|
2232
2238
|
fix: "Tell the user to choose the relationship again in the filter's Cards tab."
|
|
2233
|
-
} :
|
|
2239
|
+
} : R.reason === "relationship_ambiguous" ? {
|
|
2234
2240
|
reason: "relationship_ambiguous",
|
|
2235
|
-
message: `${N} connects to ${
|
|
2241
|
+
message: `${N} connects to ${w} through more than one path.`,
|
|
2236
2242
|
fix: "Tell the user to choose a path in the filter's Cards tab, or bind a field the card has (filter.bind)."
|
|
2237
2243
|
} : {
|
|
2238
2244
|
reason: "relationship_pending",
|
|
2239
|
-
message: `${N} may reach ${
|
|
2245
|
+
message: `${N} may reach ${w} through the domain's relationships; whether it applies is decided when the card runs.`,
|
|
2240
2246
|
fix: "Bind a field the card has (filter.bind) to make it certain, or leave it to the relationships."
|
|
2241
2247
|
};
|
|
2242
2248
|
}
|
|
@@ -2247,59 +2253,59 @@ function ni(e, a, t, s, o) {
|
|
|
2247
2253
|
case "automatic":
|
|
2248
2254
|
case "passthrough":
|
|
2249
2255
|
case "notApplicable":
|
|
2250
|
-
return { reason: "filter_settings_override", message: `${N} still wouldn't filter ${
|
|
2256
|
+
return { reason: "filter_settings_override", message: `${N} still wouldn't filter ${w}: its settings leave that card out.`, fix: "Tell the user to change the filter's settings in the editor." };
|
|
2251
2257
|
default: {
|
|
2252
|
-
const
|
|
2253
|
-
throw new Error(`Unhandled filter card target ${String(
|
|
2258
|
+
const R = I;
|
|
2259
|
+
throw new Error(`Unhandled filter card target ${String(R.status)}`);
|
|
2254
2260
|
}
|
|
2255
2261
|
}
|
|
2256
|
-
},
|
|
2257
|
-
for (const
|
|
2258
|
-
(
|
|
2259
|
-
for (const
|
|
2260
|
-
const
|
|
2261
|
-
if (!
|
|
2262
|
-
const D =
|
|
2263
|
-
if (
|
|
2264
|
-
|
|
2265
|
-
const
|
|
2262
|
+
}, v = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Map();
|
|
2263
|
+
for (const C of t)
|
|
2264
|
+
(C.op === "filter.bind" || C.op === "filter.exclude") && y.set(`${C.filterId}|${C.cardId}`, C);
|
|
2265
|
+
for (const C of y.values()) {
|
|
2266
|
+
const k = Pe(a, C.filterId, void 0, o), b = i.get(C.cardId);
|
|
2267
|
+
if (!k || !b) continue;
|
|
2268
|
+
const D = k.reaches.includes(C.cardId);
|
|
2269
|
+
if (C.op === "filter.bind" ? D : !D) continue;
|
|
2270
|
+
v.add(`${C.filterId}|${C.cardId}`);
|
|
2271
|
+
const w = C.op === "filter.bind" ? p(C.filterId, C.cardId) : { reason: "filter_settings_override", message: `"${k.label}" would still filter "${b.card.title ?? ""}".`, fix: "Tell the user to change the filter's settings in the editor." };
|
|
2266
2272
|
n.push({
|
|
2267
2273
|
code: "filter_not_editable",
|
|
2268
|
-
message:
|
|
2269
|
-
path: `changes[${
|
|
2270
|
-
fix:
|
|
2271
|
-
details: { reason:
|
|
2274
|
+
message: w.message,
|
|
2275
|
+
path: `changes[${C.changeIndex ?? 0}]`,
|
|
2276
|
+
fix: w.fix,
|
|
2277
|
+
details: { reason: w.reason, cardId: C.cardId }
|
|
2272
2278
|
});
|
|
2273
2279
|
}
|
|
2274
|
-
for (const [
|
|
2275
|
-
const
|
|
2276
|
-
if (!
|
|
2277
|
-
const D =
|
|
2278
|
-
var
|
|
2279
|
-
return ((
|
|
2280
|
-
})),
|
|
2281
|
-
Ne(
|
|
2280
|
+
for (const [C, k] of s) {
|
|
2281
|
+
const b = Pe(a, C, void 0, o);
|
|
2282
|
+
if (!b) continue;
|
|
2283
|
+
const D = b.editable && ((E = b.exceptSheetIds) == null ? void 0 : E.some((_) => {
|
|
2284
|
+
var I;
|
|
2285
|
+
return ((I = d.get(_)) == null ? void 0 : I.sheetKind) === "dashboard";
|
|
2286
|
+
})), w = b.editable && !D ? b.sheetIds : void 0, N = k.sheetIds === "all" ? "all" : [...k.sheetIds].sort();
|
|
2287
|
+
Ne(w === "all" || !w ? w : [...w].sort(), N) || n.push({
|
|
2282
2288
|
code: "filter_not_editable",
|
|
2283
|
-
message: `"${
|
|
2284
|
-
path: `changes[${
|
|
2289
|
+
message: `"${b.label}" wouldn't show on the sheets asked for. Change where it shows in the editor.`,
|
|
2290
|
+
path: `changes[${k.changeIndex}].sheetIds`,
|
|
2285
2291
|
fix: "Tell the user to change the filter's sheets in the editor.",
|
|
2286
|
-
details: { reason: "filter_settings_override",
|
|
2292
|
+
details: { reason: "filter_settings_override", ...w ? { sheetIds: w } : {} }
|
|
2287
2293
|
});
|
|
2288
2294
|
}
|
|
2289
|
-
const
|
|
2290
|
-
for (const
|
|
2291
|
-
const
|
|
2292
|
-
for (const
|
|
2293
|
-
if (
|
|
2294
|
-
const D =
|
|
2295
|
-
if (D &&
|
|
2296
|
-
const N = p(
|
|
2295
|
+
const S = Ie(e), x = (C) => C === "blocked" || C === "ambiguous";
|
|
2296
|
+
for (const C of l.inputs) {
|
|
2297
|
+
const k = C.input.id;
|
|
2298
|
+
for (const b of l.reachedCards({ inputId: k })) {
|
|
2299
|
+
if (v.has(`${k}|${b.cardId}`) || !x($e(C.input, b.card, o).reach)) continue;
|
|
2300
|
+
const D = S.findFilterInput({ inputId: k }), w = D && S.reachedCards({ inputId: k }).find((_) => _.cardId === b.cardId);
|
|
2301
|
+
if (D && w && x($e(D.input, w.card, o).reach)) continue;
|
|
2302
|
+
const N = p(k, b.cardId);
|
|
2297
2303
|
n.push({
|
|
2298
2304
|
code: "invalid_change",
|
|
2299
|
-
message: `${N.message} The card would stop showing data while "${
|
|
2300
|
-
path: `changes[${h(
|
|
2305
|
+
message: `${N.message} The card would stop showing data while "${C.input.label}" has a value.`,
|
|
2306
|
+
path: `changes[${h(k, b.cardId)}]`,
|
|
2301
2307
|
fix: N.fix,
|
|
2302
|
-
details: { reason: N.reason, filterId:
|
|
2308
|
+
details: { reason: N.reason, filterId: k, cardId: b.cardId }
|
|
2303
2309
|
});
|
|
2304
2310
|
}
|
|
2305
2311
|
}
|
|
@@ -2310,22 +2316,22 @@ function ii(e, a, t) {
|
|
|
2310
2316
|
for (const [n, i] of a) {
|
|
2311
2317
|
const d = o.findFilterInput({ inputId: n });
|
|
2312
2318
|
if (!d) continue;
|
|
2313
|
-
const l = Ha({ dashboard: e, target: { kind: "dashboardInput", input: d.input, scope: {} }, calendar: t }).value, c = d.input.filter.dateSelectionMode, h = c === "day" ? "its date picker takes one day" : c === "months" ? "its month picker takes one whole month" : void 0, p = (
|
|
2319
|
+
const l = Ha({ dashboard: e, target: { kind: "dashboardInput", input: d.input, scope: {} }, calendar: t }).value, c = d.input.filter.dateSelectionMode, h = c === "day" ? "its date picker takes one day" : c === "months" ? "its month picker takes one whole month" : void 0, p = (v, y) => s.push({
|
|
2314
2320
|
code: "filter_not_editable",
|
|
2315
|
-
message:
|
|
2321
|
+
message: v,
|
|
2316
2322
|
path: `changes[${i.changeIndex}]`,
|
|
2317
|
-
fix:
|
|
2323
|
+
fix: y,
|
|
2318
2324
|
details: { reason: "default_not_applied", ...c ? { datePicker: c } : {} }
|
|
2319
2325
|
});
|
|
2320
2326
|
if (i.period) {
|
|
2321
|
-
const
|
|
2322
|
-
(!
|
|
2327
|
+
const v = Ja(l && "relativeMeta" in l ? l.relativeMeta : void 0);
|
|
2328
|
+
(!v || tn(i.period) || !an(v, i.period)) && p(
|
|
2323
2329
|
`"${d.input.label}" wouldn't load with that default${h ? `: ${h}` : ""}.`,
|
|
2324
2330
|
h ? "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."
|
|
2325
2331
|
);
|
|
2326
2332
|
} else if (i.values) {
|
|
2327
|
-
const
|
|
2328
|
-
(!l ||
|
|
2333
|
+
const v = (y) => JSON.stringify((y ?? []).map(String).sort());
|
|
2334
|
+
(!l || v(l.values) !== v(i.values)) && p(`"${d.input.label}" wouldn't load with those values.`, "Tell the user to change the filter's default in the editor.");
|
|
2329
2335
|
} else
|
|
2330
2336
|
(Ya(d.input.filter.dataType) ? i.period === null : i.values === null) && l && p(`"${d.input.label}" would still load with a default.`, "Tell the user to change the filter's default in the editor.");
|
|
2331
2337
|
}
|
|
@@ -2358,8 +2364,8 @@ function ri(e, a) {
|
|
|
2358
2364
|
function di(e, a, t, s) {
|
|
2359
2365
|
const o = Object.fromEntries(Object.entries(a).filter(([, p]) => p != null)), n = tt(o), i = tt(e), d = (p) => Sa[p].safeParse(o);
|
|
2360
2366
|
if (!e || n && n !== i) {
|
|
2361
|
-
const p = n ?? i,
|
|
2362
|
-
return
|
|
2367
|
+
const p = n ?? i, v = p ? d(p) : void 0;
|
|
2368
|
+
return v != null && v.success ? v.data : s({
|
|
2363
2369
|
code: e ? "query_form_mismatch" : "type_not_supported",
|
|
2364
2370
|
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.",
|
|
2365
2371
|
path: t,
|
|
@@ -2367,8 +2373,8 @@ function di(e, a, t, s) {
|
|
|
2367
2373
|
});
|
|
2368
2374
|
}
|
|
2369
2375
|
const l = { ...e };
|
|
2370
|
-
for (const [p,
|
|
2371
|
-
|
|
2376
|
+
for (const [p, v] of Object.entries(a))
|
|
2377
|
+
v !== void 0 && (v === null ? delete l[p] : l[p] = v);
|
|
2372
2378
|
const c = ms(e, a);
|
|
2373
2379
|
c && delete l.timeWindow;
|
|
2374
2380
|
const h = Sa[i].safeParse(l);
|
|
@@ -2410,7 +2416,7 @@ function ci(e) {
|
|
|
2410
2416
|
return (s = (t = (a = e == null ? void 0 : e.filters) == null ? void 0 : a.conditions) == null ? void 0 : t.find((o) => o.relativeMeta)) == null ? void 0 : s.field;
|
|
2411
2417
|
}
|
|
2412
2418
|
async function ui(e, a, t, s, o, n) {
|
|
2413
|
-
const i = no(e), d = i.kind === "config" ? i.executableSources : i.kind === "sql" ? i.pinnedCatalogSources.map((
|
|
2419
|
+
const i = no(e), d = i.kind === "config" ? i.executableSources : i.kind === "sql" ? i.pinnedCatalogSources.map((x) => x.source) : [], l = he(e), c = typeof a == "string" ? (l == null ? void 0 : l.kind) === "semantic" ? l.datasetName : void 0 : a.datasetName, h = d.find((x) => x.kind === "semantic" && Tt(x.datasetName) === Tt(c));
|
|
2414
2420
|
if ((!h || h.kind !== "semantic") && n)
|
|
2415
2421
|
return o({
|
|
2416
2422
|
code: "field_not_found",
|
|
@@ -2425,13 +2431,13 @@ async function ui(e, a, t, s, o, n) {
|
|
|
2425
2431
|
path: s,
|
|
2426
2432
|
fix: "Name a field of the card's own dataset, or { name, datasetName } for a dataset its query joins."
|
|
2427
2433
|
});
|
|
2428
|
-
const p = await t.loadCardSource({ domainId: h.domainId, datasetName: h.datasetName }),
|
|
2429
|
-
return
|
|
2434
|
+
const p = await t.loadCardSource({ domainId: h.domainId, datasetName: h.datasetName }), v = typeof a == "string" ? a : a.name, y = p ? ot(p.fields, v, h.datasetName) : void 0, S = y ? Yo(h, { column_name: y.name, data_type: y.dataType, ...y.sourceField ? { sourceField: y.sourceField } : {} }) : void 0;
|
|
2435
|
+
return S || o({
|
|
2430
2436
|
code: "field_not_found",
|
|
2431
|
-
message: `"${
|
|
2437
|
+
message: `"${v}" isn't a field of ${h.datasetName}.`,
|
|
2432
2438
|
path: s,
|
|
2433
2439
|
fix: "Use one of details.available, or read semaphor_get_dataset_schema.",
|
|
2434
|
-
details: { available: ((p == null ? void 0 : p.fields) ?? []).slice(0, 20).map((
|
|
2440
|
+
details: { available: ((p == null ? void 0 : p.fields) ?? []).slice(0, 20).map((x) => x.name) }
|
|
2435
2441
|
});
|
|
2436
2442
|
}
|
|
2437
2443
|
const fi = {
|
|
@@ -2494,59 +2500,59 @@ function pi(e) {
|
|
|
2494
2500
|
}
|
|
2495
2501
|
const gi = 50;
|
|
2496
2502
|
function Or(e, a) {
|
|
2497
|
-
var
|
|
2498
|
-
const t = (
|
|
2499
|
-
(
|
|
2503
|
+
var w, N;
|
|
2504
|
+
const t = (w = a.sheetIds) != null && w.length ? new Set(a.sheetIds) : void 0, s = (N = a.cardIds) != null && N.length ? new Set(a.cardIds) : void 0, o = (e.sheets ?? []).filter((_) => !t || t.has(_.id)), n = xe(e).filter(
|
|
2505
|
+
(_) => (!t || t.has(_.sheetId)) && (!s || s.has(_.cardId))
|
|
2500
2506
|
), i = n.length > (a.maxQueryCards ?? gi), d = new Map(
|
|
2501
|
-
(e.sheets ?? []).flatMap((
|
|
2502
|
-
), l = /* @__PURE__ */ new Map(), c = (
|
|
2503
|
-
(
|
|
2507
|
+
(e.sheets ?? []).flatMap((_) => (_.frames ?? []).map((I) => [I.id, I]))
|
|
2508
|
+
), l = /* @__PURE__ */ new Map(), c = (_) => {
|
|
2509
|
+
(_ == null ? void 0 : _.kind) === "semantic" && l.set(`${_.domainId}|${_.datasetName}`, { domainId: _.domainId, datasetName: _.datasetName });
|
|
2504
2510
|
}, h = new Map(
|
|
2505
|
-
(e.sheets ?? []).map((
|
|
2506
|
-
), p = (
|
|
2507
|
-
if (
|
|
2508
|
-
const
|
|
2509
|
-
return
|
|
2510
|
-
},
|
|
2511
|
-
sheetId:
|
|
2512
|
-
title:
|
|
2513
|
-
kind:
|
|
2514
|
-
...
|
|
2515
|
-
cards: n.filter((
|
|
2511
|
+
(e.sheets ?? []).map((_) => [_.id, _t({ dashboard: e, place: { kind: _.kind === "document" ? "document" : "sheet", sheetId: _.id } })])
|
|
2512
|
+
), p = (_) => ({ catalog: _, inputs: e.inputs, variables: e.variables }), v = (_) => p(h.get(_)), y = /* @__PURE__ */ new Map(), S = (_, I) => {
|
|
2513
|
+
if (_.kind === "document") return v(_.id);
|
|
2514
|
+
const R = _t({ dashboard: e, place: { kind: "sheet", sheetId: _.id, cardId: I } });
|
|
2515
|
+
return y.set(`${_.id}:${I}`, R), p(R);
|
|
2516
|
+
}, x = o.map((_) => ({
|
|
2517
|
+
sheetId: _.id,
|
|
2518
|
+
title: _.title ?? "",
|
|
2519
|
+
kind: _.kind === "document" ? "document" : "dashboard",
|
|
2520
|
+
..._.kind === "document" ? yi(_, v(_.id)) : { layout: _i(_) },
|
|
2521
|
+
cards: n.filter((I) => I.sheetId === _.id).map((I) => {
|
|
2516
2522
|
var oe;
|
|
2517
|
-
const
|
|
2518
|
-
if (
|
|
2519
|
-
const te = he(
|
|
2523
|
+
const R = I.card, P = I.kind === "frameCard" ? (oe = d.get(I.frameId)) == null ? void 0 : oe.visualId : void 0, V = P ? { linkedVisualId: P } : {}, K = { cardId: I.cardId, title: R.title ?? "" };
|
|
2524
|
+
if (I.kind !== "frameCard") {
|
|
2525
|
+
const te = he(R);
|
|
2520
2526
|
return c(te), {
|
|
2521
2527
|
...K,
|
|
2522
|
-
...
|
|
2528
|
+
...Ue(R),
|
|
2523
2529
|
...te ? { source: te } : {},
|
|
2524
2530
|
editable: !1,
|
|
2525
|
-
notEditable:
|
|
2531
|
+
notEditable: I.kind === "documentSectionCard" ? { reason: "document_section", message: "Cards in Document sections can't be changed through the MCP yet. Change them in the editor." } : {
|
|
2526
2532
|
reason: "not_expressible",
|
|
2527
2533
|
message: "This card isn't in a tile, so it can't be changed through the MCP. Change it in the editor.",
|
|
2528
2534
|
detail: "a card outside a tile"
|
|
2529
2535
|
}
|
|
2530
2536
|
};
|
|
2531
2537
|
}
|
|
2532
|
-
if (
|
|
2533
|
-
const te =
|
|
2534
|
-
return te.editable ? { ...K, type: "text", ...V, editable: !0, text: te.text, ...te.editorOnly.length ? { editorOnly: te.editorOnly } : {} } : { ...K, ...
|
|
2538
|
+
if (R.type === "text") {
|
|
2539
|
+
const te = Ka(R, S(_, R.id));
|
|
2540
|
+
return te.editable ? { ...K, type: "text", ...V, editable: !0, text: te.text, ...te.editorOnly.length ? { editorOnly: te.editorOnly } : {} } : { ...K, ...Ue(R), ...V, editable: !1, notEditable: { reason: "text", message: te.message } };
|
|
2535
2541
|
}
|
|
2536
|
-
const B = we(
|
|
2542
|
+
const B = we(R, { sql: a.sql });
|
|
2537
2543
|
if (c(B.source), !B.editable)
|
|
2538
2544
|
return {
|
|
2539
2545
|
...K,
|
|
2540
|
-
...
|
|
2546
|
+
...Ue(R),
|
|
2541
2547
|
...B.source ? { source: B.source } : {},
|
|
2542
2548
|
...V,
|
|
2543
2549
|
editable: !1,
|
|
2544
2550
|
notEditable: { reason: B.reason, message: B.message, ...B.detail ? { detail: B.detail } : {} }
|
|
2545
2551
|
};
|
|
2546
|
-
const se = i ? void 0 : Ft(
|
|
2552
|
+
const se = i ? void 0 : Ft(R);
|
|
2547
2553
|
return {
|
|
2548
2554
|
...K,
|
|
2549
|
-
...
|
|
2555
|
+
...Ue(R),
|
|
2550
2556
|
type: B.type,
|
|
2551
2557
|
source: B.source,
|
|
2552
2558
|
...V,
|
|
@@ -2562,27 +2568,27 @@ function Or(e, a) {
|
|
|
2562
2568
|
})), E = as(e, es(a.calendar, a.updatedAt), {
|
|
2563
2569
|
...a.relationshipReach ? { relationshipReach: a.relationshipReach } : {}
|
|
2564
2570
|
});
|
|
2565
|
-
for (const
|
|
2566
|
-
|
|
2567
|
-
const
|
|
2568
|
-
for (const
|
|
2569
|
-
const
|
|
2570
|
-
(
|
|
2571
|
-
}
|
|
2572
|
-
const
|
|
2573
|
-
var
|
|
2574
|
-
return ((
|
|
2575
|
-
}).map((
|
|
2576
|
-
(
|
|
2577
|
-
var
|
|
2578
|
-
return (
|
|
2579
|
-
var
|
|
2580
|
-
return
|
|
2571
|
+
for (const _ of E)
|
|
2572
|
+
_.editable && l.set(`${_.domainId}|${_.datasetName}`, { domainId: _.domainId, datasetName: _.datasetName });
|
|
2573
|
+
const C = vi(e, a, new Map([...h, ...y]));
|
|
2574
|
+
for (const _ of e.variables ?? []) {
|
|
2575
|
+
const I = kt(_);
|
|
2576
|
+
(I == null ? void 0 : I.kind) === "semantic" && l.set(`${I.domainId}|${I.datasetName}`, { domainId: I.domainId, datasetName: I.datasetName });
|
|
2577
|
+
}
|
|
2578
|
+
const k = (e.variables ?? []).filter((_) => {
|
|
2579
|
+
var I;
|
|
2580
|
+
return ((I = kt(_)) == null ? void 0 : I.kind) === "physical";
|
|
2581
|
+
}).map((_) => _.name), b = (e.sheets ?? []).some(
|
|
2582
|
+
(_) => {
|
|
2583
|
+
var I;
|
|
2584
|
+
return (I = _.document) == null ? void 0 : I.sections.some((R) => {
|
|
2585
|
+
var P, V;
|
|
2586
|
+
return R.type === "text" && (((P = R.style) == null ? void 0 : P.fontWeight) || ((V = R.style) == null ? void 0 : V.color));
|
|
2581
2587
|
});
|
|
2582
2588
|
}
|
|
2583
2589
|
), D = [
|
|
2584
|
-
...
|
|
2585
|
-
...
|
|
2590
|
+
...k.length ? [`a variable on a table or view source (${k.join(", ")}): changed in the editor`] : [],
|
|
2591
|
+
...b ? ["a Document text section's weight or color: changed in the editor"] : [],
|
|
2586
2592
|
// No change creates a calculated field (DV-D13, ledger AR-27): the parity backlog names it.
|
|
2587
2593
|
"creating a calculated field: use one the domain has, or a SQL variable",
|
|
2588
2594
|
// No change writes click to filter yet; agent click authoring is the next
|
|
@@ -2597,9 +2603,9 @@ function Or(e, a) {
|
|
|
2597
2603
|
updatedAt: a.updatedAt,
|
|
2598
2604
|
access: a.access,
|
|
2599
2605
|
datasets: [...l.values()],
|
|
2600
|
-
sheets:
|
|
2606
|
+
sheets: x,
|
|
2601
2607
|
filters: E,
|
|
2602
|
-
variables:
|
|
2608
|
+
variables: C,
|
|
2603
2609
|
style: bi(e, a),
|
|
2604
2610
|
editorOnly: D,
|
|
2605
2611
|
...i ? { truncated: !0 } : {}
|
|
@@ -2656,14 +2662,14 @@ function vi(e, a, t) {
|
|
|
2656
2662
|
usedIn: o((h) => h.source === "documentMeta" && h.key === c.reportKey),
|
|
2657
2663
|
editable: !1
|
|
2658
2664
|
})), l = (e.variables ?? []).map((c) => {
|
|
2659
|
-
const h = rs(c, { sql: a.sql }), p = Dt(c, e)[0],
|
|
2665
|
+
const h = rs(c, { sql: a.sql }), p = Dt(c, e)[0], v = Co(c.presentation);
|
|
2660
2666
|
return {
|
|
2661
2667
|
name: c.name,
|
|
2662
2668
|
kind: "data",
|
|
2663
2669
|
words: Jo(c),
|
|
2664
2670
|
parts: Lo(c),
|
|
2665
|
-
...
|
|
2666
|
-
usedIn: o((
|
|
2671
|
+
...v ? { presentation: v } : {},
|
|
2672
|
+
usedIn: o((y) => y.source === "data" && y.variableId === c.id),
|
|
2667
2673
|
editable: h.editable,
|
|
2668
2674
|
...h.editable ? {} : { notEditable: { reason: h.reason, message: h.message } },
|
|
2669
2675
|
...p ? { broken: `${p.message} ${p.fix}` } : {}
|
|
@@ -2676,7 +2682,7 @@ const Ii = {
|
|
|
2676
2682
|
pageNumber: "The page number (Documents)",
|
|
2677
2683
|
pageCount: "The page count (Documents)"
|
|
2678
2684
|
};
|
|
2679
|
-
function
|
|
2685
|
+
function Ue(e) {
|
|
2680
2686
|
const a = Ee(e);
|
|
2681
2687
|
return a ? { type: a.type, ...a.properties } : { type: $t(e.type) };
|
|
2682
2688
|
}
|
|
@@ -2722,29 +2728,29 @@ function It(e, a, t) {
|
|
|
2722
2728
|
}
|
|
2723
2729
|
function ps(e, a) {
|
|
2724
2730
|
const t = [], s = e.config;
|
|
2725
|
-
for (const
|
|
2726
|
-
const
|
|
2727
|
-
Array.isArray(
|
|
2731
|
+
for (const S of Ci) {
|
|
2732
|
+
const x = s == null ? void 0 : s[S];
|
|
2733
|
+
Array.isArray(x) && x.forEach((E, C) => It(t, `${a}.config.${S}[${C}]`, E));
|
|
2728
2734
|
}
|
|
2729
2735
|
const o = Z(s == null ? void 0 : s.matrix) ? s.matrix : void 0, n = Z(o == null ? void 0 : o.presentation) ? o.presentation : void 0;
|
|
2730
|
-
for (const
|
|
2731
|
-
const
|
|
2732
|
-
if (Z(
|
|
2736
|
+
for (const S of ["measureFormats", "levelFormats"]) {
|
|
2737
|
+
const x = n == null ? void 0 : n[S];
|
|
2738
|
+
if (Z(x)) for (const [E, C] of Object.entries(x)) Oe(t, `${a}.config.matrix.presentation.${S}.${E}`, C);
|
|
2733
2739
|
}
|
|
2734
2740
|
re(n, "conditionalFormatting") && t.push({ path: `${a}.config.matrix.presentation.conditionalFormatting`, field: "conditionalFormatting", replacement: Qe });
|
|
2735
2741
|
const i = e.interactionConfig, d = i == null ? void 0 : i.drillHierarchies;
|
|
2736
|
-
Array.isArray(d) && d.forEach((
|
|
2737
|
-
Z(
|
|
2738
|
-
Z(E) && It(t, `${a}.interactionConfig.drillHierarchies[${
|
|
2742
|
+
Array.isArray(d) && d.forEach((S, x) => {
|
|
2743
|
+
Z(S) && (It(t, `${a}.interactionConfig.drillHierarchies[${x}].baseField`, S.baseField), Array.isArray(S.steps) && S.steps.forEach((E, C) => {
|
|
2744
|
+
Z(E) && It(t, `${a}.interactionConfig.drillHierarchies[${x}].steps[${C}].field`, E.field);
|
|
2739
2745
|
}));
|
|
2740
2746
|
});
|
|
2741
2747
|
const l = e.preferences;
|
|
2742
2748
|
if (!l) return t;
|
|
2743
2749
|
const c = `${a}.preferences`;
|
|
2744
2750
|
if (re(l, "formatNumber")) {
|
|
2745
|
-
const
|
|
2751
|
+
const S = l.formatNumber, x = Z(S) && Object.keys(S).every((E) => E === "colorRanges");
|
|
2746
2752
|
t.push(
|
|
2747
|
-
|
|
2753
|
+
x ? { path: `${c}.formatNumber.colorRanges`, field: "colorRanges", replacement: `${Qe} (a rule on the KPI's value)` } : { path: `${c}.formatNumber`, field: "formatNumber", replacement: "`format` on each measure in `config.metricColumns`; for a SQL KPI, `preferences.sqlKpiValue.format`" }
|
|
2748
2754
|
);
|
|
2749
2755
|
}
|
|
2750
2756
|
re(l, "numberAxisFormat") && t.push({ path: `${c}.numberAxisFormat`, field: "numberAxisFormat", replacement: "`valueFormat` on `preferences.yAxisConfig` (or the axis it formats)" }), re(l, "columnSettings") && t.push({ path: `${c}.columnSettings`, field: "columnSettings", replacement: "`preferences.tablePrefs.columnSettingsMap`, keyed by column" });
|
|
@@ -2752,27 +2758,27 @@ function ps(e, a) {
|
|
|
2752
2758
|
re(h, "formatOptions") && t.push({ path: `${c}.kpiVisualOptions.formatOptions`, field: "formatOptions", replacement: "`format` on each measure in `config.metricColumns`; for a SQL KPI, `preferences.sqlKpiValue.format`" }), re(h, "queryComparisonPolarity") && t.push({ path: `${c}.kpiVisualOptions.queryComparisonPolarity`, field: "queryComparisonPolarity", replacement: "`preferences.sqlKpiValue.comparisonPolarity`" });
|
|
2753
2759
|
const p = l.tablePrefs;
|
|
2754
2760
|
re(p, "conditionalFormatting") && t.push({ path: `${c}.tablePrefs.conditionalFormatting`, field: "conditionalFormatting", replacement: Qe });
|
|
2755
|
-
const
|
|
2756
|
-
if (Z(
|
|
2757
|
-
for (const [
|
|
2758
|
-
if (!Z(
|
|
2759
|
-
const E = `${c}.tablePrefs.columnSettingsMap.${
|
|
2760
|
-
for (const
|
|
2761
|
-
re(
|
|
2762
|
-
re(
|
|
2761
|
+
const v = p == null ? void 0 : p.columnSettingsMap;
|
|
2762
|
+
if (Z(v))
|
|
2763
|
+
for (const [S, x] of Object.entries(v)) {
|
|
2764
|
+
if (!Z(x)) continue;
|
|
2765
|
+
const E = `${c}.tablePrefs.columnSettingsMap.${S}`;
|
|
2766
|
+
for (const C of ["numberFormat", "dateFormat", "inheritMetricFormat"])
|
|
2767
|
+
re(x, C) && t.push({ path: `${E}.${C}`, field: C, replacement: C === "inheritMetricFormat" ? "nothing: a column follows its `format`" : wi });
|
|
2768
|
+
re(x, "colorRanges") && t.push({ path: `${E}.colorRanges`, field: "colorRanges", replacement: Qe });
|
|
2763
2769
|
}
|
|
2764
|
-
for (const
|
|
2765
|
-
const
|
|
2766
|
-
if (Z(
|
|
2770
|
+
for (const S of $i) {
|
|
2771
|
+
const x = l[S];
|
|
2772
|
+
if (Z(x)) {
|
|
2767
2773
|
for (const E of ["formatMode", "mode", "formatOptions"])
|
|
2768
|
-
re(
|
|
2769
|
-
|
|
2774
|
+
re(x, E) && t.push({ path: `${c}.${S}.${E}`, field: E, replacement: `\`preferences.${S}.valueFormat\` (absent means the column's format)` });
|
|
2775
|
+
S === "dataLabelsConfig" && re(x, "format") && t.push({ path: `${c}.${S}.format`, field: "format", replacement: "`preferences.dataLabelsConfig.valueFormat`" }), Oe(t, `${c}.${S}.valueFormat`, x.valueFormat);
|
|
2770
2776
|
}
|
|
2771
2777
|
}
|
|
2772
|
-
const
|
|
2773
|
-
if (Z(
|
|
2774
|
-
for (const [
|
|
2775
|
-
Z(
|
|
2778
|
+
const y = l.sqlColumns;
|
|
2779
|
+
if (Z(y))
|
|
2780
|
+
for (const [S, x] of Object.entries(y))
|
|
2781
|
+
Z(x) && Oe(t, `${c}.sqlColumns.${S}.format`, x.format);
|
|
2776
2782
|
return Z(l.sqlKpiValue) && Oe(t, `${c}.sqlKpiValue.format`, l.sqlKpiValue.format), t;
|
|
2777
2783
|
}
|
|
2778
2784
|
function Si(e) {
|
|
@@ -3053,52 +3059,52 @@ function Vi(e, a) {
|
|
|
3053
3059
|
);
|
|
3054
3060
|
}
|
|
3055
3061
|
}
|
|
3056
|
-
function
|
|
3062
|
+
function Ki(e) {
|
|
3057
3063
|
var l;
|
|
3058
3064
|
const a = (l = e.card.preferences) == null ? void 0 : l.tablePrefs, t = a == null ? void 0 : a.columnSettingsMap;
|
|
3059
3065
|
if (!J(t)) return;
|
|
3060
3066
|
const s = e.card, o = ys(s), n = ee(s, "pivotByColumns").length > 0, i = /* @__PURE__ */ new Map(), d = [];
|
|
3061
3067
|
for (const [c, h] of Object.entries(t)) {
|
|
3062
3068
|
if (!J(h)) continue;
|
|
3063
|
-
const p = h,
|
|
3069
|
+
const p = h, v = `preferences.tablePrefs.columnSettingsMap[${JSON.stringify(c)}]`;
|
|
3064
3070
|
if (Pi(p)) {
|
|
3065
|
-
const
|
|
3066
|
-
if (
|
|
3067
|
-
Da(e, c,
|
|
3068
|
-
else if (
|
|
3069
|
-
const
|
|
3070
|
-
|
|
3071
|
-
path:
|
|
3071
|
+
const y = So(p.numberFormat);
|
|
3072
|
+
if (y && o)
|
|
3073
|
+
Da(e, c, y, `${v}.numberFormat`);
|
|
3074
|
+
else if (y && Rt(s)) {
|
|
3075
|
+
const S = Fa(s, c), x = { key: c, format: y, from: `${v}.numberFormat` };
|
|
3076
|
+
S ? i.set(S, [...i.get(S) ?? [], x]) : n ? d.push(x) : e.unconverted.push({
|
|
3077
|
+
path: x.from,
|
|
3072
3078
|
reason: "unmatched_column_setting",
|
|
3073
3079
|
detail: `"${c}" names no card column.`
|
|
3074
3080
|
});
|
|
3075
|
-
} else
|
|
3076
|
-
(
|
|
3081
|
+
} else y && s.type !== "matrixTable" && s.type !== "kpi" && ee(s, "metricColumns").some(
|
|
3082
|
+
(x) => x.comparison != null
|
|
3077
3083
|
) && e.unconverted.push({
|
|
3078
|
-
path: `${
|
|
3084
|
+
path: `${v}.numberFormat`,
|
|
3079
3085
|
reason: "chart_comparison_column_setting",
|
|
3080
3086
|
detail: `"${c}" formats this chart's comparison tooltip only.`
|
|
3081
3087
|
});
|
|
3082
3088
|
}
|
|
3083
3089
|
if (J(p.dateFormat)) {
|
|
3084
|
-
const
|
|
3085
|
-
if (
|
|
3086
|
-
Da(e, c, ko(p.dateFormat), `${
|
|
3087
|
-
else if (
|
|
3088
|
-
const
|
|
3089
|
-
(!
|
|
3090
|
-
path: `${
|
|
3090
|
+
const y = p.type === "date";
|
|
3091
|
+
if (y && o)
|
|
3092
|
+
Da(e, c, ko(p.dateFormat), `${v}.dateFormat`);
|
|
3093
|
+
else if (y && Rt(s)) {
|
|
3094
|
+
const S = Fa(s, c);
|
|
3095
|
+
(!S || !Li(s, S)) && e.unconverted.push({
|
|
3096
|
+
path: `${v}.dateFormat`,
|
|
3091
3097
|
reason: "config_column_date_setting",
|
|
3092
3098
|
detail: `"${c}"'s download formats its dates with this setting.`
|
|
3093
3099
|
});
|
|
3094
3100
|
}
|
|
3095
3101
|
}
|
|
3096
|
-
for (const
|
|
3097
|
-
Object.prototype.hasOwnProperty.call(p,
|
|
3102
|
+
for (const y of qi)
|
|
3103
|
+
Object.prototype.hasOwnProperty.call(p, y) && (delete p[y], e.changes.push({ path: `${v}.${y}`, action: "removed" }));
|
|
3098
3104
|
}
|
|
3099
3105
|
Bi(e, i), Vi(e, d);
|
|
3100
3106
|
}
|
|
3101
|
-
function
|
|
3107
|
+
function ji(e) {
|
|
3102
3108
|
return Object.keys(e).some(
|
|
3103
3109
|
(a) => a !== "enabled" && a !== "colorRanges" && e[a] !== void 0
|
|
3104
3110
|
);
|
|
@@ -3106,10 +3112,10 @@ function Ki(e) {
|
|
|
3106
3112
|
function Wi(e) {
|
|
3107
3113
|
return (e == null ? void 0 : e.enabled) === !1 || (e == null ? void 0 : e.enabled) === "false";
|
|
3108
3114
|
}
|
|
3109
|
-
function
|
|
3115
|
+
function Gi(e) {
|
|
3110
3116
|
const a = e.card, t = a.preferences;
|
|
3111
3117
|
if (!t) return;
|
|
3112
|
-
const s = t.kpiVisualOptions, o = J(s == null ? void 0 : s.formatOptions) ? s.formatOptions : void 0, n = t, i = J(n.formatNumber) ? n.formatNumber : void 0, d = o ? Me(To(o)) : void 0, l = i &&
|
|
3118
|
+
const s = t.kpiVisualOptions, o = J(s == null ? void 0 : s.formatOptions) ? s.formatOptions : void 0, n = t, i = J(n.formatNumber) ? n.formatNumber : void 0, d = o ? Me(To(o)) : void 0, l = i && ji(i) ? Me(Ro(i)) : void 0;
|
|
3113
3119
|
if (a.type === "kpi") {
|
|
3114
3120
|
if (Wi(i) && e.unconverted.push({
|
|
3115
3121
|
path: "preferences.formatNumber.enabled",
|
|
@@ -3130,7 +3136,7 @@ function Ui(e) {
|
|
|
3130
3136
|
ee(a, "metricColumns").forEach((h) => {
|
|
3131
3137
|
d ? st(e, h, d, "preferences.kpiVisualOptions.formatOptions") : l && !h.format && st(e, h, l, "preferences.formatNumber");
|
|
3132
3138
|
});
|
|
3133
|
-
|
|
3139
|
+
Ui(e, i);
|
|
3134
3140
|
} else if (l) {
|
|
3135
3141
|
const c = ee(a, "metricColumns");
|
|
3136
3142
|
ys(a) ? e.unconverted.push({
|
|
@@ -3151,7 +3157,7 @@ function Ui(e) {
|
|
|
3151
3157
|
for (const c of ["numberAxisFormat", "columnSettings"])
|
|
3152
3158
|
ke(t, [c]) && e.changes.push({ path: `preferences.${c}`, action: "removed" });
|
|
3153
3159
|
}
|
|
3154
|
-
function
|
|
3160
|
+
function Ui(e, a) {
|
|
3155
3161
|
var n;
|
|
3156
3162
|
const t = a == null ? void 0 : a.decimalPlaces, s = e.card.preferences;
|
|
3157
3163
|
if (typeof t != "number" || ((n = s.comparisonPresentation) == null ? void 0 : n.precision) !== void 0) return;
|
|
@@ -3201,7 +3207,7 @@ function Yi(e, a = {}) {
|
|
|
3201
3207
|
ee(t.card, s).forEach((o, n) => {
|
|
3202
3208
|
J(o) && Di(t, o, s, `config.${s}[${n}]`);
|
|
3203
3209
|
});
|
|
3204
|
-
return Ei(t),
|
|
3210
|
+
return Ei(t), Ki(t), Gi(t), Hi(t), zi(t), Oi(t, a), t.changes.length === 0 && t.unconverted.length === 0 ? { card: e, changes: [], unconverted: [] } : t;
|
|
3205
3211
|
}
|
|
3206
3212
|
const Ji = "__semaphor_unassigned_trigger__", Xi = "__NULL__";
|
|
3207
3213
|
function Zi(e) {
|
|
@@ -3236,45 +3242,45 @@ function ar(e, a) {
|
|
|
3236
3242
|
return n.length === 1 ? { ref: { kind: "field", fieldId: n[0] } } : n.length > 1 ? { reason: "ambiguous_column" } : (d = (i = e.config) == null ? void 0 : i.pivotByColumns) != null && d.length ? tr(e, a) : { reason: "no_matching_column" };
|
|
3237
3243
|
}
|
|
3238
3244
|
function Ea(e, a, t, s, o) {
|
|
3239
|
-
const n = (
|
|
3240
|
-
s.push({ ruleId: e.id, name: e.name, enabled: e.enabled !== !1, path: `${t}.${
|
|
3245
|
+
const n = (_, I, R) => {
|
|
3246
|
+
s.push({ ruleId: e.id, name: e.name, enabled: e.enabled !== !1, path: `${t}.${_}`, reference: I, reason: R });
|
|
3241
3247
|
}, i = e.condition.columnId ?? "", d = a(i);
|
|
3242
3248
|
if (!("ref" in d)) return n("condition.columnId", i, d.reason);
|
|
3243
3249
|
const l = e.target.level, c = l === "row" ? e.target.applyToColumnIds : e.target.columnIds;
|
|
3244
3250
|
if (l === "cell" && !(c != null && c.length) && e.enabled !== !1)
|
|
3245
3251
|
return n("target.columnIds", "", "every_column");
|
|
3246
3252
|
const h = [];
|
|
3247
|
-
for (const [
|
|
3248
|
-
const
|
|
3249
|
-
if (!("ref" in
|
|
3250
|
-
return n(`target.${l === "row" ? "applyToColumnIds" : "columnIds"}[${
|
|
3251
|
-
h.push(
|
|
3253
|
+
for (const [_, I] of (c ?? []).entries()) {
|
|
3254
|
+
const R = a(I);
|
|
3255
|
+
if (!("ref" in R))
|
|
3256
|
+
return n(`target.${l === "row" ? "applyToColumnIds" : "columnIds"}[${_}]`, I, R.reason);
|
|
3257
|
+
h.push(R.ref);
|
|
3252
3258
|
}
|
|
3253
3259
|
const {
|
|
3254
3260
|
columnIds: p,
|
|
3255
|
-
applyToColumnIds:
|
|
3256
|
-
conditionColumnId:
|
|
3257
|
-
matrix:
|
|
3258
|
-
rowRoles:
|
|
3261
|
+
applyToColumnIds: v,
|
|
3262
|
+
conditionColumnId: y,
|
|
3263
|
+
matrix: S,
|
|
3264
|
+
rowRoles: x,
|
|
3259
3265
|
depth: E,
|
|
3260
|
-
includeTotals:
|
|
3261
|
-
includeSubtotals:
|
|
3262
|
-
...
|
|
3263
|
-
} = e.target, { columnId: D,
|
|
3264
|
-
...
|
|
3266
|
+
includeTotals: C,
|
|
3267
|
+
includeSubtotals: k,
|
|
3268
|
+
...b
|
|
3269
|
+
} = e.target, { columnId: D, ...w } = e.condition, N = {
|
|
3270
|
+
...b,
|
|
3265
3271
|
...h.length ? { columns: h } : {},
|
|
3266
3272
|
// The Matrix scope means something only on a Matrix card.
|
|
3267
3273
|
...o ? {
|
|
3268
|
-
...
|
|
3269
|
-
...
|
|
3274
|
+
...S !== void 0 ? { matrix: S } : {},
|
|
3275
|
+
...x !== void 0 ? { rowRoles: x } : {},
|
|
3270
3276
|
...E !== void 0 ? { depth: E } : {},
|
|
3271
|
-
...
|
|
3272
|
-
...
|
|
3277
|
+
...C !== void 0 ? { includeTotals: C } : {},
|
|
3278
|
+
...k !== void 0 ? { includeSubtotals: k } : {}
|
|
3273
3279
|
} : {}
|
|
3274
3280
|
};
|
|
3275
3281
|
return {
|
|
3276
3282
|
...e,
|
|
3277
|
-
condition: {
|
|
3283
|
+
condition: { ...w, column: d.ref },
|
|
3278
3284
|
target: N
|
|
3279
3285
|
};
|
|
3280
3286
|
}
|
|
@@ -3287,58 +3293,58 @@ function sr(e, a) {
|
|
|
3287
3293
|
if (!n || typeof n != "object") return [];
|
|
3288
3294
|
const { start: d, end: l, color: c } = n, h = s(d), p = s(l);
|
|
3289
3295
|
if (Number.isNaN(h) || Number.isNaN(p) || h > p || h === 1 / 0 || p === -1 / 0) return [];
|
|
3290
|
-
const
|
|
3291
|
-
return [{ id: `kpi-color-range-${i + 1}`, condition:
|
|
3296
|
+
const v = h === -1 / 0 ? void 0 : h, y = p === 1 / 0 ? void 0 : p, S = v !== void 0 && y !== void 0 ? { kind: "between", column: t, min: v, max: y, inclusive: !0 } : v !== void 0 ? { kind: "comparison", column: t, operator: "gte", value: v } : y !== void 0 ? { kind: "comparison", column: t, operator: "lte", value: y } : { kind: "blank", column: t, isBlank: !1 }, x = typeof c == "string" ? c : "";
|
|
3297
|
+
return [{ id: `kpi-color-range-${i + 1}`, condition: S, target: { level: "cell" }, style: { textColor: x } }];
|
|
3292
3298
|
}).reverse();
|
|
3293
3299
|
}
|
|
3294
3300
|
function or(e) {
|
|
3295
|
-
var h, p,
|
|
3296
|
-
const a = structuredClone(e), t = [], s = [], o = [], n = (
|
|
3297
|
-
t.some((
|
|
3301
|
+
var h, p, v, y, S, x, E;
|
|
3302
|
+
const a = structuredClone(e), t = [], s = [], o = [], n = (C) => {
|
|
3303
|
+
t.some((k) => k.from.startsWith(C)) || t.push({ ruleId: "", action: "removed", from: C });
|
|
3298
3304
|
}, i = (h = a.preferences) == null ? void 0 : h.tablePrefs;
|
|
3299
3305
|
if (i && ue(i, "conditionalFormatting")) {
|
|
3300
|
-
const
|
|
3301
|
-
((
|
|
3302
|
-
var
|
|
3303
|
-
if (!
|
|
3304
|
-
t.push({ ruleId: D.id, action: "removed", from: `${
|
|
3306
|
+
const C = i.conditionalFormatting, k = "preferences.tablePrefs.conditionalFormatting", b = a.type === "table" || a.type === "detailTable";
|
|
3307
|
+
((C == null ? void 0 : C.rules) ?? []).forEach((D, w) => {
|
|
3308
|
+
var _;
|
|
3309
|
+
if (!b || ((_ = D.target) == null ? void 0 : _.matrix) !== void 0) {
|
|
3310
|
+
t.push({ ruleId: D.id, action: "removed", from: `${k}.rules[${w}]` });
|
|
3305
3311
|
return;
|
|
3306
3312
|
}
|
|
3307
|
-
const N = Ea(D, (
|
|
3308
|
-
N && (o.push(N), t.push({ ruleId: D.id, action: "moved", from: `${
|
|
3309
|
-
}), delete i.conditionalFormatting, s.some((D) => D.path.startsWith(
|
|
3313
|
+
const N = Ea(D, (I) => ar(a, I), `${k}.rules[${w}]`, s, !1);
|
|
3314
|
+
N && (o.push(N), t.push({ ruleId: D.id, action: "moved", from: `${k}.rules[${w}]` }));
|
|
3315
|
+
}), delete i.conditionalFormatting, s.some((D) => D.path.startsWith(k)) || n(k);
|
|
3310
3316
|
}
|
|
3311
|
-
const d = (
|
|
3317
|
+
const d = (v = (p = a.config) == null ? void 0 : p.matrix) == null ? void 0 : v.presentation;
|
|
3312
3318
|
if (d && ue(d, "conditionalFormatting")) {
|
|
3313
|
-
const
|
|
3314
|
-
((
|
|
3319
|
+
const C = d.conditionalFormatting, k = "config.matrix.presentation.conditionalFormatting", b = new Set((S = (y = a.config) == null ? void 0 : y.matrix) == null ? void 0 : S.spec.measures.map((D) => D.id));
|
|
3320
|
+
((C == null ? void 0 : C.rules) ?? []).forEach((D, w) => {
|
|
3315
3321
|
const N = Ea(
|
|
3316
3322
|
D,
|
|
3317
|
-
(
|
|
3318
|
-
`${
|
|
3323
|
+
(_) => b.has(_) ? { ref: { kind: "matrixMeasure", measureId: _ } } : { reason: "no_matching_column" },
|
|
3324
|
+
`${k}.rules[${w}]`,
|
|
3319
3325
|
s,
|
|
3320
3326
|
!0
|
|
3321
3327
|
);
|
|
3322
|
-
N && (o.push(N), t.push({ ruleId: D.id, action: "moved", from: `${
|
|
3323
|
-
}), delete d.conditionalFormatting, s.some((D) => D.path.startsWith(
|
|
3328
|
+
N && (o.push(N), t.push({ ruleId: D.id, action: "moved", from: `${k}.rules[${w}]` }));
|
|
3329
|
+
}), delete d.conditionalFormatting, s.some((D) => D.path.startsWith(k)) || n(k);
|
|
3324
3330
|
}
|
|
3325
3331
|
const l = a.preferences, c = l == null ? void 0 : l.formatNumber;
|
|
3326
3332
|
if (c && ue(c, "colorRanges")) {
|
|
3327
|
-
const
|
|
3333
|
+
const C = Array.isArray(c.colorRanges) ? c.colorRanges : [];
|
|
3328
3334
|
if (a.type === "kpi") {
|
|
3329
|
-
const
|
|
3330
|
-
o.push(...
|
|
3335
|
+
const k = sr(a, C);
|
|
3336
|
+
o.push(...k), k.forEach((b) => t.push({ ruleId: b.id, action: "moved", from: "preferences.formatNumber.colorRanges" }));
|
|
3331
3337
|
}
|
|
3332
|
-
delete c.colorRanges, Object.keys(c).length === 0 && delete l.formatNumber, t.some((
|
|
3338
|
+
delete c.colorRanges, Object.keys(c).length === 0 && delete l.formatNumber, t.some((k) => k.from === "preferences.formatNumber.colorRanges") || t.push({ ruleId: "", action: "removed", from: "preferences.formatNumber.colorRanges" });
|
|
3333
3339
|
}
|
|
3334
3340
|
if (!t.length && !s.length) return { card: e, changes: [], unresolved: [] };
|
|
3335
3341
|
if (o.length) {
|
|
3336
|
-
const
|
|
3342
|
+
const C = ((E = (x = a.preferences) == null ? void 0 : x.conditionalFormatting) == null ? void 0 : E.rules) ?? [], k = new Set(C.map((b) => b.id));
|
|
3337
3343
|
a.preferences = {
|
|
3338
3344
|
...a.preferences,
|
|
3339
3345
|
conditionalFormatting: {
|
|
3340
3346
|
version: 1,
|
|
3341
|
-
rules: [...
|
|
3347
|
+
rules: [...C, ...o.filter((b) => !k.has(b.id))]
|
|
3342
3348
|
}
|
|
3343
3349
|
};
|
|
3344
3350
|
}
|
|
@@ -3358,7 +3364,7 @@ function nr(e) {
|
|
|
3358
3364
|
case "relabel":
|
|
3359
3365
|
return !0;
|
|
3360
3366
|
case "settings":
|
|
3361
|
-
return e.update.settings.totals === void 0 && e.update.settings.inheritComparison === void 0 && e.update.settings.
|
|
3367
|
+
return e.update.settings.totals === void 0 && e.update.settings.inheritComparison === void 0 && e.update.settings.trend !== !0 && e.update.settings.trendGrain === void 0;
|
|
3362
3368
|
default:
|
|
3363
3369
|
return !1;
|
|
3364
3370
|
}
|
|
@@ -3368,23 +3374,23 @@ function Lr(e) {
|
|
|
3368
3374
|
}
|
|
3369
3375
|
export {
|
|
3370
3376
|
Vr as AGGREGATES,
|
|
3371
|
-
|
|
3372
|
-
|
|
3377
|
+
Kr as AUTOMATIC_TEMPORAL_BUCKET_FORMAT,
|
|
3378
|
+
jr as CALCULATED_FIELDS_GROUP_ID,
|
|
3373
3379
|
Wr as CALCULATED_FIELDS_GROUP_NAME,
|
|
3374
|
-
|
|
3375
|
-
|
|
3380
|
+
Gr as CARD_CONFIG_KEY_CLASSES,
|
|
3381
|
+
Ur as CARD_KEY_CLASSES,
|
|
3376
3382
|
ho as CARD_QUERY_CONFIG_KEYS,
|
|
3377
3383
|
kr as CARD_QUERY_REQUEST_DESCRIPTIVE_FIELDS,
|
|
3378
3384
|
Sr as CARD_QUERY_REQUEST_EXECUTED_FIELDS,
|
|
3379
|
-
|
|
3385
|
+
Nh as CARD_SURFACES,
|
|
3380
3386
|
Qr as CARD_TYPES,
|
|
3381
3387
|
Fe as CARD_TYPE_RULES,
|
|
3382
|
-
|
|
3388
|
+
Ke as CHART_COLORS_BOUNDS,
|
|
3383
3389
|
Hr as CHIP_VALUE_COLUMN,
|
|
3384
3390
|
zr as COLUMN_KEY_CLASSES,
|
|
3385
3391
|
Yr as COLUMN_PRESENTATION_KEYS,
|
|
3386
3392
|
Jr as COMPARISON_POLARITIES,
|
|
3387
|
-
|
|
3393
|
+
xf as COMPARISON_SIGN_WORDS,
|
|
3388
3394
|
Xr as CONTROL_BINDING_MAPPING_MISSING_ERROR_CODE,
|
|
3389
3395
|
Zr as CONTROL_BINDING_TARGET_INVALID_ERROR_CODE,
|
|
3390
3396
|
ed as CONTROL_BINDING_VALUE_INVALID_ERROR_CODE,
|
|
@@ -3395,16 +3401,16 @@ export {
|
|
|
3395
3401
|
nd as CONTROL_REFERENCE_MISSING_ERROR_CODE,
|
|
3396
3402
|
id as CONTROL_VALUE_INVALID_ERROR_CODE,
|
|
3397
3403
|
rd as CONTROL_VALUE_MISSING_ERROR_CODE,
|
|
3398
|
-
|
|
3404
|
+
Ph as CORNER_STEPS,
|
|
3399
3405
|
ce as CardQueryRequestError,
|
|
3400
3406
|
dd as ControlResolutionError,
|
|
3401
3407
|
ld as DASHBOARD_CHANGE_OPS,
|
|
3402
3408
|
cd as DASHBOARD_DEFAULT_OPTION_DEPENDENCIES,
|
|
3403
|
-
|
|
3409
|
+
Sf as DASHBOARD_FILTER_OPERATIONS,
|
|
3404
3410
|
ud as DASHBOARD_INPUT_RUNTIME_SCOPE_KINDS,
|
|
3405
3411
|
nn as DASHBOARD_STYLE_NUMBER_BOUNDS,
|
|
3406
|
-
|
|
3407
|
-
|
|
3412
|
+
kf as DOCUMENT_KPI_SECTION_MAX_CARDS,
|
|
3413
|
+
Tf as DOCUMENT_KPI_SECTION_MAX_TILES,
|
|
3408
3414
|
fd as DOMAIN_EDIT_CHANGE_OPS,
|
|
3409
3415
|
md as DYNAMIC_TEXT_MESSAGE,
|
|
3410
3416
|
hd as DashboardFilterMappingContractError,
|
|
@@ -3413,274 +3419,279 @@ export {
|
|
|
3413
3419
|
ua as FORMAT_WORDS,
|
|
3414
3420
|
bd as FilterModelError,
|
|
3415
3421
|
yd as KPI_MEASURES_SHOWN,
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3422
|
+
Uh as KPI_TREND_GRAINS,
|
|
3423
|
+
Qh as KPI_TREND_MAX_POINTS,
|
|
3424
|
+
Hh as KPI_TREND_PERIODS,
|
|
3425
|
+
vd as LEGACY_TABLE_CARD_TYPES,
|
|
3426
|
+
ym as LEGACY_TABLE_ROUTING_ID_NAMESPACE,
|
|
3419
3427
|
ba as MAX_CREATE_CHANGES,
|
|
3420
|
-
|
|
3428
|
+
Id as MAX_NEXT_STEP_CHARS,
|
|
3421
3429
|
_o as MAX_PROPOSED_CHANGES,
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3430
|
+
_d as MAX_QUERY_LIMIT,
|
|
3431
|
+
Cd as MAX_TEXT_WORDS,
|
|
3432
|
+
$d as MEASURE_CALCULATION_SUMMARIES,
|
|
3433
|
+
Qm as NEW_CARD_TYPE,
|
|
3434
|
+
wd as NON_ADDITIVE_SUM_OF_ROWS_HINT,
|
|
3435
|
+
xd as PUBLIC_TRANSFORM_KIND,
|
|
3436
|
+
Sd as QUERY_ASPECTS,
|
|
3437
|
+
kd as QUERY_CONFIG_KEY_ASPECTS,
|
|
3438
|
+
Hm as RELATIONSHIP_ROUTE_CHANGED_MESSAGE,
|
|
3439
|
+
Td as RESERVED_VARIABLE_NAMES,
|
|
3440
|
+
Rd as SEE_RECORDS_CARD_TYPES,
|
|
3441
|
+
Ad as SEE_RECORDS_LIMITS,
|
|
3442
|
+
Fd as SEE_RECORDS_MAX_PAGE,
|
|
3443
|
+
zm as SEE_RECORDS_MESSAGES,
|
|
3444
|
+
Dd as SEMAPHOR_CARTESIAN_CHART_TYPES,
|
|
3445
|
+
Od as SETTINGS_BY_KIND,
|
|
3446
|
+
Bh as SHELF_FIELD_KEYS,
|
|
3447
|
+
Lh as SPACING_STEPS,
|
|
3448
|
+
Ed as TIME_GRAINS,
|
|
3449
|
+
qd as TOOLBAR_FILTER_REACH_FIELDS,
|
|
3450
|
+
Rf as VARIABLE_CARD_TYPE,
|
|
3451
|
+
Af as VARIABLE_COMPARISON_PARTS,
|
|
3452
|
+
Nd as VARIABLE_GETS,
|
|
3453
|
+
Ff as VARIABLE_LIST_CAP,
|
|
3454
|
+
Df as VARIABLE_LIST_SHOWN,
|
|
3455
|
+
Pd as VARIABLE_NAME_PATTERN,
|
|
3456
|
+
Of as VARIABLE_VALUE_PART,
|
|
3457
|
+
Ld as WINDOW_ERROR_CODES,
|
|
3458
|
+
Md as WINDOW_WARNING_CODES,
|
|
3459
|
+
Bd as acceptedColumnRefKinds,
|
|
3460
|
+
Vd as analyticsFilterSchema,
|
|
3461
|
+
vm as applyCardReferenceRemapping,
|
|
3454
3462
|
Kd as applyCardSettings,
|
|
3455
3463
|
wt as applyDashboardOperations,
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3464
|
+
jd as applyFilterApplicability,
|
|
3465
|
+
Ym as applyFilterSettingsChange,
|
|
3466
|
+
Im as applyGroupByOverride,
|
|
3467
|
+
Wd as applyLinkedClickToFilterOverrides,
|
|
3460
3468
|
Gd as applyMeasureCalculations,
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3469
|
+
Ud as applyOptionDependencyOverride,
|
|
3470
|
+
Qd as applyVariableChange,
|
|
3471
|
+
zh as automaticKpiTrendGrain,
|
|
3472
|
+
Hd as blockClause,
|
|
3473
|
+
zd as blockSentence,
|
|
3474
|
+
tp as bookmarkImpactSentence,
|
|
3475
|
+
Jm as buildCardExportFormatOptions,
|
|
3476
|
+
_m as buildCardExportQueryContext,
|
|
3477
|
+
Xm as buildCardExportRequest,
|
|
3478
|
+
Zm as buildCardExportRequestFromOptions,
|
|
3479
|
+
eh as buildColumnCatalog,
|
|
3480
|
+
Yd as buildControlDefinitionIndex,
|
|
3472
3481
|
no as buildDashboardCardSourceIndex,
|
|
3473
|
-
|
|
3474
|
-
|
|
3482
|
+
th as buildEntityColumnGroup,
|
|
3483
|
+
ah as buildFilterInputFromDefinition,
|
|
3475
3484
|
Qo as buildFilterInputFromField,
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3485
|
+
Jd as buildLinkedClickToFilterOverrides,
|
|
3486
|
+
Xd as buildProposeChangeInputSchema,
|
|
3487
|
+
Zd as buildSavedEditorCard,
|
|
3488
|
+
sh as buildTableExportFormatOptions,
|
|
3489
|
+
el as calculationAddSchema,
|
|
3490
|
+
oh as cardColumnRefForKey,
|
|
3491
|
+
tl as cardColumnRefSchema,
|
|
3483
3492
|
wo as cardConditionalFormattingSchema,
|
|
3484
|
-
|
|
3485
|
-
|
|
3493
|
+
al as cardQueryPatchSchema,
|
|
3494
|
+
sl as cardReachesDatasetThroughRelationships,
|
|
3486
3495
|
Ps as cardSettingsKind,
|
|
3487
3496
|
qs as cardTypeSentenceName,
|
|
3488
|
-
|
|
3497
|
+
ol as carryColumnSettings,
|
|
3489
3498
|
po as changeCardType,
|
|
3490
|
-
|
|
3499
|
+
nl as changeMatrixEditor,
|
|
3491
3500
|
xo as checkConditionalRuleColumns,
|
|
3492
3501
|
Dt as checkDataVariable,
|
|
3493
|
-
|
|
3502
|
+
il as checkDetailDateFormat,
|
|
3494
3503
|
qr as checkPresentationStores,
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3504
|
+
rl as chipOverVariable,
|
|
3505
|
+
dl as clickToFilterSettingsSchema,
|
|
3506
|
+
ll as collectJoinPlanIdentifiers,
|
|
3498
3507
|
Qa as collectVariableReferences,
|
|
3499
3508
|
Na as columnDataset,
|
|
3500
3509
|
go as columnFieldKey,
|
|
3501
|
-
|
|
3502
|
-
|
|
3510
|
+
ja as columnKeys,
|
|
3511
|
+
cl as columnRefIssue,
|
|
3503
3512
|
la as columnRefKey,
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3513
|
+
ul as columnSettingsInputSchema,
|
|
3514
|
+
Ef as comparisonPartPresentation,
|
|
3515
|
+
Cm as composeCardReferenceRemapping,
|
|
3516
|
+
fl as conditionalRuleSchema,
|
|
3508
3517
|
Lr as confirmClassFor,
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3518
|
+
ml as contextChangeSchema,
|
|
3519
|
+
hl as controlBindingExecutionSchema,
|
|
3520
|
+
pl as controlDefinitionExecutionSchema,
|
|
3512
3521
|
so as controlRefusal,
|
|
3513
3522
|
Ar as convertLegacyStyle,
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3523
|
+
gl as createDashboardFilterBindingId,
|
|
3524
|
+
Bm as createMatrixAuthoringDraft,
|
|
3525
|
+
Vm as createMatrixConfig,
|
|
3517
3526
|
zo as createNewCard,
|
|
3518
|
-
|
|
3527
|
+
bl as createTargetSchema,
|
|
3519
3528
|
Ho as createTextCard,
|
|
3520
|
-
|
|
3529
|
+
yl as dashboardCardFilterSourceInventoryContains,
|
|
3521
3530
|
Zs as dashboardChangeSchema,
|
|
3522
|
-
|
|
3523
|
-
|
|
3531
|
+
vl as dashboardFilterTargetMatchesLogicalValue,
|
|
3532
|
+
qf as dashboardFilterValueTypeForDataType,
|
|
3524
3533
|
No as dashboardInputScopeIncludesDocumentSheets,
|
|
3525
3534
|
Tn as dashboardStyleAsEdit,
|
|
3526
|
-
|
|
3535
|
+
Il as dashboardStyleChangeSchema,
|
|
3527
3536
|
za as dashboardStyleLayers,
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3537
|
+
_l as decideClickToFilterCardLevel,
|
|
3538
|
+
Cl as decideClickToFilterField,
|
|
3539
|
+
$l as defaultClickToFilterSettings,
|
|
3531
3540
|
pn as defaultVariableGet,
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3541
|
+
Vh as defaultVariableName,
|
|
3542
|
+
ap as describeBookmarkImpact,
|
|
3543
|
+
wl as describeDashboardFilterCardReach,
|
|
3535
3544
|
$e as describeDashboardFilterCardReachDetail,
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3545
|
+
nh as describeDateWindow,
|
|
3546
|
+
ih as describeFilterReachEntry,
|
|
3547
|
+
rh as describeKpiDateSection,
|
|
3548
|
+
dh as describeKpiTileDate,
|
|
3549
|
+
Yh as describeKpiTrendRow,
|
|
3550
|
+
xl as describeMeasureCalculations,
|
|
3541
3551
|
ao as describeQueryChange,
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3552
|
+
lh as describeRelationshipRoute,
|
|
3553
|
+
ch as describeRelationshipSkip,
|
|
3554
|
+
Sl as describeTableColumnTotal,
|
|
3555
|
+
Nf as documentInputTextUsage,
|
|
3556
|
+
Pf as doesDashboardInputApplyToTarget,
|
|
3557
|
+
Lf as doesDashboardInputReachFilterTarget,
|
|
3558
|
+
Mf as doesDashboardInputSurviveCarriedContext,
|
|
3559
|
+
kl as doesToolbarFilterReachTab,
|
|
3560
|
+
uh as domainCalculatedFields,
|
|
3561
|
+
Tl as domainEditChangeSchema,
|
|
3562
|
+
Rl as domainEditChangeSchemas,
|
|
3553
3563
|
Kh as draftBlocker,
|
|
3554
3564
|
gn as draftFromVariable,
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3565
|
+
Al as drawsDetailDatesInBrowser,
|
|
3566
|
+
Fl as dropMatrixEditorField,
|
|
3567
|
+
op as editBrandStyle,
|
|
3558
3568
|
rn as editDashboardStyle,
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
+
Jh as estimateKpiTrendPoints,
|
|
3570
|
+
Dl as evaluateConditionalRules,
|
|
3571
|
+
Ol as explicitComparisonSchema,
|
|
3572
|
+
Us as fieldIdentityKey,
|
|
3573
|
+
El as fieldRef,
|
|
3574
|
+
ql as fieldRefSchema,
|
|
3575
|
+
Nl as filterApplicabilityContextForCard,
|
|
3576
|
+
fh as filterReachPreviewAnswers,
|
|
3577
|
+
Pl as filterValueReachForCard,
|
|
3578
|
+
Ll as filterValueSemanticDataset,
|
|
3579
|
+
Ml as findBorrowedSelectionBinding,
|
|
3569
3580
|
ot as findCatalogField,
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3581
|
+
Bl as findDashboardCardExecutableSource,
|
|
3582
|
+
Vl as findDashboardCardPinnedCatalogSource,
|
|
3583
|
+
Ga as findDashboardFilterTarget,
|
|
3573
3584
|
Kl as findDashboardSqlPinnedCatalogSource,
|
|
3574
3585
|
ps as findRetiredCardPresentationFields,
|
|
3575
3586
|
Er as findRetiredPresentationFields,
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3587
|
+
Gs as findSortedColumn,
|
|
3588
|
+
mh as flattenEntityColumns,
|
|
3589
|
+
jl as foldPrototypeDocumentInputs,
|
|
3590
|
+
Wl as formatFilterModelIssues,
|
|
3580
3591
|
ws as formatResolvedPrimaryDateFieldIssues,
|
|
3581
3592
|
Gl as formatSkippedFilterWarnings,
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3593
|
+
Ul as fromEditableRules,
|
|
3594
|
+
hh as getCalculatedFieldAggregateOverrides,
|
|
3595
|
+
Ql as getCalculatedFieldNamespace,
|
|
3596
|
+
ph as getCalculatedFieldParameters,
|
|
3597
|
+
gh as getCalculatedFieldShelfOverrides,
|
|
3598
|
+
Hl as getCardDefinition,
|
|
3599
|
+
bh as getClickContextFromTable,
|
|
3600
|
+
zl as getColumnCatalogFieldId,
|
|
3601
|
+
Yl as getDashboardFilterSubscriptionHint,
|
|
3602
|
+
Jl as getDashboardGlobalDateFilter,
|
|
3603
|
+
Bf as getDocumentKpiSectionShapeIssues,
|
|
3604
|
+
Vf as getDocumentSectionCards,
|
|
3605
|
+
yh as getDomainCalculatedSelectionOverrides,
|
|
3606
|
+
Xl as getFieldAggregationOptions,
|
|
3607
|
+
Zl as getMatrixBindingTargets,
|
|
3597
3608
|
Km as getMatrixLevelLabel,
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3609
|
+
jm as getMatrixMeasureLabel,
|
|
3610
|
+
ec as getStableDomainCalculatedFieldId,
|
|
3611
|
+
tc as getTemporalBucketAuthoringOptions,
|
|
3612
|
+
ac as getTemporalBucketAuthoringSelection,
|
|
3613
|
+
sc as handleSchema,
|
|
3614
|
+
oc as hasDashboardFilterSubscription,
|
|
3615
|
+
vh as hasSeeRecordsMeasureFilter,
|
|
3605
3616
|
ue as hasStoredKey,
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3617
|
+
nc as hasTextCardRichWords,
|
|
3618
|
+
ic as hasToolbarFilterReachField,
|
|
3619
|
+
$m as hostFilterValueFor,
|
|
3620
|
+
wm as hostFilterValuesToSlots,
|
|
3621
|
+
rc as inspectMatrixCardConfig,
|
|
3622
|
+
xm as isAdHocFilterValueOnTab,
|
|
3612
3623
|
Ca as isAggregateGet,
|
|
3613
|
-
|
|
3614
|
-
|
|
3624
|
+
dc as isAllowedDashboardInputScopeCombination,
|
|
3625
|
+
lc as isCardType,
|
|
3615
3626
|
Kf as isDashboardFilterOperationCompatible,
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3627
|
+
Ua as isDashboardInputOnTab,
|
|
3628
|
+
jf as isDashboardInputOwnedBySheet,
|
|
3629
|
+
Wf as isDashboardInputScopeEmpty,
|
|
3619
3630
|
Gf as isDashboardTargetIdTaken,
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3631
|
+
cc as isDatabaseEntityReference,
|
|
3632
|
+
uc as isGroupedDate,
|
|
3633
|
+
fc as isLegacyTableCard,
|
|
3634
|
+
mc as isPresentationCurrencyBinding,
|
|
3635
|
+
hc as isSeeRecordsCardType,
|
|
3636
|
+
pc as isSemanticAutoJoinCard,
|
|
3637
|
+
gc as isSemaphorCartesianChartType,
|
|
3627
3638
|
Oo as isSqlKpi,
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3639
|
+
bc as isStructuralControlBinding,
|
|
3640
|
+
yc as isTextCardRichContent,
|
|
3641
|
+
vc as isValidControlOptionPresentation,
|
|
3642
|
+
Uf as isVariableComparisonPart,
|
|
3643
|
+
Ic as isWhenRun,
|
|
3644
|
+
_c as kpiSegmentMetricId,
|
|
3645
|
+
Cc as kpiShowsTrend,
|
|
3635
3646
|
Es as kpiTrendBy,
|
|
3636
|
-
|
|
3647
|
+
Ih as kpiTrendByHint,
|
|
3637
3648
|
Ws as labelAt,
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3649
|
+
$c as layoutArrangeSchema,
|
|
3650
|
+
Sm as legacyTableRoutingIds,
|
|
3651
|
+
km as legacyTableRoutingTarget,
|
|
3652
|
+
wc as linkedClickToFilterOverridesSchema,
|
|
3653
|
+
Tm as listAdHocFilterValuesOnTab,
|
|
3643
3654
|
xe as listDashboardCardLocations,
|
|
3644
|
-
|
|
3645
|
-
|
|
3655
|
+
xc as listDashboardFilterDefinitions,
|
|
3656
|
+
Sc as listDashboardFilterInputsOnTab,
|
|
3646
3657
|
Wa as listDashboardFilterTargets,
|
|
3647
|
-
|
|
3658
|
+
Qf as listDashboardInputReachKeys,
|
|
3648
3659
|
Eo as listDashboardInputScopeExceptedCardIds,
|
|
3649
3660
|
qo as listDashboardInputScopeExceptedSheetIds,
|
|
3650
|
-
|
|
3661
|
+
kc as listDashboardInputsTolerantly,
|
|
3651
3662
|
Ot as listDashboardTabTargets,
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3663
|
+
Hf as listDataVariablePlaces,
|
|
3664
|
+
Rm as listFilterInputValueTargets,
|
|
3665
|
+
zf as listFilterTargetScopeTargets,
|
|
3666
|
+
Yf as listReachedVariableTargets,
|
|
3667
|
+
Jf as listReferencedDataVariableIds,
|
|
3668
|
+
Tc as listStoredFilterDefinitions,
|
|
3669
|
+
Xf as listVariableScopeTargets,
|
|
3670
|
+
Zf as mapDashboardCards,
|
|
3671
|
+
em as mapDocumentSectionCards,
|
|
3672
|
+
Rc as mapRuleColumns,
|
|
3673
|
+
Ac as matchColumns,
|
|
3674
|
+
Am as matrixCatalogSources,
|
|
3664
3675
|
vo as matrixColumnKeys,
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
+
Fc as matrixColumnsSchema,
|
|
3677
|
+
Dc as matrixDefinitionFieldRefs,
|
|
3678
|
+
Oc as matrixDefinitionFields,
|
|
3679
|
+
Ec as matrixDefinitionSources,
|
|
3680
|
+
qc as matrixEditorCatalogFromFields,
|
|
3681
|
+
Fm as matrixExecutionSources,
|
|
3682
|
+
Nc as measureCalculationOptions,
|
|
3683
|
+
Pc as measureComparisonSchema,
|
|
3684
|
+
Lc as measureRefSchema,
|
|
3685
|
+
Mc as measureTransformSchema,
|
|
3686
|
+
Wm as mergeMatrixSorts,
|
|
3676
3687
|
lo as metricCardQuerySchema,
|
|
3677
3688
|
yo as moveMatrixLevel,
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3689
|
+
jh as newVariableDraft,
|
|
3690
|
+
Wh as newVariableId,
|
|
3691
|
+
Bc as normalizeClickToFilterSettings,
|
|
3692
|
+
Vc as normalizeDashboardInputs,
|
|
3682
3693
|
Kc as normalizeLegacyLinkedTargetOverrides,
|
|
3683
|
-
|
|
3694
|
+
jc as occurrenceKeys,
|
|
3684
3695
|
es as outlineCalendar,
|
|
3685
3696
|
Or as outlineDashboard,
|
|
3686
3697
|
Pe as outlineFilter,
|
|
@@ -3689,181 +3700,181 @@ export {
|
|
|
3689
3700
|
Rr as parseCardQueryRequest,
|
|
3690
3701
|
$n as parseCardQueryRequestContext,
|
|
3691
3702
|
Tr as parseCardQueryRequestExtras,
|
|
3692
|
-
|
|
3693
|
-
|
|
3703
|
+
Wc as parseColumnRefKey,
|
|
3704
|
+
_h as parseDashboardStyle,
|
|
3694
3705
|
Gc as parseExecutionControlBindingsShallow,
|
|
3695
3706
|
Ss as parseExecutionControlContext,
|
|
3696
|
-
|
|
3707
|
+
Uc as parseExecutionControlContract,
|
|
3697
3708
|
pa as planCardLabels,
|
|
3698
3709
|
ha as planCardRequery,
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3710
|
+
Ch as pluralDatasetLabel,
|
|
3711
|
+
Dm as prepareLoadedDashboard,
|
|
3712
|
+
Qc as previewTemporalBucketAuthoringFormat,
|
|
3713
|
+
tm as projectDataVariableToCard,
|
|
3714
|
+
Hc as pruneUnrelatedCalculatedFilters,
|
|
3704
3715
|
oo as queryForm,
|
|
3705
|
-
|
|
3706
|
-
|
|
3716
|
+
zc as queryMeasureSchema,
|
|
3717
|
+
Yc as readCardConditionalRules,
|
|
3707
3718
|
we as readCardQuery,
|
|
3708
3719
|
Ft as readCardSettings,
|
|
3709
3720
|
he as readCardSource,
|
|
3710
3721
|
Ee as readCardTypeProperties,
|
|
3711
|
-
|
|
3722
|
+
Xh as readComparisonDates,
|
|
3712
3723
|
Ie as readDashboardFilterModel,
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3724
|
+
Zh as readDefaultComparisonDates,
|
|
3725
|
+
Jc as readExactDomainCalculatedFieldReference,
|
|
3726
|
+
$h as readFilterReachResponse,
|
|
3727
|
+
Om as readFilterValueList,
|
|
3728
|
+
wh as readKpiDateContext,
|
|
3729
|
+
Xc as readKpiFigure,
|
|
3730
|
+
Zc as readKpiNumber,
|
|
3731
|
+
eu as readMatrixCardConfig,
|
|
3732
|
+
tu as readMeasureCalculations,
|
|
3733
|
+
au as readSqlFilterUse,
|
|
3734
|
+
su as readStoredTransform,
|
|
3735
|
+
Ka as readTextCardWords,
|
|
3725
3736
|
Ze as readTextWords,
|
|
3726
|
-
|
|
3727
|
-
|
|
3737
|
+
ou as readTransform,
|
|
3738
|
+
am as readVariableAnswer,
|
|
3728
3739
|
rs as readVariableEditability,
|
|
3729
3740
|
kt as readVariableSource,
|
|
3730
3741
|
Co as readablePresentation,
|
|
3731
|
-
|
|
3742
|
+
nu as rebindDashboardOptionDependencyInputId,
|
|
3732
3743
|
ma as rebuildsRole,
|
|
3733
|
-
|
|
3734
|
-
|
|
3744
|
+
iu as reconcileMatrixSpecStructure,
|
|
3745
|
+
ru as reconcileTemporalBucketAuthoringFormat,
|
|
3735
3746
|
ro as recordsCardQuerySchema,
|
|
3736
3747
|
Js as refDataset,
|
|
3737
3748
|
be as refKey,
|
|
3738
3749
|
Ct as refName,
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3750
|
+
du as registeredDomainEditChangeSchemas,
|
|
3751
|
+
lu as relationshipAddSchema,
|
|
3752
|
+
cu as relationshipRouteTarget,
|
|
3753
|
+
uu as remapClickToFilterReferences,
|
|
3754
|
+
fu as remapLinkedClickToFilterOverrides,
|
|
3755
|
+
mu as requireNormalizedDashboardInputs,
|
|
3756
|
+
hu as resolveBindingControlValue,
|
|
3757
|
+
sm as resolveCanonicalDetailResultRawKey,
|
|
3758
|
+
om as resolveCanonicalResultOutputKey,
|
|
3748
3759
|
Mo as resolveCanonicalResultOutputKeys,
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3760
|
+
nm as resolveCanonicalResultRawKey,
|
|
3761
|
+
xh as resolveCardColumnRef,
|
|
3762
|
+
Un as resolveCardSettings,
|
|
3763
|
+
Sh as resolveConditionalRules,
|
|
3753
3764
|
Fr as resolveDashboardChanges,
|
|
3754
3765
|
Dr as resolveDashboardCreate,
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3766
|
+
pu as resolveDashboardEntitySource,
|
|
3767
|
+
gu as resolveDashboardFilterAutomaticTarget,
|
|
3768
|
+
bu as resolveDashboardFilterInheritedTarget,
|
|
3769
|
+
yu as resolveDashboardOptionDependencies,
|
|
3770
|
+
vu as resolveDashboardOptionPopulation,
|
|
3771
|
+
Iu as resolveDashboardSqlFilterTarget,
|
|
3761
3772
|
dn as resolveDashboardStyle,
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3773
|
+
_u as resolveDetailTableRawTemporalPresentation,
|
|
3774
|
+
Cu as resolveFieldSelectedSource,
|
|
3775
|
+
$u as resolveGroupByFieldTarget,
|
|
3776
|
+
wu as resolveKpiLayout,
|
|
3766
3777
|
La as resolveKpiShape,
|
|
3767
|
-
|
|
3768
|
-
|
|
3778
|
+
xu as resolveKpiValueStyle,
|
|
3779
|
+
Em as resolveMatrixControlBindings,
|
|
3769
3780
|
Gm as resolveMatrixDefinition,
|
|
3770
3781
|
fa as resolveMeasureCalculations,
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3782
|
+
Su as resolveMeasureTransform,
|
|
3783
|
+
ku as resolveMetricFieldTarget,
|
|
3784
|
+
Tu as resolveScalarMappedValue,
|
|
3785
|
+
Ru as resolveTableColumnTotal,
|
|
3786
|
+
Au as resolveTemporalBucketAuthoringFormat,
|
|
3776
3787
|
xs as resolveTemporalResultOwner,
|
|
3777
3788
|
ga as resolveTextCardWords,
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3789
|
+
Fu as resolveValueStyle,
|
|
3790
|
+
Du as respondsToSelectionsSchema,
|
|
3791
|
+
Ou as retainConditionalRules,
|
|
3792
|
+
Eu as retainedMatrixPath,
|
|
3793
|
+
im as rewriteDashboardInputScopeIds,
|
|
3794
|
+
qm as routeLegacyTableCard,
|
|
3795
|
+
Nm as routeLegacyTableCards,
|
|
3796
|
+
Pm as routeLegacyTableFrame,
|
|
3786
3797
|
He as sameColumnKey,
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3798
|
+
qu as sanitizeTextCardUrl,
|
|
3799
|
+
kh as seeRecordsAvailability,
|
|
3800
|
+
Th as seeRecordsCardAvailability,
|
|
3790
3801
|
Pr as seeRecordsMeasureId,
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
+
Rh as seeRecordsMeasureKind,
|
|
3803
|
+
Ah as seeRecordsReasonHidesOffer,
|
|
3804
|
+
Nu as seeRecordsRequestSchema,
|
|
3805
|
+
Fh as seeRecordsRowField,
|
|
3806
|
+
Pu as selectDashboardOptionDependencyInputIds,
|
|
3807
|
+
Lu as selectionFieldFromExplorerField,
|
|
3808
|
+
Dh as selectionTupleFromClickContext,
|
|
3809
|
+
Oh as setMeasureCalculations,
|
|
3810
|
+
Mu as settableCardType,
|
|
3811
|
+
Bu as sharedCardPreferences,
|
|
3812
|
+
Vu as sharedTableDialect,
|
|
3802
3813
|
Ku as sheetChangeSchemas,
|
|
3803
3814
|
io as sqlCardQuerySchema,
|
|
3804
|
-
|
|
3815
|
+
ju as sqlKpiResultKeys,
|
|
3805
3816
|
qe as statedLabelsOf,
|
|
3806
3817
|
Rs as storedCardTypeFor,
|
|
3807
|
-
|
|
3808
|
-
|
|
3818
|
+
Wu as storedRunPresentation,
|
|
3819
|
+
rm as storedTextRefs,
|
|
3809
3820
|
Gu as stripInstanceTargetsForLibrarySave,
|
|
3810
|
-
|
|
3821
|
+
Uu as structuralControlOverride,
|
|
3811
3822
|
ts as summarizeFilter,
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3823
|
+
Qu as supportsCanonicalDashboardTemporalResult,
|
|
3824
|
+
Hu as tabChangeSchemas,
|
|
3825
|
+
zu as tableColumnTotalLabel,
|
|
3826
|
+
Yu as textCardExcerpt,
|
|
3827
|
+
Ju as textCardWordingClauses,
|
|
3817
3828
|
_t as textCatalogAt,
|
|
3818
3829
|
ct as toChartType,
|
|
3819
|
-
|
|
3820
|
-
|
|
3830
|
+
Xu as toEditableRules,
|
|
3831
|
+
Zu as toFiniteKpiNumber,
|
|
3821
3832
|
$t as toPublicCardType,
|
|
3822
3833
|
Xs as toStoredComparison,
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3834
|
+
ef as toolbarFilterInputFields,
|
|
3835
|
+
tf as toolbarFilterScope,
|
|
3836
|
+
af as transformComparisonDocument,
|
|
3837
|
+
sf as transformGroupings,
|
|
3838
|
+
of as transformOrderSchema,
|
|
3828
3839
|
bo as updateMatrixConfig,
|
|
3829
3840
|
Yi as upgradeCardFormats,
|
|
3830
3841
|
Nr as upgradeCardPresentation,
|
|
3831
3842
|
or as upgradeConditionalFormatting,
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3843
|
+
Lm as upgradeToStoredDashboard,
|
|
3844
|
+
nf as validateAndResolveWindowTransforms,
|
|
3845
|
+
rf as validateControlValue,
|
|
3846
|
+
dm as validateDashboardFilterValues,
|
|
3836
3847
|
$s as validateResolvedPrimaryDateFieldShape,
|
|
3837
|
-
|
|
3838
|
-
|
|
3848
|
+
lm as variableCardKeepsComparison,
|
|
3849
|
+
cm as variableComparison,
|
|
3839
3850
|
Ye as variableFromDraft,
|
|
3840
3851
|
hn as variableGetOptions,
|
|
3841
|
-
|
|
3842
|
-
|
|
3852
|
+
um as variablePartCell,
|
|
3853
|
+
fm as variablePartType,
|
|
3843
3854
|
Lo as variableParts,
|
|
3844
|
-
|
|
3845
|
-
|
|
3855
|
+
mm as variableQueryResponseOf,
|
|
3856
|
+
Eh as variableSourceWords,
|
|
3846
3857
|
bn as variableTakesComparison,
|
|
3847
3858
|
Jo as variableWords,
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3859
|
+
df as withCardConditionalRules,
|
|
3860
|
+
lf as withCardConfigSqlDatePatterns,
|
|
3861
|
+
hm as withCardExcludedFromScope,
|
|
3862
|
+
pm as withCardIncludedInScope,
|
|
3863
|
+
cf as withDashboardOptionDependencyOverride,
|
|
3864
|
+
uf as withDetailSqlDatePattern,
|
|
3865
|
+
gm as withDraftCard,
|
|
3866
|
+
ff as withFormatOverride,
|
|
3867
|
+
mf as withSqlDatePattern,
|
|
3857
3868
|
Po as withUnstatedScopeParts,
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3869
|
+
hf as withoutSqlDatePattern,
|
|
3870
|
+
pf as withoutToolbarFilterReachFields,
|
|
3871
|
+
gf as wordingBlocks,
|
|
3872
|
+
bf as wordingClauses,
|
|
3873
|
+
yf as writeColumnFormat,
|
|
3874
|
+
vf as writeColumnPolarity,
|
|
3875
|
+
If as writeComparisonDisplay,
|
|
3876
|
+
_f as writeComparisonPresentation,
|
|
3877
|
+
Cf as writeInheritComparison,
|
|
3878
|
+
$f as writeSeeRecords,
|
|
3868
3879
|
Ys as writeTextWords
|
|
3869
3880
|
};
|