@burdenoff/microfe-bigconsole 2026.1119.4 → 2026.1119.6

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.
@@ -1,149 +1,195 @@
1
- import e from "../../hooks/useStoreDashboardTemplates.js";
2
- import { memo as t, useCallback as n, useEffect as r, useState as i } from "react";
3
- import { Button as a, Dialog as o, DialogContent as s, DialogDescription as c, DialogFooter as l, DialogHeader as u, DialogTitle as d, Input as f, Spinner as p, Textarea as m } from "@burdenoff/fe-libs/ui";
4
- import { useI18n as h } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
5
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
1
+ import { usePublishOwnerOptions as e } from "../../hooks/usePublishOwnerOptions.js";
2
+ import t from "../../hooks/useStoreDashboardTemplates.js";
3
+ import { publishOwnerName as n } from "../../utils/publishOwner.js";
4
+ import { memo as r, useCallback as i, useEffect as a, useState as o } from "react";
5
+ import { Button as s, Dialog as c, DialogContent as l, DialogDescription as u, DialogFooter as ee, DialogHeader as d, DialogTitle as f, Input as p, Select as m, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v, Spinner as y, Textarea as b } from "@burdenoff/fe-libs/ui";
6
+ import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
6
8
  // src/bigconsole/components/dashboard/PublishToStoreDialog.tsx
