@burdenoff/microfe-organization 2026.519.1 → 2026.521.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.
- package/dist/generated/global-operations.d.ts +41 -0
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +39 -30
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.js +3 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/organization-management/AdminOrganizationRoutes.d.ts.map +1 -1
- package/dist/organization-management/AdminOrganizationRoutes.js +62 -45
- package/dist/organization-management/AdminOrganizationRoutes.js.map +1 -1
- package/dist/organization-management/UserOrganizationRoutes.d.ts.map +1 -1
- package/dist/organization-management/UserOrganizationRoutes.js +60 -43
- package/dist/organization-management/UserOrganizationRoutes.js.map +1 -1
- package/dist/organization-management/modules/members/components/PendingInvitesList.d.ts.map +1 -1
- package/dist/organization-management/modules/members/components/PendingInvitesList.js +70 -67
- package/dist/organization-management/modules/members/components/PendingInvitesList.js.map +1 -1
- package/dist/organization-management/modules/members/hooks/useInvites.d.ts +7 -2
- package/dist/organization-management/modules/members/hooks/useInvites.d.ts.map +1 -1
- package/dist/organization-management/modules/members/hooks/useInvites.js +9 -8
- package/dist/organization-management/modules/members/hooks/useInvites.js.map +1 -1
- package/dist/organization-management/modules/members/pages/InviteMemberPage.d.ts.map +1 -1
- package/dist/organization-management/modules/members/pages/InviteMemberPage.js +48 -47
- package/dist/organization-management/modules/members/pages/InviteMemberPage.js.map +1 -1
- package/dist/organization-management/modules/members/pages/MyInvitesPage.js +8 -8
- package/dist/organization-management/modules/organizations/hooks/useOrgsWithPermission.d.ts +26 -0
- package/dist/organization-management/modules/organizations/hooks/useOrgsWithPermission.d.ts.map +1 -0
- package/dist/organization-management/modules/organizations/hooks/useOrgsWithPermission.js +63 -0
- package/dist/organization-management/modules/organizations/hooks/useOrgsWithPermission.js.map +1 -0
- package/dist/organization-management/modules/organizations/pages/OrganizationDetailPage.d.ts.map +1 -1
- package/dist/organization-management/modules/organizations/pages/OrganizationDetailPage.js +5 -5
- package/dist/organization-management/modules/organizations/pages/OrganizationDetailPage.js.map +1 -1
- package/dist/organization-management/modules/organizations/pages/OrganizationsListPage.d.ts.map +1 -1
- package/dist/organization-management/modules/organizations/pages/OrganizationsListPage.js +226 -202
- package/dist/organization-management/modules/organizations/pages/OrganizationsListPage.js.map +1 -1
- package/dist/organization-management/modules/workspaces/components/WorkspaceForm.d.ts.map +1 -1
- package/dist/organization-management/modules/workspaces/components/WorkspaceForm.js +152 -147
- package/dist/organization-management/modules/workspaces/components/WorkspaceForm.js.map +1 -1
- package/dist/organization-management/modules/workspaces/pages/WorkspaceCreatePage.d.ts.map +1 -1
- package/dist/organization-management/modules/workspaces/pages/WorkspaceCreatePage.js +39 -46
- package/dist/organization-management/modules/workspaces/pages/WorkspaceCreatePage.js.map +1 -1
- package/dist/organization-management/modules/workspaces/pages/WorkspacesListPage.d.ts.map +1 -1
- package/dist/organization-management/modules/workspaces/pages/WorkspacesListPage.js +3 -3
- package/dist/organization-management/modules/workspaces/pages/WorkspacesListPage.js.map +1 -1
- package/dist/organization-management/providers/OrgScopedPermissions.d.ts +22 -0
- package/dist/organization-management/providers/OrgScopedPermissions.d.ts.map +1 -0
- package/dist/organization-management/providers/OrgScopedPermissions.js +14 -0
- package/dist/organization-management/providers/OrgScopedPermissions.js.map +1 -0
- package/package.json +6 -4
|
@@ -3,107 +3,112 @@ import { useTr as t } from "../../../shared/hooks/useTr.js";
|
|
|
3
3
|
import { useTenants as n } from "../hooks/useWorkspaces.js";
|
|
4
4
|
import { ZodError as r } from "../../../../node_modules/zod/v3/ZodError.js";
|
|
5
5
|
import { createWorkspaceSchema as i, updateWorkspaceSchema as a } from "../schemas/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { useOrgsWithPermission as o } from "../../organizations/hooks/useOrgsWithPermission.js";
|
|
7
|
+
import { useEffect as s, useMemo as c, useState as l } from "react";
|
|
8
|
+
import { Building as u, Home as d, Loader2 as f } from "lucide-react";
|
|
9
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
10
|
//#region src/organization-management/modules/workspaces/components/WorkspaceForm.tsx
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
name:
|
|
13
|
-
slug:
|
|
14
|
-
type:
|
|
15
|
-
tenantId:
|
|
16
|
-
organizationId:
|
|
17
|
-
}), [
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
function g({ workspace: g, tenantId: _, tenantName: v, organizationId: y, organizationName: b, showOrganizationSelector: x = !1, onSubmit: S, onCancel: C, loading: w }) {
|
|
12
|
+
let T = t(), [E, D] = l({
|
|
13
|
+
name: g?.name || "",
|
|
14
|
+
slug: g?.slug || "",
|
|
15
|
+
type: g?.type || "PERSONAL",
|
|
16
|
+
tenantId: _ || g?.tenantId || "",
|
|
17
|
+
organizationId: y || g?.organizationId || ""
|
|
18
|
+
}), [O, k] = l({}), A = !g && x && !_, j = !g && x && !y, { tenants: M, loading: N } = n(100, 0, A), { organizations: P, loading: F } = e(E.tenantId ? { tenantId: E.tenantId } : void 0, 100, 0, j), { allowedIds: I, loading: L } = o(c(() => P.map((e) => e.id), [P]), "workspace", "create"), R = !g && x && !y, z = c(() => R ? P.filter((e) => I.has(e.id)) : P, [
|
|
19
|
+
P,
|
|
20
|
+
I,
|
|
21
|
+
R
|
|
22
|
+
]);
|
|
23
|
+
s(() => {
|
|
24
|
+
_ && _ !== E.tenantId && D((e) => ({
|
|
20
25
|
...e,
|
|
21
|
-
tenantId:
|
|
26
|
+
tenantId: _
|
|
22
27
|
}));
|
|
23
|
-
}, [
|
|
24
|
-
|
|
28
|
+
}, [E.tenantId, _]), s(() => {
|
|
29
|
+
y && y !== E.organizationId && D((e) => ({
|
|
25
30
|
...e,
|
|
26
|
-
organizationId:
|
|
31
|
+
organizationId: y
|
|
27
32
|
}));
|
|
28
|
-
}, [
|
|
29
|
-
!
|
|
33
|
+
}, [E.organizationId, y]), s(() => {
|
|
34
|
+
!x || y || g || D((e) => !e.organizationId || z.some((t) => t.id === e.organizationId) ? e : {
|
|
30
35
|
...e,
|
|
31
36
|
organizationId: ""
|
|
32
37
|
});
|
|
33
38
|
}, [
|
|
39
|
+
y,
|
|
40
|
+
z,
|
|
41
|
+
x,
|
|
42
|
+
g
|
|
43
|
+
]);
|
|
44
|
+
let B = c(() => v || (M.find((e) => e.id === E.tenantId)?.name ?? E.tenantId), [
|
|
45
|
+
E.tenantId,
|
|
34
46
|
v,
|
|
35
|
-
|
|
47
|
+
M
|
|
48
|
+
]), V = c(() => b || (z.find((e) => e.id === E.organizationId)?.name ?? E.organizationId), [
|
|
49
|
+
E.organizationId,
|
|
36
50
|
b,
|
|
37
|
-
|
|
38
|
-
])
|
|
39
|
-
let F = s(() => _ || (j.find((e) => e.id === T.tenantId)?.name ?? T.tenantId), [
|
|
40
|
-
T.tenantId,
|
|
41
|
-
_,
|
|
42
|
-
j
|
|
43
|
-
]), I = s(() => y || (N.find((e) => e.id === T.organizationId)?.name ?? T.organizationId), [
|
|
44
|
-
T.organizationId,
|
|
45
|
-
y,
|
|
46
|
-
N
|
|
47
|
-
]), L = () => {
|
|
51
|
+
z
|
|
52
|
+
]), H = () => {
|
|
48
53
|
try {
|
|
49
|
-
return (
|
|
54
|
+
return (g ? a : i).parse(E), k({}), !0;
|
|
50
55
|
} catch (e) {
|
|
51
56
|
if (e instanceof r) {
|
|
52
57
|
let t = {};
|
|
53
58
|
e.issues.forEach((e) => {
|
|
54
59
|
let n = e.path.join(".");
|
|
55
60
|
t[n] = e.message;
|
|
56
|
-
}),
|
|
61
|
+
}), k(t);
|
|
57
62
|
}
|
|
58
63
|
return !1;
|
|
59
64
|
}
|
|
60
65
|
};
|
|
61
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ h("form", {
|
|
62
67
|
onSubmit: async (e) => {
|
|
63
|
-
e.preventDefault(),
|
|
64
|
-
name:
|
|
65
|
-
type:
|
|
68
|
+
e.preventDefault(), H() && await S(g ? {
|
|
69
|
+
name: E.name === g.name ? void 0 : E.name,
|
|
70
|
+
type: E.type === g.type ? void 0 : E.type
|
|
66
71
|
} : {
|
|
67
|
-
tenantId:
|
|
68
|
-
organizationId:
|
|
69
|
-
name:
|
|
70
|
-
slug:
|
|
71
|
-
type:
|
|
72
|
+
tenantId: E.tenantId,
|
|
73
|
+
organizationId: E.organizationId,
|
|
74
|
+
name: E.name,
|
|
75
|
+
slug: E.slug,
|
|
76
|
+
type: E.type || void 0
|
|
72
77
|
});
|
|
73
78
|
},
|
|
74
79
|
className: "space-y-6",
|
|
75
80
|
children: [
|
|
76
|
-
|
|
77
|
-
/* @__PURE__ */
|
|
81
|
+
g ? null : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", { children: [
|
|
82
|
+
/* @__PURE__ */ h("label", {
|
|
78
83
|
htmlFor: "tenantId",
|
|
79
84
|
className: "mb-1 block text-sm font-medium text-[var(--color-text-primary)]",
|
|
80
85
|
children: [
|
|
81
|
-
|
|
86
|
+
T("organizations.form.tenant", "Tenant"),
|
|
82
87
|
" ",
|
|
83
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ m("span", {
|
|
84
89
|
className: "text-[var(--color-status-error-text)]",
|
|
85
90
|
children: "*"
|
|
86
91
|
})
|
|
87
92
|
]
|
|
88
93
|
}),
|
|
89
|
-
|
|
94
|
+
x && !_ ? /* @__PURE__ */ h("div", {
|
|
90
95
|
className: "relative",
|
|
91
96
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ h("select", {
|
|
93
98
|
id: "tenantId",
|
|
94
|
-
value:
|
|
95
|
-
onChange: (e) =>
|
|
99
|
+
value: E.tenantId,
|
|
100
|
+
onChange: (e) => D((t) => ({
|
|
96
101
|
...t,
|
|
97
102
|
tenantId: e.target.value,
|
|
98
103
|
organizationId: ""
|
|
99
104
|
})),
|
|
100
105
|
className: "w-full appearance-none rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] py-2 pl-10 pr-10 text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] disabled:cursor-not-allowed disabled:bg-[var(--color-bg-muted)]",
|
|
101
|
-
disabled:
|
|
106
|
+
disabled: w || N,
|
|
102
107
|
required: !0,
|
|
103
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ m("option", {
|
|
104
109
|
value: "",
|
|
105
|
-
children:
|
|
106
|
-
}),
|
|
110
|
+
children: T("workspaces.form.selectTenant", "Select a tenant...")
|
|
111
|
+
}), M.map((e) => /* @__PURE__ */ h("option", {
|
|
107
112
|
value: e.id,
|
|
108
113
|
children: [
|
|
109
114
|
e.name,
|
|
@@ -113,18 +118,18 @@ function h({ workspace: h, tenantId: g, tenantName: _, organizationId: v, organi
|
|
|
113
118
|
]
|
|
114
119
|
}, e.id))]
|
|
115
120
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ m(d, {
|
|
117
122
|
size: 18,
|
|
118
123
|
className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"
|
|
119
124
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ m("div", {
|
|
121
126
|
className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]",
|
|
122
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ m("svg", {
|
|
123
128
|
className: "h-4 w-4",
|
|
124
129
|
fill: "none",
|
|
125
130
|
viewBox: "0 0 24 24",
|
|
126
131
|
stroke: "currentColor",
|
|
127
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ m("path", {
|
|
128
133
|
strokeLinecap: "round",
|
|
129
134
|
strokeLinejoin: "round",
|
|
130
135
|
strokeWidth: 2,
|
|
@@ -132,72 +137,72 @@ function h({ workspace: h, tenantId: g, tenantName: _, organizationId: v, organi
|
|
|
132
137
|
})
|
|
133
138
|
})
|
|
134
139
|
}),
|
|
135
|
-
|
|
140
|
+
N ? /* @__PURE__ */ m("div", {
|
|
136
141
|
className: "absolute right-10 top-1/2 -translate-y-1/2",
|
|
137
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ m(f, {
|
|
138
143
|
size: 16,
|
|
139
144
|
className: "animate-spin text-[var(--color-text-muted)]"
|
|
140
145
|
})
|
|
141
146
|
}) : null
|
|
142
147
|
]
|
|
143
|
-
}) : /* @__PURE__ */
|
|
148
|
+
}) : /* @__PURE__ */ h("div", {
|
|
144
149
|
className: "relative",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ m("input", {
|
|
146
151
|
id: "tenantId",
|
|
147
152
|
type: "text",
|
|
148
|
-
value:
|
|
149
|
-
onChange: (e) =>
|
|
153
|
+
value: B,
|
|
154
|
+
onChange: (e) => D((t) => ({
|
|
150
155
|
...t,
|
|
151
156
|
tenantId: e.target.value
|
|
152
157
|
})),
|
|
153
158
|
className: "w-full rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] py-2 pl-10 pr-4 text-[var(--color-text-primary)] placeholder:text-[var(--color-text-muted)] focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] disabled:cursor-not-allowed disabled:bg-[var(--color-bg-muted)]",
|
|
154
|
-
placeholder:
|
|
155
|
-
disabled:
|
|
159
|
+
placeholder: T("organizations.form.tenantPlaceholder", "Enter tenant ID"),
|
|
160
|
+
disabled: w || !!_,
|
|
156
161
|
required: !0,
|
|
157
162
|
autoComplete: "off"
|
|
158
|
-
}), /* @__PURE__ */
|
|
163
|
+
}), /* @__PURE__ */ m(d, {
|
|
159
164
|
size: 18,
|
|
160
165
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"
|
|
161
166
|
})]
|
|
162
167
|
}),
|
|
163
|
-
(
|
|
168
|
+
(_ || E.tenantId) && /* @__PURE__ */ m("p", {
|
|
164
169
|
className: "mt-1 text-xs text-[var(--color-text-muted)]",
|
|
165
|
-
children:
|
|
170
|
+
children: T("workspaces.form.creatingUnderTenant", "Creating workspace under the selected tenant.")
|
|
166
171
|
}),
|
|
167
|
-
|
|
172
|
+
O.tenantId ? /* @__PURE__ */ m("p", {
|
|
168
173
|
className: "mt-1 text-sm text-[var(--color-status-error-text)]",
|
|
169
|
-
children:
|
|
174
|
+
children: O.tenantId
|
|
170
175
|
}) : null
|
|
171
|
-
] }), /* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
176
|
+
] }), /* @__PURE__ */ h("div", { children: [
|
|
177
|
+
/* @__PURE__ */ h("label", {
|
|
173
178
|
htmlFor: "organizationId",
|
|
174
179
|
className: "mb-1 block text-sm font-medium text-[var(--color-text-primary)]",
|
|
175
180
|
children: [
|
|
176
|
-
|
|
181
|
+
T("common.organization", "Organization"),
|
|
177
182
|
" ",
|
|
178
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ m("span", {
|
|
179
184
|
className: "text-[var(--color-status-error-text)]",
|
|
180
185
|
children: "*"
|
|
181
186
|
})
|
|
182
187
|
]
|
|
183
188
|
}),
|
|
184
|
-
|
|
189
|
+
x && !y ? /* @__PURE__ */ h("div", {
|
|
185
190
|
className: "relative",
|
|
186
191
|
children: [
|
|
187
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ h("select", {
|
|
188
193
|
id: "organizationId",
|
|
189
|
-
value:
|
|
190
|
-
onChange: (e) =>
|
|
194
|
+
value: E.organizationId,
|
|
195
|
+
onChange: (e) => D((t) => ({
|
|
191
196
|
...t,
|
|
192
197
|
organizationId: e.target.value
|
|
193
198
|
})),
|
|
194
199
|
className: "w-full appearance-none rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] py-2 pl-10 pr-10 text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] disabled:cursor-not-allowed disabled:bg-[var(--color-bg-muted)]",
|
|
195
|
-
disabled:
|
|
200
|
+
disabled: w || F || L || !E.tenantId,
|
|
196
201
|
required: !0,
|
|
197
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ m("option", {
|
|
198
203
|
value: "",
|
|
199
|
-
children:
|
|
200
|
-
}),
|
|
204
|
+
children: E.tenantId ? z.length === 0 && !F && !L ? T("workspaces.form.noOrganizationsAvailable", "No organizations available — you need workspace create permission") : T("workspaces.form.selectOrganization", "Select an organization...") : T("workspaces.form.selectTenantFirst", "Select a tenant first")
|
|
205
|
+
}), z.map((e) => /* @__PURE__ */ h("option", {
|
|
201
206
|
value: e.id,
|
|
202
207
|
children: [
|
|
203
208
|
e.name,
|
|
@@ -207,18 +212,18 @@ function h({ workspace: h, tenantId: g, tenantName: _, organizationId: v, organi
|
|
|
207
212
|
]
|
|
208
213
|
}, e.id))]
|
|
209
214
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ m(u, {
|
|
211
216
|
size: 18,
|
|
212
217
|
className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"
|
|
213
218
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ m("div", {
|
|
215
220
|
className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]",
|
|
216
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ m("svg", {
|
|
217
222
|
className: "h-4 w-4",
|
|
218
223
|
fill: "none",
|
|
219
224
|
viewBox: "0 0 24 24",
|
|
220
225
|
stroke: "currentColor",
|
|
221
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ m("path", {
|
|
222
227
|
strokeLinecap: "round",
|
|
223
228
|
strokeLinejoin: "round",
|
|
224
229
|
strokeWidth: 2,
|
|
@@ -226,161 +231,161 @@ function h({ workspace: h, tenantId: g, tenantName: _, organizationId: v, organi
|
|
|
226
231
|
})
|
|
227
232
|
})
|
|
228
233
|
}),
|
|
229
|
-
|
|
234
|
+
F || L ? /* @__PURE__ */ m("div", {
|
|
230
235
|
className: "absolute right-10 top-1/2 -translate-y-1/2",
|
|
231
|
-
children: /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ m(f, {
|
|
232
237
|
size: 16,
|
|
233
238
|
className: "animate-spin text-[var(--color-text-muted)]"
|
|
234
239
|
})
|
|
235
240
|
}) : null
|
|
236
241
|
]
|
|
237
|
-
}) : /* @__PURE__ */
|
|
242
|
+
}) : /* @__PURE__ */ h("div", {
|
|
238
243
|
className: "relative",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ m("input", {
|
|
240
245
|
id: "organizationId",
|
|
241
246
|
type: "text",
|
|
242
|
-
value:
|
|
243
|
-
onChange: (e) =>
|
|
247
|
+
value: V,
|
|
248
|
+
onChange: (e) => D((t) => ({
|
|
244
249
|
...t,
|
|
245
250
|
organizationId: e.target.value
|
|
246
251
|
})),
|
|
247
252
|
className: "w-full rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] py-2 pl-10 pr-4 text-[var(--color-text-primary)] placeholder:text-[var(--color-text-muted)] focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] disabled:cursor-not-allowed disabled:bg-[var(--color-bg-muted)]",
|
|
248
|
-
placeholder:
|
|
249
|
-
disabled:
|
|
253
|
+
placeholder: T("workspaces.form.orgIdPlaceholder", "Enter organization ID"),
|
|
254
|
+
disabled: w || !!y,
|
|
250
255
|
required: !0,
|
|
251
256
|
autoComplete: "off"
|
|
252
|
-
}), /* @__PURE__ */
|
|
257
|
+
}), /* @__PURE__ */ m(u, {
|
|
253
258
|
size: 18,
|
|
254
259
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"
|
|
255
260
|
})]
|
|
256
261
|
}),
|
|
257
|
-
(
|
|
262
|
+
(y || E.organizationId) && /* @__PURE__ */ m("p", {
|
|
258
263
|
className: "mt-1 text-xs text-[var(--color-text-muted)]",
|
|
259
|
-
children:
|
|
264
|
+
children: T("workspaces.form.creatingUnderOrg", "Creating workspace under the selected organization.")
|
|
260
265
|
}),
|
|
261
|
-
|
|
266
|
+
O.organizationId ? /* @__PURE__ */ m("p", {
|
|
262
267
|
className: "mt-1 text-sm text-[var(--color-status-error-text)]",
|
|
263
|
-
children:
|
|
268
|
+
children: O.organizationId
|
|
264
269
|
}) : null
|
|
265
270
|
] })] }),
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ h("div", { children: [
|
|
272
|
+
/* @__PURE__ */ h("label", {
|
|
268
273
|
htmlFor: "name",
|
|
269
274
|
className: "mb-1 block text-sm font-medium text-[var(--color-text-primary)]",
|
|
270
275
|
children: [
|
|
271
|
-
|
|
276
|
+
T("workspaces.form.name", "Workspace Name"),
|
|
272
277
|
" ",
|
|
273
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ m("span", {
|
|
274
279
|
className: "text-[var(--color-status-error-text)]",
|
|
275
280
|
children: "*"
|
|
276
281
|
})
|
|
277
282
|
]
|
|
278
283
|
}),
|
|
279
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ m("input", {
|
|
280
285
|
id: "name",
|
|
281
286
|
type: "text",
|
|
282
|
-
value:
|
|
283
|
-
onChange: (e) =>
|
|
287
|
+
value: E.name,
|
|
288
|
+
onChange: (e) => D((t) => ({
|
|
284
289
|
...t,
|
|
285
290
|
name: e.target.value
|
|
286
291
|
})),
|
|
287
292
|
className: "w-full rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2 text-[var(--color-text-primary)] placeholder:text-[var(--color-text-muted)] focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] disabled:cursor-not-allowed disabled:bg-[var(--color-bg-muted)]",
|
|
288
|
-
placeholder:
|
|
289
|
-
disabled:
|
|
293
|
+
placeholder: T("workspaces.form.namePlaceholder", "Enter workspace name"),
|
|
294
|
+
disabled: w,
|
|
290
295
|
required: !0,
|
|
291
296
|
autoComplete: "organization-title"
|
|
292
297
|
}),
|
|
293
|
-
|
|
298
|
+
O.name ? /* @__PURE__ */ m("p", {
|
|
294
299
|
className: "mt-1 text-sm text-[var(--color-status-error-text)]",
|
|
295
|
-
children:
|
|
300
|
+
children: O.name
|
|
296
301
|
}) : null
|
|
297
302
|
] }),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ h("div", { children: [
|
|
304
|
+
/* @__PURE__ */ h("label", {
|
|
300
305
|
htmlFor: "slug",
|
|
301
306
|
className: "mb-1 block text-sm font-medium text-[var(--color-text-primary)]",
|
|
302
307
|
children: [
|
|
303
|
-
|
|
308
|
+
T("common.slug", "Slug"),
|
|
304
309
|
" ",
|
|
305
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ m("span", {
|
|
306
311
|
className: "text-[var(--color-status-error-text)]",
|
|
307
312
|
children: "*"
|
|
308
313
|
})
|
|
309
314
|
]
|
|
310
315
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ m("input", {
|
|
312
317
|
id: "slug",
|
|
313
318
|
type: "text",
|
|
314
|
-
value:
|
|
315
|
-
onChange: (e) =>
|
|
319
|
+
value: E.slug,
|
|
320
|
+
onChange: (e) => D((t) => ({
|
|
316
321
|
...t,
|
|
317
322
|
slug: e.target.value.toLowerCase().replace(/\s+/g, "-")
|
|
318
323
|
})),
|
|
319
324
|
className: "w-full rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2 text-[var(--color-text-primary)] placeholder:text-[var(--color-text-muted)] focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] disabled:cursor-not-allowed disabled:bg-[var(--color-bg-muted)]",
|
|
320
|
-
placeholder:
|
|
321
|
-
disabled:
|
|
322
|
-
required: !
|
|
325
|
+
placeholder: T("workspaces.form.slugPlaceholder", "workspace-slug"),
|
|
326
|
+
disabled: w || !!g,
|
|
327
|
+
required: !g,
|
|
323
328
|
autoComplete: "off"
|
|
324
329
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ m("p", {
|
|
326
331
|
className: "mt-1 text-xs text-[var(--color-text-muted)]",
|
|
327
|
-
children:
|
|
332
|
+
children: T("organizations.form.slugImmutable", "Lowercase letters, numbers, and hyphens only. Cannot be changed after creation.")
|
|
328
333
|
}),
|
|
329
|
-
|
|
334
|
+
O.slug ? /* @__PURE__ */ m("p", {
|
|
330
335
|
className: "mt-1 text-sm text-[var(--color-status-error-text)]",
|
|
331
|
-
children:
|
|
336
|
+
children: O.slug
|
|
332
337
|
}) : null
|
|
333
338
|
] }),
|
|
334
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
335
340
|
htmlFor: "type",
|
|
336
341
|
className: "mb-1 block text-sm font-medium text-[var(--color-text-primary)]",
|
|
337
|
-
children:
|
|
338
|
-
}), /* @__PURE__ */
|
|
342
|
+
children: T("workspaces.list.column.type", "Type")
|
|
343
|
+
}), /* @__PURE__ */ h("select", {
|
|
339
344
|
id: "type",
|
|
340
|
-
value:
|
|
341
|
-
onChange: (e) =>
|
|
345
|
+
value: E.type,
|
|
346
|
+
onChange: (e) => D((t) => ({
|
|
342
347
|
...t,
|
|
343
348
|
type: e.target.value
|
|
344
349
|
})),
|
|
345
350
|
className: "w-full rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2 text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] disabled:cursor-not-allowed disabled:bg-[var(--color-bg-muted)]",
|
|
346
|
-
disabled:
|
|
351
|
+
disabled: w,
|
|
347
352
|
children: [
|
|
348
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ m("option", {
|
|
349
354
|
value: "PERSONAL",
|
|
350
|
-
children:
|
|
355
|
+
children: T("workspaces.type.personal", "Personal")
|
|
351
356
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ m("option", {
|
|
353
358
|
value: "TEAM",
|
|
354
|
-
children:
|
|
359
|
+
children: T("workspaces.type.team", "Team")
|
|
355
360
|
}),
|
|
356
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ m("option", {
|
|
357
362
|
value: "ENTERPRISE",
|
|
358
|
-
children:
|
|
363
|
+
children: T("workspaces.type.enterprise", "Enterprise")
|
|
359
364
|
})
|
|
360
365
|
]
|
|
361
366
|
})] }),
|
|
362
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ h("div", {
|
|
363
368
|
className: "flex flex-col gap-3 border-t border-[var(--color-border-default)] pt-4 sm:flex-row",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ h("button", {
|
|
365
370
|
type: "submit",
|
|
366
|
-
disabled:
|
|
371
|
+
disabled: w,
|
|
367
372
|
className: "inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--color-action-primary-bg)] px-6 py-2.5 font-medium text-[var(--color-action-primary-text)] transition-all duration-200 hover:opacity-90 hover:scale-[1.02] active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-50 sm:min-w-[220px]",
|
|
368
|
-
children: [
|
|
373
|
+
children: [w ? /* @__PURE__ */ m(f, {
|
|
369
374
|
size: 16,
|
|
370
375
|
className: "animate-spin"
|
|
371
|
-
}) : null,
|
|
372
|
-
}), /* @__PURE__ */
|
|
376
|
+
}) : null, g ? T("workspaces.form.updateSubmit", "Update Workspace") : T("workspaces.create.button", "Create Workspace")]
|
|
377
|
+
}), /* @__PURE__ */ m("button", {
|
|
373
378
|
type: "button",
|
|
374
|
-
onClick:
|
|
375
|
-
disabled:
|
|
379
|
+
onClick: C,
|
|
380
|
+
disabled: w,
|
|
376
381
|
className: "rounded-lg border border-[var(--color-border-default)] bg-transparent px-6 py-2.5 font-medium text-[var(--color-text-primary)] transition-all duration-200 hover:bg-[var(--color-bg-subtle)] active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-50 sm:min-w-[140px]",
|
|
377
|
-
children:
|
|
382
|
+
children: T("common.cancel", "Cancel")
|
|
378
383
|
})]
|
|
379
384
|
})
|
|
380
385
|
]
|
|
381
386
|
});
|
|
382
387
|
}
|
|
383
388
|
//#endregion
|
|
384
|
-
export {
|
|
389
|
+
export { g as WorkspaceForm };
|
|
385
390
|
|
|
386
391
|
//# sourceMappingURL=WorkspaceForm.js.map
|