@coffre/ui 0.1.9 → 0.1.11
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-BJAdDvZf.js +2 -0
- package/dist/client/_coffre/assets/account-D0jLpk5c.js +1 -0
- package/dist/client/_coffre/assets/affordances-Bq2-oUB5.js +1 -0
- package/dist/client/_coffre/assets/audit-C-pcBgKe.js +2 -0
- package/dist/client/_coffre/assets/audit-CHGlDeBB.js +1 -0
- package/dist/client/_coffre/assets/{auth.device--rDR2F8w.js → auth.device-BndOUjse.js} +1 -1
- package/dist/client/_coffre/assets/auth.device-CWHNQn9W.js +2 -0
- package/dist/client/_coffre/assets/directory-nDExpkAz.js +1 -0
- package/dist/client/_coffre/assets/dist-QVHMLatb.js +1 -0
- package/dist/client/_coffre/assets/globals-CKBoTlyH.css +1 -0
- package/dist/client/_coffre/assets/grants-CjoOnxzz.js +1 -0
- package/dist/client/_coffre/assets/icons-BQ27Ds9u.js +1 -0
- package/dist/client/_coffre/assets/index-CUGytaO3.js +12 -0
- package/dist/client/_coffre/assets/link-DP8SVWon.js +1 -0
- package/dist/client/_coffre/assets/login-CeaxDMcr.js +2 -0
- package/dist/client/_coffre/assets/login-DrMgvqZn.js +1 -0
- package/dist/client/_coffre/assets/offboarding-CNr_1tnl.js +1 -0
- package/dist/client/_coffre/assets/page-CGmvjSy4.js +1 -0
- package/dist/client/_coffre/assets/preload-helper-ClBkJ19f.js +1 -0
- package/dist/client/_coffre/assets/principal-page-DNLb_q_e.js +1 -0
- package/dist/client/_coffre/assets/projects._project._environment-CHzbboGp.js +3 -0
- package/dist/client/_coffre/assets/projects._project._environment-DDxu_HHD.js +2 -0
- package/dist/client/_coffre/assets/projects._project.index-CIAsjvg6.js +2 -0
- package/dist/client/_coffre/assets/projects._project.index-DZ9l6d-1.js +1 -0
- package/dist/client/_coffre/assets/projects.index-4eUXreE_.js +1 -0
- package/dist/client/_coffre/assets/row-state-ByET1OKX.js +1 -0
- package/dist/client/_coffre/assets/settings-D2zp1Ssu.js +1 -0
- package/dist/client/_coffre/assets/suspense-C7KwSnTG.js +1 -0
- package/dist/client/_coffre/assets/tokens._token-DWmbqzNk.js +2 -0
- package/dist/client/_coffre/assets/tokens._token-Dui_4KfS.js +1 -0
- package/dist/client/_coffre/assets/tokens.index-CSi5Wxwf.js +1 -0
- package/dist/client/_coffre/assets/ui-BdipqGpP.js +46 -0
- package/dist/client/_coffre/assets/unregistered-CA7B4C1m.js +1 -0
- package/dist/client/_coffre/assets/use-action-DRm9yVhV.js +1 -0
- package/dist/client/_coffre/assets/use-change-BRRMJocl.js +1 -0
- package/dist/client/_coffre/assets/use-shell-BMGlJ25Q.js +1 -0
- package/dist/client/_coffre/assets/useQuery-D__2KBOs.js +1 -0
- package/dist/client/_coffre/assets/useSuspenseQuery-CSXyDALB.js +1 -0
- package/dist/client/_coffre/assets/users._user-BkNrX7Qf.js +1 -0
- package/dist/client/_coffre/assets/users._user-jbSvtdOg.js +2 -0
- package/dist/client/_coffre/assets/users.index-CKnQ1G76.js +1 -0
- package/dist/server/.vite/manifest.json +343 -246
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-Dx-c3XVk.js +162 -0
- package/dist/server/_coffre/assets/{account-CZgVVZTf.js → account-BocTPU1J.js} +150 -117
- package/dist/server/_coffre/assets/{account-D7-ZAE2T.js → account-CL8hOGhO.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-BEbhtsEp.js → audit-Bcka4vA6.js} +46 -16
- package/dist/server/_coffre/assets/audit-CSRQYIhu.js +31 -0
- package/dist/server/_coffre/assets/{auth.device-w9N3FlNk.js → auth.device-CMcUISZY.js} +7 -5
- package/dist/server/_coffre/assets/{auth.device-CMR3csAI.js → auth.device-DqO0T-rU.js} +5 -5
- package/dist/server/_coffre/assets/{directory-Dr5X9TB5.js → directory-CyYx6Jx1.js} +87 -112
- package/dist/server/_coffre/assets/{use-action-DQUmeH-5.js → dist-CnnV3t2g.js} +3 -48
- package/dist/server/_coffre/assets/globals-CKBoTlyH.css +1 -0
- package/dist/server/_coffre/assets/grants-CRijabX0.js +158 -0
- package/dist/server/_coffre/assets/{page-BdnhpwvH.js → icons-Dy-5ccDF.js} +3 -196
- 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-BI9tzJEy.js} +7 -5
- package/dist/server/_coffre/assets/{login-B2njIq_o.js → login-C-v88YwP.js} +2 -2
- package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +56 -0
- package/dist/server/_coffre/assets/{offboarding-DY5MarpG.js → offboarding-1H0LavTd.js} +6 -4
- package/dist/server/_coffre/assets/page-D_mO0-sn.js +3592 -0
- package/dist/server/_coffre/assets/{principal-page-SdG8_zcu.js → principal-page-DQDoXute.js} +51 -42
- package/dist/server/_coffre/assets/{projects._project._environment-CUS0VFUe.js → projects._project._environment-C-yVwC92.js} +168 -248
- package/dist/server/_coffre/assets/{projects._project._environment-BQIrmE3r.js → projects._project._environment-D_5R40of.js} +4 -11
- package/dist/server/_coffre/assets/{projects._project.index-D1NxvBtZ.js → projects._project.index-A2BImFIT.js} +134 -96
- package/dist/server/_coffre/assets/{projects._project.index-BjNdR4KC.js → projects._project.index-BPPKxKrt.js} +5 -4
- package/dist/server/_coffre/assets/{projects.index-BQDuuh6t.js → projects.index-543IsPzY.js} +62 -54
- package/dist/server/_coffre/assets/{react-dom-qCTiwGGR.js → react-dom-bBoJXlK2.js} +417 -51
- package/dist/server/_coffre/assets/{router-BUwZOXEH.js → router-CM3vK8QO.js} +376 -92
- package/dist/server/_coffre/assets/row-state-XBtDoIA4.js +117 -0
- package/dist/server/_coffre/assets/{settings-HOErM3pd.js → settings-BLVU74ym.js} +8 -6
- package/dist/server/_coffre/assets/suspense-CzYTwxOj.js +602 -0
- package/dist/server/_coffre/assets/tokens._token-B-hBgwBW.js +10 -0
- package/dist/server/_coffre/assets/{tokens._token-BZUArbzi.js → tokens._token-aubAUonP.js} +97 -79
- package/dist/server/_coffre/assets/{tokens.index-BReCgoV9.js → tokens.index-4D3jwp5v.js} +9 -6
- package/dist/server/_coffre/assets/{ui-D_slKpSF.js → ui-BI3Bf72q.js} +7 -836
- package/dist/server/_coffre/assets/{unregistered-Z17da4Rc.js → unregistered-CagDxMyw.js} +5 -3
- package/dist/server/_coffre/assets/use-action-tzBZvjjQ.js +47 -0
- package/dist/server/_coffre/assets/use-change-Dggqxy5y.js +1212 -0
- package/dist/server/_coffre/assets/use-shell-CwStDfzX.js +462 -0
- package/dist/server/_coffre/assets/useQuery-C6_dBjem.js +8 -0
- package/dist/server/_coffre/assets/{useStore-DWGPqzXR.js → useRouter-CaUSUNsw.js} +1 -420
- package/dist/server/_coffre/assets/useSuspenseQuery-BuapQt_P.js +117 -0
- package/dist/server/_coffre/assets/{users._user-DHTNhQ9o.js → users._user-137WNyxn.js} +4 -5
- package/dist/server/_coffre/assets/users._user-C252Iilj.js +10 -0
- package/dist/server/_coffre/assets/{users.index-Cfo3ODpX.js → users.index-DQHsfnal.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/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/components/syncs.tsx +42 -26
- package/src/lib/announce.ts +36 -0
- package/src/lib/changes.ts +498 -0
- package/src/lib/coffre.ts +3 -2
- package/src/lib/optimistic.ts +233 -0
- package/src/lib/queries.ts +393 -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 +226 -231
- package/src/routes/projects.$project.index.tsx +136 -118
- package/src/routes/projects.index.tsx +125 -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/styles/globals.css +78 -1
- package/dist/client/_coffre/assets/account-C3rBPdu6.js +0 -2
- package/dist/client/_coffre/assets/account-J194gi6l.js +0 -1
- package/dist/client/_coffre/assets/affordances-CmoY-8Xf.js +0 -1
- package/dist/client/_coffre/assets/audit-BtI9em7Q.js +0 -2
- package/dist/client/_coffre/assets/audit-jURfT8Km.js +0 -1
- package/dist/client/_coffre/assets/auth.device-viDUwZRT.js +0 -2
- package/dist/client/_coffre/assets/coffre-CXkp3Efg.js +0 -1
- package/dist/client/_coffre/assets/directory-PEjdb8PS.js +0 -1
- package/dist/client/_coffre/assets/globals-Bh2x1gBM.css +0 -1
- package/dist/client/_coffre/assets/grants-4mSkXPU4.js +0 -1
- package/dist/client/_coffre/assets/index-CD7bvUCb.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-DQ-56W0H.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-DjH1cUyz.js +0 -1
- package/dist/client/_coffre/assets/projects._project._environment-BZnNvENc.js +0 -3
- package/dist/client/_coffre/assets/projects._project._environment-CLUpTvi-.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-CWXRo307.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-Dzgf95zv.js +0 -1
- package/dist/client/_coffre/assets/projects.index-BG8W91BX.js +0 -2
- package/dist/client/_coffre/assets/projects.index-N_kCFBMq.js +0 -1
- package/dist/client/_coffre/assets/settings-CNIY0--5.js +0 -1
- package/dist/client/_coffre/assets/settings-EimGqlQL.js +0 -2
- package/dist/client/_coffre/assets/tokens._token-CkU4dCwo.js +0 -1
- package/dist/client/_coffre/assets/tokens._token-Df2R8TF_.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-CSf5Mlz8.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-DtiWrKVq.js +0 -1
- package/dist/client/_coffre/assets/unregistered-D5go1AfR.js +0 -1
- package/dist/client/_coffre/assets/use-action-CUvWPRTx.js +0 -1
- package/dist/client/_coffre/assets/users._user-CImGVpYj.js +0 -1
- package/dist/client/_coffre/assets/users._user-D0JK911L.js +0 -2
- package/dist/client/_coffre/assets/users.index-B-7o0KBD.js +0 -1
- package/dist/client/_coffre/assets/users.index-BoFWF3mF.js +0 -2
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-CrnrBINO.js +0 -133
- package/dist/server/_coffre/assets/audit-wjpo1BWg.js +0 -74
- package/dist/server/_coffre/assets/coffre-DMs96kfX.js +0 -280
- package/dist/server/_coffre/assets/globals-Bh2x1gBM.css +0 -1
- package/dist/server/_coffre/assets/grants-C6UmWE8b.js +0 -243
- package/dist/server/_coffre/assets/projects.index-ha7jO4nC.js +0 -54
- package/dist/server/_coffre/assets/settings-Cy__khNA.js +0 -18
- package/dist/server/_coffre/assets/tokens._token-CmpmtfB_.js +0 -18
- package/dist/server/_coffre/assets/tokens.index-B5-4dD4C.js +0 -10
- package/dist/server/_coffre/assets/users._user-BKdSQhIg.js +0 -10
- package/dist/server/_coffre/assets/users.index-dMn0tlmc.js +0 -10
package/dist/server/_coffre/assets/{projects.index-BQDuuh6t.js → projects.index-543IsPzY.js}
RENAMED
|
@@ -1,36 +1,35 @@
|
|
|
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-D_mO0-sn.js";
|
|
4
|
+
import { c as createProject, h as projectsList, n as useChangeStatus, t as useChange } from "./use-change-Dggqxy5y.js";
|
|
5
|
+
import { t as useShell } from "./use-shell-CwStDfzX.js";
|
|
6
|
+
import { t as useSuspenseQuery } from "./useSuspenseQuery-BuapQt_P.js";
|
|
7
|
+
import { i as EmptyState, o as Modal } from "./ui-BI3Bf72q.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 { M as Plus, h as Hash, p as Folder, r as AlertTriangle, y as Layers } from "./icons-Dy-5ccDF.js";
|
|
11
|
+
import { a as rowClass, i as RowPending, r as RowFailure } from "./row-state-XBtDoIA4.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,
|
|
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)) : [];
|
|
27
21
|
if (!result.ok) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClosedDoor, {
|
|
28
22
|
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTriangle, { size: 18 }),
|
|
29
23
|
title: "Projects could not be listed",
|
|
30
|
-
actions: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
24
|
+
actions: result.signedOut ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
31
25
|
className: "btn",
|
|
32
26
|
to: "/login",
|
|
33
27
|
children: "Sign in again"
|
|
28
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
29
|
+
type: "button",
|
|
30
|
+
className: "btn",
|
|
31
|
+
onClick: () => void refetch(),
|
|
32
|
+
children: "Try again"
|
|
34
33
|
}),
|
|
35
34
|
children: result.error
|
|
36
35
|
});
|
|
@@ -40,16 +39,16 @@ function ProjectsPage() {
|
|
|
40
39
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageHeader, {
|
|
41
40
|
title: "Projects",
|
|
42
41
|
actions: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RootAdminOnly, {
|
|
43
|
-
capabilities
|
|
42
|
+
capabilities,
|
|
44
43
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NewProject, {})
|
|
45
44
|
})
|
|
46
45
|
}),
|
|
47
|
-
active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
46
|
+
active.length === 0 && refusedProjects.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
48
47
|
className: "card",
|
|
49
48
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyState, {
|
|
50
49
|
title: "Nothing here for you yet",
|
|
51
50
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectEmptyStateCopy, {
|
|
52
|
-
capabilities
|
|
51
|
+
capabilities,
|
|
53
52
|
hasArchivedProjects: archived.length > 0
|
|
54
53
|
})
|
|
55
54
|
})
|
|
@@ -58,7 +57,7 @@ function ProjectsPage() {
|
|
|
58
57
|
"aria-label": "Projects",
|
|
59
58
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectTable, {
|
|
60
59
|
projects: active,
|
|
61
|
-
|
|
60
|
+
refused: true
|
|
62
61
|
})
|
|
63
62
|
}),
|
|
64
63
|
archived.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
@@ -69,15 +68,13 @@ function ProjectsPage() {
|
|
|
69
68
|
children: "Archived"
|
|
70
69
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
71
70
|
className: "card",
|
|
72
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectTable, {
|
|
73
|
-
projects: archived,
|
|
74
|
-
secrets
|
|
75
|
-
})
|
|
71
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectTable, { projects: archived })
|
|
76
72
|
})]
|
|
77
73
|
})
|
|
78
74
|
] });
|
|
79
75
|
}
|
|
80
|
-
function ProjectTable({ projects,
|
|
76
|
+
function ProjectTable({ projects, refused = false }) {
|
|
77
|
+
const { status, failedAdds, dismiss } = useChangeStatus(projectsList.queryKey);
|
|
81
78
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
82
79
|
className: "dt-wrap",
|
|
83
80
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", {
|
|
@@ -105,11 +102,21 @@ function ProjectTable({ projects, secrets }) {
|
|
|
105
102
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Hash, { size: 14 }), "Secrets"]
|
|
106
103
|
})
|
|
107
104
|
})
|
|
108
|
-
] }) }), /* @__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, {
|
|
109
106
|
number: index + 1,
|
|
110
107
|
project,
|
|
111
|
-
|
|
112
|
-
|
|
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))] })]
|
|
113
120
|
})
|
|
114
121
|
});
|
|
115
122
|
}
|
|
@@ -117,11 +124,13 @@ function ProjectTable({ projects, secrets }) {
|
|
|
117
124
|
* One project. The whole row opens it; the environment links inside it sit
|
|
118
125
|
* above that and go straight to the environment.
|
|
119
126
|
*/
|
|
120
|
-
function ProjectRow({ number, project,
|
|
127
|
+
function ProjectRow({ number, project, status, onDismiss }) {
|
|
128
|
+
const secrets = project.secretCount;
|
|
129
|
+
const pending = status.state === "pending";
|
|
121
130
|
const isArchived = project.archivedAt !== null;
|
|
122
131
|
const listedEnvironments = project.environments.filter((environment) => environment.details === null || environment.details.archivedAt === null);
|
|
123
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
|
|
124
|
-
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)}`,
|
|
125
134
|
children: [
|
|
126
135
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
127
136
|
className: "n",
|
|
@@ -133,7 +142,7 @@ function ProjectRow({ number, project, secrets }) {
|
|
|
133
142
|
className: "cell-project",
|
|
134
143
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tile, { name: project.slug }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
135
144
|
className: "cell-stack",
|
|
136
|
-
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, {
|
|
137
146
|
className: "cell-link stretch",
|
|
138
147
|
to: "/projects/$project",
|
|
139
148
|
params: { project: project.slug },
|
|
@@ -174,7 +183,7 @@ function ProjectRow({ number, project, secrets }) {
|
|
|
174
183
|
}),
|
|
175
184
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
176
185
|
className: "col-secrets num nowrap",
|
|
177
|
-
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", {
|
|
178
187
|
className: "narrow-only",
|
|
179
188
|
children: [" secret", secrets === 1 ? "" : "s"]
|
|
180
189
|
})] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
@@ -183,18 +192,20 @@ function ProjectRow({ number, project, secrets }) {
|
|
|
183
192
|
})
|
|
184
193
|
})
|
|
185
194
|
]
|
|
186
|
-
})
|
|
195
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowFailure, {
|
|
196
|
+
status,
|
|
197
|
+
columns: 4,
|
|
198
|
+
onDismiss: () => status.state === "failed" && onDismiss(status.mutationId)
|
|
199
|
+
})] });
|
|
187
200
|
}
|
|
188
201
|
function NewProject() {
|
|
189
202
|
const [slug, setSlug] = (0, import_react.useState)("");
|
|
190
203
|
const [name, setName] = (0, import_react.useState)("");
|
|
191
204
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
192
|
-
const
|
|
193
|
-
const { pending, error, setError, run } = useAction();
|
|
205
|
+
const create = useChange(createProject(useCoffre()));
|
|
194
206
|
const slugError = slug === "" ? null : slugProblem(slug);
|
|
195
207
|
function close() {
|
|
196
208
|
setOpen(false);
|
|
197
|
-
setError(null);
|
|
198
209
|
}
|
|
199
210
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
200
211
|
className: "btn btn-primary",
|
|
@@ -209,15 +220,13 @@ function NewProject() {
|
|
|
209
220
|
className: "form",
|
|
210
221
|
onSubmit: (event) => {
|
|
211
222
|
event.preventDefault();
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}, () => {
|
|
216
|
-
toast.success(`Project ${slug} created`);
|
|
217
|
-
setSlug("");
|
|
218
|
-
setName("");
|
|
219
|
-
setOpen(false);
|
|
223
|
+
create({
|
|
224
|
+
slug,
|
|
225
|
+
name: name.trim()
|
|
220
226
|
});
|
|
227
|
+
setSlug("");
|
|
228
|
+
setName("");
|
|
229
|
+
close();
|
|
221
230
|
},
|
|
222
231
|
children: [
|
|
223
232
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", {
|
|
@@ -257,7 +266,6 @@ function NewProject() {
|
|
|
257
266
|
onChange: (event) => setName(event.target.value)
|
|
258
267
|
})]
|
|
259
268
|
}),
|
|
260
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorLine, { error }),
|
|
261
269
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
262
270
|
className: "dialog-actions",
|
|
263
271
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
@@ -265,11 +273,11 @@ function NewProject() {
|
|
|
265
273
|
type: "button",
|
|
266
274
|
onClick: close,
|
|
267
275
|
children: "Cancel"
|
|
268
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.
|
|
276
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
269
277
|
className: "btn btn-primary",
|
|
270
278
|
type: "submit",
|
|
271
|
-
disabled:
|
|
272
|
-
children:
|
|
279
|
+
disabled: slug === "" || slugError !== null || name.trim() === "",
|
|
280
|
+
children: "Create project"
|
|
273
281
|
})]
|
|
274
282
|
})
|
|
275
283
|
]
|