7
- function v(e) {
9
+ var C = "__personal__";
10
+ function w(e) {
8
11
  return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-").slice(0, 60);
9
12
  }
10
- var y = t(function({ isOpen: t, dashboardId: y, dashboardName: b, dashboardDescription: x, onClose: S, onPublished: C }) {
11
- let { t: w } = h(), { publishToStore: T } = e({ autoLoad: !1 }), [E, D] = i(b), [O, k] = i(v(b)), [A, j] = i(x ?? ""), [M, N] = i(!1), [P, F] = i(!1), [I, L] = i(null), [R, z] = i(null);
12
- r(() => {
13
- t && (D(b), k(v(b)), j(x ?? ""), N(!1), L(null), z(null));
13
+ var T = r(function({ isOpen: r, dashboardId: T, dashboardName: E, dashboardDescription: D, onClose: O, onPublished: k }) {
14
+ let { t: A } = te(), { publishToStore: j } = t({ autoLoad: !1 }), [M, N] = o(E), [P, F] = o(w(E)), [I, L] = o(D ?? ""), [R, z] = o(!1), [B, V] = o(!1), [H, U] = o(null), [W, G] = o(null), K = e(r), [q, J] = o(null), [Y, X] = o(!1);
15
+ a(() => {
16
+ Y || J(K.defaultOrganizationId);
17
+ }, [K.defaultOrganizationId, Y]), a(() => {
18
+ r && (N(E), F(w(E)), L(D ?? ""), z(!1), U(null), G(null), X(!1));
14
19
  }, [
15
- t,
16
- b,
17
- x
20
+ r,
21
+ E,
22
+ D
18
23
  ]);
19
- let B = n(async () => {
20
- if (!E.trim()) L(w("bigconsole.dashboards.publishStore.error.nameRequired", "A template name is required"));
21
- else if (!O.trim()) L(w("bigconsole.dashboards.publishStore.error.slugRequired", "A slug is required"));
22
- else if (!A.trim()) L(w("bigconsole.dashboards.publishStore.error.descriptionRequired", "A description is required — it is what people see in the gallery"));
24
+ let Z = i(async () => {
25
+ if (!M.trim()) U(A("bigconsole.dashboards.publishStore.error.nameRequired", "A template name is required"));
26
+ else if (!P.trim()) U(A("bigconsole.dashboards.publishStore.error.slugRequired", "A slug is required"));
27
+ else if (!I.trim()) U(A("bigconsole.dashboards.publishStore.error.descriptionRequired", "A description is required — it is what people see in the gallery"));
23
28
  else {
24
- L(null), F(!0);
29
+ U(null), V(!0);
25
30
  try {
26
- let e = await T({
27
- dashboardId: y,
28
- name: E.trim(),
29
- slug: O.trim(),
30
- description: A.trim(),
31
- includeSampleData: M
31
+ let e = await j({
32
+ dashboardId: T,
33
+ name: M.trim(),
34
+ slug: P.trim(),
35
+ description: I.trim(),
36
+ includeSampleData: R,
37
+ developerOrganizationId: q
32
38
  });
33
39
  if (!e.success) {
34
- L(e.errorMessage ?? w("bigconsole.dashboards.publishStore.error.publishFailed", "Failed to publish to the store"));
40
+ U(e.errorMessage ?? A("bigconsole.dashboards.publishStore.error.publishFailed", "Failed to publish to the store"));
35
41
  return;
36
42
  }
37
- z(e), C?.(e);
43
+ G(e), k?.(e);
38
44
  } finally {
39
- F(!1);
45
+ V(!1);
40
46
  }
41
47
  }
42
48
  }, [
43
- E,
44
- O,
45
- A,
46
49
  M,
47
- y,
50
+ P,
51
+ I,
52
+ R,
53
+ q,
48
54
  T,
49
- C,
50
- w
51
- ]), V = {
55
+ j,
56
+ k,
57
+ A
58
+ ]), ne = A("bigconsole.dashboards.publishStore.owner.personal", "Personal (only you)"), re = A("bigconsole.dashboards.publishStore.owner.viewerSuffix", "viewer — cannot publish"), ie = A("bigconsole.dashboards.publishStore.owner.inactiveSuffix", "inactive member — cannot publish"), ae = (e) => e.organizationId === null ? ne : e.disabledReason === "inactive" ? `${e.name} (${ie})` : e.disabledReason === "viewer" ? `${e.name} (${re})` : e.name, Q = W ? n(K.options, W.developerOrganizationId ?? null) : null, $ = {
52
59
  display: "block",
53
60
  marginBottom: "var(--space-2xs)",
54
61
  fontSize: "var(--font-size-sm)"
55
62
  };
56
- return /* @__PURE__ */ g(o, {
57
- open: t,
58
- onOpenChange: (e) => !e && !P && S(),
59
- children: /* @__PURE__ */ _(s, {
63
+ return /* @__PURE__ */ x(c, {
64
+ open: r,
65
+ onOpenChange: (e) => !e && !B && O(),
66
+ children: /* @__PURE__ */ S(l, {
60
67
  style: { maxWidth: "520px" },
61
68
  children: [
62
- /* @__PURE__ */ _(u, { children: [/* @__PURE__ */ g(d, { children: w("bigconsole.dashboards.publishStore.title", "Publish as Template") }), /* @__PURE__ */ g(c, { children: w("bigconsole.dashboards.publishStore.subtitle", "Share this dashboard as a reusable template. Your data sources are replaced with named slots, so nothing from this workspace is published.") })] }),
63
- R ? /* @__PURE__ */ _("div", {
69
+ /* @__PURE__ */ S(d, { children: [/* @__PURE__ */ x(f, { children: A("bigconsole.dashboards.publishStore.title", "Publish as Template") }), /* @__PURE__ */ x(u, { children: A("bigconsole.dashboards.publishStore.subtitle", "Share this dashboard as a reusable template. Your data sources are replaced with named slots, so nothing from this workspace is published.") })] }),
70
+ W ? /* @__PURE__ */ S("div", {
64
71
  style: { padding: "var(--space-md) 0" },
65
72
  children: [
66
- /* @__PURE__ */ g("p", {
73
+ /* @__PURE__ */ x("p", {
67
74
  style: { fontWeight: "var(--font-weight-medium)" },
68
- children: w("bigconsole.dashboards.publishStore.result.title", "Draft template created")
75
+ children: A("bigconsole.dashboards.publishStore.result.title", "Draft template created")
76
+ }),
77
+ /* @__PURE__ */ x("p", {
78
+ style: {
79
+ fontSize: "var(--font-size-sm)",
80
+ color: "var(--color-text-muted)"
81
+ },
82
+ children: W.sinkCount === 1 ? A("bigconsole.dashboards.publishStore.result.sinksOne", "{{count}} data source turned into slots. Finish in the Developer Portal: review the listing, then submit it for approval. It appears in the gallery once approved.", { count: W.sinkCount ?? "" }) : A("bigconsole.dashboards.publishStore.result.sinksMany", "{{count}} data sources turned into slots. Finish in the Developer Portal: review the listing, then submit it for approval. It appears in the gallery once approved.", { count: W.sinkCount ?? "" })
69
83
  }),
70
- /* @__PURE__ */ g("p", {
84
+ /* @__PURE__ */ x("p", {
85
+ "data-testid": "publish-store-owner-result",
71
86
  style: {
72
87
  fontSize: "var(--font-size-sm)",
73
88
  color: "var(--color-text-muted)"
74
89
  },
75
- children: R.sinkCount === 1 ? w("bigconsole.dashboards.publishStore.result.sinksOne", "{{count}} data source turned into slots. Finish in the Developer Portal: review the listing, then submit it for approval. It appears in the gallery once approved.", { count: R.sinkCount ?? "" }) : w("bigconsole.dashboards.publishStore.result.sinksMany", "{{count}} data sources turned into slots. Finish in the Developer Portal: review the listing, then submit it for approval. It appears in the gallery once approved.", { count: R.sinkCount ?? "" })
90
+ children: Q ? A("bigconsole.dashboards.publishStore.result.ownerOrg", "Saved as a draft owned by {{owner}}. In the Developer Portal, open My Applications with {{owner}} selected in the organization switcher to find it.", { owner: Q }) : A("bigconsole.dashboards.publishStore.result.ownerPersonal", "Saved as your personal draft. In the Developer Portal, open My Applications and choose Personal (or All) in the organization switcher to find it.")
76
91
  }),
77
- R.unknownSinkIds.length > 0 && /* @__PURE__ */ g("p", {
92
+ W.unknownSinkIds.length > 0 && /* @__PURE__ */ x("p", {
78
93
  style: {
79
94
  fontSize: "var(--font-size-sm)",
80
95
  color: "var(--color-text-warning)"
81
96
  },
82
- children: R.unknownSinkIds.length === 1 ? w("bigconsole.dashboards.publishStore.result.unknownOne", "{{count}} data source could not be named — those slots use generic labels.", { count: R.unknownSinkIds.length ?? "" }) : w("bigconsole.dashboards.publishStore.result.unknownMany", "{{count}} data sources could not be named — those slots use generic labels.", { count: R.unknownSinkIds.length ?? "" })
97
+ children: W.unknownSinkIds.length === 1 ? A("bigconsole.dashboards.publishStore.result.unknownOne", "{{count}} data source could not be named — those slots use generic labels.", { count: W.unknownSinkIds.length ?? "" }) : A("bigconsole.dashboards.publishStore.result.unknownMany", "{{count}} data sources could not be named — those slots use generic labels.", { count: W.unknownSinkIds.length ?? "" })
83
98
  })
84
99
  ]
85
- }) : /* @__PURE__ */ _("div", {
100
+ }) : /* @__PURE__ */ S("div", {
86
101
  style: {
87
102
  display: "flex",
88
103
  flexDirection: "column",
89
104
  gap: "var(--space-sm)"
90
105
  },
91
106
  children: [
92
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
107
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
93
108
  htmlFor: "tpl-name",
94
- style: V,
95
- children: w("bigconsole.dashboards.publishStore.field.name", "Template name")
96
- }), /* @__PURE__ */ g(f, {
109
+ style: $,
110
+ children: A("bigconsole.dashboards.publishStore.field.name", "Template name")
111
+ }), /* @__PURE__ */ x(p, {
97
112
  id: "tpl-name",
98
- value: E,
99
- disabled: P,
113
+ value: M,
114
+ disabled: B,
100
115
  onChange: (e) => {
101
- D(e.target.value), k(v(e.target.value));
116
+ N(e.target.value), F(w(e.target.value));
102
117
  }
103
118
  })] }),
104
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
119
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
105
120
  htmlFor: "tpl-slug",
106
- style: V,
107
- children: w("bigconsole.dashboards.publishStore.field.slug", "Slug")
108
- }), /* @__PURE__ */ g(f, {
121
+ style: $,
122
+ children: A("bigconsole.dashboards.publishStore.field.slug", "Slug")
123
+ }), /* @__PURE__ */ x(p, {
109
124
  id: "tpl-slug",
110
- value: O,
111
- disabled: P,
112
- onChange: (e) => k(v(e.target.value))
125
+ value: P,
126
+ disabled: B,
127
+ onChange: (e) => F(w(e.target.value))
113
128
  })] }),
114
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
129
+ /* @__PURE__ */ S("div", { children: [
130
+ /* @__PURE__ */ x("label", {
131
+ htmlFor: "tpl-owner",
132
+ style: $,
133
+ children: A("bigconsole.dashboards.publishStore.field.owner", "Publish as")
134
+ }),
135
+ /* @__PURE__ */ S(m, {
136
+ value: q ?? C,
137
+ disabled: B || K.loading,
138
+ onValueChange: (e) => {
139
+ X(!0), J(e === C ? null : e);
140
+ },
141
+ children: [/* @__PURE__ */ x(_, {
142
+ id: "tpl-owner",
143
+ "data-testid": "publish-store-owner",
144
+ children: /* @__PURE__ */ x(v, {})
145
+ }), /* @__PURE__ */ x(h, { children: K.options.map((e) => /* @__PURE__ */ x(g, {
146
+ value: e.organizationId ?? C,
147
+ disabled: e.disabled,
148
+ children: ae(e)
149
+ }, e.organizationId ?? C)) })]
150
+ }),
151
+ /* @__PURE__ */ x("p", {
152
+ style: {
153
+ marginTop: "var(--space-2xs)",
154
+ fontSize: "var(--font-size-xs)",
155
+ color: "var(--color-text-muted)"
156
+ },
157
+ children: K.loading ? A("bigconsole.dashboards.publishStore.owner.loading", "Loading your developer organizations…") : K.error ? A("bigconsole.dashboards.publishStore.owner.loadFailed", "Could not load your developer organizations, so this template can only be published as personal.") : A("bigconsole.dashboards.publishStore.owner.hint", "The draft appears under this owner in the Developer Portal.")
158
+ })
159
+ ] }),
160
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
115
161
  htmlFor: "tpl-desc",
116
- style: V,
117
- children: w("bigconsole.dashboards.publishStore.field.description", "Description")
118
- }), /* @__PURE__ */ g(m, {
162
+ style: $,
163
+ children: A("bigconsole.dashboards.publishStore.field.description", "Description")
164
+ }), /* @__PURE__ */ x(b, {
119
165
  id: "tpl-desc",
120
166
  rows: 3,
121
- value: A,
122
- disabled: P,
123
- placeholder: w("bigconsole.dashboards.publishStore.field.descriptionPlaceholder", "What is this dashboard for, and what data does it need?"),
124
- onChange: (e) => j(e.target.value)
167
+ value: I,
168
+ disabled: B,
169
+ placeholder: A("bigconsole.dashboards.publishStore.field.descriptionPlaceholder", "What is this dashboard for, and what data does it need?"),
170
+ onChange: (e) => L(e.target.value)
125
171
  })] }),
126
- I && /* @__PURE__ */ g("p", {
172
+ H && /* @__PURE__ */ x("p", {
127
173
  style: {
128
174
  color: "var(--color-text-danger)",
129
175
  fontSize: "var(--font-size-sm)"
130
176
  },
131
- children: I
177
+ children: H
132
178
  })
133
179
  ]
134
180
  }),
135
- /* @__PURE__ */ _(l, { children: [/* @__PURE__ */ g(a, {
181
+ /* @__PURE__ */ S(ee, { children: [/* @__PURE__ */ x(s, {
136
182
  variant: "outline",
137
- onClick: S,
138
- disabled: P,
139
- children: R ? w("bigconsole.dashboards.publishStore.action.done", "Done") : w("bigconsole.dashboards.publishStore.action.cancel", "Cancel")
140
- }), !R && /* @__PURE__ */ g(a, {
141
- onClick: B,
142
- disabled: P,
143
- children: P ? /* @__PURE__ */ g(p, {}) : w("bigconsole.dashboards.publishStore.action.publish", "Publish")
183
+ onClick: O,
184
+ disabled: B,
185
+ children: W ? A("bigconsole.dashboards.publishStore.action.done", "Done") : A("bigconsole.dashboards.publishStore.action.cancel", "Cancel")
186
+ }), !W && /* @__PURE__ */ x(s, {
187
+ onClick: Z,
188
+ disabled: B || K.loading,
189
+ children: B ? /* @__PURE__ */ x(y, {}) : A("bigconsole.dashboards.publishStore.action.publish", "Publish")
144
190
  })] })
145
191
  ]
146
192
  })
147
193
  });
148
194
  });
149
- export { y as PublishToStoreDialog, y as default };
195
+ export { T as PublishToStoreDialog, T as default };
@@ -1,5 +1,7 @@
1
- export declare function CreateQueryWidget({ savedId, name, workspaceId, }: {
2
- savedId: string;
1
+ /** Either a saved query, or a typed Ask plan that the server revalidates and re-runs before saving. */
2
+ export declare function CreateQueryWidget({ savedId, askSpec, name, workspaceId, }: {
3
+ savedId?: string;
4
+ askSpec?: unknown;
3
5
  name: string;
4
6
  workspaceId: string;
5
7
  }): import('react').JSX.Element;
@@ -1,192 +1,208 @@
1
- import { CreateExploreWidgetDocument as e, ExploreDashboardsDocument as t, ExplorePagesDocument as n } from "../../../generated/wspace-operations.js";
2
- import { exploreError as r, workspaceRequest as i } from "./useExploreRun.js";
3
- import { Control as a, controlClass as o } from "./VisualBuilder.js";
4
- import { useOptionalBigConsole as s } from "../../context/BigConsoleContext.js";
5
- import { SavedQueryWidget as c } from "./SavedQueryWidget.js";
1
+ import { BigConsoleAskAddToDashboardDocument as e, CreateExploreWidgetDocument as t, ExploreDashboardsDocument as n, ExplorePagesDocument as r } from "../../../generated/wspace-operations.js";
2
+ import { exploreError as i, workspaceRequest as a } from "./useExploreRun.js";
3
+ import { Control as o, controlClass as s } from "./VisualBuilder.js";
4
+ import { useOptionalBigConsole as c } from "../../context/BigConsoleContext.js";
5
+ import { SavedQueryWidget as l } from "./SavedQueryWidget.js";
6
6
  import "../../hooks/useActivePage.js";
7
- import { useEffect as l, useRef as u, useState as d } from "react";
8
- import { useApolloClient as f } from "@apollo/client/react";
9
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
7
+ import { useEffect as u, useRef as d, useState as f } from "react";
8
+ import { useApolloClient as p } from "@apollo/client/react";
9
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
10
10
  // src/bigconsole/components/explore/CreateQueryWidget.tsx
11
- function h({ savedId: h, name: g, workspaceId: _ }) {
12
- let v = f(), y = s(), [b, x] = d(""), [S, C] = d(""), [w, T] = d([]), [E, D] = d([]), [O, k] = d(g), [A, j] = d(""), [M, N] = d(""), [P, F] = d(""), [I, L] = d(null), [R, z] = d(null), [B, V] = d(null), [H, U] = d(null), W = JSON.stringify([
13
- b,
14
- B,
15
- H
16
- ]), G = W !== M, [K, q] = d(!1);
17
- l(() => {
18
- let e = new AbortController(), a = i(_, e.signal);
19
- return b ? v.query({
20
- query: n,
11
+ function g({ savedId: g, askSpec: _, name: v, workspaceId: y }) {
12
+ let b = p(), x = c(), [S, C] = f(""), [w, T] = f(""), [E, D] = f([]), [O, k] = f([]), [A, j] = f(v), [M, N] = f(""), [P, F] = f(""), [I, L] = f(""), [R, z] = f(null), [B, V] = f(null), [H, U] = f(null), [W, G] = f(null), K = JSON.stringify([
13
+ S,
14
+ H,
15
+ W
16
+ ]), q = K !== P, [J, Y] = f(!1);
17
+ u(() => {
18
+ let e = new AbortController(), t = a(y, e.signal);
19
+ return S ? b.query({
20
+ query: r,
21
21
  variables: {
22
- dashboardId: b,
23
- after: H
22
+ dashboardId: S,
23
+ after: W
24
24
  },
25
25
  fetchPolicy: "no-cache",
26
- context: a
26
+ context: t
27
27
  }).then(({ data: t }) => {
28
28
  if (e.signal.aborted) return;
29
29
  let n = t?.getDashboard?.pages;
30
30
  if (!n) throw Error("Missing pages");
31
- j(""), D((e) => [...H ? e : [], ...n.edges.map((e) => e.node)]), z(n.pageInfo.hasNextPage ? n.pageInfo.endCursor ?? null : null);
31
+ N(""), k((e) => [...W ? e : [], ...n.edges.map((e) => e.node)]), V(n.pageInfo.hasNextPage ? n.pageInfo.endCursor ?? null : null);
32
32
  }).catch((t) => {
33
- e.signal.aborted || j(r(t));
33
+ e.signal.aborted || N(i(t));
34
34
  }).finally(() => {
35
- e.signal.aborted || N(W);
36
- }) : v.query({
37
- query: t,
38
- variables: { after: B },
35
+ e.signal.aborted || F(K);
36
+ }) : b.query({
37
+ query: n,
38
+ variables: { after: H },
39
39
  fetchPolicy: "no-cache",
40
- context: a
40
+ context: t
41
41
  }).then(({ data: t }) => {
42
42
  if (e.signal.aborted) return;
43
43
  if (!t?.listDashboards) throw Error("Missing dashboards");
44
44
  let n = t.listDashboards;
45
- j(""), T((e) => [...B ? e : [], ...n.edges.map((e) => e.node)]), L(n.pageInfo.hasNextPage ? n.pageInfo.endCursor ?? null : null);
45
+ N(""), D((e) => [...H ? e : [], ...n.edges.map((e) => e.node)]), z(n.pageInfo.hasNextPage ? n.pageInfo.endCursor ?? null : null);
46
46
  }).catch((t) => {
47
- e.signal.aborted || j(r(t));
47
+ e.signal.aborted || N(i(t));
48
48
  }).finally(() => {
49
- e.signal.aborted || N(W);
49
+ e.signal.aborted || F(K);
50
50
  }), () => e.abort();
51
51
  }, [
52
- v,
53
- _,
54
52
  b,
55
- B,
53
+ y,
54
+ S,
56
55
  H,
57
- W
56
+ W,
57
+ K
58
58
  ]);
59
- let J = u(null);
60
- l(() => {
59
+ let X = d(null);
60
+ u(() => {
61
61
  let e = new AbortController();
62
- return J.current = e, () => e.abort();
62
+ return X.current = e, () => e.abort();
63
63
  }, []);
64
- async function Y() {
65
- let t = J.current;
66
- if (t && !t.signal.aborted && !K && O.trim() && S) {
67
- q(!0), j("");
64
+ async function Z() {
65
+ let n = X.current;
66
+ if (n && !n.signal.aborted && !J && A.trim() && w) {
67
+ Y(!0), N("");
68
68
  try {
69
- let { data: n } = await v.mutate({
70
- mutation: e,
71
- variables: {
72
- savedQueryId: h,
73
- title: O.trim(),
74
- pageId: S
75
- },
76
- fetchPolicy: "no-cache",
77
- context: i(_, t.signal)
78
- });
79
- if (t.signal.aborted) return;
80
- if (!n?.bigconsoleCreateExploreWidget) throw Error("Missing widget");
81
- F(n.bigconsoleCreateExploreWidget);
69
+ let r = a(y, n.signal), i;
70
+ if (_ !== void 0) {
71
+ let { data: t } = await b.mutate({
72
+ mutation: e,
73
+ variables: {
74
+ spec: _,
75
+ title: A.trim(),
76
+ pageId: w
77
+ },
78
+ fetchPolicy: "no-cache",
79
+ context: r
80
+ });
81
+ i = t?.bigconsoleAskAddToDashboard;
82
+ } else {
83
+ let { data: e } = await b.mutate({
84
+ mutation: t,
85
+ variables: {
86
+ savedQueryId: g ?? "",
87
+ title: A.trim(),
88
+ pageId: w
89
+ },
90
+ fetchPolicy: "no-cache",
91
+ context: r
92
+ });
93
+ i = e?.bigconsoleCreateExploreWidget;
94
+ }
95
+ if (n.signal.aborted) return;
96
+ if (!i) throw Error("Missing widget");
97
+ L(i);
82
98
  } catch (e) {
83
- t.signal.aborted || j(r(e));
99
+ n.signal.aborted || N(i(e));
84
100
  } finally {
85
- t.signal.aborted || q(!1);
101
+ n.signal.aborted || Y(!1);
86
102
  }
87
103
  }
88
104
  }
89
- return P ? /* @__PURE__ */ m("div", {
105
+ return I ? /* @__PURE__ */ h("div", {
90
106
  className: "space-y-2",
91
107
  children: [
92
- /* @__PURE__ */ p("p", {
108
+ /* @__PURE__ */ m("p", {
93
109
  role: "status",
94
110
  children: "Widget created."
95
111
  }),
96
- y && /* @__PURE__ */ p("button", {
112
+ x && /* @__PURE__ */ m("button", {
97
113
  type: "button",
98
114
  className: "underline",
99
- onClick: () => y.navigate(`/dashboards/${encodeURIComponent(b)}?page=${encodeURIComponent(S)}`),
115
+ onClick: () => x.navigate(`/dashboards/${encodeURIComponent(S)}?page=${encodeURIComponent(w)}`),
100
116
  children: "Open dashboard"
101
117
  }),
102
- /* @__PURE__ */ p(c, {
103
- id: P,
104
- title: O
118
+ /* @__PURE__ */ m(l, {
119
+ id: I,
120
+ title: A
105
121
  })
106
122
  ]
107
- }) : /* @__PURE__ */ m("fieldset", {
123
+ }) : /* @__PURE__ */ h("fieldset", {
108
124
  className: "space-y-2",
109
125
  children: [
110
- /* @__PURE__ */ p("legend", {
126
+ /* @__PURE__ */ m("legend", {
111
127
  className: "font-medium",
112
128
  children: "Create a dashboard widget"
113
129
  }),
114
- /* @__PURE__ */ m("div", {
130
+ /* @__PURE__ */ h("div", {
115
131
  className: "flex flex-wrap items-end gap-2",
116
132
  children: [
117
- /* @__PURE__ */ p(a, {
133
+ /* @__PURE__ */ m(o, {
118
134
  label: "Dashboard",
119
- children: /* @__PURE__ */ m("select", {
120
- className: o,
121
- value: b,
122
- disabled: K,
135
+ children: /* @__PURE__ */ h("select", {
136
+ className: s,
137
+ value: S,
138
+ disabled: J,
123
139
  onChange: (e) => {
124
- x(e.target.value), C(""), D([]), U(null), z(null);
140
+ C(e.target.value), T(""), k([]), G(null), V(null);
125
141
  },
126
- children: [/* @__PURE__ */ p("option", {
142
+ children: [/* @__PURE__ */ m("option", {
127
143
  value: "",
128
144
  children: "Choose dashboard"
129
- }), w.map((e) => /* @__PURE__ */ p("option", {
145
+ }), E.map((e) => /* @__PURE__ */ m("option", {
130
146
  value: e.id,
131
147
  children: e.name
132
148
  }, e.id))]
133
149
  })
134
150
  }),
135
- !b && I && /* @__PURE__ */ p("button", {
151
+ !S && R && /* @__PURE__ */ m("button", {
136
152
  type: "button",
137
- disabled: G,
138
- onClick: () => V(I),
153
+ disabled: q,
154
+ onClick: () => U(R),
139
155
  children: "More dashboards"
140
156
  }),
141
- b && /* @__PURE__ */ p(a, {
157
+ S && /* @__PURE__ */ m(o, {
142
158
  label: "Dashboard page",
143
- children: /* @__PURE__ */ m("select", {
159
+ children: /* @__PURE__ */ h("select", {
144
160
  className: "rounded border border-border-default bg-bg-surface px-2 py-1 text-sm text-text-primary",
145
- value: S,
146
- disabled: K,
147
- onChange: (e) => C(e.target.value),
148
- children: [/* @__PURE__ */ p("option", {
161
+ value: w,
162
+ disabled: J,
163
+ onChange: (e) => T(e.target.value),
164
+ children: [/* @__PURE__ */ m("option", {
149
165
  value: "",
150
166
  children: "Choose page"
151
- }), E.map((e) => /* @__PURE__ */ p("option", {
167
+ }), O.map((e) => /* @__PURE__ */ m("option", {
152
168
  value: e.id,
153
169
  children: e.name
154
170
  }, e.id))]
155
171
  })
156
172
  }),
157
- b && R && /* @__PURE__ */ p("button", {
173
+ S && B && /* @__PURE__ */ m("button", {
158
174
  type: "button",
159
- disabled: G,
160
- onClick: () => U(R),
175
+ disabled: q,
176
+ onClick: () => G(B),
161
177
  children: "More pages"
162
178
  }),
163
- /* @__PURE__ */ p(a, {
179
+ /* @__PURE__ */ m(o, {
164
180
  label: "Widget title",
165
- children: /* @__PURE__ */ p("input", {
166
- className: o,
167
- value: O,
168
- disabled: K,
169
- onChange: (e) => k(e.target.value)
181
+ children: /* @__PURE__ */ m("input", {
182
+ className: s,
183
+ value: A,
184
+ disabled: J,
185
+ onChange: (e) => j(e.target.value)
170
186
  })
171
187
  }),
172
- /* @__PURE__ */ p("button", {
188
+ /* @__PURE__ */ m("button", {
173
189
  type: "button",
174
- className: o,
175
- onClick: () => void Y(),
176
- disabled: K || !S || !O.trim(),
190
+ className: s,
191
+ onClick: () => void Z(),
192
+ disabled: J || !w || !A.trim(),
177
193
  children: "Create widget"
178
194
  })
179
195
  ]
180
196
  }),
181
- G && /* @__PURE__ */ p("p", {
197
+ q && /* @__PURE__ */ m("p", {
182
198
  role: "status",
183
199
  children: "Loading destinations…"
184
200
  }),
185
- A && /* @__PURE__ */ p("p", {
201
+ M && /* @__PURE__ */ m("p", {
186
202
  role: "alert",
187
- children: A
203
+ children: M
188
204
  })
189
205
  ]
190
206
  });
191
207
  }
192
- export { h as CreateQueryWidget };
208
+ export { g as CreateQueryWidget };
@@ -1,4 +1,4 @@
1
- export { BrowseDashboardTemplatesDocument as BROWSE_DASHBOARD_TEMPLATES, GetDashboardTemplateDetailDocument as GET_DASHBOARD_TEMPLATE_DETAIL, CreateDashboardTemplateAppDocument as CREATE_TEMPLATE_APP, CreateDashboardTemplateVersionDocument as CREATE_TEMPLATE_VERSION, } from '../../generated/global-operations';
1
+ export { BrowseDashboardTemplatesDocument as BROWSE_DASHBOARD_TEMPLATES, GetDashboardTemplateDetailDocument as GET_DASHBOARD_TEMPLATE_DETAIL, CreateDashboardTemplateAppDocument as CREATE_TEMPLATE_APP, CreateDashboardTemplateVersionDocument as CREATE_TEMPLATE_VERSION, GetPublishOwnerOrganizationsDocument as GET_PUBLISH_OWNER_ORGANIZATIONS, } from '../../generated/global-operations';
2
2
  export declare const IMPORT_DASHBOARD_TEMPLATE: import('graphql').DocumentNode;
3
3
  /**
4
4
  * Same interim treatment as IMPORT_DASHBOARD_TEMPLATE, and for the same reason:
@@ -1,7 +1,7 @@
1
- import { BrowseDashboardTemplatesDocument as e, CreateDashboardTemplateAppDocument as t, CreateDashboardTemplateVersionDocument as n, GetDashboardTemplateDetailDocument as r } from "../../generated/global-operations.js";
2
- import { gql as i } from "@apollo/client";
1
+ import { BrowseDashboardTemplatesDocument as e, CreateDashboardTemplateAppDocument as t, CreateDashboardTemplateVersionDocument as n, GetDashboardTemplateDetailDocument as r, GetPublishOwnerOrganizationsDocument as i } from "../../generated/global-operations.js";
2
+ import { gql as a } from "@apollo/client";
3
3
  // src/bigconsole/graphql/storeTemplates.ts
4
- var a = i`
4
+ var o = a`
5
5
  mutation ImportDashboardTemplate($input: BigConsoleImportDashboardTemplateInput!) {
6
6
  importDashboardTemplate(input: $input) {
7
7
  success
@@ -20,7 +20,7 @@ var a = i`
20
20
  }
21
21
  }
22
22
  }
23
- `, o = i`
23
+ `, s = a`
24
24
  query BuildDashboardTemplateContent(
25
25
  $dashboardId: ID!
26
26
  $defaultDashboardName: String
@@ -42,4 +42,4 @@ var a = i`
42
42
  }
43
43
  }
44
44
  `;
45
- export { e as BROWSE_DASHBOARD_TEMPLATES, o as BUILD_DASHBOARD_TEMPLATE_CONTENT, t as CREATE_TEMPLATE_APP, n as CREATE_TEMPLATE_VERSION, r as GET_DASHBOARD_TEMPLATE_DETAIL, a as IMPORT_DASHBOARD_TEMPLATE };
45
+ export { e as BROWSE_DASHBOARD_TEMPLATES, s as BUILD_DASHBOARD_TEMPLATE_CONTENT, t as CREATE_TEMPLATE_APP, n as CREATE_TEMPLATE_VERSION, r as GET_DASHBOARD_TEMPLATE_DETAIL, i as GET_PUBLISH_OWNER_ORGANIZATIONS, o as IMPORT_DASHBOARD_TEMPLATE };