@burdenoff/microfe-bigconsole 2026.1029.4 → 2026.1030.2
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/CreateDashboardDialog.js +450 -413
- package/dist/bigconsole/components/dashboard/QuotaLimitNotice.d.ts +9 -0
- package/dist/bigconsole/components/dashboard/QuotaLimitNotice.js +59 -0
- package/dist/bigconsole/hooks/mutationInputEnums.d.ts +1 -1
- package/dist/bigconsole/hooks/mutationInputEnums.js +1 -1
- package/dist/bigconsole/hooks/useDashboardOperations.d.ts +1 -0
- package/dist/bigconsole/hooks/useDashboardOperations.js +1 -2
- package/dist/bigconsole/hooks/useEventLogs.js +1 -1
- package/dist/bigconsole/hooks/useWidgetActions.js +1 -1
- package/dist/bigconsole/pages/DashboardsPage.js +391 -390
- package/dist/bigconsole/providers/BigConsoleQuotaProvider.d.ts +13 -0
- package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +55 -49
- package/dist/bigconsole/utils/quota.d.ts +21 -0
- package/dist/bigconsole/utils/quota.js +20 -9
- package/dist/generated/wspace-operations.d.ts +417 -425
- package/dist/generated/wspace-operations.js +19 -19
- package/dist/generated/wspace-types.d.ts +698 -737
- package/dist/generated/wspace-types.js +10 -10
- package/dist/translations/en.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { BigConsoleQuotaKind } from '../utils/quota';
|
|
2
3
|
interface BigConsoleQuotaProviderProps {
|
|
3
4
|
children: ReactNode;
|
|
4
5
|
/** Navigate to a billing route (e.g. `/billing` or `/billing/overview`). */
|
|
5
6
|
onViewBilling: (path: string) => void;
|
|
6
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Opens the billing page that resolves a quota of the given kind, carrying the
|
|
10
|
+
* active org/workspace/project. `null` outside a {@link BigConsoleQuotaProvider}
|
|
11
|
+
* (e.g. a component rendered in isolation), in which case callers omit the link.
|
|
12
|
+
*/
|
|
13
|
+
type ViewBillingForKind = (kind: BigConsoleQuotaKind) => void;
|
|
14
|
+
/**
|
|
15
|
+
* For components that show a quota refusal in place instead of raising the
|
|
16
|
+
* shared dialog (the Create Dashboard dialog, BOFF-10258) and still need the
|
|
17
|
+
* same upgrade path.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useBigConsoleViewBilling(): ViewBillingForKind | null;
|
|
7
20
|
export declare function BigConsoleQuotaProvider({ children, onViewBilling }: BigConsoleQuotaProviderProps): import('react').JSX.Element;
|
|
8
21
|
export {};
|
|
@@ -1,69 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { AlertTriangle as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import {
|
|
1
|
+
import { BIGCONSOLE_QUOTA_EXHAUSTED_EVENT as e, bigConsoleBillingPathFor as t, getBigConsoleQuotaDialogContent as n } from "../utils/quota.js";
|
|
2
|
+
import { createContext as r, useCallback as i, useContext as a, useEffect as o, useState as s } from "react";
|
|
3
|
+
import { AlertTriangle as c } from "lucide-react";
|
|
4
|
+
import { Button as l, ResponsiveDialog as u, ResponsiveDialogContent as d, ResponsiveDialogDescription as f, ResponsiveDialogFooter as p, ResponsiveDialogHeader as m, ResponsiveDialogTitle as h } from "@burdenoff/fe-libs/ui";
|
|
5
|
+
import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
6
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
7
7
|
//#region src/bigconsole/providers/BigConsoleQuotaProvider.tsx
|
|
8
|
-
var
|
|
8
|
+
var y = {
|
|
9
9
|
open: !1,
|
|
10
10
|
kind: "generic"
|
|
11
|
-
};
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
}, b = r(null);
|
|
12
|
+
function x() {
|
|
13
|
+
return a(b);
|
|
14
|
+
}
|
|
15
|
+
function S({ children: r, onViewBilling: a }) {
|
|
16
|
+
let { t: x } = g(), [S, C] = s(y);
|
|
17
|
+
o(() => {
|
|
18
|
+
let t = (e) => {
|
|
16
19
|
let t = e.detail;
|
|
17
20
|
C({
|
|
18
21
|
open: !0,
|
|
19
22
|
kind: t?.kind ?? "generic"
|
|
20
23
|
});
|
|
21
24
|
};
|
|
22
|
-
return window.addEventListener(
|
|
23
|
-
window.removeEventListener(
|
|
25
|
+
return window.addEventListener(e, t), () => {
|
|
26
|
+
window.removeEventListener(e, t);
|
|
24
27
|
};
|
|
25
28
|
}, []);
|
|
26
|
-
let w =
|
|
29
|
+
let w = i(() => {
|
|
27
30
|
C((e) => ({
|
|
28
31
|
...e,
|
|
29
32
|
open: !1
|
|
30
33
|
}));
|
|
31
|
-
}, []), T = S.kind === "billing-setup", E =
|
|
34
|
+
}, []), T = S.kind === "billing-setup", E = i((e) => a(t(e)), [a]), D = i(() => {
|
|
32
35
|
C((e) => ({
|
|
33
36
|
...e,
|
|
34
37
|
open: !1
|
|
35
|
-
})),
|
|
36
|
-
}, [
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
children: [/* @__PURE__ */
|
|
46
|
-
className: "flex
|
|
47
|
-
children: /* @__PURE__ */
|
|
48
|
-
className: "size-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
38
|
+
})), E(S.kind);
|
|
39
|
+
}, [E, S.kind]), O = n(S.kind), k = x(`bigconsole.quota.${S.kind}.title`, O.title), A = x(`bigconsole.quota.${S.kind}.message`, O.message);
|
|
40
|
+
return /* @__PURE__ */ v(b.Provider, {
|
|
41
|
+
value: E,
|
|
42
|
+
children: [r, /* @__PURE__ */ _(u, {
|
|
43
|
+
open: S.open,
|
|
44
|
+
onOpenChange: (e) => !e && w(),
|
|
45
|
+
children: /* @__PURE__ */ v(d, {
|
|
46
|
+
className: "sm:max-w-md",
|
|
47
|
+
showCloseButton: !1,
|
|
48
|
+
children: [/* @__PURE__ */ v("div", {
|
|
49
|
+
className: "flex items-start gap-3",
|
|
50
|
+
children: [/* @__PURE__ */ _("div", {
|
|
51
|
+
className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-status-warning-bg-subtle text-status-warning-text",
|
|
52
|
+
children: /* @__PURE__ */ _(c, {
|
|
53
|
+
className: "size-5",
|
|
54
|
+
"aria-hidden": "true"
|
|
55
|
+
})
|
|
56
|
+
}), /* @__PURE__ */ v(m, {
|
|
57
|
+
className: "text-left",
|
|
58
|
+
children: [/* @__PURE__ */ _(h, { children: k }), /* @__PURE__ */ _(f, { children: A })]
|
|
59
|
+
})]
|
|
60
|
+
}), /* @__PURE__ */ v(p, { children: [/* @__PURE__ */ _(l, {
|
|
61
|
+
type: "button",
|
|
62
|
+
variant: "outline",
|
|
63
|
+
onClick: w,
|
|
64
|
+
children: x("bigconsole.quota.dismiss", "Dismiss")
|
|
65
|
+
}), /* @__PURE__ */ _(l, {
|
|
66
|
+
type: "button",
|
|
67
|
+
onClick: D,
|
|
68
|
+
children: T ? x("bigconsole.quota.setUpBilling", "Set up billing") : x("bigconsole.quota.viewBilling", "View Billing")
|
|
69
|
+
})] })]
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
67
73
|
}
|
|
68
74
|
//#endregion
|
|
69
|
-
export {
|
|
75
|
+
export { S as BigConsoleQuotaProvider, x as useBigConsoleViewBilling };
|
|
@@ -30,7 +30,28 @@ export declare function createBigConsoleQuotaError(value: unknown): Error;
|
|
|
30
30
|
/** An exhausted quota, or a quota that was never provisioned because billing is not set up. */
|
|
31
31
|
export declare function isBigConsoleQuotaError(value: unknown): boolean;
|
|
32
32
|
export declare function inferBigConsoleQuotaKind(extensions: QuotaExhaustedExtensions, fallback?: BigConsoleQuotaKind): BigConsoleQuotaKind;
|
|
33
|
+
/**
|
|
34
|
+
* Classify a failure as a BigConsole quota refusal without announcing it.
|
|
35
|
+
*
|
|
36
|
+
* Returns `null` when `value` is not a quota error. A not-provisioned refusal is
|
|
37
|
+
* checked first: an organisation without billing has no plan at all, so an
|
|
38
|
+
* "upgrade" message would send them to buy something that would not help.
|
|
39
|
+
*
|
|
40
|
+
* Callers that can show the refusal in place (e.g. the Create Dashboard dialog,
|
|
41
|
+
* BOFF-10258) use this directly; everything else goes through
|
|
42
|
+
* {@link reportBigConsoleQuotaError}, which raises the shared quota dialog.
|
|
43
|
+
*/
|
|
44
|
+
export declare function classifyBigConsoleQuotaError(value: unknown, fallbackKind?: BigConsoleQuotaKind): BigConsoleQuotaExhaustedEventDetail | null;
|
|
33
45
|
export declare function reportBigConsoleQuotaError(value: unknown, fallbackKind?: BigConsoleQuotaKind): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The plan limit a quota refusal carries, when it carries one.
|
|
48
|
+
*
|
|
49
|
+
* The gateway's `QUOTA_EXHAUSTED` body reports `limitLeft` but not always the
|
|
50
|
+
* total, so this returns `null` rather than guessing; the UI then omits the line.
|
|
51
|
+
*/
|
|
52
|
+
export declare function bigConsoleQuotaLimit(detail: BigConsoleQuotaExhaustedEventDetail | null): number | null;
|
|
53
|
+
/** Billing route for a quota kind: billing setup for a not-provisioned org, else the plan page. */
|
|
54
|
+
export declare function bigConsoleBillingPathFor(kind: BigConsoleQuotaKind): string;
|
|
34
55
|
export declare function getBigConsoleQuotaDialogContent(kind: BigConsoleQuotaKind): {
|
|
35
56
|
title: string;
|
|
36
57
|
message: string;
|
|
@@ -75,16 +75,27 @@ function h(e, t = "generic") {
|
|
|
75
75
|
let n = e.quotaName?.toLowerCase(), r = e.field?.toLowerCase();
|
|
76
76
|
return r && i.has(r) || n && s.has(n) ? "project" : r && a.has(r) || n && c.has(n) ? "session" : r && o.has(r) || n && l.has(n) ? "command" : t;
|
|
77
77
|
}
|
|
78
|
-
function g(e,
|
|
78
|
+
function g(e, t = "generic") {
|
|
79
|
+
if (f(e)) return { kind: "billing-setup" };
|
|
80
|
+
let n = d(e);
|
|
81
|
+
return n ? {
|
|
82
|
+
kind: h(n, t),
|
|
83
|
+
extensions: n
|
|
84
|
+
} : null;
|
|
85
|
+
}
|
|
86
|
+
function _(e, n = "generic") {
|
|
79
87
|
if (typeof window > "u") return !1;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
let r = g(e, n);
|
|
89
|
+
return r ? (window.dispatchEvent(new CustomEvent(t, { detail: r })), !0) : !1;
|
|
90
|
+
}
|
|
91
|
+
function v(e) {
|
|
92
|
+
let t = e?.extensions?.limit;
|
|
93
|
+
return typeof t == "number" && Number.isFinite(t) && t >= 0 ? t : null;
|
|
94
|
+
}
|
|
95
|
+
function y(e) {
|
|
96
|
+
return e === "billing-setup" ? r.billingSetup : r.billing;
|
|
86
97
|
}
|
|
87
|
-
function
|
|
98
|
+
function b(e) {
|
|
88
99
|
switch (e) {
|
|
89
100
|
case "billing-setup": return {
|
|
90
101
|
title: "Set up billing to continue",
|
|
@@ -109,4 +120,4 @@ function _(e) {
|
|
|
109
120
|
}
|
|
110
121
|
}
|
|
111
122
|
//#endregion
|
|
112
|
-
export {
|
|
123
|
+
export { t as BIGCONSOLE_QUOTA_EXHAUSTED_EVENT, y as bigConsoleBillingPathFor, v as bigConsoleQuotaLimit, g as classifyBigConsoleQuotaError, p as createBigConsoleQuotaError, b as getBigConsoleQuotaDialogContent, m as isBigConsoleQuotaError, _ as reportBigConsoleQuotaError };
|