@coffre/ui 0.1.10 → 0.1.12
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/client/_coffre/assets/account-CyJDFhek.js +2 -0
- package/dist/client/_coffre/assets/account-DHSs5h2f.js +1 -0
- package/dist/client/_coffre/assets/affordances-BQD5B421.js +1 -0
- package/dist/client/_coffre/assets/audit-Bcyp_dU1.js +2 -0
- package/dist/client/_coffre/assets/audit-rMy9mU9Q.js +1 -0
- package/dist/client/_coffre/assets/auth.device-DuvaComb.js +1 -0
- package/dist/client/_coffre/assets/auth.device-yBt_sLZW.js +2 -0
- package/dist/client/_coffre/assets/directory-C4BMGC7-.js +1 -0
- package/dist/client/_coffre/assets/dist-BNkBTkxj.js +1 -0
- package/dist/client/_coffre/assets/globals-BJkzu6T5.css +1 -0
- package/dist/client/_coffre/assets/grants-CyDW25eX.js +1 -0
- package/dist/client/_coffre/assets/icons-BRl8DlXW.js +1 -0
- package/dist/client/_coffre/assets/index-CA1mtrIx.js +12 -0
- package/dist/client/_coffre/assets/link-CqlAJWBd.js +1 -0
- package/dist/client/_coffre/assets/login-B73b6bsJ.js +1 -0
- package/dist/client/_coffre/assets/login-BO1KAGPU.js +2 -0
- package/dist/client/_coffre/assets/offboarding--5vSKNHv.js +1 -0
- package/dist/client/_coffre/assets/page-Dngv8FMr.js +1 -0
- package/dist/client/_coffre/assets/preload-helper-DBha3tys.js +1 -0
- package/dist/client/_coffre/assets/principal-page-C4qDD-d8.js +1 -0
- package/dist/client/_coffre/assets/projects._project._environment-eBKxOZ0_.js +2 -0
- package/dist/client/_coffre/assets/projects._project._environment-or_AX6o5.js +3 -0
- package/dist/client/_coffre/assets/projects._project.index-DHdXfEh-.js +2 -0
- package/dist/client/_coffre/assets/projects._project.index-iynQgenH.js +1 -0
- package/dist/client/_coffre/assets/projects.index-CGW8mRil.js +1 -0
- package/dist/client/_coffre/assets/row-state-BlarvG7E.js +1 -0
- package/dist/client/_coffre/assets/settings-D-7RJIDf.js +1 -0
- package/dist/client/_coffre/assets/suspense-q_eJaZ18.js +1 -0
- package/dist/client/_coffre/assets/tokens._token-0u7midqA.js +2 -0
- package/dist/client/_coffre/assets/tokens._token-C53NqScg.js +1 -0
- package/dist/client/_coffre/assets/tokens.index-DBZTLnbi.js +1 -0
- package/dist/client/_coffre/assets/ui-BPWFJNz7.js +46 -0
- package/dist/client/_coffre/assets/unregistered-CLhgtwUt.js +1 -0
- package/dist/client/_coffre/assets/use-action-LULgF26O.js +1 -0
- package/dist/client/_coffre/assets/use-change-Bd6NZJj9.js +1 -0
- package/dist/client/_coffre/assets/use-shell-Dx92Huhb.js +1 -0
- package/dist/client/_coffre/assets/useQuery-BIIZz1CB.js +1 -0
- package/dist/client/_coffre/assets/useSuspenseQuery-tP9HFZ8w.js +1 -0
- package/dist/client/_coffre/assets/users._user-BXtaL8Ee.js +2 -0
- package/dist/client/_coffre/assets/users._user-CNYVkXaY.js +1 -0
- package/dist/client/_coffre/assets/users.index-Cs9tibIv.js +1 -0
- package/dist/server/.vite/manifest.json +342 -246
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-T9tMsCwo.js +162 -0
- package/dist/server/_coffre/assets/{account-CUQYGCYh.js → account-BUhhOS5-.js} +150 -117
- package/dist/server/_coffre/assets/{account-DMlUoBxQ.js → account-B_h55GCs.js} +10 -24
- package/dist/server/_coffre/assets/{affordances-BNaXjMOb.js → affordances-CKANXDTG.js} +2 -22
- package/dist/server/_coffre/assets/{async-local-storage-C0cwgkEr.js → async-local-storage-C10uQtMM.js} +3 -2
- package/dist/server/_coffre/assets/{audit-CCdSLmvK.js → audit-B8Ck358-.js} +46 -16
- package/dist/server/_coffre/assets/audit-DFsXfeAQ.js +31 -0
- package/dist/server/_coffre/assets/{auth.device-BoFM1jcf.js → auth.device-BXf_JjT7.js} +5 -5
- package/dist/server/_coffre/assets/{auth.device-C05u5ROO.js → auth.device-cqjWACvB.js} +7 -5
- package/dist/server/_coffre/assets/{directory-GsnYkse0.js → directory-C9SfNgpM.js} +87 -112
- package/dist/server/_coffre/assets/{use-action-DwEmf58L.js → dist-CnnV3t2g.js} +3 -48
- package/dist/server/_coffre/assets/globals-BJkzu6T5.css +1 -0
- package/dist/server/_coffre/assets/grants--315KmXu.js +158 -0
- package/dist/server/_coffre/assets/{page-BdnhpwvH.js → icons-CWsTEfpn.js} +125 -436
- package/dist/server/_coffre/assets/lazyRouteComponent-CqBNCGuZ.js +480 -0
- package/dist/server/_coffre/assets/link-42ZWdjzZ.js +422 -0
- package/dist/server/_coffre/assets/{login-DUtCQju5.js → login-CQSkYW_D.js} +7 -5
- package/dist/server/_coffre/assets/{login-B2njIq_o.js → login-LBpXXfsQ.js} +2 -2
- package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +56 -0
- package/dist/server/_coffre/assets/{offboarding-8yMa7ViM.js → offboarding-CykelNis.js} +11 -79
- package/dist/server/_coffre/assets/page-BGeDoQO5.js +3531 -0
- package/dist/server/_coffre/assets/{principal-page-B8zPcS2b.js → principal-page-CRdoAQOq.js} +51 -42
- package/dist/server/_coffre/assets/{projects._project._environment-DdIOc7wx.js → projects._project._environment-BXU1Mee5.js} +4 -11
- package/dist/server/_coffre/assets/{projects._project._environment-BZ5Z80V8.js → projects._project._environment-BrDqn8kW.js} +129 -748
- package/dist/server/_coffre/assets/{projects._project.index-CuEAUwGn.js → projects._project.index-CAxBU4tY.js} +134 -96
- package/dist/server/_coffre/assets/{projects._project.index-DvbcU1kh.js → projects._project.index-CYyUVTCl.js} +5 -4
- package/dist/server/_coffre/assets/{projects.index-5HI0wOuG.js → projects.index-D6ZoDE_0.js} +57 -55
- package/dist/server/_coffre/assets/{react-dom-qCTiwGGR.js → react-dom-bBoJXlK2.js} +417 -51
- package/dist/server/_coffre/assets/{router-CQDoql8s.js → router-Bu2qtyqw.js} +376 -92
- package/dist/server/_coffre/assets/row-state-CAItu3n_.js +117 -0
- package/dist/server/_coffre/assets/{settings-BVz78wjP.js → settings-ByeF6hBa.js} +8 -6
- package/dist/server/_coffre/assets/suspense-beD01bb8.js +602 -0
- package/dist/server/_coffre/assets/tokens._token-CM01QPCq.js +10 -0
- package/dist/server/_coffre/assets/{tokens._token-CWs3Mtki.js → tokens._token-D2E4P3Qc.js} +97 -79
- package/dist/server/_coffre/assets/{tokens.index-Ck0LN7aC.js → tokens.index-Cmrgn3mU.js} +9 -6
- package/dist/server/_coffre/assets/{ui-D_slKpSF.js → ui-DvlGkmaH.js} +7 -836
- package/dist/server/_coffre/assets/{unregistered-Z17da4Rc.js → unregistered-DSArejP9.js} +5 -3
- package/dist/server/_coffre/assets/use-action-C2wz34kq.js +47 -0
- package/dist/server/_coffre/assets/use-change-CJpGSNIq.js +1212 -0
- package/dist/server/_coffre/assets/use-shell-C3iYcyP1.js +462 -0
- package/dist/server/_coffre/assets/useQuery-ChxaQ4Cb.js +8 -0
- package/dist/server/_coffre/assets/{useStore-DWGPqzXR.js → useRouter-CaUSUNsw.js} +1 -420
- package/dist/server/_coffre/assets/useSuspenseQuery-BjAmlGZl.js +117 -0
- package/dist/server/_coffre/assets/users._user-BVeR9fZP.js +10 -0
- package/dist/server/_coffre/assets/{users._user-CMwj-VI9.js → users._user-Cih2Etf4.js} +4 -5
- package/dist/server/_coffre/assets/{users.index-fWHv6A30.js → users.index-Bo2_a95G.js} +9 -6
- package/dist/server/index.js +6 -5
- package/package.json +5 -3
- package/src/components/directory.tsx +75 -104
- package/src/components/grants.tsx +60 -112
- package/src/components/icons.tsx +0 -34
- package/src/components/offboarding.tsx +1 -52
- package/src/components/principal-page.tsx +54 -67
- package/src/components/principal-picker.tsx +7 -16
- package/src/components/row-state.tsx +95 -0
- package/src/components/service-tokens.tsx +75 -64
- package/src/components/shell.tsx +1 -1
- package/src/lib/announce.ts +36 -0
- package/src/lib/changes.ts +498 -0
- package/src/lib/coffre.ts +1 -1
- package/src/lib/optimistic.ts +233 -0
- package/src/lib/queries.ts +385 -0
- package/src/lib/use-action.ts +20 -15
- package/src/lib/use-change.ts +42 -0
- package/src/lib/use-shell.ts +17 -0
- package/src/router.tsx +17 -9
- package/src/routes/__root.tsx +8 -38
- package/src/routes/account.tsx +163 -154
- package/src/routes/audit.tsx +51 -72
- package/src/routes/auth.device.tsx +4 -2
- package/src/routes/login.tsx +3 -2
- package/src/routes/projects.$project.$environment.tsx +223 -238
- package/src/routes/projects.$project.index.tsx +136 -118
- package/src/routes/projects.index.tsx +117 -145
- package/src/routes/settings.tsx +7 -7
- package/src/routes/tokens.$token.tsx +14 -17
- package/src/routes/tokens.index.tsx +8 -4
- package/src/routes/unregistered.tsx +3 -2
- package/src/routes/users.$user.tsx +4 -4
- package/src/routes/users.index.tsx +8 -4
- package/src/shared/models.ts +1 -5
- package/src/styles/globals.css +80 -50
- package/dist/client/_coffre/assets/account-B48wuSF8.js +0 -1
- package/dist/client/_coffre/assets/account-BkNyIDT7.js +0 -2
- package/dist/client/_coffre/assets/affordances-CmoY-8Xf.js +0 -1
- package/dist/client/_coffre/assets/audit-BvwKYb-5.js +0 -2
- package/dist/client/_coffre/assets/audit-D02H-zxS.js +0 -1
- package/dist/client/_coffre/assets/auth.device-BP5FY0K1.js +0 -1
- package/dist/client/_coffre/assets/auth.device-DYOONgFF.js +0 -2
- package/dist/client/_coffre/assets/coffre-BBp7cKVa.js +0 -1
- package/dist/client/_coffre/assets/directory-Bu0EIxqI.js +0 -1
- package/dist/client/_coffre/assets/globals-Bh2x1gBM.css +0 -1
- package/dist/client/_coffre/assets/grants-DavcwofW.js +0 -1
- package/dist/client/_coffre/assets/index-CDPlq5rM.js +0 -12
- package/dist/client/_coffre/assets/login-C-wTm_t1.js +0 -2
- package/dist/client/_coffre/assets/login-CLLv1om9.js +0 -1
- package/dist/client/_coffre/assets/offboarding-DWsE2FSa.js +0 -1
- package/dist/client/_coffre/assets/page-DbSS7pYH.js +0 -1
- package/dist/client/_coffre/assets/preload-helper-DduCCcmc.js +0 -46
- package/dist/client/_coffre/assets/principal-page-Bp_iwuSd.js +0 -1
- package/dist/client/_coffre/assets/projects._project._environment-BMeX_B8l.js +0 -2
- package/dist/client/_coffre/assets/projects._project._environment-CT0A-hIU.js +0 -3
- package/dist/client/_coffre/assets/projects._project.index-C_xYOGLT.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-Chcf-cUd.js +0 -1
- package/dist/client/_coffre/assets/projects.index-CfOtb1X5.js +0 -2
- package/dist/client/_coffre/assets/projects.index-DSjOhLDh.js +0 -1
- package/dist/client/_coffre/assets/settings-BC9cUJNK.js +0 -1
- package/dist/client/_coffre/assets/settings-Bkj_E21y.js +0 -2
- package/dist/client/_coffre/assets/tokens._token-BA0KqvaW.js +0 -1
- package/dist/client/_coffre/assets/tokens._token-Dh9jLOkm.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-BgAMWkHT.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-CHueIAv1.js +0 -1
- package/dist/client/_coffre/assets/unregistered-D5go1AfR.js +0 -1
- package/dist/client/_coffre/assets/use-action-l__xZDYY.js +0 -1
- package/dist/client/_coffre/assets/users._user-Dwqa0gv5.js +0 -1
- package/dist/client/_coffre/assets/users._user-xJAb3T6Y.js +0 -2
- package/dist/client/_coffre/assets/users.index-BJoF-L37.js +0 -2
- package/dist/client/_coffre/assets/users.index-YUjtbTGy.js +0 -1
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-BKg2AlPu.js +0 -133
- package/dist/server/_coffre/assets/audit-CThXn2v7.js +0 -74
- package/dist/server/_coffre/assets/coffre-C2ANsTAz.js +0 -281
- package/dist/server/_coffre/assets/globals-Bh2x1gBM.css +0 -1
- package/dist/server/_coffre/assets/grants-B6k4Fu9z.js +0 -243
- package/dist/server/_coffre/assets/projects.index-uiomWX_l.js +0 -54
- package/dist/server/_coffre/assets/settings-4oRyDizv.js +0 -18
- package/dist/server/_coffre/assets/tokens._token-CF_deAwq.js +0 -18
- package/dist/server/_coffre/assets/tokens.index-DF_07KEe.js +0 -10
- package/dist/server/_coffre/assets/users._user-DUzwkSKT.js +0 -10
- package/dist/server/_coffre/assets/users.index-BbuweTwH.js +0 -10
- package/src/components/syncs.tsx +0 -581
package/dist/server/_coffre/assets/{projects.index-5HI0wOuG.js → projects.index-D6ZoDE_0.js}
RENAMED
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { i as require_react, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
|
|
2
|
+
import { t as Link } from "./link-42ZWdjzZ.js";
|
|
3
|
+
import { C as useCoffre, a as Tile, h as queries, i as PageHeader, n as ClosedDoor } from "./page-BGeDoQO5.js";
|
|
4
|
+
import { c as createProject, h as projectsList, n as useChangeStatus, t as useChange } from "./use-change-CJpGSNIq.js";
|
|
5
|
+
import { t as useShell } from "./use-shell-C3iYcyP1.js";
|
|
6
|
+
import { t as useSuspenseQuery } from "./useSuspenseQuery-BjAmlGZl.js";
|
|
7
|
+
import { i as EmptyState, o as Modal } from "./ui-DvlGkmaH.js";
|
|
7
8
|
import { n as isActiveAccessibleEnvironment } from "./project-environments-lEzFHUt4.js";
|
|
8
|
-
import {
|
|
9
|
+
import { n as ProjectEmptyStateCopy, r as RootAdminOnly } from "./affordances-CKANXDTG.js";
|
|
10
|
+
import { A as Plus, h as Hash, p as Folder, r as AlertTriangle, y as Layers } from "./icons-CWsTEfpn.js";
|
|
11
|
+
import { a as rowClass, i as RowPending, r as RowFailure } from "./row-state-CAItu3n_.js";
|
|
9
12
|
import { n as slugProblem } from "./validation-BQtqPe2V.js";
|
|
10
13
|
//#region src/routes/projects.index.tsx?tsr-split=component
|
|
11
14
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
12
15
|
var import_jsx_runtime = require_jsx_runtime();
|
|
13
|
-
/**
|
|
14
|
-
* Distinct secret names per project, across the environments you can open.
|
|
15
|
-
*
|
|
16
|
-
* The project summary only counts secrets per environment, and the same key
|
|
17
|
-
* in dev and prod is one secret, not two. So this lists the keys of every
|
|
18
|
-
* environment you can open and counts the names. Listing keys reads no value
|
|
19
|
-
* and writes no audit row. Environments you cannot open are not asked: the
|
|
20
|
-
* refusal would be audited.
|
|
21
|
-
*
|
|
22
|
-
* A project whose keys could not all be listed gets no count rather than a
|
|
23
|
-
* short one.
|
|
24
|
-
*/
|
|
25
16
|
function ProjectsPage() {
|
|
26
|
-
const { result,
|
|
27
|
-
const
|
|
17
|
+
const { data: result, refetch } = useSuspenseQuery(queries.projects(useCoffre()));
|
|
18
|
+
const { capabilities } = useShell();
|
|
19
|
+
const { failedAdds } = useChangeStatus(projectsList.queryKey);
|
|
20
|
+
const refusedProjects = result.ok ? failedAdds(result.projects.map((project) => project.slug)) : [];
|
|
28
21
|
if (!result.ok) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClosedDoor, {
|
|
29
22
|
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTriangle, { size: 18 }),
|
|
30
23
|
title: "Projects could not be listed",
|
|
@@ -35,7 +28,7 @@ function ProjectsPage() {
|
|
|
35
28
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
36
29
|
type: "button",
|
|
37
30
|
className: "btn",
|
|
38
|
-
onClick: () => void
|
|
31
|
+
onClick: () => void refetch(),
|
|
39
32
|
children: "Try again"
|
|
40
33
|
}),
|
|
41
34
|
children: result.error
|
|
@@ -46,16 +39,16 @@ function ProjectsPage() {
|
|
|
46
39
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageHeader, {
|
|
47
40
|
title: "Projects",
|
|
48
41
|
actions: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RootAdminOnly, {
|
|
49
|
-
capabilities
|
|
42
|
+
capabilities,
|
|
50
43
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NewProject, {})
|
|
51
44
|
})
|
|
52
45
|
}),
|
|
53
|
-
active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
46
|
+
active.length === 0 && refusedProjects.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
54
47
|
className: "card",
|
|
55
48
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyState, {
|
|
56
49
|
title: "Nothing here for you yet",
|
|
57
50
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectEmptyStateCopy, {
|
|
58
|
-
capabilities
|
|
51
|
+
capabilities,
|
|
59
52
|
hasArchivedProjects: archived.length > 0
|
|
60
53
|
})
|
|
61
54
|
})
|
|
@@ -64,7 +57,7 @@ function ProjectsPage() {
|
|
|
64
57
|
"aria-label": "Projects",
|
|
65
58
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectTable, {
|
|
66
59
|
projects: active,
|
|
67
|
-
|
|
60
|
+
refused: true
|
|
68
61
|
})
|
|
69
62
|
}),
|
|
70
63
|
archived.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
@@ -75,15 +68,13 @@ function ProjectsPage() {
|
|
|
75
68
|
children: "Archived"
|
|
76
69
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
77
70
|
className: "card",
|
|
78
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectTable, {
|
|
79
|
-
projects: archived,
|
|
80
|
-
secrets
|
|
81
|
-
})
|
|
71
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectTable, { projects: archived })
|
|
82
72
|
})]
|
|
83
73
|
})
|
|
84
74
|
] });
|
|
85
75
|
}
|
|
86
|
-
function ProjectTable({ projects,
|
|
76
|
+
function ProjectTable({ projects, refused = false }) {
|
|
77
|
+
const { status, failedAdds, dismiss } = useChangeStatus(projectsList.queryKey);
|
|
87
78
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
88
79
|
className: "dt-wrap",
|
|
89
80
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", {
|
|
@@ -111,11 +102,21 @@ function ProjectTable({ projects, secrets }) {
|
|
|
111
102
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Hash, { size: 14 }), "Secrets"]
|
|
112
103
|
})
|
|
113
104
|
})
|
|
114
|
-
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.
|
|
105
|
+
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tbody", { children: [projects.map((project, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectRow, {
|
|
115
106
|
number: index + 1,
|
|
116
107
|
project,
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
status: status(project.slug),
|
|
109
|
+
onDismiss: dismiss
|
|
110
|
+
}, project.slug)), refused && failedAdds(projects.map((project) => project.slug)).map(({ mutationId, vars, status: failed }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(RowFailure, {
|
|
111
|
+
status: failed,
|
|
112
|
+
columns: 4,
|
|
113
|
+
onDismiss: () => dismiss(mutationId),
|
|
114
|
+
children: [
|
|
115
|
+
"Project ",
|
|
116
|
+
vars.slug,
|
|
117
|
+
" was not created."
|
|
118
|
+
]
|
|
119
|
+
}, mutationId))] })]
|
|
119
120
|
})
|
|
120
121
|
});
|
|
121
122
|
}
|
|
@@ -123,11 +124,13 @@ function ProjectTable({ projects, secrets }) {
|
|
|
123
124
|
* One project. The whole row opens it; the environment links inside it sit
|
|
124
125
|
* above that and go straight to the environment.
|
|
125
126
|
*/
|
|
126
|
-
function ProjectRow({ number, project,
|
|
127
|
+
function ProjectRow({ number, project, status, onDismiss }) {
|
|
128
|
+
const secrets = project.secretCount;
|
|
129
|
+
const pending = status.state === "pending";
|
|
127
130
|
const isArchived = project.archivedAt !== null;
|
|
128
131
|
const listedEnvironments = project.environments.filter((environment) => environment.details === null || environment.details.archivedAt === null);
|
|
129
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
|
|
130
|
-
className:
|
|
132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
|
|
133
|
+
className: `row-link ${rowClass(status)}`,
|
|
131
134
|
children: [
|
|
132
135
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
133
136
|
className: "n",
|
|
@@ -139,7 +142,7 @@ function ProjectRow({ number, project, secrets }) {
|
|
|
139
142
|
className: "cell-project",
|
|
140
143
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tile, { name: project.slug }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
141
144
|
className: "cell-stack",
|
|
142
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
145
|
+
children: [pending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: project.name }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
143
146
|
className: "cell-link stretch",
|
|
144
147
|
to: "/projects/$project",
|
|
145
148
|
params: { project: project.slug },
|
|
@@ -180,7 +183,7 @@ function ProjectRow({ number, project, secrets }) {
|
|
|
180
183
|
}),
|
|
181
184
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
182
185
|
className: "col-secrets num nowrap",
|
|
183
|
-
children: secrets !== null && !isArchived ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [secrets, /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
186
|
+
children: pending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowPending, { status }) : secrets !== null && !isArchived ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [secrets, /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
184
187
|
className: "narrow-only",
|
|
185
188
|
children: [" secret", secrets === 1 ? "" : "s"]
|
|
186
189
|
})] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
@@ -189,18 +192,20 @@ function ProjectRow({ number, project, secrets }) {
|
|
|
189
192
|
})
|
|
190
193
|
})
|
|
191
194
|
]
|
|
192
|
-
})
|
|
195
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowFailure, {
|
|
196
|
+
status,
|
|
197
|
+
columns: 4,
|
|
198
|
+
onDismiss: () => status.state === "failed" && onDismiss(status.mutationId)
|
|
199
|
+
})] });
|
|
193
200
|
}
|
|
194
201
|
function NewProject() {
|
|
195
202
|
const [slug, setSlug] = (0, import_react.useState)("");
|
|
196
203
|
const [name, setName] = (0, import_react.useState)("");
|
|
197
204
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
198
|
-
const
|
|
199
|
-
const { pending, error, setError, run } = useAction();
|
|
205
|
+
const create = useChange(createProject(useCoffre()));
|
|
200
206
|
const slugError = slug === "" ? null : slugProblem(slug);
|
|
201
207
|
function close() {
|
|
202
208
|
setOpen(false);
|
|
203
|
-
setError(null);
|
|
204
209
|
}
|
|
205
210
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
206
211
|
className: "btn btn-primary",
|
|
@@ -215,15 +220,13 @@ function NewProject() {
|
|
|
215
220
|
className: "form",
|
|
216
221
|
onSubmit: (event) => {
|
|
217
222
|
event.preventDefault();
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}, () => {
|
|
222
|
-
toast.success(`Project ${slug} created`);
|
|
223
|
-
setSlug("");
|
|
224
|
-
setName("");
|
|
225
|
-
setOpen(false);
|
|
223
|
+
create({
|
|
224
|
+
slug,
|
|
225
|
+
name: name.trim()
|
|
226
226
|
});
|
|
227
|
+
setSlug("");
|
|
228
|
+
setName("");
|
|
229
|
+
close();
|
|
227
230
|
},
|
|
228
231
|
children: [
|
|
229
232
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", {
|
|
@@ -263,7 +266,6 @@ function NewProject() {
|
|
|
263
266
|
onChange: (event) => setName(event.target.value)
|
|
264
267
|
})]
|
|
265
268
|
}),
|
|
266
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorLine, { error }),
|
|
267
269
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
268
270
|
className: "dialog-actions",
|
|
269
271
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
@@ -271,11 +273,11 @@ function NewProject() {
|
|
|
271
273
|
type: "button",
|
|
272
274
|
onClick: close,
|
|
273
275
|
children: "Cancel"
|
|
274
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.
|
|
276
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
275
277
|
className: "btn btn-primary",
|
|
276
278
|
type: "submit",
|
|
277
|
-
disabled:
|
|
278
|
-
children:
|
|
279
|
+
disabled: slug === "" || slugError !== null || name.trim() === "",
|
|
280
|
+
children: "Create project"
|
|
279
281
|
})]
|
|
280
282
|
})
|
|
281
283
|
]
|