@burdenoff/microfe-workspaces 2026.1029.1 → 2026.1029.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.
|
@@ -124,6 +124,20 @@ var e = {
|
|
|
124
124
|
value: "type"
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
|
+
{
|
|
128
|
+
kind: "Field",
|
|
129
|
+
name: {
|
|
130
|
+
kind: "Name",
|
|
131
|
+
value: "organizationId"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
kind: "Field",
|
|
136
|
+
name: {
|
|
137
|
+
kind: "Name",
|
|
138
|
+
value: "tenantId"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
127
141
|
{
|
|
128
142
|
kind: "Field",
|
|
129
143
|
name: {
|
|
@@ -31,6 +31,9 @@ export interface WorkspaceSummary {
|
|
|
31
31
|
name: string;
|
|
32
32
|
status: string;
|
|
33
33
|
type: string;
|
|
34
|
+
/** Set when the item comes from the global `myWorkspaces` query. */
|
|
35
|
+
organizationId?: string | null;
|
|
36
|
+
tenantId?: string | null;
|
|
34
37
|
createdAt: string;
|
|
35
38
|
}
|
|
36
39
|
export interface ProjectSummary {
|
|
@@ -1,67 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { commitWorkspaceSelection as e } from "../../../hooks/useOpenWorkspace.js";
|
|
2
|
+
import { tWithFallback as t } from "../../../utils/i18n.js";
|
|
3
|
+
import { WidgetWrapper as n } from "../WidgetWrapper.js";
|
|
4
|
+
import { ArrowRight as r, Building2 as i, Circle as a } from "lucide-react";
|
|
5
|
+
import { useActiveContext as o } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { Badge as l, Button as u, IllustratedEmptyState as d } from "@burdenoff/fe-libs/ui";
|
|
8
|
+
import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
9
|
//#region src/pages/dashboard/widgets/WorkspacesWidget.tsx
|
|
8
|
-
var
|
|
10
|
+
var p = {
|
|
9
11
|
ACTIVE: "bg-status-success-bg",
|
|
10
12
|
SUSPENDED: "bg-status-warning-bg",
|
|
11
13
|
ARCHIVED: "bg-text-tertiary"
|
|
12
14
|
};
|
|
13
|
-
function
|
|
14
|
-
let { t:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
function m({ workspaceData: m, isLoading: h, navigate: g }) {
|
|
16
|
+
let { t: _ } = f(), v = m?.workspaces.items ?? [], y = m?.workspaces.total ?? 0, { setOrganization: b, setWorkspace: x, setProject: S, setTenant: C } = o(), w = (t) => {
|
|
17
|
+
e({
|
|
18
|
+
setOrganization: b,
|
|
19
|
+
setWorkspace: x,
|
|
20
|
+
setProject: S,
|
|
21
|
+
setTenant: C
|
|
22
|
+
}, t), g(`/workspaces/${t.id}`);
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ s(n, {
|
|
25
|
+
title: t(_, "dashboard.workspaces.title", "Workspaces"),
|
|
26
|
+
icon: /* @__PURE__ */ s(i, { className: "size-4" }),
|
|
18
27
|
size: "medium",
|
|
19
|
-
isLoading:
|
|
20
|
-
unavailable: !
|
|
21
|
-
headerAction: /* @__PURE__ */
|
|
28
|
+
isLoading: h,
|
|
29
|
+
unavailable: !m,
|
|
30
|
+
headerAction: /* @__PURE__ */ c(u, {
|
|
22
31
|
variant: "ghost",
|
|
23
32
|
size: "sm",
|
|
24
33
|
className: "text-xs",
|
|
25
|
-
onClick: () =>
|
|
34
|
+
onClick: () => g("/workspaces/list"),
|
|
26
35
|
children: [
|
|
27
|
-
|
|
36
|
+
t(_, "dashboard.workspaces.viewAll", "View all"),
|
|
28
37
|
" ",
|
|
29
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ s(r, { className: "ml-1 size-3" })
|
|
30
39
|
]
|
|
31
40
|
}),
|
|
32
|
-
children:
|
|
41
|
+
children: v.length === 0 ? /* @__PURE__ */ s(d, {
|
|
33
42
|
illustration: "empty-data",
|
|
34
|
-
title:
|
|
43
|
+
title: t(_, "dashboard.workspaces.emptyTitle", "No workspaces yet"),
|
|
35
44
|
className: "py-4",
|
|
36
|
-
action: /* @__PURE__ */
|
|
45
|
+
action: /* @__PURE__ */ s(u, {
|
|
37
46
|
variant: "outline",
|
|
38
47
|
size: "sm",
|
|
39
|
-
onClick: () =>
|
|
40
|
-
children:
|
|
48
|
+
onClick: () => g("/workspaces/list"),
|
|
49
|
+
children: t(_, "dashboard.workspaces.emptyAction", "Create your first workspace")
|
|
41
50
|
})
|
|
42
|
-
}) : /* @__PURE__ */
|
|
51
|
+
}) : /* @__PURE__ */ c("div", {
|
|
43
52
|
className: "space-y-2",
|
|
44
|
-
children: [
|
|
53
|
+
children: [v.slice(0, 5).map((e) => /* @__PURE__ */ c("button", {
|
|
45
54
|
type: "button",
|
|
46
55
|
className: "w-full flex items-center justify-between p-2 rounded-md hover:bg-accent/5 cursor-pointer transition-colors text-left",
|
|
47
|
-
onClick: () =>
|
|
48
|
-
children: [/* @__PURE__ */
|
|
56
|
+
onClick: () => w(e),
|
|
57
|
+
children: [/* @__PURE__ */ c("div", {
|
|
49
58
|
className: "flex items-center gap-2 min-w-0",
|
|
50
|
-
children: [/* @__PURE__ */ a
|
|
59
|
+
children: [/* @__PURE__ */ s(a, { className: `size-2 ${p[e.status] || "bg-text-tertiary"} fill-current ${e.status === "ACTIVE" ? "motion-safe:animate-vc-glow-pulse" : ""}` }), /* @__PURE__ */ s("span", {
|
|
51
60
|
className: "text-sm font-medium text-text-primary truncate",
|
|
52
61
|
children: e.name
|
|
53
62
|
})]
|
|
54
|
-
}), /* @__PURE__ */
|
|
63
|
+
}), /* @__PURE__ */ s(l, {
|
|
55
64
|
variant: "outline",
|
|
56
65
|
className: "text-[10px] shrink-0",
|
|
57
66
|
children: e.type
|
|
58
67
|
})]
|
|
59
|
-
}, e.id)),
|
|
68
|
+
}, e.id)), y > 5 && /* @__PURE__ */ s("p", {
|
|
60
69
|
className: "text-xs text-text-secondary text-center pt-1",
|
|
61
|
-
children:
|
|
70
|
+
children: t(_, "dashboard.workspaces.more", "+{count} more workspaces", { count: y - 5 })
|
|
62
71
|
})]
|
|
63
72
|
})
|
|
64
73
|
});
|
|
65
74
|
}
|
|
66
75
|
//#endregion
|
|
67
|
-
export {
|
|
76
|
+
export { m as WorkspacesWidget };
|