@burdenoff/microfe-workspaces 2026.1023.5 → 2026.1029.1
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,76 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
-
import { Badge as u, CardContent as d, CardHeader as f, CardTitle as p, GlassCard as m } from "@burdenoff/fe-libs/ui";
|
|
9
|
-
import { useNavigate as h } from "react-router";
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { getWorkspaceStatusClasses as t } from "../utils/tokenHelpers.js";
|
|
3
|
+
import { useOpenWorkspace as n } from "../hooks/useOpenWorkspace.js";
|
|
4
|
+
import { Building2 as r, FolderKanban as i, Users as a } from "lucide-react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { Badge as c, CardContent as l, CardHeader as u, CardTitle as d, GlassCard as f } from "@burdenoff/fe-libs/ui";
|
|
10
7
|
//#region src/components/WorkspaceCard.tsx
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
e && x(e), S(g.id), C(null), typeof g.tenantId == "string" && w(g.tenantId), v(b(`${y}/${g.id}`));
|
|
15
|
-
};
|
|
16
|
-
return /* @__PURE__ */ l(m, {
|
|
8
|
+
function p({ workspace: p }) {
|
|
9
|
+
let m = e(), h = n(), g = () => h(p);
|
|
10
|
+
return /* @__PURE__ */ s(f, {
|
|
17
11
|
treatment: "insight",
|
|
18
12
|
className: "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg/50",
|
|
19
|
-
onClick:
|
|
13
|
+
onClick: g,
|
|
20
14
|
onKeyDown: (e) => {
|
|
21
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
15
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), g());
|
|
22
16
|
},
|
|
23
17
|
role: "button",
|
|
24
18
|
tabIndex: 0,
|
|
25
|
-
"aria-label":
|
|
19
|
+
"aria-label": m("workspaceCard.openWorkspaceAriaLabel", "Open workspace {{name}}", { name: p.name }),
|
|
26
20
|
"data-tour": "workspaces-card",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
21
|
+
children: [/* @__PURE__ */ o(u, { children: /* @__PURE__ */ s("div", {
|
|
28
22
|
className: "flex items-center gap-3",
|
|
29
|
-
children: [/* @__PURE__ */
|
|
23
|
+
children: [/* @__PURE__ */ o("div", {
|
|
30
24
|
className: "p-3 rounded-lg bg-action-primary-bg/10 transition-colors",
|
|
31
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ o(r, {
|
|
32
26
|
className: "text-primary",
|
|
33
27
|
size: 24
|
|
34
28
|
})
|
|
35
|
-
}), /* @__PURE__ */
|
|
29
|
+
}), /* @__PURE__ */ s("div", {
|
|
36
30
|
className: "flex-1 min-w-0",
|
|
37
|
-
children: [/* @__PURE__ */
|
|
31
|
+
children: [/* @__PURE__ */ o(d, {
|
|
38
32
|
className: "text-lg truncate",
|
|
39
|
-
children:
|
|
40
|
-
}), /* @__PURE__ */
|
|
33
|
+
children: p.name
|
|
34
|
+
}), /* @__PURE__ */ o("div", {
|
|
41
35
|
className: "flex items-center gap-2 mt-1",
|
|
42
|
-
children: /* @__PURE__ */ c
|
|
43
|
-
className: `text-xs border ${
|
|
44
|
-
children:
|
|
36
|
+
children: /* @__PURE__ */ o(c, {
|
|
37
|
+
className: `text-xs border ${t(p.status)}`,
|
|
38
|
+
children: p.status
|
|
45
39
|
})
|
|
46
40
|
})]
|
|
47
41
|
})]
|
|
48
|
-
}) }), /* @__PURE__ */ l
|
|
42
|
+
}) }), /* @__PURE__ */ s(l, { children: [/* @__PURE__ */ s("div", {
|
|
49
43
|
className: "flex flex-wrap gap-4 text-sm text-text-secondary",
|
|
50
|
-
children: [typeof
|
|
44
|
+
children: [typeof p.memberCount == "number" && p.memberCount > 0 && /* @__PURE__ */ s("div", {
|
|
51
45
|
className: "flex items-center gap-1",
|
|
52
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ o(a, {
|
|
53
47
|
size: 16,
|
|
54
48
|
"aria-hidden": "true"
|
|
55
|
-
}), /* @__PURE__ */
|
|
56
|
-
count:
|
|
57
|
-
suffix:
|
|
49
|
+
}), /* @__PURE__ */ o("span", { children: m("workspaceCard.memberCount", "{{count}} member{{suffix}}", {
|
|
50
|
+
count: p.memberCount,
|
|
51
|
+
suffix: p.memberCount === 1 ? "" : "s"
|
|
58
52
|
}) })]
|
|
59
|
-
}), typeof
|
|
53
|
+
}), typeof p.projectCount == "number" && p.projectCount > 0 && /* @__PURE__ */ s("div", {
|
|
60
54
|
className: "flex items-center gap-1",
|
|
61
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ o(i, {
|
|
62
56
|
size: 16,
|
|
63
57
|
"aria-hidden": "true"
|
|
64
|
-
}), /* @__PURE__ */
|
|
65
|
-
count:
|
|
66
|
-
suffix:
|
|
58
|
+
}), /* @__PURE__ */ o("span", { children: m("workspaceCard.projectCount", "{{count}} project{{suffix}}", {
|
|
59
|
+
count: p.projectCount,
|
|
60
|
+
suffix: p.projectCount === 1 ? "" : "s"
|
|
67
61
|
}) })]
|
|
68
62
|
})]
|
|
69
|
-
}),
|
|
63
|
+
}), p.domain && /* @__PURE__ */ o("p", {
|
|
70
64
|
className: "mt-2 truncate text-xs text-text-muted",
|
|
71
|
-
children:
|
|
65
|
+
children: p.domain
|
|
72
66
|
})] })]
|
|
73
67
|
});
|
|
74
68
|
}
|
|
75
69
|
//#endregion
|
|
76
|
-
export {
|
|
70
|
+
export { p as WorkspaceCard };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface OpenableWorkspace {
|
|
2
|
+
id: string;
|
|
3
|
+
organizationId?: string | null;
|
|
4
|
+
/** The local Workspace type still names the organization field `orgId`. */
|
|
5
|
+
orgId?: string | null;
|
|
6
|
+
tenantId?: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkspaceSelectionSetters {
|
|
9
|
+
setOrganization: (organizationId: string | null) => void;
|
|
10
|
+
setWorkspace: (workspaceId: string | null) => void;
|
|
11
|
+
setProject: (projectId: string | null) => void;
|
|
12
|
+
setTenant: (tenantId: string | null) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Commits `workspace` as the active selection (BOFF-2821 G1, BOFF-7187).
|
|
16
|
+
*
|
|
17
|
+
* The workspace token and `x-workspace-id` follow the committed selection, and
|
|
18
|
+
* the workspace-layer `workspace(id)` resolver only answers for the workspace
|
|
19
|
+
* the request is scoped to. A detail page opened for any other workspace gets
|
|
20
|
+
* `null` back and renders "Workspace not found". Setting the selection also
|
|
21
|
+
* re-issues the token and syncs the `?workspace=…` query.
|
|
22
|
+
*/
|
|
23
|
+
export declare function commitWorkspaceSelection(setters: WorkspaceSelectionSetters, workspace: OpenableWorkspace): void;
|
|
24
|
+
/**
|
|
25
|
+
* Opens a workspace's detail page with that workspace committed as the active
|
|
26
|
+
* selection. Use it for every navigation into `/<workspaceId>`, including the
|
|
27
|
+
* redirect after a workspace is created.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useOpenWorkspace(): (workspace: OpenableWorkspace) => void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useWorkspacesContext as e } from "../providers/WorkspacesProvider.js";
|
|
2
|
+
import { useScopedNavigation as t } from "./useScopedNavigation.js";
|
|
3
|
+
import { useCallback as n } from "react";
|
|
4
|
+
import { useActiveContext as r } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
5
|
+
import { useNavigate as i } from "react-router";
|
|
6
|
+
//#region src/hooks/useOpenWorkspace.ts
|
|
7
|
+
function a(e, t) {
|
|
8
|
+
let n = t.organizationId ?? t.orgId;
|
|
9
|
+
n && e.setOrganization(n), e.setWorkspace(t.id), e.setProject(null), typeof t.tenantId == "string" && e.setTenant(t.tenantId);
|
|
10
|
+
}
|
|
11
|
+
function o() {
|
|
12
|
+
let o = i(), { basePath: s = "/" } = e(), { withCurrentSearch: c } = t(), { setOrganization: l, setWorkspace: u, setProject: d, setTenant: f } = r();
|
|
13
|
+
return n((e) => {
|
|
14
|
+
a({
|
|
15
|
+
setOrganization: l,
|
|
16
|
+
setWorkspace: u,
|
|
17
|
+
setProject: d,
|
|
18
|
+
setTenant: f
|
|
19
|
+
}, e), o(c(`${s}/${e.id}`));
|
|
20
|
+
}, [
|
|
21
|
+
s,
|
|
22
|
+
o,
|
|
23
|
+
l,
|
|
24
|
+
d,
|
|
25
|
+
f,
|
|
26
|
+
u,
|
|
27
|
+
c
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { o as useOpenWorkspace };
|
|
@@ -1,256 +1,257 @@
|
|
|
1
1
|
import { useWorkspacesContext as e } from "../providers/WorkspacesProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useOpenWorkspace as t } from "../hooks/useOpenWorkspace.js";
|
|
3
|
+
import { tWithFallback as n } from "../utils/i18n.js";
|
|
4
|
+
import { useWorkspacesPageView as r } from "../hooks/useWorkspacesPageView.js";
|
|
4
5
|
import { useCreateWorkspace as ee } from "../hooks/useWorkspaceMutations.js";
|
|
5
|
-
import { useMyOrganizations as
|
|
6
|
-
import { generateSlug as
|
|
7
|
-
import { useOrgsWithPermission as
|
|
8
|
-
import { useEffect as
|
|
9
|
-
import { AlertCircle as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { Button as
|
|
12
|
-
import { useI18n as
|
|
13
|
-
import { Link as b, useNavigate as
|
|
14
|
-
import { useUpgradePrompt as
|
|
15
|
-
import { AccessDenied as
|
|
16
|
-
import { useForm as
|
|
6
|
+
import { useMyOrganizations as te, useMyTenants as i } from "../hooks/useTenants.js";
|
|
7
|
+
import { generateSlug as a } from "../utils/slug.js";
|
|
8
|
+
import { useOrgsWithPermission as o } from "../hooks/useOrgsWithPermission.js";
|
|
9
|
+
import { useEffect as s, useMemo as c } from "react";
|
|
10
|
+
import { AlertCircle as l, ArrowLeft as u } from "lucide-react";
|
|
11
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
12
|
+
import { Button as p, CardContent as m, CardDescription as h, CardHeader as g, CardTitle as _, GlassCard as v, PagePurpose as ne, Skeleton as y } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { useI18n as re } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
14
|
+
import { Link as b, useNavigate as ie } from "react-router";
|
|
15
|
+
import { useUpgradePrompt as ae } from "@burdenoff/fe-libs/shared/hooks";
|
|
16
|
+
import { AccessDenied as oe, UpgradeInlineBanner as x } from "@burdenoff/fe-libs/shared/components";
|
|
17
|
+
import { useForm as S, z as C } from "@burdenoff/fe-libs/form";
|
|
17
18
|
//#region src/pages/CreateWorkspacePage.tsx
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
let { t:
|
|
21
|
-
name:
|
|
22
|
-
slug:
|
|
23
|
-
tenantId:
|
|
24
|
-
organizationId:
|
|
25
|
-
}), [
|
|
26
|
-
schema:
|
|
19
|
+
function w() {
|
|
20
|
+
r("workspaces.create");
|
|
21
|
+
let { t: w } = re(), { isFree: T, approachingLimits: E, plan: D } = ae({ resource: "workspaces" }), O = E[0], k = !!O && typeof O.limit == "number" && O.current >= O.limit, A = T && !!O, j = c(() => C.object({
|
|
22
|
+
name: C.string().min(2, n(w, "createWorkspace.validation.nameMin", "Name must be at least 2 characters")).max(100),
|
|
23
|
+
slug: C.string().min(2, n(w, "createWorkspace.validation.slugMin", "Slug must be at least 2 characters")).max(50).regex(/^[a-z0-9-]+$/, n(w, "createWorkspace.validation.slugFormat", "Slug can only contain lowercase letters, numbers, and hyphens")),
|
|
24
|
+
tenantId: C.string().min(1, n(w, "createWorkspace.validation.tenantRequired", "Please select a tenant")),
|
|
25
|
+
organizationId: C.string().min(1, n(w, "createWorkspace.validation.organizationRequired", "Please select an organization"))
|
|
26
|
+
}), [w]), M = ie(), { basePath: N = "/" } = e(), { mutate: P, isPending: F } = ee(), I = t(), { data: L, isLoading: R, error: z } = i(), { data: B, isLoading: V, error: H } = te(), U = c(() => L?.items ?? [], [L]), W = c(() => B?.items ?? [], [B]), G = c(() => U.find((e) => e.type === "SHARED" || e.slug === "burdenoff-shared")?.id ?? U[0]?.id ?? "", [U]), K = S({
|
|
27
|
+
schema: j,
|
|
27
28
|
defaultValues: {
|
|
28
29
|
name: "",
|
|
29
30
|
slug: "",
|
|
30
31
|
tenantId: "",
|
|
31
32
|
organizationId: ""
|
|
32
33
|
}
|
|
33
|
-
}), q = K.watch("tenantId"), J = K.watch("name"), { allowedIds: Y, loading: X, isError: Z } =
|
|
34
|
+
}), q = K.watch("tenantId"), J = K.watch("name"), { allowedIds: Y, loading: X, isError: Z } = o(c(() => W.map((e) => e.id), [W]), "workspace", "create"), Q = c(() => q ? W.filter((e) => e.tenantId === q) : [], [q, W]), $ = c(() => Z ? Q : Q.filter((e) => Y.has(e.id)), [
|
|
34
35
|
Q,
|
|
35
36
|
Y,
|
|
36
37
|
Z
|
|
37
38
|
]);
|
|
38
|
-
|
|
39
|
-
K.setValue("slug", J ?
|
|
40
|
-
}, [J, K]),
|
|
39
|
+
s(() => {
|
|
40
|
+
K.setValue("slug", J ? a(J) : "");
|
|
41
|
+
}, [J, K]), s(() => {
|
|
41
42
|
K.setValue("organizationId", "");
|
|
42
|
-
}, [q, K]),
|
|
43
|
+
}, [q, K]), s(() => {
|
|
43
44
|
!K.getValues("tenantId") && G && K.setValue("tenantId", G, {
|
|
44
45
|
shouldDirty: !1,
|
|
45
46
|
shouldTouch: !1
|
|
46
47
|
});
|
|
47
|
-
}, [G, K]),
|
|
48
|
+
}, [G, K]), s(() => {
|
|
48
49
|
let e = K.getValues("organizationId");
|
|
49
50
|
!$.some((t) => t.id === e) && $[0]?.id && K.setValue("organizationId", $[0].id, {
|
|
50
51
|
shouldDirty: !1,
|
|
51
52
|
shouldTouch: !1
|
|
52
53
|
});
|
|
53
54
|
}, [$, K]);
|
|
54
|
-
let
|
|
55
|
-
|
|
55
|
+
let se = (e) => {
|
|
56
|
+
P({
|
|
56
57
|
name: e.name,
|
|
57
58
|
slug: e.slug,
|
|
58
59
|
tenantId: e.tenantId,
|
|
59
60
|
organizationId: e.organizationId
|
|
60
61
|
}, { onSuccess: (e) => {
|
|
61
|
-
|
|
62
|
+
I(e);
|
|
62
63
|
} });
|
|
63
|
-
},
|
|
64
|
-
return !
|
|
64
|
+
}, ce = Y.size > 0, le = R || V || X, ue = !z && !H && W.length > 0;
|
|
65
|
+
return !le && !Z && ue && !ce ? /* @__PURE__ */ f("div", {
|
|
65
66
|
className: "p-6",
|
|
66
|
-
children: [/* @__PURE__ */
|
|
67
|
-
to: `${
|
|
67
|
+
children: [/* @__PURE__ */ f(b, {
|
|
68
|
+
to: `${N}/list`,
|
|
68
69
|
className: "inline-flex items-center gap-2 text-text-secondary hover:text-text-primary transition-colors mb-6",
|
|
69
|
-
children: [/* @__PURE__ */ u
|
|
70
|
-
}), /* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ d(u, { size: 20 }), n(w, "createWorkspace.backToWorkspaces", "Back to Workspaces")]
|
|
71
|
+
}), /* @__PURE__ */ d(oe, {
|
|
71
72
|
variant: "card",
|
|
72
|
-
title:
|
|
73
|
-
description:
|
|
74
|
-
details:
|
|
73
|
+
title: n(w, "createWorkspace.permissionRequiredTitle", "Permission Required"),
|
|
74
|
+
description: n(w, "createWorkspace.permissionRequiredDescription", "You don't have permission to create workspaces in any of your organizations."),
|
|
75
|
+
details: n(w, "createWorkspace.permissionRequiredDetails", "Required: workspace:create"),
|
|
75
76
|
primaryAction: {
|
|
76
|
-
label:
|
|
77
|
-
onClick: () =>
|
|
77
|
+
label: n(w, "createWorkspace.goBack", "Go Back"),
|
|
78
|
+
onClick: () => M(`${N}/list`)
|
|
78
79
|
}
|
|
79
80
|
})]
|
|
80
|
-
}) : /* @__PURE__ */
|
|
81
|
+
}) : /* @__PURE__ */ f("div", {
|
|
81
82
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6",
|
|
82
83
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
to: `${
|
|
84
|
+
/* @__PURE__ */ f(b, {
|
|
85
|
+
to: `${N}/list`,
|
|
85
86
|
className: "inline-flex items-center gap-2 text-text-secondary hover:text-text-primary transition-colors",
|
|
86
|
-
children: [/* @__PURE__ */ u
|
|
87
|
+
children: [/* @__PURE__ */ d(u, { size: 20 }), n(w, "createWorkspace.backToWorkspaces", "Back to Workspaces")]
|
|
87
88
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ d("div", {
|
|
89
90
|
className: "max-w-2xl mx-auto w-full",
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
+
children: /* @__PURE__ */ d(ne, { children: n(w, "createWorkspace.purpose", "Create a workspace to give a team, client or initiative its own dedicated space — with its own projects, members, agents and activity, kept separate from the rest. Give it a clear name, pick the organization that owns it, and you can invite people and add projects right after.") })
|
|
91
92
|
}),
|
|
92
|
-
|
|
93
|
+
A && /* @__PURE__ */ d("div", {
|
|
93
94
|
className: "max-w-2xl mx-auto w-full",
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ d(x, {
|
|
95
96
|
resource: "workspaces",
|
|
96
|
-
current:
|
|
97
|
-
limit:
|
|
98
|
-
severity:
|
|
99
|
-
message:
|
|
97
|
+
current: O.current,
|
|
98
|
+
limit: O.limit ?? void 0,
|
|
99
|
+
severity: k ? "critical" : void 0,
|
|
100
|
+
message: k ? n(w, "createWorkspace.upgradeCapMessage", `You've used all workspaces in the ${D?.planName ?? "free"} plan.`) : n(w, "createWorkspace.upgradeApproachingMessage", "Upgrade to create more workspaces.")
|
|
100
101
|
})
|
|
101
102
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ f(v, {
|
|
103
104
|
treatment: "glass",
|
|
104
105
|
glow: !0,
|
|
105
106
|
className: "max-w-2xl mx-auto border-border-seam",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ f(g, { children: [/* @__PURE__ */ d(_, { children: n(w, "createWorkspace.title", "Create New Workspace") }), /* @__PURE__ */ d(h, { children: n(w, "createWorkspace.subtitle", "Set up a new workspace for your team") })] }), /* @__PURE__ */ f(m, { children: [Z && /* @__PURE__ */ f("div", {
|
|
107
108
|
role: "alert",
|
|
108
109
|
className: "mb-4 flex items-start gap-2 rounded-md border border-warning/30 bg-warning/10 p-3 text-sm text-text-primary",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ d(l, {
|
|
110
111
|
size: 16,
|
|
111
112
|
className: "mt-0.5 shrink-0 text-warning"
|
|
112
|
-
}), /* @__PURE__ */
|
|
113
|
-
}), /* @__PURE__ */
|
|
114
|
-
onSubmit: K.handleSubmit(
|
|
113
|
+
}), /* @__PURE__ */ d("span", { children: n(w, "createWorkspace.permissionCheckUnavailable", "We couldn't verify your workspace-create permissions just now, so the organization list isn't filtered. If you submit and don't have access, the request will be rejected and you can retry.") })]
|
|
114
|
+
}), /* @__PURE__ */ f("form", {
|
|
115
|
+
onSubmit: K.handleSubmit(se),
|
|
115
116
|
className: "space-y-6",
|
|
116
117
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ f("div", {
|
|
118
119
|
className: "space-y-2",
|
|
119
120
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ d("label", {
|
|
121
122
|
htmlFor: "workspace-name",
|
|
122
123
|
className: "text-sm font-medium text-text-primary",
|
|
123
|
-
children:
|
|
124
|
+
children: n(w, "createWorkspace.nameLabel", "Workspace Name *")
|
|
124
125
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ d("input", {
|
|
126
127
|
id: "workspace-name",
|
|
127
|
-
placeholder:
|
|
128
|
+
placeholder: n(w, "createWorkspace.namePlaceholder", "My Workspace"),
|
|
128
129
|
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
129
130
|
...K.register("name")
|
|
130
131
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ d("p", {
|
|
132
133
|
className: "text-xs text-text-secondary",
|
|
133
|
-
children:
|
|
134
|
+
children: n(w, "createWorkspace.nameHint", "A descriptive name for your workspace")
|
|
134
135
|
}),
|
|
135
|
-
K.formState.errors.name?.message && /* @__PURE__ */
|
|
136
|
+
K.formState.errors.name?.message && /* @__PURE__ */ d("p", {
|
|
136
137
|
className: "text-sm text-status-error-text",
|
|
137
138
|
children: K.formState.errors.name.message
|
|
138
139
|
})
|
|
139
140
|
]
|
|
140
141
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ f("div", {
|
|
142
143
|
className: "space-y-2",
|
|
143
144
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ d("label", {
|
|
145
146
|
htmlFor: "workspace-slug",
|
|
146
147
|
className: "text-sm font-medium text-text-primary",
|
|
147
|
-
children:
|
|
148
|
+
children: n(w, "createWorkspace.slugLabel", "Slug *")
|
|
148
149
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ d("input", {
|
|
150
151
|
id: "workspace-slug",
|
|
151
|
-
placeholder:
|
|
152
|
+
placeholder: n(w, "createWorkspace.slugPlaceholder", "my-workspace"),
|
|
152
153
|
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
153
154
|
...K.register("slug")
|
|
154
155
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ d("p", {
|
|
156
157
|
className: "text-xs text-text-secondary",
|
|
157
|
-
children:
|
|
158
|
+
children: n(w, "createWorkspace.slugHint", "URL-friendly identifier (auto-generated, but you can edit it)")
|
|
158
159
|
}),
|
|
159
|
-
K.formState.errors.slug?.message && /* @__PURE__ */
|
|
160
|
+
K.formState.errors.slug?.message && /* @__PURE__ */ d("p", {
|
|
160
161
|
className: "text-sm text-status-error-text",
|
|
161
162
|
children: K.formState.errors.slug.message
|
|
162
163
|
})
|
|
163
164
|
]
|
|
164
165
|
}),
|
|
165
|
-
U.length === 1 ? null : /* @__PURE__ */
|
|
166
|
+
U.length === 1 ? null : /* @__PURE__ */ f("div", {
|
|
166
167
|
className: "space-y-2",
|
|
167
168
|
children: [
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ d("label", {
|
|
169
170
|
htmlFor: "workspace-tenant",
|
|
170
171
|
className: "text-sm font-medium text-text-primary",
|
|
171
|
-
children:
|
|
172
|
+
children: n(w, "createWorkspace.tenantLabel", "Tenant *")
|
|
172
173
|
}),
|
|
173
|
-
R ? /* @__PURE__ */
|
|
174
|
+
R ? /* @__PURE__ */ d(y, { className: "h-10 w-full" }) : z ? /* @__PURE__ */ f("div", {
|
|
174
175
|
className: "flex items-center gap-2 text-sm text-status-error-text",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
176
|
-
}) : U.length === 0 ? /* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ d(l, { size: 16 }), n(w, "createWorkspace.failedToLoadTenants", "Failed to load tenants")]
|
|
177
|
+
}) : U.length === 0 ? /* @__PURE__ */ d("div", {
|
|
177
178
|
className: "text-sm text-text-secondary",
|
|
178
|
-
children:
|
|
179
|
-
}) : /* @__PURE__ */
|
|
179
|
+
children: n(w, "createWorkspace.noTenantsAvailable", "No tenants available. Contact your administrator.")
|
|
180
|
+
}) : /* @__PURE__ */ f("select", {
|
|
180
181
|
id: "workspace-tenant",
|
|
181
182
|
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
182
183
|
...K.register("tenantId"),
|
|
183
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ d("option", {
|
|
184
185
|
value: "",
|
|
185
|
-
children:
|
|
186
|
-
}), U.map((e) => /* @__PURE__ */
|
|
186
|
+
children: n(w, "createWorkspace.selectTenantPlaceholder", "Select a tenant")
|
|
187
|
+
}), U.map((e) => /* @__PURE__ */ d("option", {
|
|
187
188
|
value: e.id,
|
|
188
189
|
children: e.name
|
|
189
190
|
}, e.id))]
|
|
190
191
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ d("p", {
|
|
192
193
|
className: "text-xs text-text-secondary",
|
|
193
|
-
children:
|
|
194
|
+
children: n(w, "createWorkspace.tenantHint", "Select which tenant this workspace belongs to")
|
|
194
195
|
}),
|
|
195
|
-
K.formState.errors.tenantId?.message && /* @__PURE__ */
|
|
196
|
+
K.formState.errors.tenantId?.message && /* @__PURE__ */ d("p", {
|
|
196
197
|
className: "text-sm text-status-error-text",
|
|
197
198
|
children: K.formState.errors.tenantId.message
|
|
198
199
|
})
|
|
199
200
|
]
|
|
200
201
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ f("div", {
|
|
202
203
|
className: "space-y-2",
|
|
203
204
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ d("label", {
|
|
205
206
|
htmlFor: "workspace-organization",
|
|
206
207
|
className: "text-sm font-medium text-text-primary",
|
|
207
|
-
children:
|
|
208
|
+
children: n(w, "createWorkspace.organizationLabel", "Organization *")
|
|
208
209
|
}),
|
|
209
|
-
V || X ? /* @__PURE__ */
|
|
210
|
+
V || X ? /* @__PURE__ */ d(y, { className: "h-10 w-full" }) : H ? /* @__PURE__ */ f("div", {
|
|
210
211
|
className: "flex items-center gap-2 text-sm text-status-error-text",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
212
|
-
}) : q ? $.length === 0 ? /* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ d(l, { size: 16 }), n(w, "createWorkspace.failedToLoadOrganizations", "Failed to load organizations")]
|
|
213
|
+
}) : q ? $.length === 0 ? /* @__PURE__ */ d("div", {
|
|
213
214
|
className: "text-sm text-text-secondary",
|
|
214
|
-
children:
|
|
215
|
-
}) : /* @__PURE__ */
|
|
215
|
+
children: n(w, "createWorkspace.noOrganizationsFound", "No organizations found for this tenant")
|
|
216
|
+
}) : /* @__PURE__ */ f("select", {
|
|
216
217
|
id: "workspace-organization",
|
|
217
218
|
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
218
219
|
disabled: !q,
|
|
219
220
|
...K.register("organizationId"),
|
|
220
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ d("option", {
|
|
221
222
|
value: "",
|
|
222
|
-
children:
|
|
223
|
-
}), $.map((e) => /* @__PURE__ */
|
|
223
|
+
children: n(w, "createWorkspace.selectOrganizationPlaceholder", "Select an organization")
|
|
224
|
+
}), $.map((e) => /* @__PURE__ */ d("option", {
|
|
224
225
|
value: e.id,
|
|
225
226
|
children: e.name
|
|
226
227
|
}, e.id))]
|
|
227
|
-
}) : /* @__PURE__ */
|
|
228
|
+
}) : /* @__PURE__ */ d("div", {
|
|
228
229
|
className: "text-sm text-text-secondary",
|
|
229
|
-
children:
|
|
230
|
+
children: n(w, "createWorkspace.selectTenantFirst", "Please select a tenant first")
|
|
230
231
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ d("p", {
|
|
232
233
|
className: "text-xs text-text-secondary",
|
|
233
|
-
children:
|
|
234
|
+
children: n(w, "createWorkspace.organizationHint", "Select which organization owns this workspace")
|
|
234
235
|
}),
|
|
235
|
-
K.formState.errors.organizationId?.message && /* @__PURE__ */
|
|
236
|
+
K.formState.errors.organizationId?.message && /* @__PURE__ */ d("p", {
|
|
236
237
|
className: "text-sm text-status-error-text",
|
|
237
238
|
children: K.formState.errors.organizationId.message
|
|
238
239
|
})
|
|
239
240
|
]
|
|
240
241
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ f("div", {
|
|
242
243
|
className: "flex justify-end gap-3 pt-4",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ d(p, {
|
|
244
245
|
type: "button",
|
|
245
246
|
variant: "outline",
|
|
246
|
-
onClick: () =>
|
|
247
|
-
disabled:
|
|
248
|
-
children:
|
|
249
|
-
}), /* @__PURE__ */
|
|
247
|
+
onClick: () => M(`${N}/list`),
|
|
248
|
+
disabled: F,
|
|
249
|
+
children: n(w, "createWorkspace.cancel", "Cancel")
|
|
250
|
+
}), /* @__PURE__ */ d(p, {
|
|
250
251
|
type: "submit",
|
|
251
|
-
disabled:
|
|
252
|
-
title:
|
|
253
|
-
children:
|
|
252
|
+
disabled: F || R || V || X || k,
|
|
253
|
+
title: k ? n(w, "createWorkspace.disabledAtCap", "Workspace limit reached — upgrade your plan to create more.") : void 0,
|
|
254
|
+
children: F ? n(w, "createWorkspace.creating", "Creating...") : n(w, "createWorkspace.submit", "Create Workspace")
|
|
254
255
|
})]
|
|
255
256
|
})
|
|
256
257
|
]
|
|
@@ -260,4 +261,4 @@ function D() {
|
|
|
260
261
|
});
|
|
261
262
|
}
|
|
262
263
|
//#endregion
|
|
263
|
-
export {
|
|
264
|
+
export { w as CreateWorkspacePage };
|