@burdenoff/microfe-bigconsole 2026.1119.3 → 2026.1119.5
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/bigconsole/components/dashboard/PublishToStoreDialog.js +126 -80
- package/dist/bigconsole/components/parser/ParserSelector.js +150 -145
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +50 -49
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +223 -201
- package/dist/bigconsole/customWidget/index.d.ts +2 -1
- package/dist/bigconsole/customWidget/index.js +1 -0
- package/dist/bigconsole/customWidget/proposalContract.d.ts +55 -1
- package/dist/bigconsole/customWidget/proposalContract.js +37 -14
- package/dist/bigconsole/customWidget/proposalPreviewData.d.ts +18 -0
- package/dist/bigconsole/customWidget/proposalPreviewData.js +70 -0
- package/dist/bigconsole/customWidget/proposalSource.d.ts +10 -0
- package/dist/bigconsole/customWidget/proposalSource.js +197 -51
- package/dist/bigconsole/graphql/storeTemplates.d.ts +1 -1
- package/dist/bigconsole/graphql/storeTemplates.js +5 -5
- package/dist/bigconsole/hooks/useParserOperations.js +80 -74
- package/dist/bigconsole/hooks/usePublishOwnerOptions.d.ts +10 -0
- package/dist/bigconsole/hooks/usePublishOwnerOptions.js +48 -0
- package/dist/bigconsole/hooks/useStoreDashboardTemplates.d.ts +8 -0
- package/dist/bigconsole/hooks/useStoreDashboardTemplates.js +3 -1
- package/dist/bigconsole/pages/ParserBuilderPage.js +540 -518
- package/dist/bigconsole/store/parserScope.d.ts +24 -0
- package/dist/bigconsole/store/parserScope.js +17 -0
- package/dist/bigconsole/store/parserStore.d.ts +3 -0
- package/dist/bigconsole/store/parserStore.js +70 -68
- package/dist/bigconsole/utils/publishOwner.d.ts +100 -0
- package/dist/bigconsole/utils/publishOwner.js +71 -0
- package/dist/generated/global-operations.d.ts +19 -0
- package/dist/generated/global-operations.js +80 -1
- package/dist/generated/wspace-operations.d.ts +10 -0
- package/dist/generated/wspace-operations.js +180 -110
- package/package.json +1 -1
|
@@ -1,149 +1,195 @@
|
|
|
1
|
-
import e from "../../hooks/
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
-
|
|
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
|
|
11
|
-
let { t:
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
r,
|
|
21
|
+
E,
|
|
22
|
+
D
|
|
18
23
|
]);
|
|
19
|
-
let
|
|
20
|
-
if (!
|
|
21
|
-
else if (!
|
|
22
|
-
else if (!
|
|
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
|
-
|
|
29
|
+
U(null), V(!0);
|
|
25
30
|
try {
|
|
26
|
-
let e = await
|
|
27
|
-
dashboardId:
|
|
28
|
-
name:
|
|
29
|
-
slug:
|
|
30
|
-
description:
|
|
31
|
-
includeSampleData:
|
|
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
|
-
|
|
40
|
+
U(e.errorMessage ?? A("bigconsole.dashboards.publishStore.error.publishFailed", "Failed to publish to the store"));
|
|
35
41
|
return;
|
|
36
42
|
}
|
|
37
|
-
|
|
43
|
+
G(e), k?.(e);
|
|
38
44
|
} finally {
|
|
39
|
-
|
|
45
|
+
V(!1);
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
48
|
}, [
|
|
43
|
-
E,
|
|
44
|
-
O,
|
|
45
|
-
A,
|
|
46
49
|
M,
|
|
47
|
-
|
|
50
|
+
P,
|
|
51
|
+
I,
|
|
52
|
+
R,
|
|
53
|
+
q,
|
|
48
54
|
T,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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__ */
|
|
57
|
-
open:
|
|
58
|
-
onOpenChange: (e) => !e && !
|
|
59
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
63
|
-
|
|
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__ */
|
|
73
|
+
/* @__PURE__ */ x("p", {
|
|
67
74
|
style: { fontWeight: "var(--font-weight-medium)" },
|
|
68
|
-
children:
|
|
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__ */
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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__ */
|
|
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__ */
|
|
107
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
93
108
|
htmlFor: "tpl-name",
|
|
94
|
-
style:
|
|
95
|
-
children:
|
|
96
|
-
}), /* @__PURE__ */
|
|
109
|
+
style: $,
|
|
110
|
+
children: A("bigconsole.dashboards.publishStore.field.name", "Template name")
|
|
111
|
+
}), /* @__PURE__ */ x(p, {
|
|
97
112
|
id: "tpl-name",
|
|
98
|
-
value:
|
|
99
|
-
disabled:
|
|
113
|
+
value: M,
|
|
114
|
+
disabled: B,
|
|
100
115
|
onChange: (e) => {
|
|
101
|
-
|
|
116
|
+
N(e.target.value), F(w(e.target.value));
|
|
102
117
|
}
|
|
103
118
|
})] }),
|
|
104
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
105
120
|
htmlFor: "tpl-slug",
|
|
106
|
-
style:
|
|
107
|
-
children:
|
|
108
|
-
}), /* @__PURE__ */
|
|
121
|
+
style: $,
|
|
122
|
+
children: A("bigconsole.dashboards.publishStore.field.slug", "Slug")
|
|
123
|
+
}), /* @__PURE__ */ x(p, {
|
|
109
124
|
id: "tpl-slug",
|
|
110
|
-
value:
|
|
111
|
-
disabled:
|
|
112
|
-
onChange: (e) =>
|
|
125
|
+
value: P,
|
|
126
|
+
disabled: B,
|
|
127
|
+
onChange: (e) => F(w(e.target.value))
|
|
113
128
|
})] }),
|
|
114
|
-
/* @__PURE__ */
|
|
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:
|
|
117
|
-
children:
|
|
118
|
-
}), /* @__PURE__ */
|
|
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:
|
|
122
|
-
disabled:
|
|
123
|
-
placeholder:
|
|
124
|
-
onChange: (e) =>
|
|
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
|
-
|
|
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:
|
|
177
|
+
children: H
|
|
132
178
|
})
|
|
133
179
|
]
|
|
134
180
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ S(ee, { children: [/* @__PURE__ */ x(s, {
|
|
136
182
|
variant: "outline",
|
|
137
|
-
onClick:
|
|
138
|
-
disabled:
|
|
139
|
-
children:
|
|
140
|
-
}), !
|
|
141
|
-
onClick:
|
|
142
|
-
disabled:
|
|
143
|
-
children:
|
|
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 {
|
|
195
|
+
export { T as PublishToStoreDialog, T as default };
|