@burdenoff/microfe-cosmicintersection 2026.1012.1 → 2026.1030.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/cosmicintersection/lib/useSelectedRecord.d.ts +20 -0
- package/dist/cosmicintersection/lib/useSelectedRecord.d.ts.map +1 -0
- package/dist/cosmicintersection/lib/useSelectedRecord.js +19 -0
- package/dist/cosmicintersection/lib/useSelectedRecord.js.map +1 -0
- package/dist/cosmicintersection/pages/access/AccessPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/access/AccessPage.js +239 -226
- package/dist/cosmicintersection/pages/access/AccessPage.js.map +1 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js +196 -195
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +188 -175
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js +202 -201
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js.map +1 -1
- package/dist/utils/pageContext.d.ts +33 -7
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +75 -33
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { notify as e } from "../../lib/toast.js";
|
|
2
|
-
import { useCosAccessGrantsQuery as t, useCosDatasetsQuery as n, useCosGrantAccessMutation as ee, useCosRevokeAccessMutation as
|
|
3
|
-
import { useTr as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
2
|
+
import { useCosAccessGrantsQuery as t, useCosDatasetsQuery as n, useCosGrantAccessMutation as ee, useCosRevokeAccessMutation as te } from "../../api/cosmicApi.js";
|
|
3
|
+
import { useTr as ne } from "../../../shared/hooks/useTr.js";
|
|
4
|
+
import r from "../../components/ActionMenu.js";
|
|
5
|
+
import re from "../../components/EmptyState.js";
|
|
6
|
+
import ie from "../../components/ErrorState.js";
|
|
7
|
+
import ae from "../../components/LoadingState.js";
|
|
8
|
+
import oe from "../../components/EntityTagsField.js";
|
|
9
|
+
import se from "../../components/PageLayout.js";
|
|
10
|
+
import i, { formatEnumLabel as ce } from "../../components/StatusBadge.js";
|
|
11
11
|
import "../../components/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { useSelectedRecord as a } from "../../lib/useSelectedRecord.js";
|
|
13
|
+
import { useMemo as o, useState as s } from "react";
|
|
14
|
+
import { Fragment as le, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
15
|
+
import { KeyRound as u, ShieldCheck as ue } from "lucide-react";
|
|
16
|
+
import { Badge as d, Button as f, Dialog as de, DialogContent as fe, DialogDescription as p, DialogFooter as m, DialogHeader as h, DialogTitle as pe, Input as g, Label as _, Select as v, SelectContent as y, SelectItem as b, SelectTrigger as x, SelectValue as S, Table as me, TableBody as he, TableCell as C, TableHead as w, TableHeader as ge, TableRow as T, Textarea as _e } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/cosmicintersection/pages/access/AccessPage.tsx
|
|
17
|
-
var
|
|
18
|
+
var E = "ALL", ve = [
|
|
18
19
|
"PENDING",
|
|
19
20
|
"ACTIVE",
|
|
20
21
|
"EXPIRED",
|
|
21
22
|
"REVOKED"
|
|
22
23
|
];
|
|
23
|
-
function
|
|
24
|
+
function D(e) {
|
|
24
25
|
return e === "ACTIVE" || e === "PENDING";
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function O(e) {
|
|
27
28
|
if (!e) return "—";
|
|
28
29
|
let t = new Date(e);
|
|
29
30
|
return Number.isNaN(t.getTime()) ? "—" : t.toLocaleDateString(void 0, {
|
|
@@ -32,254 +33,266 @@ function M(e) {
|
|
|
32
33
|
day: "numeric"
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
var
|
|
36
|
+
var k = {
|
|
36
37
|
datasetId: "",
|
|
37
38
|
granteeId: "",
|
|
38
39
|
scopes: [],
|
|
39
40
|
reason: "",
|
|
40
41
|
expiresAt: ""
|
|
41
42
|
};
|
|
42
|
-
function
|
|
43
|
-
let P =
|
|
43
|
+
function A() {
|
|
44
|
+
let A = ne(), { selectedId: j, select: M } = a("datasetId"), N = j ?? E, P = (e) => M(e === E ? null : e), { selectedId: F, select: ye } = a("id"), I = (e) => ye(F === e.id ? null : e.id), [L, be] = s(E), R = n({ pagination: {
|
|
44
45
|
limit: 50,
|
|
45
46
|
offset: 0
|
|
46
|
-
} }),
|
|
47
|
+
} }), z = o(() => R.data?.cosListDatasets.items ?? [], [R.data]), B = o(() => {
|
|
47
48
|
let e = /* @__PURE__ */ new Map();
|
|
48
|
-
for (let t of
|
|
49
|
+
for (let t of z) e.set(t.id, t.name);
|
|
49
50
|
return e;
|
|
50
|
-
}, [
|
|
51
|
-
datasetId:
|
|
52
|
-
status: L ===
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
...
|
|
56
|
-
datasetId:
|
|
57
|
-
}),
|
|
51
|
+
}, [z]), { data: V, loading: xe, error: H, refetch: U } = t({
|
|
52
|
+
datasetId: N === E ? void 0 : N,
|
|
53
|
+
status: L === E ? void 0 : L
|
|
54
|
+
}), W = o(() => V?.cosListAccessGrants ?? [], [V]), [Se, { loading: G }] = ee(), [Ce] = te(), [we, K] = s(!1), [q, J] = s(k), Y = () => {
|
|
55
|
+
J({
|
|
56
|
+
...k,
|
|
57
|
+
datasetId: N === E ? "" : N
|
|
58
|
+
}), K(!0);
|
|
58
59
|
}, X = (e, t) => {
|
|
59
|
-
|
|
60
|
+
J((n) => ({
|
|
60
61
|
...n,
|
|
61
62
|
[e]: t
|
|
62
63
|
}));
|
|
63
|
-
},
|
|
64
|
-
if (!
|
|
65
|
-
e.error(
|
|
64
|
+
}, Te = async () => {
|
|
65
|
+
if (!q.datasetId) {
|
|
66
|
+
e.error(A("cosmicintersection.pages.access.datasetRequired", "Dataset is required"), A("cosmicintersection.pages.access.datasetRequiredDescription", "Choose which dataset this grant applies to."));
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
|
-
if (!
|
|
69
|
-
e.error(
|
|
69
|
+
if (!q.granteeId.trim()) {
|
|
70
|
+
e.error(A("cosmicintersection.pages.access.granteeRequired", "Grantee is required"), A("cosmicintersection.pages.access.granteeRequiredDescription", "Enter the workspace User ID to grant access to."));
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
73
|
let t;
|
|
73
|
-
if (
|
|
74
|
-
let n = new Date(
|
|
74
|
+
if (q.expiresAt) {
|
|
75
|
+
let n = new Date(q.expiresAt);
|
|
75
76
|
if (Number.isNaN(n.getTime())) {
|
|
76
|
-
e.error(
|
|
77
|
+
e.error(A("cosmicintersection.pages.access.invalidExpiry", "Invalid expiry"), A("cosmicintersection.pages.access.invalidExpiryDescription", "Enter a valid expiry date or leave it blank."));
|
|
77
78
|
return;
|
|
78
79
|
}
|
|
79
80
|
t = n.toISOString();
|
|
80
81
|
}
|
|
81
|
-
(await
|
|
82
|
-
datasetId:
|
|
83
|
-
granteeId:
|
|
84
|
-
scopes:
|
|
85
|
-
reason:
|
|
82
|
+
(await Se({ variables: { input: {
|
|
83
|
+
datasetId: q.datasetId,
|
|
84
|
+
granteeId: q.granteeId.trim(),
|
|
85
|
+
scopes: q.scopes.length ? q.scopes : void 0,
|
|
86
|
+
reason: q.reason.trim() || void 0,
|
|
86
87
|
expiresAt: t
|
|
87
|
-
} } })).data?.cosGrantAccess?.id && (e.success(
|
|
88
|
+
} } })).data?.cosGrantAccess?.id && (e.success(A("cosmicintersection.pages.access.accessGranted", "Access granted")), K(!1), J(k), await U());
|
|
88
89
|
}, Z = async (t) => {
|
|
89
|
-
let n = await
|
|
90
|
+
let n = await Ce({ variables: { id: t.id } });
|
|
90
91
|
if (n.error) throw Error(n.error.message);
|
|
91
|
-
if (!n.data?.cosRevokeAccess?.id) throw e.error(
|
|
92
|
-
e.success(
|
|
93
|
-
}, Q = /* @__PURE__ */
|
|
92
|
+
if (!n.data?.cosRevokeAccess?.id) throw e.error(A("cosmicintersection.pages.access.revokeError", "Could not revoke grant"), A("cosmicintersection.pages.access.revokeErrorDescription", "The server did not confirm the change.")), Error("Revoke not confirmed");
|
|
93
|
+
e.success(A("cosmicintersection.pages.access.accessRevoked", "Access revoked")), await U();
|
|
94
|
+
}, Q = /* @__PURE__ */ l(f, {
|
|
94
95
|
type: "button",
|
|
95
|
-
onClick:
|
|
96
|
-
children: [/* @__PURE__ */
|
|
97
|
-
}), $ =
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
title:
|
|
100
|
-
description:
|
|
96
|
+
onClick: Y,
|
|
97
|
+
children: [/* @__PURE__ */ c(u, { className: "size-4" }), A("cosmicintersection.pages.access.grantAccess", "Grant access")]
|
|
98
|
+
}), $ = N === E;
|
|
99
|
+
return /* @__PURE__ */ l(se, {
|
|
100
|
+
title: A("cosmicintersection.pages.access.title", "Data access"),
|
|
101
|
+
description: A("cosmicintersection.pages.access.description", "Govern who can reach restricted and embargoed datasets, with scoped, expiring grants."),
|
|
101
102
|
actions: Q,
|
|
102
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ l("div", {
|
|
103
104
|
className: "space-y-4",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ l("div", {
|
|
105
106
|
className: "flex flex-wrap items-center gap-3",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ c("div", {
|
|
107
108
|
className: "w-full max-w-[18rem]",
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
-
value:
|
|
110
|
-
onValueChange:
|
|
111
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: /* @__PURE__ */ l(v, {
|
|
110
|
+
value: N,
|
|
111
|
+
onValueChange: P,
|
|
112
|
+
children: [/* @__PURE__ */ c(x, {
|
|
112
113
|
"aria-label": "Filter by dataset",
|
|
113
|
-
children: /* @__PURE__ */
|
|
114
|
-
}), /* @__PURE__ */
|
|
115
|
-
value:
|
|
114
|
+
children: /* @__PURE__ */ c(S, { placeholder: "All datasets" })
|
|
115
|
+
}), /* @__PURE__ */ l(y, { children: [/* @__PURE__ */ c(b, {
|
|
116
|
+
value: E,
|
|
116
117
|
children: "All datasets"
|
|
117
|
-
}),
|
|
118
|
+
}), z.map((e) => /* @__PURE__ */ c(b, {
|
|
118
119
|
value: e.id,
|
|
119
120
|
children: e.name
|
|
120
121
|
}, e.id))] })]
|
|
121
122
|
})
|
|
122
|
-
}), /* @__PURE__ */
|
|
123
|
+
}), /* @__PURE__ */ c("div", {
|
|
123
124
|
className: "w-full max-w-[14rem]",
|
|
124
|
-
children: /* @__PURE__ */
|
|
125
|
+
children: /* @__PURE__ */ l(v, {
|
|
125
126
|
value: L,
|
|
126
|
-
onValueChange:
|
|
127
|
-
children: [/* @__PURE__ */
|
|
127
|
+
onValueChange: be,
|
|
128
|
+
children: [/* @__PURE__ */ c(x, {
|
|
128
129
|
"aria-label": "Filter by status",
|
|
129
|
-
children: /* @__PURE__ */
|
|
130
|
-
}), /* @__PURE__ */
|
|
131
|
-
value:
|
|
130
|
+
children: /* @__PURE__ */ c(S, { placeholder: "All statuses" })
|
|
131
|
+
}), /* @__PURE__ */ l(y, { children: [/* @__PURE__ */ c(b, {
|
|
132
|
+
value: E,
|
|
132
133
|
children: "All statuses"
|
|
133
|
-
}),
|
|
134
|
+
}), ve.map((e) => /* @__PURE__ */ c(b, {
|
|
134
135
|
value: e,
|
|
135
|
-
children:
|
|
136
|
+
children: ce(e)
|
|
136
137
|
}, e))] })]
|
|
137
138
|
})
|
|
138
139
|
})]
|
|
139
140
|
}), (() => {
|
|
140
|
-
if (
|
|
141
|
+
if (xe) return /* @__PURE__ */ c(ae, {
|
|
141
142
|
variant: "rows",
|
|
142
143
|
rows: 6,
|
|
143
|
-
label:
|
|
144
|
+
label: A("cosmicintersection.pages.access.loading", "Loading access grants…")
|
|
144
145
|
});
|
|
145
|
-
if (
|
|
146
|
-
message:
|
|
147
|
-
onRetry: () => void
|
|
146
|
+
if (H) return /* @__PURE__ */ c(ie, {
|
|
147
|
+
message: H.message,
|
|
148
|
+
onRetry: () => void U()
|
|
148
149
|
});
|
|
149
|
-
if (
|
|
150
|
-
let e =
|
|
151
|
-
return /* @__PURE__ */
|
|
152
|
-
icon:
|
|
153
|
-
title: e ?
|
|
154
|
-
description: e ?
|
|
150
|
+
if (W.length === 0) {
|
|
151
|
+
let e = N !== E || L !== E;
|
|
152
|
+
return /* @__PURE__ */ c(re, {
|
|
153
|
+
icon: ue,
|
|
154
|
+
title: e ? A("cosmicintersection.pages.access.emptyFilterTitle", "No grants match these filters") : A("cosmicintersection.pages.access.emptyTitle", "No access grants yet"),
|
|
155
|
+
description: e ? A("cosmicintersection.pages.access.emptyFilterDescription", "Try clearing the dataset or status filter to see more grants.") : A("cosmicintersection.pages.access.emptyDescription", "Grant a workspace member scoped access to a restricted or embargoed dataset."),
|
|
155
156
|
action: e ? void 0 : Q
|
|
156
157
|
});
|
|
157
158
|
}
|
|
158
|
-
return /* @__PURE__ */
|
|
159
|
+
return /* @__PURE__ */ l(le, { children: [/* @__PURE__ */ c("div", {
|
|
159
160
|
className: "hidden rounded-card border border-border-default bg-bg-elevated md:block",
|
|
160
|
-
children: /* @__PURE__ */
|
|
161
|
-
$ ? /* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
161
|
+
children: /* @__PURE__ */ l(me, { children: [/* @__PURE__ */ c(ge, { children: /* @__PURE__ */ l(T, { children: [
|
|
162
|
+
$ ? /* @__PURE__ */ c(w, { children: "Dataset" }) : null,
|
|
163
|
+
/* @__PURE__ */ c(w, { children: "Grantee" }),
|
|
164
|
+
/* @__PURE__ */ c(w, { children: "Status" }),
|
|
165
|
+
/* @__PURE__ */ c(w, { children: "Scopes" }),
|
|
166
|
+
/* @__PURE__ */ c(w, { children: "Reason" }),
|
|
167
|
+
/* @__PURE__ */ c(w, { children: "Granted" }),
|
|
168
|
+
/* @__PURE__ */ c(w, { children: "Expires" }),
|
|
169
|
+
/* @__PURE__ */ c(w, { children: "Revoked" }),
|
|
170
|
+
/* @__PURE__ */ c(w, {
|
|
170
171
|
className: "text-right",
|
|
171
172
|
children: "Actions"
|
|
172
173
|
})
|
|
173
|
-
] }) }), /* @__PURE__ */
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
174
|
+
] }) }), /* @__PURE__ */ c(he, { children: W.map((e) => /* @__PURE__ */ l(T, {
|
|
175
|
+
"aria-selected": F === e.id,
|
|
176
|
+
"data-state": F === e.id ? "selected" : void 0,
|
|
177
|
+
className: F === e.id ? "bg-bg-sunken" : void 0,
|
|
178
|
+
children: [
|
|
179
|
+
$ ? /* @__PURE__ */ c(C, {
|
|
180
|
+
className: "max-w-[12rem]",
|
|
181
|
+
children: /* @__PURE__ */ c("span", {
|
|
182
|
+
className: "line-clamp-1 text-sm text-text-primary",
|
|
183
|
+
children: B.get(e.datasetId) ?? /* @__PURE__ */ c("span", {
|
|
184
|
+
className: "font-mono text-xs text-text-secondary",
|
|
185
|
+
children: e.datasetId
|
|
186
|
+
})
|
|
187
|
+
})
|
|
188
|
+
}) : null,
|
|
189
|
+
/* @__PURE__ */ c(C, {
|
|
190
|
+
className: "max-w-[12rem]",
|
|
191
|
+
children: /* @__PURE__ */ c("button", {
|
|
192
|
+
type: "button",
|
|
193
|
+
onClick: () => I(e),
|
|
194
|
+
"aria-pressed": F === e.id,
|
|
195
|
+
className: "block max-w-full truncate text-left font-mono text-xs text-text-primary underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus",
|
|
196
|
+
children: e.granteeId
|
|
197
|
+
})
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ c(C, { children: /* @__PURE__ */ c(i, { status: e.status }) }),
|
|
200
|
+
/* @__PURE__ */ c(C, { children: /* @__PURE__ */ c("div", {
|
|
201
|
+
className: "flex max-w-[12rem] flex-wrap gap-1",
|
|
202
|
+
children: e.scopes.length === 0 ? /* @__PURE__ */ c("span", {
|
|
203
|
+
className: "text-xs text-text-secondary",
|
|
204
|
+
children: "—"
|
|
205
|
+
}) : e.scopes.map((e) => /* @__PURE__ */ c(d, {
|
|
206
|
+
variant: "outline",
|
|
207
|
+
className: "text-xs",
|
|
208
|
+
children: e
|
|
209
|
+
}, e))
|
|
210
|
+
}) }),
|
|
211
|
+
/* @__PURE__ */ c(C, {
|
|
212
|
+
className: "max-w-[14rem]",
|
|
213
|
+
children: e.reason ? /* @__PURE__ */ c("span", {
|
|
214
|
+
className: "line-clamp-1 text-sm text-text-secondary",
|
|
215
|
+
children: e.reason
|
|
216
|
+
}) : /* @__PURE__ */ c("span", {
|
|
217
|
+
className: "text-sm text-text-secondary",
|
|
218
|
+
children: "—"
|
|
219
|
+
})
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ c(C, {
|
|
222
|
+
className: "whitespace-nowrap text-sm text-text-secondary",
|
|
223
|
+
children: O(e.grantedAt)
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ c(C, {
|
|
226
|
+
className: "whitespace-nowrap text-sm text-text-secondary",
|
|
227
|
+
children: O(e.expiresAt)
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ c(C, {
|
|
230
|
+
className: "whitespace-nowrap text-sm text-text-secondary",
|
|
231
|
+
children: O(e.revokedAt)
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ c(C, {
|
|
234
|
+
className: "text-right",
|
|
235
|
+
children: D(e.status) ? /* @__PURE__ */ c(r, {
|
|
236
|
+
ariaLabel: `Actions for grant to ${e.granteeId}`,
|
|
237
|
+
entityName: e.granteeId,
|
|
238
|
+
onDelete: () => Z(e),
|
|
239
|
+
deleteLabel: "Revoke grant"
|
|
240
|
+
}) : /* @__PURE__ */ c("span", {
|
|
241
|
+
className: "text-xs text-text-secondary",
|
|
242
|
+
children: "—"
|
|
181
243
|
})
|
|
182
244
|
})
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
children: /* @__PURE__ */ l("span", {
|
|
187
|
-
className: "block truncate font-mono text-xs text-text-primary",
|
|
188
|
-
children: e.granteeId
|
|
189
|
-
})
|
|
190
|
-
}),
|
|
191
|
-
/* @__PURE__ */ l(E, { children: /* @__PURE__ */ l(a, { status: e.status }) }),
|
|
192
|
-
/* @__PURE__ */ l(E, { children: /* @__PURE__ */ l("div", {
|
|
193
|
-
className: "flex max-w-[12rem] flex-wrap gap-1",
|
|
194
|
-
children: e.scopes.length === 0 ? /* @__PURE__ */ l("span", {
|
|
195
|
-
className: "text-xs text-text-secondary",
|
|
196
|
-
children: "—"
|
|
197
|
-
}) : e.scopes.map((e) => /* @__PURE__ */ l(f, {
|
|
198
|
-
variant: "outline",
|
|
199
|
-
className: "text-xs",
|
|
200
|
-
children: e
|
|
201
|
-
}, e))
|
|
202
|
-
}) }),
|
|
203
|
-
/* @__PURE__ */ l(E, {
|
|
204
|
-
className: "max-w-[14rem]",
|
|
205
|
-
children: e.reason ? /* @__PURE__ */ l("span", {
|
|
206
|
-
className: "line-clamp-1 text-sm text-text-secondary",
|
|
207
|
-
children: e.reason
|
|
208
|
-
}) : /* @__PURE__ */ l("span", {
|
|
209
|
-
className: "text-sm text-text-secondary",
|
|
210
|
-
children: "—"
|
|
211
|
-
})
|
|
212
|
-
}),
|
|
213
|
-
/* @__PURE__ */ l(E, {
|
|
214
|
-
className: "whitespace-nowrap text-sm text-text-secondary",
|
|
215
|
-
children: M(e.grantedAt)
|
|
216
|
-
}),
|
|
217
|
-
/* @__PURE__ */ l(E, {
|
|
218
|
-
className: "whitespace-nowrap text-sm text-text-secondary",
|
|
219
|
-
children: M(e.expiresAt)
|
|
220
|
-
}),
|
|
221
|
-
/* @__PURE__ */ l(E, {
|
|
222
|
-
className: "whitespace-nowrap text-sm text-text-secondary",
|
|
223
|
-
children: M(e.revokedAt)
|
|
224
|
-
}),
|
|
225
|
-
/* @__PURE__ */ l(E, {
|
|
226
|
-
className: "text-right",
|
|
227
|
-
children: j(e.status) ? /* @__PURE__ */ l(i, {
|
|
228
|
-
ariaLabel: `Actions for grant to ${e.granteeId}`,
|
|
229
|
-
entityName: e.granteeId,
|
|
230
|
-
onDelete: () => Z(e),
|
|
231
|
-
deleteLabel: "Revoke grant"
|
|
232
|
-
}) : /* @__PURE__ */ l("span", {
|
|
233
|
-
className: "text-xs text-text-secondary",
|
|
234
|
-
children: "—"
|
|
235
|
-
})
|
|
236
|
-
})
|
|
237
|
-
] }, e.id)) })] })
|
|
238
|
-
}), /* @__PURE__ */ l("ul", {
|
|
245
|
+
]
|
|
246
|
+
}, e.id)) })] })
|
|
247
|
+
}), /* @__PURE__ */ c("ul", {
|
|
239
248
|
className: "space-y-3 md:hidden",
|
|
240
|
-
children:
|
|
241
|
-
|
|
242
|
-
|
|
249
|
+
children: W.map((e) => /* @__PURE__ */ c("li", {
|
|
250
|
+
"aria-current": F === e.id ? "true" : void 0,
|
|
251
|
+
className: F === e.id ? "rounded-card border border-border-focus bg-bg-sunken" : "rounded-card border border-border-default bg-bg-elevated",
|
|
252
|
+
children: /* @__PURE__ */ l("div", {
|
|
243
253
|
className: "flex items-start justify-between gap-2 p-4",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ l("div", {
|
|
245
255
|
className: "min-w-0 flex-1 space-y-2",
|
|
246
256
|
children: [
|
|
247
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ l("div", {
|
|
248
258
|
className: "flex flex-wrap items-center gap-2",
|
|
249
|
-
children: [$ ? /* @__PURE__ */
|
|
259
|
+
children: [$ ? /* @__PURE__ */ c("span", {
|
|
250
260
|
className: "truncate text-sm font-medium text-text-primary",
|
|
251
|
-
children:
|
|
252
|
-
}) : null, /* @__PURE__ */
|
|
261
|
+
children: B.get(e.datasetId) ?? "Dataset"
|
|
262
|
+
}) : null, /* @__PURE__ */ c(i, { status: e.status })]
|
|
253
263
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("p", {
|
|
255
265
|
className: "text-xs text-text-secondary",
|
|
256
266
|
children: "Grantee (User ID)"
|
|
257
|
-
}), /* @__PURE__ */
|
|
258
|
-
|
|
267
|
+
}), /* @__PURE__ */ c("button", {
|
|
268
|
+
type: "button",
|
|
269
|
+
onClick: () => I(e),
|
|
270
|
+
"aria-pressed": F === e.id,
|
|
271
|
+
className: "block max-w-full truncate text-left font-mono text-xs text-text-primary underline-offset-2 hover:underline",
|
|
259
272
|
children: e.granteeId
|
|
260
273
|
})] }),
|
|
261
|
-
e.scopes.length > 0 ? /* @__PURE__ */
|
|
274
|
+
e.scopes.length > 0 ? /* @__PURE__ */ c("div", {
|
|
262
275
|
className: "flex flex-wrap gap-1",
|
|
263
|
-
children: e.scopes.map((e) => /* @__PURE__ */
|
|
276
|
+
children: e.scopes.map((e) => /* @__PURE__ */ c(d, {
|
|
264
277
|
variant: "outline",
|
|
265
278
|
className: "text-xs",
|
|
266
279
|
children: e
|
|
267
280
|
}, e))
|
|
268
281
|
}) : null,
|
|
269
|
-
e.reason ? /* @__PURE__ */
|
|
282
|
+
e.reason ? /* @__PURE__ */ c("p", {
|
|
270
283
|
className: "line-clamp-2 text-xs text-text-secondary",
|
|
271
284
|
children: e.reason
|
|
272
285
|
}) : null,
|
|
273
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ l("div", {
|
|
274
287
|
className: "flex flex-wrap gap-x-3 gap-y-1 text-xs text-text-secondary",
|
|
275
288
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
e.revokedAt ? /* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ l("span", { children: ["Granted ", O(e.grantedAt)] }),
|
|
290
|
+
/* @__PURE__ */ l("span", { children: ["Expires ", O(e.expiresAt)] }),
|
|
291
|
+
e.revokedAt ? /* @__PURE__ */ l("span", { children: ["Revoked ", O(e.revokedAt)] }) : null
|
|
279
292
|
]
|
|
280
293
|
})
|
|
281
294
|
]
|
|
282
|
-
}),
|
|
295
|
+
}), D(e.status) ? /* @__PURE__ */ c(r, {
|
|
283
296
|
ariaLabel: `Actions for grant to ${e.granteeId}`,
|
|
284
297
|
entityName: e.granteeId,
|
|
285
298
|
onDelete: () => Z(e),
|
|
@@ -289,105 +302,105 @@ function P() {
|
|
|
289
302
|
}, e.id))
|
|
290
303
|
})] });
|
|
291
304
|
})()]
|
|
292
|
-
}), /* @__PURE__ */
|
|
293
|
-
open:
|
|
294
|
-
onOpenChange: (e) =>
|
|
295
|
-
children: /* @__PURE__ */
|
|
305
|
+
}), /* @__PURE__ */ c(de, {
|
|
306
|
+
open: we,
|
|
307
|
+
onOpenChange: (e) => K(e || G ? e : !1),
|
|
308
|
+
children: /* @__PURE__ */ l(fe, {
|
|
296
309
|
className: "max-h-[85vh] max-w-md overflow-y-auto",
|
|
297
310
|
children: [
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(pe, { children: A("cosmicintersection.pages.access.grantDataAccess", "Grant data access") }), /* @__PURE__ */ c(p, { children: A("cosmicintersection.pages.access.grantDataAccessDescription", "Give a workspace member scoped access to a dataset. Access is identified by the member's User ID.") })] }),
|
|
312
|
+
/* @__PURE__ */ l("div", {
|
|
300
313
|
className: "space-y-4",
|
|
301
314
|
children: [
|
|
302
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ l("div", {
|
|
303
316
|
className: "space-y-1.5",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ c(_, {
|
|
305
318
|
htmlFor: "grant-dataset",
|
|
306
|
-
children:
|
|
307
|
-
}), /* @__PURE__ */
|
|
308
|
-
value:
|
|
319
|
+
children: A("cosmicintersection.pages.access.dataset", "Dataset")
|
|
320
|
+
}), /* @__PURE__ */ l(v, {
|
|
321
|
+
value: q.datasetId || void 0,
|
|
309
322
|
onValueChange: (e) => X("datasetId", e),
|
|
310
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ c(x, {
|
|
311
324
|
id: "grant-dataset",
|
|
312
|
-
"aria-label":
|
|
313
|
-
children: /* @__PURE__ */
|
|
314
|
-
}), /* @__PURE__ */
|
|
325
|
+
"aria-label": A("cosmicintersection.pages.access.dataset", "Dataset"),
|
|
326
|
+
children: /* @__PURE__ */ c(S, { placeholder: A("cosmicintersection.pages.access.selectDataset", "Select a dataset") })
|
|
327
|
+
}), /* @__PURE__ */ c(y, { children: z.map((e) => /* @__PURE__ */ c(b, {
|
|
315
328
|
value: e.id,
|
|
316
329
|
children: e.name
|
|
317
330
|
}, e.id)) })]
|
|
318
331
|
})]
|
|
319
332
|
}),
|
|
320
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ l("div", {
|
|
321
334
|
className: "space-y-1.5",
|
|
322
335
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ c(_, {
|
|
324
337
|
htmlFor: "grant-grantee",
|
|
325
|
-
children:
|
|
338
|
+
children: A("cosmicintersection.pages.access.grantee", "Grantee (User ID)")
|
|
326
339
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ c(g, {
|
|
328
341
|
id: "grant-grantee",
|
|
329
|
-
value:
|
|
342
|
+
value: q.granteeId,
|
|
330
343
|
onChange: (e) => X("granteeId", e.target.value),
|
|
331
344
|
placeholder: "e.g. 4fe35990-…",
|
|
332
345
|
className: "font-mono"
|
|
333
346
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ c("p", {
|
|
335
348
|
className: "text-xs text-text-secondary",
|
|
336
|
-
children:
|
|
349
|
+
children: A("cosmicintersection.pages.access.granteeHint", "Paste the workspace member's User ID. You can copy it from the member's profile (\"Get ID\") or the workspace member directory.")
|
|
337
350
|
})
|
|
338
351
|
]
|
|
339
352
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
value:
|
|
353
|
+
/* @__PURE__ */ c(oe, {
|
|
354
|
+
value: q.scopes,
|
|
342
355
|
onChange: (e) => X("scopes", e),
|
|
343
|
-
label:
|
|
356
|
+
label: A("cosmicintersection.pages.access.scopes", "Scopes"),
|
|
344
357
|
placeholder: "e.g. read, download"
|
|
345
358
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ l("div", {
|
|
347
360
|
className: "space-y-1.5",
|
|
348
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ c(_, {
|
|
349
362
|
htmlFor: "grant-reason",
|
|
350
|
-
children:
|
|
351
|
-
}), /* @__PURE__ */
|
|
363
|
+
children: A("cosmicintersection.pages.access.reason", "Reason")
|
|
364
|
+
}), /* @__PURE__ */ c(_e, {
|
|
352
365
|
id: "grant-reason",
|
|
353
|
-
value:
|
|
366
|
+
value: q.reason,
|
|
354
367
|
onChange: (e) => X("reason", e.target.value),
|
|
355
368
|
rows: 2,
|
|
356
|
-
placeholder:
|
|
369
|
+
placeholder: A("cosmicintersection.pages.access.reasonPlaceholder", "Why this member needs access.")
|
|
357
370
|
})]
|
|
358
371
|
}),
|
|
359
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ l("div", {
|
|
360
373
|
className: "space-y-1.5",
|
|
361
374
|
children: [
|
|
362
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ c(_, {
|
|
363
376
|
htmlFor: "grant-expires",
|
|
364
|
-
children:
|
|
377
|
+
children: A("cosmicintersection.pages.access.expiresOptional", "Expires (optional)")
|
|
365
378
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ c(g, {
|
|
367
380
|
id: "grant-expires",
|
|
368
381
|
type: "datetime-local",
|
|
369
|
-
value:
|
|
382
|
+
value: q.expiresAt,
|
|
370
383
|
onChange: (e) => X("expiresAt", e.target.value)
|
|
371
384
|
}),
|
|
372
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ c("p", {
|
|
373
386
|
className: "text-xs text-text-secondary",
|
|
374
|
-
children:
|
|
387
|
+
children: A("cosmicintersection.pages.access.expiresHint", "Leave blank for an open-ended grant.")
|
|
375
388
|
})
|
|
376
389
|
]
|
|
377
390
|
})
|
|
378
391
|
]
|
|
379
392
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ l(m, { children: [/* @__PURE__ */ c(f, {
|
|
381
394
|
type: "button",
|
|
382
395
|
variant: "outline",
|
|
383
|
-
onClick: () =>
|
|
384
|
-
disabled:
|
|
385
|
-
children:
|
|
386
|
-
}), /* @__PURE__ */
|
|
396
|
+
onClick: () => K(!1),
|
|
397
|
+
disabled: G,
|
|
398
|
+
children: A("cosmicintersection.common.cancel", "Cancel")
|
|
399
|
+
}), /* @__PURE__ */ l(f, {
|
|
387
400
|
type: "button",
|
|
388
|
-
onClick: () => void
|
|
389
|
-
disabled:
|
|
390
|
-
children: [/* @__PURE__ */
|
|
401
|
+
onClick: () => void Te(),
|
|
402
|
+
disabled: G,
|
|
403
|
+
children: [/* @__PURE__ */ c(u, { className: "size-4" }), G ? A("cosmicintersection.pages.access.granting", "Granting…") : A("cosmicintersection.pages.access.grantAccess", "Grant access")]
|
|
391
404
|
})] })
|
|
392
405
|
]
|
|
393
406
|
})
|
|
@@ -395,6 +408,6 @@ function P() {
|
|
|
395
408
|
});
|
|
396
409
|
}
|
|
397
410
|
//#endregion
|
|
398
|
-
export {
|
|
411
|
+
export { A as default };
|
|
399
412
|
|
|
400
413
|
//# sourceMappingURL=AccessPage.js.map
|